1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#ifndef __LINUX_V4L2_SUBDEV_H
25#define __LINUX_V4L2_SUBDEV_H
26
27#include <linux/ioctl.h>
28#include <linux/types.h>
29#include <linux/v4l2-common.h>
30#include <linux/v4l2-mediabus.h>
31
32
33
34
35
36
37enum v4l2_subdev_format_whence {
38 V4L2_SUBDEV_FORMAT_TRY = 0,
39 V4L2_SUBDEV_FORMAT_ACTIVE = 1,
40};
41
42
43
44
45
46
47
48struct v4l2_subdev_format {
49 __u32 which;
50 __u32 pad;
51 struct v4l2_mbus_framefmt format;
52 __u32 reserved[8];
53};
54
55
56
57
58
59
60
61struct v4l2_subdev_crop {
62 __u32 which;
63 __u32 pad;
64 struct v4l2_rect rect;
65 __u32 reserved[8];
66};
67
68#define V4L2_SUBDEV_MBUS_CODE_CSC_COLORSPACE 0x00000001
69#define V4L2_SUBDEV_MBUS_CODE_CSC_XFER_FUNC 0x00000002
70#define V4L2_SUBDEV_MBUS_CODE_CSC_YCBCR_ENC 0x00000004
71#define V4L2_SUBDEV_MBUS_CODE_CSC_HSV_ENC V4L2_SUBDEV_MBUS_CODE_CSC_YCBCR_ENC
72#define V4L2_SUBDEV_MBUS_CODE_CSC_QUANTIZATION 0x00000008
73
74
75
76
77
78
79
80
81
82struct v4l2_subdev_mbus_code_enum {
83 __u32 pad;
84 __u32 index;
85 __u32 code;
86 __u32 which;
87 __u32 flags;
88 __u32 reserved[7];
89};
90
91
92
93
94
95
96
97
98struct v4l2_subdev_frame_size_enum {
99 __u32 index;
100 __u32 pad;
101 __u32 code;
102 __u32 min_width;
103 __u32 max_width;
104 __u32 min_height;
105 __u32 max_height;
106 __u32 which;
107 __u32 reserved[8];
108};
109
110
111
112
113
114
115struct v4l2_subdev_frame_interval {
116 __u32 pad;
117 struct v4l2_fract interval;
118 __u32 reserved[9];
119};
120
121
122
123
124
125
126
127
128
129
130
131struct v4l2_subdev_frame_interval_enum {
132 __u32 index;
133 __u32 pad;
134 __u32 code;
135 __u32 width;
136 __u32 height;
137 struct v4l2_fract interval;
138 __u32 which;
139 __u32 reserved[8];
140};
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157struct v4l2_subdev_selection {
158 __u32 which;
159 __u32 pad;
160 __u32 target;
161 __u32 flags;
162 struct v4l2_rect r;
163 __u32 reserved[8];
164};
165
166
167
168
169
170
171
172struct v4l2_subdev_capability {
173 __u32 version;
174 __u32 capabilities;
175 __u32 reserved[14];
176};
177
178
179#define V4L2_SUBDEV_CAP_RO_SUBDEV BIT(0)
180
181
182#define v4l2_subdev_edid v4l2_edid
183
184#define VIDIOC_SUBDEV_QUERYCAP _IOR('V', 0, struct v4l2_subdev_capability)
185#define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format)
186#define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format)
187#define VIDIOC_SUBDEV_G_FRAME_INTERVAL _IOWR('V', 21, struct v4l2_subdev_frame_interval)
188#define VIDIOC_SUBDEV_S_FRAME_INTERVAL _IOWR('V', 22, struct v4l2_subdev_frame_interval)
189#define VIDIOC_SUBDEV_ENUM_MBUS_CODE _IOWR('V', 2, struct v4l2_subdev_mbus_code_enum)
190#define VIDIOC_SUBDEV_ENUM_FRAME_SIZE _IOWR('V', 74, struct v4l2_subdev_frame_size_enum)
191#define VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL _IOWR('V', 75, struct v4l2_subdev_frame_interval_enum)
192#define VIDIOC_SUBDEV_G_CROP _IOWR('V', 59, struct v4l2_subdev_crop)
193#define VIDIOC_SUBDEV_S_CROP _IOWR('V', 60, struct v4l2_subdev_crop)
194#define VIDIOC_SUBDEV_G_SELECTION _IOWR('V', 61, struct v4l2_subdev_selection)
195#define VIDIOC_SUBDEV_S_SELECTION _IOWR('V', 62, struct v4l2_subdev_selection)
196
197#define VIDIOC_SUBDEV_G_STD _IOR('V', 23, v4l2_std_id)
198#define VIDIOC_SUBDEV_S_STD _IOW('V', 24, v4l2_std_id)
199#define VIDIOC_SUBDEV_ENUMSTD _IOWR('V', 25, struct v4l2_standard)
200#define VIDIOC_SUBDEV_G_EDID _IOWR('V', 40, struct v4l2_edid)
201#define VIDIOC_SUBDEV_S_EDID _IOWR('V', 41, struct v4l2_edid)
202#define VIDIOC_SUBDEV_QUERYSTD _IOR('V', 63, v4l2_std_id)
203#define VIDIOC_SUBDEV_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings)
204#define VIDIOC_SUBDEV_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings)
205#define VIDIOC_SUBDEV_ENUM_DV_TIMINGS _IOWR('V', 98, struct v4l2_enum_dv_timings)
206#define VIDIOC_SUBDEV_QUERY_DV_TIMINGS _IOR('V', 99, struct v4l2_dv_timings)
207#define VIDIOC_SUBDEV_DV_TIMINGS_CAP _IOWR('V', 100, struct v4l2_dv_timings_cap)
208
209#endif
210