]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - include/linux/v4l2-subdev.h
[media] v4l: v4l2_subdev userspace frame interval API
[mirror_ubuntu-artful-kernel.git] / include / linux / v4l2-subdev.h
1 /*
2 * V4L2 subdev userspace API
3 *
4 * Copyright (C) 2010 Nokia Corporation
5 *
6 * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
7 * Sakari Ailus <sakari.ailus@iki.fi>
8 *
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.
12 *
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.
17 *
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
21 */
22
23 #ifndef __LINUX_V4L2_SUBDEV_H
24 #define __LINUX_V4L2_SUBDEV_H
25
26 #include <linux/ioctl.h>
27 #include <linux/types.h>
28 #include <linux/v4l2-mediabus.h>
29
30 /**
31 * enum v4l2_subdev_format_whence - Media bus format type
32 * @V4L2_SUBDEV_FORMAT_TRY: try format, for negotiation only
33 * @V4L2_SUBDEV_FORMAT_ACTIVE: active format, applied to the device
34 */
35 enum v4l2_subdev_format_whence {
36 V4L2_SUBDEV_FORMAT_TRY = 0,
37 V4L2_SUBDEV_FORMAT_ACTIVE = 1,
38 };
39
40 /**
41 * struct v4l2_subdev_format - Pad-level media bus format
42 * @which: format type (from enum v4l2_subdev_format_whence)
43 * @pad: pad number, as reported by the media API
44 * @format: media bus format (format code and frame size)
45 */
46 struct v4l2_subdev_format {
47 __u32 which;
48 __u32 pad;
49 struct v4l2_mbus_framefmt format;
50 __u32 reserved[8];
51 };
52
53 /**
54 * struct v4l2_subdev_mbus_code_enum - Media bus format enumeration
55 * @pad: pad number, as reported by the media API
56 * @index: format index during enumeration
57 * @code: format code (from enum v4l2_mbus_pixelcode)
58 */
59 struct v4l2_subdev_mbus_code_enum {
60 __u32 pad;
61 __u32 index;
62 __u32 code;
63 __u32 reserved[9];
64 };
65
66 /**
67 * struct v4l2_subdev_frame_size_enum - Media bus format enumeration
68 * @pad: pad number, as reported by the media API
69 * @index: format index during enumeration
70 * @code: format code (from enum v4l2_mbus_pixelcode)
71 */
72 struct v4l2_subdev_frame_size_enum {
73 __u32 index;
74 __u32 pad;
75 __u32 code;
76 __u32 min_width;
77 __u32 max_width;
78 __u32 min_height;
79 __u32 max_height;
80 __u32 reserved[9];
81 };
82
83 /**
84 * struct v4l2_subdev_frame_interval - Pad-level frame rate
85 * @pad: pad number, as reported by the media API
86 * @interval: frame interval in seconds
87 */
88 struct v4l2_subdev_frame_interval {
89 __u32 pad;
90 struct v4l2_fract interval;
91 __u32 reserved[9];
92 };
93
94 /**
95 * struct v4l2_subdev_frame_interval_enum - Frame interval enumeration
96 * @pad: pad number, as reported by the media API
97 * @index: frame interval index during enumeration
98 * @code: format code (from enum v4l2_mbus_pixelcode)
99 * @width: frame width in pixels
100 * @height: frame height in pixels
101 * @interval: frame interval in seconds
102 */
103 struct v4l2_subdev_frame_interval_enum {
104 __u32 index;
105 __u32 pad;
106 __u32 code;
107 __u32 width;
108 __u32 height;
109 struct v4l2_fract interval;
110 __u32 reserved[9];
111 };
112
113 #define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format)
114 #define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format)
115 #define VIDIOC_SUBDEV_G_FRAME_INTERVAL \
116 _IOWR('V', 21, struct v4l2_subdev_frame_interval)
117 #define VIDIOC_SUBDEV_S_FRAME_INTERVAL \
118 _IOWR('V', 22, struct v4l2_subdev_frame_interval)
119 #define VIDIOC_SUBDEV_ENUM_MBUS_CODE \
120 _IOWR('V', 2, struct v4l2_subdev_mbus_code_enum)
121 #define VIDIOC_SUBDEV_ENUM_FRAME_SIZE \
122 _IOWR('V', 74, struct v4l2_subdev_frame_size_enum)
123 #define VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL \
124 _IOWR('V', 75, struct v4l2_subdev_frame_interval_enum)
125
126 #endif