diff options
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/davinci/vpbe.h | 14 | ||||
-rw-r--r-- | include/media/davinci/vpbe_types.h | 8 | ||||
-rw-r--r-- | include/media/davinci/vpbe_venc.h | 2 | ||||
-rw-r--r-- | include/media/davinci/vpif_types.h | 26 | ||||
-rw-r--r-- | include/media/s5p_fimc.h | 2 | ||||
-rw-r--r-- | include/media/s5p_hdmi.h | 2 | ||||
-rw-r--r-- | include/media/v4l2-ctrls.h | 23 | ||||
-rw-r--r-- | include/media/v4l2-subdev.h | 48 |
8 files changed, 101 insertions, 24 deletions
diff --git a/include/media/davinci/vpbe.h b/include/media/davinci/vpbe.h index 8bc1b3c0e679..a7ca4884c46c 100644 --- a/include/media/davinci/vpbe.h +++ b/include/media/davinci/vpbe.h | |||
@@ -35,7 +35,7 @@ struct osd_config_info { | |||
35 | struct vpbe_output { | 35 | struct vpbe_output { |
36 | struct v4l2_output output; | 36 | struct v4l2_output output; |
37 | /* | 37 | /* |
38 | * If output capabilities include dv_preset, list supported presets | 38 | * If output capabilities include dv_timings, list supported timings |
39 | * below | 39 | * below |
40 | */ | 40 | */ |
41 | char *subdev_name; | 41 | char *subdev_name; |
@@ -120,16 +120,16 @@ struct vpbe_device_ops { | |||
120 | unsigned int (*get_output)(struct vpbe_device *vpbe_dev); | 120 | unsigned int (*get_output)(struct vpbe_device *vpbe_dev); |
121 | 121 | ||
122 | /* Set DV preset at current output */ | 122 | /* Set DV preset at current output */ |
123 | int (*s_dv_preset)(struct vpbe_device *vpbe_dev, | 123 | int (*s_dv_timings)(struct vpbe_device *vpbe_dev, |
124 | struct v4l2_dv_preset *dv_preset); | 124 | struct v4l2_dv_timings *dv_timings); |
125 | 125 | ||
126 | /* Get DV presets supported at the output */ | 126 | /* Get DV presets supported at the output */ |
127 | int (*g_dv_preset)(struct vpbe_device *vpbe_dev, | 127 | int (*g_dv_timings)(struct vpbe_device *vpbe_dev, |
128 | struct v4l2_dv_preset *dv_preset); | 128 | struct v4l2_dv_timings *dv_timings); |
129 | 129 | ||
130 | /* Enumerate the DV Presets supported at the output */ | 130 | /* Enumerate the DV Presets supported at the output */ |
131 | int (*enum_dv_presets)(struct vpbe_device *vpbe_dev, | 131 | int (*enum_dv_timings)(struct vpbe_device *vpbe_dev, |
132 | struct v4l2_dv_enum_preset *preset_info); | 132 | struct v4l2_enum_dv_timings *timings_info); |
133 | 133 | ||
134 | /* Set std at the output */ | 134 | /* Set std at the output */ |
135 | int (*s_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id); | 135 | int (*s_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id); |
diff --git a/include/media/davinci/vpbe_types.h b/include/media/davinci/vpbe_types.h index 727f55170e41..9b85396514be 100644 --- a/include/media/davinci/vpbe_types.h +++ b/include/media/davinci/vpbe_types.h | |||
@@ -32,11 +32,6 @@ enum vpbe_enc_timings_type { | |||
32 | VPBE_ENC_TIMINGS_INVALID = 0x8, | 32 | VPBE_ENC_TIMINGS_INVALID = 0x8, |
33 | }; | 33 | }; |
34 | 34 | ||
35 | union vpbe_timings { | ||
36 | v4l2_std_id std_id; | ||
37 | unsigned int dv_preset; | ||
38 | }; | ||
39 | |||
40 | /* | 35 | /* |
41 | * struct vpbe_enc_mode_info | 36 | * struct vpbe_enc_mode_info |
42 | * @name: ptr to name string of the standard, "NTSC", "PAL" etc | 37 | * @name: ptr to name string of the standard, "NTSC", "PAL" etc |
@@ -73,7 +68,8 @@ union vpbe_timings { | |||
73 | struct vpbe_enc_mode_info { | 68 | struct vpbe_enc_mode_info { |
74 | unsigned char *name; | 69 | unsigned char *name; |
75 | enum vpbe_enc_timings_type timings_type; | 70 | enum vpbe_enc_timings_type timings_type; |
76 | union vpbe_timings timings; | 71 | v4l2_std_id std_id; |
72 | struct v4l2_dv_timings dv_timings; | ||
77 | unsigned int interlaced; | 73 | unsigned int interlaced; |
78 | unsigned int xres; | 74 | unsigned int xres; |
79 | unsigned int yres; | 75 | unsigned int yres; |
diff --git a/include/media/davinci/vpbe_venc.h b/include/media/davinci/vpbe_venc.h index 6b57334f4029..cc78c2eb16da 100644 --- a/include/media/davinci/vpbe_venc.h +++ b/include/media/davinci/vpbe_venc.h | |||
@@ -32,7 +32,7 @@ struct venc_platform_data { | |||
32 | int (*setup_pinmux)(enum v4l2_mbus_pixelcode if_type, | 32 | int (*setup_pinmux)(enum v4l2_mbus_pixelcode if_type, |
33 | int field); | 33 | int field); |
34 | int (*setup_clock)(enum vpbe_enc_timings_type type, | 34 | int (*setup_clock)(enum vpbe_enc_timings_type type, |
35 | unsigned int mode); | 35 | unsigned int pixclock); |
36 | int (*setup_if_config)(enum v4l2_mbus_pixelcode pixcode); | 36 | int (*setup_if_config)(enum v4l2_mbus_pixelcode pixcode); |
37 | /* Number of LCD outputs supported */ | 37 | /* Number of LCD outputs supported */ |
38 | int num_lcd_outputs; | 38 | int num_lcd_outputs; |
diff --git a/include/media/davinci/vpif_types.h b/include/media/davinci/vpif_types.h index d8f6ab1943e4..3882e0675ccf 100644 --- a/include/media/davinci/vpif_types.h +++ b/include/media/davinci/vpif_types.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | 21 | ||
22 | #define VPIF_CAPTURE_MAX_CHANNELS 2 | 22 | #define VPIF_CAPTURE_MAX_CHANNELS 2 |
23 | #define VPIF_DISPLAY_MAX_CHANNELS 2 | ||
23 | 24 | ||
24 | enum vpif_if_type { | 25 | enum vpif_if_type { |
25 | VPIF_IF_BT656, | 26 | VPIF_IF_BT656, |
@@ -37,29 +38,38 @@ struct vpif_interface { | |||
37 | struct vpif_subdev_info { | 38 | struct vpif_subdev_info { |
38 | const char *name; | 39 | const char *name; |
39 | struct i2c_board_info board_info; | 40 | struct i2c_board_info board_info; |
40 | u32 input; | 41 | }; |
41 | u32 output; | 42 | |
42 | unsigned can_route:1; | 43 | struct vpif_output { |
43 | struct vpif_interface vpif_if; | 44 | struct v4l2_output output; |
45 | const char *subdev_name; | ||
46 | u32 input_route; | ||
47 | u32 output_route; | ||
48 | }; | ||
49 | |||
50 | struct vpif_display_chan_config { | ||
51 | const struct vpif_output *outputs; | ||
52 | int output_count; | ||
53 | bool clip_en; | ||
44 | }; | 54 | }; |
45 | 55 | ||
46 | struct vpif_display_config { | 56 | struct vpif_display_config { |
47 | int (*set_clock)(int, int); | 57 | int (*set_clock)(int, int); |
48 | struct vpif_subdev_info *subdevinfo; | 58 | struct vpif_subdev_info *subdevinfo; |
49 | int subdev_count; | 59 | int subdev_count; |
50 | const char **output; | 60 | struct vpif_display_chan_config chan_config[VPIF_DISPLAY_MAX_CHANNELS]; |
51 | int output_count; | ||
52 | const char *card_name; | 61 | const char *card_name; |
53 | bool ch2_clip_en; | ||
54 | bool ch3_clip_en; | ||
55 | }; | 62 | }; |
56 | 63 | ||
57 | struct vpif_input { | 64 | struct vpif_input { |
58 | struct v4l2_input input; | 65 | struct v4l2_input input; |
59 | const char *subdev_name; | 66 | const char *subdev_name; |
67 | u32 input_route; | ||
68 | u32 output_route; | ||
60 | }; | 69 | }; |
61 | 70 | ||
62 | struct vpif_capture_chan_config { | 71 | struct vpif_capture_chan_config { |
72 | struct vpif_interface vpif_if; | ||
63 | const struct vpif_input *inputs; | 73 | const struct vpif_input *inputs; |
64 | int input_count; | 74 | int input_count; |
65 | }; | 75 | }; |
diff --git a/include/media/s5p_fimc.h b/include/media/s5p_fimc.h index 09421a611d73..eaea62a382f8 100644 --- a/include/media/s5p_fimc.h +++ b/include/media/s5p_fimc.h | |||
@@ -30,7 +30,6 @@ struct i2c_board_info; | |||
30 | * @board_info: pointer to I2C subdevice's board info | 30 | * @board_info: pointer to I2C subdevice's board info |
31 | * @clk_frequency: frequency of the clock the host interface provides to sensor | 31 | * @clk_frequency: frequency of the clock the host interface provides to sensor |
32 | * @bus_type: determines bus type, MIPI, ITU-R BT.601 etc. | 32 | * @bus_type: determines bus type, MIPI, ITU-R BT.601 etc. |
33 | * @csi_data_align: MIPI-CSI interface data alignment in bits | ||
34 | * @i2c_bus_num: i2c control bus id the sensor is attached to | 33 | * @i2c_bus_num: i2c control bus id the sensor is attached to |
35 | * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU) | 34 | * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU) |
36 | * @clk_id: index of the SoC peripheral clock for sensors | 35 | * @clk_id: index of the SoC peripheral clock for sensors |
@@ -40,7 +39,6 @@ struct s5p_fimc_isp_info { | |||
40 | struct i2c_board_info *board_info; | 39 | struct i2c_board_info *board_info; |
41 | unsigned long clk_frequency; | 40 | unsigned long clk_frequency; |
42 | enum cam_bus_type bus_type; | 41 | enum cam_bus_type bus_type; |
43 | u16 csi_data_align; | ||
44 | u16 i2c_bus_num; | 42 | u16 i2c_bus_num; |
45 | u16 mux_id; | 43 | u16 mux_id; |
46 | u16 flags; | 44 | u16 flags; |
diff --git a/include/media/s5p_hdmi.h b/include/media/s5p_hdmi.h index 361a751f73af..181642b8d0a5 100644 --- a/include/media/s5p_hdmi.h +++ b/include/media/s5p_hdmi.h | |||
@@ -20,6 +20,7 @@ struct i2c_board_info; | |||
20 | * @hdmiphy_info: template for HDMIPHY I2C device | 20 | * @hdmiphy_info: template for HDMIPHY I2C device |
21 | * @mhl_bus: controller id for MHL control bus | 21 | * @mhl_bus: controller id for MHL control bus |
22 | * @mhl_info: template for MHL I2C device | 22 | * @mhl_info: template for MHL I2C device |
23 | * @hpd_gpio: GPIO for Hot-Plug-Detect pin | ||
23 | * | 24 | * |
24 | * NULL pointer for *_info fields indicates that | 25 | * NULL pointer for *_info fields indicates that |
25 | * the corresponding chip is not present | 26 | * the corresponding chip is not present |
@@ -29,6 +30,7 @@ struct s5p_hdmi_platform_data { | |||
29 | struct i2c_board_info *hdmiphy_info; | 30 | struct i2c_board_info *hdmiphy_info; |
30 | int mhl_bus; | 31 | int mhl_bus; |
31 | struct i2c_board_info *mhl_info; | 32 | struct i2c_board_info *mhl_info; |
33 | int hpd_gpio; | ||
32 | }; | 34 | }; |
33 | 35 | ||
34 | #endif /* S5P_HDMI_H */ | 36 | #endif /* S5P_HDMI_H */ |
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 801adb466bd2..96509119f28f 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h | |||
@@ -351,6 +351,29 @@ struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl, | |||
351 | const struct v4l2_ctrl_ops *ops, | 351 | const struct v4l2_ctrl_ops *ops, |
352 | u32 id, s32 max, s32 mask, s32 def); | 352 | u32 id, s32 max, s32 mask, s32 def); |
353 | 353 | ||
354 | /** v4l2_ctrl_new_std_menu_items() - Create a new standard V4L2 menu control | ||
355 | * with driver specific menu. | ||
356 | * @hdl: The control handler. | ||
357 | * @ops: The control ops. | ||
358 | * @id: The control ID. | ||
359 | * @max: The control's maximum value. | ||
360 | * @mask: The control's skip mask for menu controls. This makes it | ||
361 | * easy to skip menu items that are not valid. If bit X is set, | ||
362 | * then menu item X is skipped. Of course, this only works for | ||
363 | * menus with <= 32 menu items. There are no menus that come | ||
364 | * close to that number, so this is OK. Should we ever need more, | ||
365 | * then this will have to be extended to a u64 or a bit array. | ||
366 | * @def: The control's default value. | ||
367 | * @qmenu: The new menu. | ||
368 | * | ||
369 | * Same as v4l2_ctrl_new_std_menu(), but @qmenu will be the driver specific | ||
370 | * menu of this control. | ||
371 | * | ||
372 | */ | ||
373 | struct v4l2_ctrl *v4l2_ctrl_new_std_menu_items(struct v4l2_ctrl_handler *hdl, | ||
374 | const struct v4l2_ctrl_ops *ops, u32 id, s32 max, | ||
375 | s32 mask, s32 def, const char * const *qmenu); | ||
376 | |||
354 | /** v4l2_ctrl_new_int_menu() - Create a new standard V4L2 integer menu control. | 377 | /** v4l2_ctrl_new_int_menu() - Create a new standard V4L2 integer menu control. |
355 | * @hdl: The control handler. | 378 | * @hdl: The control handler. |
356 | * @ops: The control ops. | 379 | * @ops: The control ops. |
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 2ecd7377153b..b137a5e1151a 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #ifndef _V4L2_SUBDEV_H | 21 | #ifndef _V4L2_SUBDEV_H |
22 | #define _V4L2_SUBDEV_H | 22 | #define _V4L2_SUBDEV_H |
23 | 23 | ||
24 | #include <linux/types.h> | ||
24 | #include <linux/v4l2-subdev.h> | 25 | #include <linux/v4l2-subdev.h> |
25 | #include <media/media-entity.h> | 26 | #include <media/media-entity.h> |
26 | #include <media/v4l2-common.h> | 27 | #include <media/v4l2-common.h> |
@@ -45,6 +46,7 @@ struct v4l2_fh; | |||
45 | struct v4l2_subdev; | 46 | struct v4l2_subdev; |
46 | struct v4l2_subdev_fh; | 47 | struct v4l2_subdev_fh; |
47 | struct tuner_setup; | 48 | struct tuner_setup; |
49 | struct v4l2_mbus_frame_desc; | ||
48 | 50 | ||
49 | /* decode_vbi_line */ | 51 | /* decode_vbi_line */ |
50 | struct v4l2_decode_vbi_line { | 52 | struct v4l2_decode_vbi_line { |
@@ -226,6 +228,36 @@ struct v4l2_subdev_audio_ops { | |||
226 | int (*s_stream)(struct v4l2_subdev *sd, int enable); | 228 | int (*s_stream)(struct v4l2_subdev *sd, int enable); |
227 | }; | 229 | }; |
228 | 230 | ||
231 | /* Indicates the @length field specifies maximum data length. */ | ||
232 | #define V4L2_MBUS_FRAME_DESC_FL_LEN_MAX (1U << 0) | ||
233 | /* Indicates user defined data format, i.e. non standard frame format. */ | ||
234 | #define V4L2_MBUS_FRAME_DESC_FL_BLOB (1U << 1) | ||
235 | |||
236 | /** | ||
237 | * struct v4l2_mbus_frame_desc_entry - media bus frame description structure | ||
238 | * @flags: V4L2_MBUS_FRAME_DESC_FL_* flags | ||
239 | * @pixelcode: media bus pixel code, valid if FRAME_DESC_FL_BLOB is not set | ||
240 | * @length: number of octets per frame, valid for compressed or unspecified | ||
241 | * formats | ||
242 | */ | ||
243 | struct v4l2_mbus_frame_desc_entry { | ||
244 | u16 flags; | ||
245 | u32 pixelcode; | ||
246 | u32 length; | ||
247 | }; | ||
248 | |||
249 | #define V4L2_FRAME_DESC_ENTRY_MAX 4 | ||
250 | |||
251 | /** | ||
252 | * struct v4l2_mbus_frame_desc - media bus data frame description | ||
253 | * @entry: frame descriptors array | ||
254 | * @num_entries: number of entries in @entry array | ||
255 | */ | ||
256 | struct v4l2_mbus_frame_desc { | ||
257 | struct v4l2_mbus_frame_desc_entry entry[V4L2_FRAME_DESC_ENTRY_MAX]; | ||
258 | unsigned short num_entries; | ||
259 | }; | ||
260 | |||
229 | /* | 261 | /* |
230 | s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by | 262 | s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by |
231 | video input devices. | 263 | video input devices. |
@@ -274,6 +306,10 @@ struct v4l2_subdev_audio_ops { | |||
274 | s_mbus_config: set a certain mediabus configuration. This operation is added | 306 | s_mbus_config: set a certain mediabus configuration. This operation is added |
275 | for compatibility with soc-camera drivers and should not be used by new | 307 | for compatibility with soc-camera drivers and should not be used by new |
276 | software. | 308 | software. |
309 | |||
310 | s_rx_buffer: set a host allocated memory buffer for the subdev. The subdev | ||
311 | can adjust @size to a lower value and must not write more data to the | ||
312 | buffer starting at @data than the original value of @size. | ||
277 | */ | 313 | */ |
278 | struct v4l2_subdev_video_ops { | 314 | struct v4l2_subdev_video_ops { |
279 | int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); | 315 | int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); |
@@ -327,6 +363,8 @@ struct v4l2_subdev_video_ops { | |||
327 | struct v4l2_mbus_config *cfg); | 363 | struct v4l2_mbus_config *cfg); |
328 | int (*s_mbus_config)(struct v4l2_subdev *sd, | 364 | int (*s_mbus_config)(struct v4l2_subdev *sd, |
329 | const struct v4l2_mbus_config *cfg); | 365 | const struct v4l2_mbus_config *cfg); |
366 | int (*s_rx_buffer)(struct v4l2_subdev *sd, void *buf, | ||
367 | unsigned int *size); | ||
330 | }; | 368 | }; |
331 | 369 | ||
332 | /* | 370 | /* |
@@ -455,6 +493,12 @@ struct v4l2_subdev_ir_ops { | |||
455 | struct v4l2_subdev_ir_parameters *params); | 493 | struct v4l2_subdev_ir_parameters *params); |
456 | }; | 494 | }; |
457 | 495 | ||
496 | /** | ||
497 | * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations | ||
498 | * @get_frame_desc: get the current low level media bus frame parameters. | ||
499 | * @get_frame_desc: set the low level media bus frame parameters, @fd array | ||
500 | * may be adjusted by the subdev driver to device capabilities. | ||
501 | */ | ||
458 | struct v4l2_subdev_pad_ops { | 502 | struct v4l2_subdev_pad_ops { |
459 | int (*enum_mbus_code)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, | 503 | int (*enum_mbus_code)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, |
460 | struct v4l2_subdev_mbus_code_enum *code); | 504 | struct v4l2_subdev_mbus_code_enum *code); |
@@ -483,6 +527,10 @@ struct v4l2_subdev_pad_ops { | |||
483 | struct v4l2_subdev_format *source_fmt, | 527 | struct v4l2_subdev_format *source_fmt, |
484 | struct v4l2_subdev_format *sink_fmt); | 528 | struct v4l2_subdev_format *sink_fmt); |
485 | #endif /* CONFIG_MEDIA_CONTROLLER */ | 529 | #endif /* CONFIG_MEDIA_CONTROLLER */ |
530 | int (*get_frame_desc)(struct v4l2_subdev *sd, unsigned int pad, | ||
531 | struct v4l2_mbus_frame_desc *fd); | ||
532 | int (*set_frame_desc)(struct v4l2_subdev *sd, unsigned int pad, | ||
533 | struct v4l2_mbus_frame_desc *fd); | ||
486 | }; | 534 | }; |
487 | 535 | ||
488 | struct v4l2_subdev_ops { | 536 | struct v4l2_subdev_ops { |