diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2015-03-04 04:47:55 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-03-23 14:44:35 -0400 |
commit | e1c47e732cbb4211d15ae0c4465dc4ceefcaa398 (patch) | |
tree | 1c76ec4c6c75765dd1b90e5a63398d44be3e8fe6 /include/uapi | |
parent | f7234138f14c2296c5eb6b8224abe00b507faf3f (diff) |
[media] v4l2-subdev.h: add 'which' field for the enum structs
While all other pad ops allow you to select whether to use the 'try' or
the 'active' formats, the enum ops didn't have that option and always used
'try'.
However, this will fail if a simple (e.g. PCI) bridge driver wants to use
the enum pad op of a subdev that's also used in a complex platform driver
like the omap3. Such a bridge driver generally wants to enum formats based
on the active format.
So add a new 'which' field to these structs. Note that V4L2_SUBDEV_FORMAT_TRY
is 0, so the default remains TRY (applications need to set reserved to 0).
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'include/uapi')
-rw-r--r-- | include/uapi/linux/v4l2-subdev.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h index e0a7e3da498a..dbce2b554e02 100644 --- a/include/uapi/linux/v4l2-subdev.h +++ b/include/uapi/linux/v4l2-subdev.h | |||
@@ -69,12 +69,14 @@ struct v4l2_subdev_crop { | |||
69 | * @pad: pad number, as reported by the media API | 69 | * @pad: pad number, as reported by the media API |
70 | * @index: format index during enumeration | 70 | * @index: format index during enumeration |
71 | * @code: format code (MEDIA_BUS_FMT_ definitions) | 71 | * @code: format code (MEDIA_BUS_FMT_ definitions) |
72 | * @which: format type (from enum v4l2_subdev_format_whence) | ||
72 | */ | 73 | */ |
73 | struct v4l2_subdev_mbus_code_enum { | 74 | struct v4l2_subdev_mbus_code_enum { |
74 | __u32 pad; | 75 | __u32 pad; |
75 | __u32 index; | 76 | __u32 index; |
76 | __u32 code; | 77 | __u32 code; |
77 | __u32 reserved[9]; | 78 | __u32 which; |
79 | __u32 reserved[8]; | ||
78 | }; | 80 | }; |
79 | 81 | ||
80 | /** | 82 | /** |
@@ -82,6 +84,7 @@ struct v4l2_subdev_mbus_code_enum { | |||
82 | * @pad: pad number, as reported by the media API | 84 | * @pad: pad number, as reported by the media API |
83 | * @index: format index during enumeration | 85 | * @index: format index during enumeration |
84 | * @code: format code (MEDIA_BUS_FMT_ definitions) | 86 | * @code: format code (MEDIA_BUS_FMT_ definitions) |
87 | * @which: format type (from enum v4l2_subdev_format_whence) | ||
85 | */ | 88 | */ |
86 | struct v4l2_subdev_frame_size_enum { | 89 | struct v4l2_subdev_frame_size_enum { |
87 | __u32 index; | 90 | __u32 index; |
@@ -91,7 +94,8 @@ struct v4l2_subdev_frame_size_enum { | |||
91 | __u32 max_width; | 94 | __u32 max_width; |
92 | __u32 min_height; | 95 | __u32 min_height; |
93 | __u32 max_height; | 96 | __u32 max_height; |
94 | __u32 reserved[9]; | 97 | __u32 which; |
98 | __u32 reserved[8]; | ||
95 | }; | 99 | }; |
96 | 100 | ||
97 | /** | 101 | /** |
@@ -113,6 +117,7 @@ struct v4l2_subdev_frame_interval { | |||
113 | * @width: frame width in pixels | 117 | * @width: frame width in pixels |
114 | * @height: frame height in pixels | 118 | * @height: frame height in pixels |
115 | * @interval: frame interval in seconds | 119 | * @interval: frame interval in seconds |
120 | * @which: format type (from enum v4l2_subdev_format_whence) | ||
116 | */ | 121 | */ |
117 | struct v4l2_subdev_frame_interval_enum { | 122 | struct v4l2_subdev_frame_interval_enum { |
118 | __u32 index; | 123 | __u32 index; |
@@ -121,7 +126,8 @@ struct v4l2_subdev_frame_interval_enum { | |||
121 | __u32 width; | 126 | __u32 width; |
122 | __u32 height; | 127 | __u32 height; |
123 | struct v4l2_fract interval; | 128 | struct v4l2_fract interval; |
124 | __u32 reserved[9]; | 129 | __u32 which; |
130 | __u32 reserved[8]; | ||
125 | }; | 131 | }; |
126 | 132 | ||
127 | /** | 133 | /** |