aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/v4l2-subdev.h
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-12-11 09:41:28 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-16 06:27:27 -0500
commit9a74251d8bee7a25fee89a0be3ccea73e01c1a05 (patch)
tree5bffc0457e8fb4e39ac98e7d41423a1512aae498 /include/media/v4l2-subdev.h
parentfaa582610d87edf3ae1d07710a8f7e11c105686c (diff)
V4L/DVB (13658): v4l: add a media-bus API for configuring v4l2 subdev pixel and frame formats
Video subdevices, like cameras, decoders, connect to video bridges over specialised busses. Data is being transferred over these busses in various formats, which only loosely correspond to fourcc codes, describing how video data is stored in RAM. This is not a one-to-one correspondence, therefore we cannot use fourcc codes to configure subdevice output data formats. This patch adds codes for several such on-the-bus formats and an API, similar to the familiar .s_fmt(), .g_fmt(), .try_fmt(), .enum_fmt() API for configuring those codes. After all users of the old API in struct v4l2_subdev_video_ops are converted, it will be removed. Also add helper routines to support generic pass-through mode for the soc-camera framework. create mode 100644 drivers/media/video/soc_mediabus.c create mode 100644 include/media/soc_mediabus.h create mode 100644 include/media/v4l2-mediabus.h Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media/v4l2-subdev.h')
-rw-r--r--include/media/v4l2-subdev.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index a128458dc9eb..9ba99cd39ee7 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -22,6 +22,7 @@
22#define _V4L2_SUBDEV_H 22#define _V4L2_SUBDEV_H
23 23
24#include <media/v4l2-common.h> 24#include <media/v4l2-common.h>
25#include <media/v4l2-mediabus.h>
25 26
26/* generic v4l2_device notify callback notification values */ 27/* generic v4l2_device notify callback notification values */
27#define V4L2_SUBDEV_IR_RX_NOTIFY _IOW('v', 0, u32) 28#define V4L2_SUBDEV_IR_RX_NOTIFY _IOW('v', 0, u32)
@@ -207,7 +208,7 @@ struct v4l2_subdev_audio_ops {
207 s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by 208 s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by
208 video input devices. 209 video input devices.
209 210
210 s_crystal_freq: sets the frequency of the crystal used to generate the 211 s_crystal_freq: sets the frequency of the crystal used to generate the
211 clocks in Hz. An extra flags field allows device specific configuration 212 clocks in Hz. An extra flags field allows device specific configuration
212 regarding clock frequency dividers, etc. If not used, then set flags 213 regarding clock frequency dividers, etc. If not used, then set flags
213 to 0. If the frequency is not supported, then -EINVAL is returned. 214 to 0. If the frequency is not supported, then -EINVAL is returned.
@@ -230,6 +231,13 @@ struct v4l2_subdev_audio_ops {
230 231
231 g_dv_timings(): Get custom dv timings in the sub device. 232 g_dv_timings(): Get custom dv timings in the sub device.
232 233
234 enum_mbus_fmt: enumerate pixel formats, provided by a video data source
235
236 g_mbus_fmt: get the current pixel format, provided by a video data source
237
238 try_mbus_fmt: try to set a pixel format on a video data source
239
240 s_mbus_fmt: set a pixel format on a video data source
233 */ 241 */
234struct v4l2_subdev_video_ops { 242struct v4l2_subdev_video_ops {
235 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); 243 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config);
@@ -261,6 +269,14 @@ struct v4l2_subdev_video_ops {
261 struct v4l2_dv_timings *timings); 269 struct v4l2_dv_timings *timings);
262 int (*g_dv_timings)(struct v4l2_subdev *sd, 270 int (*g_dv_timings)(struct v4l2_subdev *sd,
263 struct v4l2_dv_timings *timings); 271 struct v4l2_dv_timings *timings);
272 int (*enum_mbus_fmt)(struct v4l2_subdev *sd, int index,
273 enum v4l2_mbus_pixelcode *code);
274 int (*g_mbus_fmt)(struct v4l2_subdev *sd,
275 struct v4l2_mbus_framefmt *fmt);
276 int (*try_mbus_fmt)(struct v4l2_subdev *sd,
277 struct v4l2_mbus_framefmt *fmt);
278 int (*s_mbus_fmt)(struct v4l2_subdev *sd,
279 struct v4l2_mbus_framefmt *fmt);
264}; 280};
265 281
266/** 282/**