2 * V4L2 subdev userspace API
4 * Copyright (C) 2010 Nokia Corporation
6 * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
7 * Sakari Ailus <sakari.ailus@iki.fi>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifndef __LINUX_V4L2_SUBDEV_H
24 #define __LINUX_V4L2_SUBDEV_H
26 #include <linux/ioctl.h>
27 #include <linux/types.h>
28 #ifdef KERNEL_HEADER_MODIFICATION
29 #include "v4l2-mediabus.h"
31 #include <linux/v4l2-mediabus.h>
35 * enum v4l2_subdev_format_whence - Media bus format type
36 * @V4L2_SUBDEV_FORMAT_TRY: try format, for negotiation only
37 * @V4L2_SUBDEV_FORMAT_ACTIVE: active format, applied to the device
39 enum v4l2_subdev_format_whence {
40 V4L2_SUBDEV_FORMAT_TRY = 0,
41 V4L2_SUBDEV_FORMAT_ACTIVE = 1,
45 * struct v4l2_subdev_format - Pad-level media bus format
46 * @which: format type (from enum v4l2_subdev_format_whence)
47 * @pad: pad number, as reported by the media API
48 * @format: media bus format (format code and frame size)
50 struct v4l2_subdev_format {
53 struct v4l2_mbus_framefmt format;
58 * struct v4l2_subdev_crop - Pad-level crop settings
59 * @which: format type (from enum v4l2_subdev_format_whence)
60 * @pad: pad number, as reported by the media API
61 * @rect: pad crop rectangle boundaries
63 struct v4l2_subdev_crop {
66 struct v4l2_rect rect;
71 * struct v4l2_subdev_mbus_code_enum - Media bus format enumeration
72 * @pad: pad number, as reported by the media API
73 * @index: format index during enumeration
74 * @code: format code (from enum v4l2_mbus_pixelcode)
76 struct v4l2_subdev_mbus_code_enum {
84 * struct v4l2_subdev_frame_size_enum - Media bus format enumeration
85 * @pad: pad number, as reported by the media API
86 * @index: format index during enumeration
87 * @code: format code (from enum v4l2_mbus_pixelcode)
89 struct v4l2_subdev_frame_size_enum {
101 * struct v4l2_subdev_frame_interval - Pad-level frame rate
102 * @pad: pad number, as reported by the media API
103 * @interval: frame interval in seconds
105 struct v4l2_subdev_frame_interval {
107 struct v4l2_fract interval;
112 * struct v4l2_subdev_frame_interval_enum - Frame interval enumeration
113 * @pad: pad number, as reported by the media API
114 * @index: frame interval index during enumeration
115 * @code: format code (from enum v4l2_mbus_pixelcode)
116 * @width: frame width in pixels
117 * @height: frame height in pixels
118 * @interval: frame interval in seconds
120 struct v4l2_subdev_frame_interval_enum {
126 struct v4l2_fract interval;
130 #define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format)
131 #define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format)
132 #define VIDIOC_SUBDEV_G_FRAME_INTERVAL \
133 _IOWR('V', 21, struct v4l2_subdev_frame_interval)
134 #define VIDIOC_SUBDEV_S_FRAME_INTERVAL \
135 _IOWR('V', 22, struct v4l2_subdev_frame_interval)
136 #define VIDIOC_SUBDEV_ENUM_MBUS_CODE \
137 _IOWR('V', 2, struct v4l2_subdev_mbus_code_enum)
138 #define VIDIOC_SUBDEV_ENUM_FRAME_SIZE \
139 _IOWR('V', 74, struct v4l2_subdev_frame_size_enum)
140 #define VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL \
141 _IOWR('V', 75, struct v4l2_subdev_frame_interval_enum)
142 #define VIDIOC_SUBDEV_G_CROP _IOWR('V', 59, struct v4l2_subdev_crop)
143 #define VIDIOC_SUBDEV_S_CROP _IOWR('V', 60, struct v4l2_subdev_crop)