blob: 779002b9166172d42553bc046cdbe36421f33787 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef __LINUX_V4L2_SUBDEV_H
20#define __LINUX_V4L2_SUBDEV_H
21#include <linux/ioctl.h>
22#include <linux/types.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#include <linux/v4l2-common.h>
24#include <linux/v4l2-mediabus.h>
25enum v4l2_subdev_format_whence {
Tao Baod7db5942015-01-28 10:07:51 -080026 V4L2_SUBDEV_FORMAT_TRY = 0,
Tao Baod7db5942015-01-28 10:07:51 -080027 V4L2_SUBDEV_FORMAT_ACTIVE = 1,
Ben Cheng655a7c02013-10-16 16:09:24 -070028};
29struct v4l2_subdev_format {
Tao Baod7db5942015-01-28 10:07:51 -080030 __u32 which;
Tao Baod7db5942015-01-28 10:07:51 -080031 __u32 pad;
32 struct v4l2_mbus_framefmt format;
33 __u32 reserved[8];
Ben Cheng655a7c02013-10-16 16:09:24 -070034};
Ben Cheng655a7c02013-10-16 16:09:24 -070035struct v4l2_subdev_crop {
Tao Baod7db5942015-01-28 10:07:51 -080036 __u32 which;
37 __u32 pad;
38 struct v4l2_rect rect;
Tao Baod7db5942015-01-28 10:07:51 -080039 __u32 reserved[8];
Ben Cheng655a7c02013-10-16 16:09:24 -070040};
Christopher Ferris32ff3f82020-12-14 13:10:04 -080041#define V4L2_SUBDEV_MBUS_CODE_CSC_COLORSPACE 0x00000001
42#define V4L2_SUBDEV_MBUS_CODE_CSC_XFER_FUNC 0x00000002
43#define V4L2_SUBDEV_MBUS_CODE_CSC_YCBCR_ENC 0x00000004
44#define V4L2_SUBDEV_MBUS_CODE_CSC_HSV_ENC V4L2_SUBDEV_MBUS_CODE_CSC_YCBCR_ENC
45#define V4L2_SUBDEV_MBUS_CODE_CSC_QUANTIZATION 0x00000008
Ben Cheng655a7c02013-10-16 16:09:24 -070046struct v4l2_subdev_mbus_code_enum {
Tao Baod7db5942015-01-28 10:07:51 -080047 __u32 pad;
Tao Baod7db5942015-01-28 10:07:51 -080048 __u32 index;
49 __u32 code;
Christopher Ferris05d08e92016-02-04 13:16:38 -080050 __u32 which;
Christopher Ferris32ff3f82020-12-14 13:10:04 -080051 __u32 flags;
52 __u32 reserved[7];
Christopher Ferris05d08e92016-02-04 13:16:38 -080053};
Ben Cheng655a7c02013-10-16 16:09:24 -070054struct v4l2_subdev_frame_size_enum {
Tao Baod7db5942015-01-28 10:07:51 -080055 __u32 index;
56 __u32 pad;
Christopher Ferris05d08e92016-02-04 13:16:38 -080057 __u32 code;
Tao Baod7db5942015-01-28 10:07:51 -080058 __u32 min_width;
59 __u32 max_width;
60 __u32 min_height;
61 __u32 max_height;
Tao Baod7db5942015-01-28 10:07:51 -080062 __u32 which;
Tao Baod7db5942015-01-28 10:07:51 -080063 __u32 reserved[8];
Ben Cheng655a7c02013-10-16 16:09:24 -070064};
Christopher Ferris05d08e92016-02-04 13:16:38 -080065struct v4l2_subdev_frame_interval {
66 __u32 pad;
67 struct v4l2_fract interval;
68 __u32 reserved[9];
Christopher Ferris05d08e92016-02-04 13:16:38 -080069};
70struct v4l2_subdev_frame_interval_enum {
71 __u32 index;
72 __u32 pad;
Christopher Ferris05d08e92016-02-04 13:16:38 -080073 __u32 code;
74 __u32 width;
75 __u32 height;
76 struct v4l2_fract interval;
Christopher Ferris05d08e92016-02-04 13:16:38 -080077 __u32 which;
78 __u32 reserved[8];
79};
80struct v4l2_subdev_selection {
Christopher Ferris05d08e92016-02-04 13:16:38 -080081 __u32 which;
82 __u32 pad;
83 __u32 target;
84 __u32 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -080085 struct v4l2_rect r;
86 __u32 reserved[8];
87};
Christopher Ferris8177cdf2020-08-03 11:53:55 -070088struct v4l2_subdev_capability {
89 __u32 version;
90 __u32 capabilities;
91 __u32 reserved[14];
92};
93#define V4L2_SUBDEV_CAP_RO_SUBDEV BIT(0)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070094#define v4l2_subdev_edid v4l2_edid
Christopher Ferris8177cdf2020-08-03 11:53:55 -070095#define VIDIOC_SUBDEV_QUERYCAP _IOR('V', 0, struct v4l2_subdev_capability)
Ben Cheng655a7c02013-10-16 16:09:24 -070096#define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format)
Ben Cheng655a7c02013-10-16 16:09:24 -070097#define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070098#define VIDIOC_SUBDEV_G_FRAME_INTERVAL _IOWR('V', 21, struct v4l2_subdev_frame_interval)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070099#define VIDIOC_SUBDEV_S_FRAME_INTERVAL _IOWR('V', 22, struct v4l2_subdev_frame_interval)
100#define VIDIOC_SUBDEV_ENUM_MBUS_CODE _IOWR('V', 2, struct v4l2_subdev_mbus_code_enum)
101#define VIDIOC_SUBDEV_ENUM_FRAME_SIZE _IOWR('V', 74, struct v4l2_subdev_frame_size_enum)
102#define VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL _IOWR('V', 75, struct v4l2_subdev_frame_interval_enum)
Ben Cheng655a7c02013-10-16 16:09:24 -0700103#define VIDIOC_SUBDEV_G_CROP _IOWR('V', 59, struct v4l2_subdev_crop)
104#define VIDIOC_SUBDEV_S_CROP _IOWR('V', 60, struct v4l2_subdev_crop)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700105#define VIDIOC_SUBDEV_G_SELECTION _IOWR('V', 61, struct v4l2_subdev_selection)
106#define VIDIOC_SUBDEV_S_SELECTION _IOWR('V', 62, struct v4l2_subdev_selection)
Christopher Ferris9ce28842018-10-25 12:11:39 -0700107#define VIDIOC_SUBDEV_G_STD _IOR('V', 23, v4l2_std_id)
108#define VIDIOC_SUBDEV_S_STD _IOW('V', 24, v4l2_std_id)
109#define VIDIOC_SUBDEV_ENUMSTD _IOWR('V', 25, struct v4l2_standard)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700110#define VIDIOC_SUBDEV_G_EDID _IOWR('V', 40, struct v4l2_edid)
111#define VIDIOC_SUBDEV_S_EDID _IOWR('V', 41, struct v4l2_edid)
Christopher Ferris9ce28842018-10-25 12:11:39 -0700112#define VIDIOC_SUBDEV_QUERYSTD _IOR('V', 63, v4l2_std_id)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700113#define VIDIOC_SUBDEV_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings)
114#define VIDIOC_SUBDEV_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700115#define VIDIOC_SUBDEV_ENUM_DV_TIMINGS _IOWR('V', 98, struct v4l2_enum_dv_timings)
116#define VIDIOC_SUBDEV_QUERY_DV_TIMINGS _IOR('V', 99, struct v4l2_dv_timings)
117#define VIDIOC_SUBDEV_DV_TIMINGS_CAP _IOWR('V', 100, struct v4l2_dv_timings_cap)
Ben Cheng655a7c02013-10-16 16:09:24 -0700118#endif