blob: b24d6168dc937e6eb25ac09db0cb78ba6eed324c [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_MEDIA_H
20#define __LINUX_MEDIA_H
Christopher Ferris106b3a82016-08-24 12:15:38 -070021#include <stdint.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070022#include <linux/ioctl.h>
Christopher Ferris106b3a82016-08-24 12:15:38 -070023#include <linux/types.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070024#include <linux/version.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070025struct media_device_info {
Christopher Ferris106b3a82016-08-24 12:15:38 -070026 char driver[16];
Tao Baod7db5942015-01-28 10:07:51 -080027 char model[32];
28 char serial[40];
29 char bus_info[32];
Christopher Ferris106b3a82016-08-24 12:15:38 -070030 __u32 media_version;
Tao Baod7db5942015-01-28 10:07:51 -080031 __u32 hw_revision;
32 __u32 driver_version;
33 __u32 reserved[31];
Christopher Ferris106b3a82016-08-24 12:15:38 -070034};
Ben Cheng655a7c02013-10-16 16:09:24 -070035#define MEDIA_ENT_ID_FLAG_NEXT (1 << 31)
Christopher Ferris106b3a82016-08-24 12:15:38 -070036#define MEDIA_ENT_F_UNKNOWN 0x00000000
37#define MEDIA_ENT_F_BASE 0x00000000
Christopher Ferris106b3a82016-08-24 12:15:38 -070038#define MEDIA_ENT_F_OLD_BASE 0x00010000
39#define MEDIA_ENT_F_OLD_SUBDEV_BASE 0x00020000
40#define MEDIA_ENT_F_DTV_DEMOD (MEDIA_ENT_F_BASE + 0x00001)
41#define MEDIA_ENT_F_TS_DEMUX (MEDIA_ENT_F_BASE + 0x00002)
Christopher Ferris106b3a82016-08-24 12:15:38 -070042#define MEDIA_ENT_F_DTV_CA (MEDIA_ENT_F_BASE + 0x00003)
43#define MEDIA_ENT_F_DTV_NET_DECAP (MEDIA_ENT_F_BASE + 0x00004)
44#define MEDIA_ENT_F_IO_DTV (MEDIA_ENT_F_BASE + 0x01001)
45#define MEDIA_ENT_F_IO_VBI (MEDIA_ENT_F_BASE + 0x01002)
Christopher Ferris106b3a82016-08-24 12:15:38 -070046#define MEDIA_ENT_F_IO_SWRADIO (MEDIA_ENT_F_BASE + 0x01003)
47#define MEDIA_ENT_F_IF_VID_DECODER (MEDIA_ENT_F_BASE + 0x02001)
48#define MEDIA_ENT_F_IF_AUD_DECODER (MEDIA_ENT_F_BASE + 0x02002)
49#define MEDIA_ENT_F_AUDIO_CAPTURE (MEDIA_ENT_F_BASE + 0x03001)
Christopher Ferris106b3a82016-08-24 12:15:38 -070050#define MEDIA_ENT_F_AUDIO_PLAYBACK (MEDIA_ENT_F_BASE + 0x03002)
51#define MEDIA_ENT_F_AUDIO_MIXER (MEDIA_ENT_F_BASE + 0x03003)
Christopher Ferris49f525c2016-12-12 14:55:36 -080052#define MEDIA_ENT_F_PROC_VIDEO_COMPOSER (MEDIA_ENT_F_BASE + 0x4001)
53#define MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER (MEDIA_ENT_F_BASE + 0x4002)
Christopher Ferris49f525c2016-12-12 14:55:36 -080054#define MEDIA_ENT_F_PROC_VIDEO_PIXEL_ENC_CONV (MEDIA_ENT_F_BASE + 0x4003)
55#define MEDIA_ENT_F_PROC_VIDEO_LUT (MEDIA_ENT_F_BASE + 0x4004)
56#define MEDIA_ENT_F_PROC_VIDEO_SCALER (MEDIA_ENT_F_BASE + 0x4005)
57#define MEDIA_ENT_F_PROC_VIDEO_STATISTICS (MEDIA_ENT_F_BASE + 0x4006)
Christopher Ferris1308ad32017-11-14 17:32:13 -080058#define MEDIA_ENT_F_VID_MUX (MEDIA_ENT_F_BASE + 0x5001)
59#define MEDIA_ENT_F_VID_IF_BRIDGE (MEDIA_ENT_F_BASE + 0x5002)
Christopher Ferris106b3a82016-08-24 12:15:38 -070060#define MEDIA_ENT_F_IO_V4L (MEDIA_ENT_F_OLD_BASE + 1)
61#define MEDIA_ENT_F_CAM_SENSOR (MEDIA_ENT_F_OLD_SUBDEV_BASE + 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -070062#define MEDIA_ENT_F_FLASH (MEDIA_ENT_F_OLD_SUBDEV_BASE + 2)
63#define MEDIA_ENT_F_LENS (MEDIA_ENT_F_OLD_SUBDEV_BASE + 3)
64#define MEDIA_ENT_F_ATV_DECODER (MEDIA_ENT_F_OLD_SUBDEV_BASE + 4)
65#define MEDIA_ENT_F_TUNER (MEDIA_ENT_F_OLD_SUBDEV_BASE + 5)
Christopher Ferris106b3a82016-08-24 12:15:38 -070066#define MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN MEDIA_ENT_F_OLD_SUBDEV_BASE
Ben Cheng655a7c02013-10-16 16:09:24 -070067#define MEDIA_ENT_TYPE_SHIFT 16
68#define MEDIA_ENT_TYPE_MASK 0x00ff0000
69#define MEDIA_ENT_SUBTYPE_MASK 0x0000ffff
Christopher Ferris106b3a82016-08-24 12:15:38 -070070#define MEDIA_ENT_T_DEVNODE_UNKNOWN (MEDIA_ENT_T_DEVNODE | MEDIA_ENT_SUBTYPE_MASK)
71#define MEDIA_ENT_T_DEVNODE MEDIA_ENT_F_OLD_BASE
72#define MEDIA_ENT_T_DEVNODE_V4L MEDIA_ENT_F_IO_V4L
Ben Cheng655a7c02013-10-16 16:09:24 -070073#define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_T_DEVNODE + 2)
74#define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_T_DEVNODE + 3)
Christopher Ferris106b3a82016-08-24 12:15:38 -070075#define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_T_DEVNODE + 4)
76#define MEDIA_ENT_T_UNKNOWN MEDIA_ENT_F_UNKNOWN
77#define MEDIA_ENT_T_V4L2_VIDEO MEDIA_ENT_F_IO_V4L
Christopher Ferris106b3a82016-08-24 12:15:38 -070078#define MEDIA_ENT_T_V4L2_SUBDEV MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN
79#define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR MEDIA_ENT_F_CAM_SENSOR
80#define MEDIA_ENT_T_V4L2_SUBDEV_FLASH MEDIA_ENT_F_FLASH
81#define MEDIA_ENT_T_V4L2_SUBDEV_LENS MEDIA_ENT_F_LENS
Christopher Ferris106b3a82016-08-24 12:15:38 -070082#define MEDIA_ENT_T_V4L2_SUBDEV_DECODER MEDIA_ENT_F_ATV_DECODER
83#define MEDIA_ENT_T_V4L2_SUBDEV_TUNER MEDIA_ENT_F_TUNER
Christopher Ferris1308ad32017-11-14 17:32:13 -080084#define MEDIA_API_VERSION KERNEL_VERSION(0, 1, 0)
Ben Cheng655a7c02013-10-16 16:09:24 -070085#define MEDIA_ENT_FL_DEFAULT (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -070086#define MEDIA_ENT_FL_CONNECTOR (1 << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070087struct media_entity_desc {
Tao Baod7db5942015-01-28 10:07:51 -080088 __u32 id;
89 char name[32];
90 __u32 type;
91 __u32 revision;
Tao Baod7db5942015-01-28 10:07:51 -080092 __u32 flags;
93 __u32 group_id;
94 __u16 pads;
95 __u16 links;
Tao Baod7db5942015-01-28 10:07:51 -080096 __u32 reserved[4];
97 union {
98 struct {
99 __u32 major;
Tao Baod7db5942015-01-28 10:07:51 -0800100 __u32 minor;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800101 } dev;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800102 struct {
103 __u32 card;
104 __u32 device;
105 __u32 subdevice;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800106 } alsa;
107 struct {
108 __u32 major;
109 __u32 minor;
Tao Baod7db5942015-01-28 10:07:51 -0800110 } v4l;
111 struct {
112 __u32 major;
Tao Baod7db5942015-01-28 10:07:51 -0800113 __u32 minor;
114 } fb;
Tao Baod7db5942015-01-28 10:07:51 -0800115 int dvb;
Tao Baod7db5942015-01-28 10:07:51 -0800116 __u8 raw[184];
117 };
Ben Cheng655a7c02013-10-16 16:09:24 -0700118};
119#define MEDIA_PAD_FL_SINK (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700120#define MEDIA_PAD_FL_SOURCE (1 << 1)
Christopher Ferris38062f92014-07-09 15:33:25 -0700121#define MEDIA_PAD_FL_MUST_CONNECT (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700122struct media_pad_desc {
Tao Baod7db5942015-01-28 10:07:51 -0800123 __u32 entity;
Tao Baod7db5942015-01-28 10:07:51 -0800124 __u16 index;
125 __u32 flags;
126 __u32 reserved[2];
Ben Cheng655a7c02013-10-16 16:09:24 -0700127};
Christopher Ferris38062f92014-07-09 15:33:25 -0700128#define MEDIA_LNK_FL_ENABLED (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700129#define MEDIA_LNK_FL_IMMUTABLE (1 << 1)
130#define MEDIA_LNK_FL_DYNAMIC (1 << 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700131#define MEDIA_LNK_FL_LINK_TYPE (0xf << 28)
132#define MEDIA_LNK_FL_DATA_LINK (0 << 28)
133#define MEDIA_LNK_FL_INTERFACE_LINK (1 << 28)
Ben Cheng655a7c02013-10-16 16:09:24 -0700134struct media_link_desc {
Tao Baod7db5942015-01-28 10:07:51 -0800135 struct media_pad_desc source;
136 struct media_pad_desc sink;
137 __u32 flags;
138 __u32 reserved[2];
Christopher Ferris38062f92014-07-09 15:33:25 -0700139};
Ben Cheng655a7c02013-10-16 16:09:24 -0700140struct media_links_enum {
Tao Baod7db5942015-01-28 10:07:51 -0800141 __u32 entity;
142 struct media_pad_desc __user * pads;
Tao Baod7db5942015-01-28 10:07:51 -0800143 struct media_link_desc __user * links;
144 __u32 reserved[4];
Ben Cheng655a7c02013-10-16 16:09:24 -0700145};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700146#define MEDIA_INTF_T_DVB_BASE 0x00000100
Christopher Ferris106b3a82016-08-24 12:15:38 -0700147#define MEDIA_INTF_T_V4L_BASE 0x00000200
148#define MEDIA_INTF_T_ALSA_BASE 0x00000300
149#define MEDIA_INTF_T_DVB_FE (MEDIA_INTF_T_DVB_BASE)
150#define MEDIA_INTF_T_DVB_DEMUX (MEDIA_INTF_T_DVB_BASE + 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700151#define MEDIA_INTF_T_DVB_DVR (MEDIA_INTF_T_DVB_BASE + 2)
152#define MEDIA_INTF_T_DVB_CA (MEDIA_INTF_T_DVB_BASE + 3)
153#define MEDIA_INTF_T_DVB_NET (MEDIA_INTF_T_DVB_BASE + 4)
154#define MEDIA_INTF_T_V4L_VIDEO (MEDIA_INTF_T_V4L_BASE)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700155#define MEDIA_INTF_T_V4L_VBI (MEDIA_INTF_T_V4L_BASE + 1)
156#define MEDIA_INTF_T_V4L_RADIO (MEDIA_INTF_T_V4L_BASE + 2)
157#define MEDIA_INTF_T_V4L_SUBDEV (MEDIA_INTF_T_V4L_BASE + 3)
158#define MEDIA_INTF_T_V4L_SWRADIO (MEDIA_INTF_T_V4L_BASE + 4)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800159#define MEDIA_INTF_T_V4L_TOUCH (MEDIA_INTF_T_V4L_BASE + 5)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700160#define MEDIA_INTF_T_ALSA_PCM_CAPTURE (MEDIA_INTF_T_ALSA_BASE)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800161#define MEDIA_INTF_T_ALSA_PCM_PLAYBACK (MEDIA_INTF_T_ALSA_BASE + 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700162#define MEDIA_INTF_T_ALSA_CONTROL (MEDIA_INTF_T_ALSA_BASE + 2)
163#define MEDIA_INTF_T_ALSA_COMPRESS (MEDIA_INTF_T_ALSA_BASE + 3)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700164#define MEDIA_INTF_T_ALSA_RAWMIDI (MEDIA_INTF_T_ALSA_BASE + 4)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800165#define MEDIA_INTF_T_ALSA_HWDEP (MEDIA_INTF_T_ALSA_BASE + 5)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700166#define MEDIA_INTF_T_ALSA_SEQUENCER (MEDIA_INTF_T_ALSA_BASE + 6)
167#define MEDIA_INTF_T_ALSA_TIMER (MEDIA_INTF_T_ALSA_BASE + 7)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700168struct media_v2_entity {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800169 __u32 id;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700170 char name[64];
171 __u32 function;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700172 __u32 reserved[6];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800173} __attribute__((packed));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700174struct media_v2_intf_devnode {
175 __u32 major;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700176 __u32 minor;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800177} __attribute__((packed));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700178struct media_v2_interface {
179 __u32 id;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700180 __u32 intf_type;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800181 __u32 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700182 __u32 reserved[9];
183 union {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700184 struct media_v2_intf_devnode devnode;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800185 __u32 raw[16];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700186 };
187} __attribute__((packed));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700188struct media_v2_pad {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800189 __u32 id;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700190 __u32 entity_id;
191 __u32 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700192 __u32 reserved[5];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800193} __attribute__((packed));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700194struct media_v2_link {
195 __u32 id;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700196 __u32 source_id;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800197 __u32 sink_id;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700198 __u32 flags;
199 __u32 reserved[6];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700200} __attribute__((packed));
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800201struct media_v2_topology {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700202 __u64 topology_version;
203 __u32 num_entities;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700204 __u32 reserved1;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800205 __u64 ptr_entities;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700206 __u32 num_interfaces;
207 __u32 reserved2;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700208 __u64 ptr_interfaces;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800209 __u32 num_pads;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700210 __u32 reserved3;
211 __u64 ptr_pads;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700212 __u32 num_links;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800213 __u32 reserved4;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700214 __u64 ptr_links;
215} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700216#define MEDIA_IOC_DEVICE_INFO _IOWR('|', 0x00, struct media_device_info)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800217#define MEDIA_IOC_ENUM_ENTITIES _IOWR('|', 0x01, struct media_entity_desc)
Ben Cheng655a7c02013-10-16 16:09:24 -0700218#define MEDIA_IOC_ENUM_LINKS _IOWR('|', 0x02, struct media_links_enum)
219#define MEDIA_IOC_SETUP_LINK _IOWR('|', 0x03, struct media_link_desc)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700220#define MEDIA_IOC_G_TOPOLOGY _IOWR('|', 0x04, struct media_v2_topology)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800221#endif