diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2008-12-18 09:34:20 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 06:40:18 -0500 |
commit | a9bef518cd78d569a3ff0b1ac2afa5e2d8b3573a (patch) | |
tree | 30c50223f02e8bbc3b070a60aef8432397b90954 /include | |
parent | 39bf372f606448de2df93a90f40efc613cb5c909 (diff) |
V4L/DVB (10074): soc-camera: add camera sense data
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.
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/media/soc_camera.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index e6ed0d94ac1b..38b826c608be 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -36,6 +36,7 @@ struct soc_camera_device { | |||
36 | unsigned char iface; /* Host number */ | 36 | unsigned char iface; /* Host number */ |
37 | unsigned char devnum; /* Device number per host */ | 37 | unsigned char devnum; /* Device number per host */ |
38 | unsigned char buswidth; /* See comment in .c */ | 38 | unsigned char buswidth; /* See comment in .c */ |
39 | struct soc_camera_sense *sense; /* See comment in struct definition */ | ||
39 | struct soc_camera_ops *ops; | 40 | struct soc_camera_ops *ops; |
40 | struct video_device *vdev; | 41 | struct video_device *vdev; |
41 | const struct soc_camera_data_format *current_fmt; | 42 | const struct soc_camera_data_format *current_fmt; |
@@ -172,6 +173,32 @@ struct soc_camera_ops { | |||
172 | int num_controls; | 173 | int num_controls; |
173 | }; | 174 | }; |
174 | 175 | ||
176 | #define SOCAM_SENSE_PCLK_CHANGED (1 << 0) | ||
177 | |||
178 | /** | ||
179 | * This struct can be attached to struct soc_camera_device by the host driver | ||
180 | * to request sense from the camera, for example, when calling .set_fmt(). The | ||
181 | * host then can check which flags are set and verify respective values if any. | ||
182 | * For example, if SOCAM_SENSE_PCLK_CHANGED is set, it means, pixclock has | ||
183 | * changed during this operation. After completion the host should detach sense. | ||
184 | * | ||
185 | * @flags ored SOCAM_SENSE_* flags | ||
186 | * @master_clock if the host wants to be informed about pixel-clock | ||
187 | * change, it better set master_clock. | ||
188 | * @pixel_clock_max maximum pixel clock frequency supported by the host, | ||
189 | * camera is not allowed to exceed this. | ||
190 | * @pixel_clock if the camera driver changed pixel clock during this | ||
191 | * operation, it sets SOCAM_SENSE_PCLK_CHANGED, uses | ||
192 | * master_clock to calculate the new pixel-clock and | ||
193 | * sets this field. | ||
194 | */ | ||
195 | struct soc_camera_sense { | ||
196 | unsigned long flags; | ||
197 | unsigned long master_clock; | ||
198 | unsigned long pixel_clock_max; | ||
199 | unsigned long pixel_clock; | ||
200 | }; | ||
201 | |||
175 | static inline struct v4l2_queryctrl const *soc_camera_find_qctrl( | 202 | static inline struct v4l2_queryctrl const *soc_camera_find_qctrl( |
176 | struct soc_camera_ops *ops, int id) | 203 | struct soc_camera_ops *ops, int id) |
177 | { | 204 | { |