aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/soc_camera.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/media/soc_camera.h')
-rw-r--r--include/media/soc_camera.h32
1 files changed, 10 insertions, 22 deletions
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 3d74e60032dd..9d69f01b6fa2 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -24,18 +24,13 @@ struct soc_camera_device {
24 struct device *pdev; /* Platform device */ 24 struct device *pdev; /* Platform device */
25 s32 user_width; 25 s32 user_width;
26 s32 user_height; 26 s32 user_height;
27 unsigned short width_min; 27 enum v4l2_colorspace colorspace;
28 unsigned short height_min;
29 unsigned short y_skip_top; /* Lines to skip at the top */
30 unsigned char iface; /* Host number */ 28 unsigned char iface; /* Host number */
31 unsigned char devnum; /* Device number per host */ 29 unsigned char devnum; /* Device number per host */
32 unsigned char buswidth; /* See comment in .c */
33 struct soc_camera_sense *sense; /* See comment in struct definition */ 30 struct soc_camera_sense *sense; /* See comment in struct definition */
34 struct soc_camera_ops *ops; 31 struct soc_camera_ops *ops;
35 struct video_device *vdev; 32 struct video_device *vdev;
36 const struct soc_camera_data_format *current_fmt; 33 const struct soc_camera_format_xlate *current_fmt;
37 const struct soc_camera_data_format *formats;
38 int num_formats;
39 struct soc_camera_format_xlate *user_formats; 34 struct soc_camera_format_xlate *user_formats;
40 int num_user_formats; 35 int num_user_formats;
41 enum v4l2_field field; /* Preserve field over close() */ 36 enum v4l2_field field; /* Preserve field over close() */
@@ -86,6 +81,8 @@ struct soc_camera_host_ops {
86 int (*set_bus_param)(struct soc_camera_device *, __u32); 81 int (*set_bus_param)(struct soc_camera_device *, __u32);
87 int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *); 82 int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *);
88 int (*set_ctrl)(struct soc_camera_device *, struct v4l2_control *); 83 int (*set_ctrl)(struct soc_camera_device *, struct v4l2_control *);
84 int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
85 int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
89 unsigned int (*poll)(struct file *, poll_table *); 86 unsigned int (*poll)(struct file *, poll_table *);
90 const struct v4l2_queryctrl *controls; 87 const struct v4l2_queryctrl *controls;
91 int num_controls; 88 int num_controls;
@@ -107,6 +104,8 @@ struct soc_camera_link {
107 int i2c_adapter_id; 104 int i2c_adapter_id;
108 struct i2c_board_info *board_info; 105 struct i2c_board_info *board_info;
109 const char *module_name; 106 const char *module_name;
107 void *priv;
108
110 /* 109 /*
111 * For non-I2C devices platform platform has to provide methods to 110 * For non-I2C devices platform platform has to provide methods to
112 * add a device to the system and to remove 111 * add a device to the system and to remove
@@ -162,23 +161,13 @@ static inline struct v4l2_subdev *soc_camera_to_subdev(
162int soc_camera_host_register(struct soc_camera_host *ici); 161int soc_camera_host_register(struct soc_camera_host *ici);
163void soc_camera_host_unregister(struct soc_camera_host *ici); 162void soc_camera_host_unregister(struct soc_camera_host *ici);
164 163
165const struct soc_camera_data_format *soc_camera_format_by_fourcc(
166 struct soc_camera_device *icd, unsigned int fourcc);
167const struct soc_camera_format_xlate *soc_camera_xlate_by_fourcc( 164const struct soc_camera_format_xlate *soc_camera_xlate_by_fourcc(
168 struct soc_camera_device *icd, unsigned int fourcc); 165 struct soc_camera_device *icd, unsigned int fourcc);
169 166
170struct soc_camera_data_format {
171 const char *name;
172 unsigned int depth;
173 __u32 fourcc;
174 enum v4l2_colorspace colorspace;
175};
176
177/** 167/**
178 * struct soc_camera_format_xlate - match between host and sensor formats 168 * struct soc_camera_format_xlate - match between host and sensor formats
179 * @cam_fmt: sensor format provided by the sensor 169 * @code: code of a sensor provided format
180 * @host_fmt: host format after host translation from cam_fmt 170 * @host_fmt: host format after host translation from code
181 * @buswidth: bus width for this format
182 * 171 *
183 * Host and sensor translation structure. Used in table of host and sensor 172 * Host and sensor translation structure. Used in table of host and sensor
184 * formats matchings in soc_camera_device. A host can override the generic list 173 * formats matchings in soc_camera_device. A host can override the generic list
@@ -186,9 +175,8 @@ struct soc_camera_data_format {
186 * format setup. 175 * format setup.
187 */ 176 */
188struct soc_camera_format_xlate { 177struct soc_camera_format_xlate {
189 const struct soc_camera_data_format *cam_fmt; 178 enum v4l2_mbus_pixelcode code;
190 const struct soc_camera_data_format *host_fmt; 179 const struct soc_mbus_pixelfmt *host_fmt;
191 unsigned char buswidth;
192}; 180};
193 181
194struct soc_camera_ops { 182struct soc_camera_ops {