diff options
-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 | { |