diff options
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/soc_camera.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 344d89904774..3185e8daaa0a 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -22,8 +22,8 @@ struct soc_camera_device { | |||
22 | struct list_head list; | 22 | struct list_head list; |
23 | struct device dev; | 23 | struct device dev; |
24 | struct device *pdev; /* Platform device */ | 24 | struct device *pdev; /* Platform device */ |
25 | struct v4l2_rect rect_current; /* Current window */ | 25 | s32 user_width; |
26 | struct v4l2_rect rect_max; /* Maximum window */ | 26 | s32 user_height; |
27 | unsigned short width_min; | 27 | unsigned short width_min; |
28 | unsigned short height_min; | 28 | unsigned short height_min; |
29 | unsigned short y_skip_top; /* Lines to skip at the top */ | 29 | unsigned short y_skip_top; /* Lines to skip at the top */ |
@@ -76,6 +76,8 @@ struct soc_camera_host_ops { | |||
76 | int (*get_formats)(struct soc_camera_device *, int, | 76 | int (*get_formats)(struct soc_camera_device *, int, |
77 | struct soc_camera_format_xlate *); | 77 | struct soc_camera_format_xlate *); |
78 | void (*put_formats)(struct soc_camera_device *); | 78 | void (*put_formats)(struct soc_camera_device *); |
79 | int (*cropcap)(struct soc_camera_device *, struct v4l2_cropcap *); | ||
80 | int (*get_crop)(struct soc_camera_device *, struct v4l2_crop *); | ||
79 | int (*set_crop)(struct soc_camera_device *, struct v4l2_crop *); | 81 | int (*set_crop)(struct soc_camera_device *, struct v4l2_crop *); |
80 | int (*set_fmt)(struct soc_camera_device *, struct v4l2_format *); | 82 | int (*set_fmt)(struct soc_camera_device *, struct v4l2_format *); |
81 | int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *); | 83 | int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *); |
@@ -277,6 +279,21 @@ static inline unsigned long soc_camera_bus_param_compatible( | |||
277 | common_flags; | 279 | common_flags; |
278 | } | 280 | } |
279 | 281 | ||
282 | static inline void soc_camera_limit_side(unsigned int *start, | ||
283 | unsigned int *length, unsigned int start_min, | ||
284 | unsigned int length_min, unsigned int length_max) | ||
285 | { | ||
286 | if (*length < length_min) | ||
287 | *length = length_min; | ||
288 | else if (*length > length_max) | ||
289 | *length = length_max; | ||
290 | |||
291 | if (*start < start_min) | ||
292 | *start = start_min; | ||
293 | else if (*start > start_min + length_max - *length) | ||
294 | *start = start_min + length_max - *length; | ||
295 | } | ||
296 | |||
280 | extern unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, | 297 | extern unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, |
281 | unsigned long flags); | 298 | unsigned long flags); |
282 | 299 | ||