diff options
-rw-r--r-- | include/media/v4l2-subdev.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index abf1a0e50333..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. |
@@ -461,6 +493,12 @@ struct v4l2_subdev_ir_ops { | |||
461 | struct v4l2_subdev_ir_parameters *params); | 493 | struct v4l2_subdev_ir_parameters *params); |
462 | }; | 494 | }; |
463 | 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 | */ | ||
464 | struct v4l2_subdev_pad_ops { | 502 | struct v4l2_subdev_pad_ops { |
465 | 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, |
466 | struct v4l2_subdev_mbus_code_enum *code); | 504 | struct v4l2_subdev_mbus_code_enum *code); |
@@ -489,6 +527,10 @@ struct v4l2_subdev_pad_ops { | |||
489 | struct v4l2_subdev_format *source_fmt, | 527 | struct v4l2_subdev_format *source_fmt, |
490 | struct v4l2_subdev_format *sink_fmt); | 528 | struct v4l2_subdev_format *sink_fmt); |
491 | #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); | ||
492 | }; | 534 | }; |
493 | 535 | ||
494 | struct v4l2_subdev_ops { | 536 | struct v4l2_subdev_ops { |