diff options
Diffstat (limited to 'include/media/soc_camera.h')
-rw-r--r-- | include/media/soc_camera.h | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 7440d9250665..37013688af44 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -45,6 +45,7 @@ struct soc_camera_device { | |||
45 | int num_formats; | 45 | int num_formats; |
46 | struct soc_camera_format_xlate *user_formats; | 46 | struct soc_camera_format_xlate *user_formats; |
47 | int num_user_formats; | 47 | int num_user_formats; |
48 | enum v4l2_field field; /* Preserve field over close() */ | ||
48 | struct module *owner; | 49 | struct module *owner; |
49 | void *host_priv; /* Per-device host private data */ | 50 | void *host_priv; /* Per-device host private data */ |
50 | /* soc_camera.c private count. Only accessed with .video_lock held */ | 51 | /* soc_camera.c private count. Only accessed with .video_lock held */ |
@@ -74,7 +75,8 @@ struct soc_camera_host_ops { | |||
74 | int (*resume)(struct soc_camera_device *); | 75 | int (*resume)(struct soc_camera_device *); |
75 | int (*get_formats)(struct soc_camera_device *, int, | 76 | int (*get_formats)(struct soc_camera_device *, int, |
76 | struct soc_camera_format_xlate *); | 77 | struct soc_camera_format_xlate *); |
77 | int (*set_fmt)(struct soc_camera_device *, __u32, struct v4l2_rect *); | 78 | int (*set_crop)(struct soc_camera_device *, struct v4l2_rect *); |
79 | int (*set_fmt)(struct soc_camera_device *, struct v4l2_format *); | ||
78 | int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *); | 80 | int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *); |
79 | void (*init_videobuf)(struct videobuf_queue *, | 81 | void (*init_videobuf)(struct videobuf_queue *, |
80 | struct soc_camera_device *); | 82 | struct soc_camera_device *); |
@@ -93,13 +95,18 @@ struct soc_camera_host_ops { | |||
93 | struct soc_camera_link { | 95 | struct soc_camera_link { |
94 | /* Camera bus id, used to match a camera and a bus */ | 96 | /* Camera bus id, used to match a camera and a bus */ |
95 | int bus_id; | 97 | int bus_id; |
96 | /* GPIO number to switch between 8 and 10 bit modes */ | ||
97 | unsigned int gpio; | ||
98 | /* Per camera SOCAM_SENSOR_* bus flags */ | 98 | /* Per camera SOCAM_SENSOR_* bus flags */ |
99 | unsigned long flags; | 99 | unsigned long flags; |
100 | /* Optional callbacks to power on or off and reset the sensor */ | 100 | /* Optional callbacks to power on or off and reset the sensor */ |
101 | int (*power)(struct device *, int); | 101 | int (*power)(struct device *, int); |
102 | int (*reset)(struct device *); | 102 | int (*reset)(struct device *); |
103 | /* | ||
104 | * some platforms may support different data widths than the sensors | ||
105 | * native ones due to different data line routing. Let the board code | ||
106 | * overwrite the width flags. | ||
107 | */ | ||
108 | int (*set_bus_param)(struct soc_camera_link *, unsigned long flags); | ||
109 | unsigned long (*query_bus_param)(struct soc_camera_link *); | ||
103 | }; | 110 | }; |
104 | 111 | ||
105 | static inline struct soc_camera_device *to_soc_camera_dev(struct device *dev) | 112 | static inline struct soc_camera_device *to_soc_camera_dev(struct device *dev) |
@@ -159,7 +166,8 @@ struct soc_camera_ops { | |||
159 | int (*release)(struct soc_camera_device *); | 166 | int (*release)(struct soc_camera_device *); |
160 | int (*start_capture)(struct soc_camera_device *); | 167 | int (*start_capture)(struct soc_camera_device *); |
161 | int (*stop_capture)(struct soc_camera_device *); | 168 | int (*stop_capture)(struct soc_camera_device *); |
162 | int (*set_fmt)(struct soc_camera_device *, __u32, struct v4l2_rect *); | 169 | int (*set_crop)(struct soc_camera_device *, struct v4l2_rect *); |
170 | int (*set_fmt)(struct soc_camera_device *, struct v4l2_format *); | ||
163 | int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *); | 171 | int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *); |
164 | unsigned long (*query_bus_param)(struct soc_camera_device *); | 172 | unsigned long (*query_bus_param)(struct soc_camera_device *); |
165 | int (*set_bus_param)(struct soc_camera_device *, unsigned long); | 173 | int (*set_bus_param)(struct soc_camera_device *, unsigned long); |
@@ -239,15 +247,19 @@ static inline struct v4l2_queryctrl const *soc_camera_find_qctrl( | |||
239 | static inline unsigned long soc_camera_bus_param_compatible( | 247 | static inline unsigned long soc_camera_bus_param_compatible( |
240 | unsigned long camera_flags, unsigned long bus_flags) | 248 | unsigned long camera_flags, unsigned long bus_flags) |
241 | { | 249 | { |
242 | unsigned long common_flags, hsync, vsync, pclk; | 250 | unsigned long common_flags, hsync, vsync, pclk, data, buswidth, mode; |
243 | 251 | ||
244 | common_flags = camera_flags & bus_flags; | 252 | common_flags = camera_flags & bus_flags; |
245 | 253 | ||
246 | hsync = common_flags & (SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_HSYNC_ACTIVE_LOW); | 254 | hsync = common_flags & (SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_HSYNC_ACTIVE_LOW); |
247 | vsync = common_flags & (SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW); | 255 | vsync = common_flags & (SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW); |
248 | pclk = common_flags & (SOCAM_PCLK_SAMPLE_RISING | SOCAM_PCLK_SAMPLE_FALLING); | 256 | pclk = common_flags & (SOCAM_PCLK_SAMPLE_RISING | SOCAM_PCLK_SAMPLE_FALLING); |
257 | data = common_flags & (SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATA_ACTIVE_LOW); | ||
258 | mode = common_flags & (SOCAM_MASTER | SOCAM_SLAVE); | ||
259 | buswidth = common_flags & SOCAM_DATAWIDTH_MASK; | ||
249 | 260 | ||
250 | return (!hsync || !vsync || !pclk) ? 0 : common_flags; | 261 | return (!hsync || !vsync || !pclk || !data || !mode || !buswidth) ? 0 : |
262 | common_flags; | ||
251 | } | 263 | } |
252 | 264 | ||
253 | extern unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, | 265 | extern unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, |