summaryrefslogtreecommitdiff
path: root/linux/include/media/soc_camera.h
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2008-12-18 15:34:20 +0100
committerGuennadi Liakhovetski <g.liakhovetski@gmx.de>2008-12-18 15:34:20 +0100
commit0f0829dfa93f384ef8f33ecdcd0bd0d0d3335177 (patch)
tree14c93c57c5edb7d93f106e47b0c104b885449f3a /linux/include/media/soc_camera.h
parentf6f0ba19f43abdbe858fc402613d07a1885a482f (diff)
downloadmediapointer-dvb-s2-0f0829dfa93f384ef8f33ecdcd0bd0d0d3335177.tar.gz
mediapointer-dvb-s2-0f0829dfa93f384ef8f33ecdcd0bd0d0d3335177.tar.bz2
soc-camera: add camera sense data
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Add a struct soc_camera_sense, that can be used by camera host drivers to request additional information from a camera driver, for example, when changing data format. This struct can be extended in the future, its first use is to request the camera driver whether the pixel-clock frequency has changed. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Tested-by: Robert Jarzmik <robert.jarzmik@free.fr> --- include/media/soc_camera.h | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-)
Diffstat (limited to 'linux/include/media/soc_camera.h')
-rw-r--r--linux/include/media/soc_camera.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/linux/include/media/soc_camera.h b/linux/include/media/soc_camera.h
index e6ed0d94a..38b826c60 100644
--- a/linux/include/media/soc_camera.h
+++ b/linux/include/media/soc_camera.h
@@ -36,6 +36,7 @@ struct soc_camera_device {
unsigned char iface; /* Host number */
unsigned char devnum; /* Device number per host */
unsigned char buswidth; /* See comment in .c */
+ struct soc_camera_sense *sense; /* See comment in struct definition */
struct soc_camera_ops *ops;
struct video_device *vdev;
const struct soc_camera_data_format *current_fmt;
@@ -172,6 +173,32 @@ struct soc_camera_ops {
int num_controls;
};
+#define SOCAM_SENSE_PCLK_CHANGED (1 << 0)
+
+/**
+ * This struct can be attached to struct soc_camera_device by the host driver
+ * to request sense from the camera, for example, when calling .set_fmt(). The
+ * host then can check which flags are set and verify respective values if any.
+ * For example, if SOCAM_SENSE_PCLK_CHANGED is set, it means, pixclock has
+ * changed during this operation. After completion the host should detach sense.
+ *
+ * @flags ored SOCAM_SENSE_* flags
+ * @master_clock if the host wants to be informed about pixel-clock
+ * change, it better set master_clock.
+ * @pixel_clock_max maximum pixel clock frequency supported by the host,
+ * camera is not allowed to exceed this.
+ * @pixel_clock if the camera driver changed pixel clock during this
+ * operation, it sets SOCAM_SENSE_PCLK_CHANGED, uses
+ * master_clock to calculate the new pixel-clock and
+ * sets this field.
+ */
+struct soc_camera_sense {
+ unsigned long flags;
+ unsigned long master_clock;
+ unsigned long pixel_clock_max;
+ unsigned long pixel_clock;
+};
+
static inline struct v4l2_queryctrl const *soc_camera_find_qctrl(
struct soc_camera_ops *ops, int id)
{