blob: cd2cb0d162862c97538d6831e19b00fb7306f0b3 [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>
Ben Cheng655a7c02013-10-16 16:09:24 -070023/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070024#include <linux/types.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070025#include <linux/version.h>
26#define MEDIA_API_VERSION KERNEL_VERSION(0, 1, 0)
27struct media_device_info {
Ben Cheng655a7c02013-10-16 16:09:24 -070028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070029 char driver[16];
Tao Baod7db5942015-01-28 10:07:51 -080030 char model[32];
31 char serial[40];
32 char bus_info[32];
Ben Cheng655a7c02013-10-16 16:09:24 -070033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070034 __u32 media_version;
Tao Baod7db5942015-01-28 10:07:51 -080035 __u32 hw_revision;
36 __u32 driver_version;
37 __u32 reserved[31];
Ben Cheng655a7c02013-10-16 16:09:24 -070038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070039};
Ben Cheng655a7c02013-10-16 16:09:24 -070040#define MEDIA_ENT_ID_FLAG_NEXT (1 << 31)
Christopher Ferris106b3a82016-08-24 12:15:38 -070041#define MEDIA_ENT_F_UNKNOWN 0x00000000
42#define MEDIA_ENT_F_BASE 0x00000000
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44#define MEDIA_ENT_F_OLD_BASE 0x00010000
45#define MEDIA_ENT_F_OLD_SUBDEV_BASE 0x00020000
46#define MEDIA_ENT_F_DTV_DEMOD (MEDIA_ENT_F_BASE + 0x00001)
47#define MEDIA_ENT_F_TS_DEMUX (MEDIA_ENT_F_BASE + 0x00002)
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49#define MEDIA_ENT_F_DTV_CA (MEDIA_ENT_F_BASE + 0x00003)
50#define MEDIA_ENT_F_DTV_NET_DECAP (MEDIA_ENT_F_BASE + 0x00004)
51#define MEDIA_ENT_F_IO_DTV (MEDIA_ENT_F_BASE + 0x01001)
52#define MEDIA_ENT_F_IO_VBI (MEDIA_ENT_F_BASE + 0x01002)
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54#define MEDIA_ENT_F_IO_SWRADIO (MEDIA_ENT_F_BASE + 0x01003)
55#define MEDIA_ENT_F_IF_VID_DECODER (MEDIA_ENT_F_BASE + 0x02001)
56#define MEDIA_ENT_F_IF_AUD_DECODER (MEDIA_ENT_F_BASE + 0x02002)
57#define MEDIA_ENT_F_AUDIO_CAPTURE (MEDIA_ENT_F_BASE + 0x03001)
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59#define MEDIA_ENT_F_AUDIO_PLAYBACK (MEDIA_ENT_F_BASE + 0x03002)
60#define MEDIA_ENT_F_AUDIO_MIXER (MEDIA_ENT_F_BASE + 0x03003)
61#define MEDIA_ENT_F_IO_V4L (MEDIA_ENT_F_OLD_BASE + 1)
62#define MEDIA_ENT_F_CAM_SENSOR (MEDIA_ENT_F_OLD_SUBDEV_BASE + 1)
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64#define MEDIA_ENT_F_FLASH (MEDIA_ENT_F_OLD_SUBDEV_BASE + 2)
65#define MEDIA_ENT_F_LENS (MEDIA_ENT_F_OLD_SUBDEV_BASE + 3)
66#define MEDIA_ENT_F_ATV_DECODER (MEDIA_ENT_F_OLD_SUBDEV_BASE + 4)
67#define MEDIA_ENT_F_TUNER (MEDIA_ENT_F_OLD_SUBDEV_BASE + 5)
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69#define MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN MEDIA_ENT_F_OLD_SUBDEV_BASE
Ben Cheng655a7c02013-10-16 16:09:24 -070070#define MEDIA_ENT_TYPE_SHIFT 16
71#define MEDIA_ENT_TYPE_MASK 0x00ff0000
72#define MEDIA_ENT_SUBTYPE_MASK 0x0000ffff
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070074#define MEDIA_ENT_T_DEVNODE_UNKNOWN (MEDIA_ENT_T_DEVNODE | MEDIA_ENT_SUBTYPE_MASK)
75#define MEDIA_ENT_T_DEVNODE MEDIA_ENT_F_OLD_BASE
76#define MEDIA_ENT_T_DEVNODE_V4L MEDIA_ENT_F_IO_V4L
Ben Cheng655a7c02013-10-16 16:09:24 -070077#define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_T_DEVNODE + 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -070078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_T_DEVNODE + 3)
Christopher Ferris106b3a82016-08-24 12:15:38 -070080#define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_T_DEVNODE + 4)
81#define MEDIA_ENT_T_UNKNOWN MEDIA_ENT_F_UNKNOWN
82#define MEDIA_ENT_T_V4L2_VIDEO MEDIA_ENT_F_IO_V4L
Ben Cheng655a7c02013-10-16 16:09:24 -070083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070084#define MEDIA_ENT_T_V4L2_SUBDEV MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN
85#define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR MEDIA_ENT_F_CAM_SENSOR
86#define MEDIA_ENT_T_V4L2_SUBDEV_FLASH MEDIA_ENT_F_FLASH
87#define MEDIA_ENT_T_V4L2_SUBDEV_LENS MEDIA_ENT_F_LENS
Christopher Ferris05d08e92016-02-04 13:16:38 -080088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070089#define MEDIA_ENT_T_V4L2_SUBDEV_DECODER MEDIA_ENT_F_ATV_DECODER
90#define MEDIA_ENT_T_V4L2_SUBDEV_TUNER MEDIA_ENT_F_TUNER
Ben Cheng655a7c02013-10-16 16:09:24 -070091#define MEDIA_ENT_FL_DEFAULT (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -070092#define MEDIA_ENT_FL_CONNECTOR (1 << 1)
93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070094struct media_entity_desc {
Tao Baod7db5942015-01-28 10:07:51 -080095 __u32 id;
96 char name[32];
97 __u32 type;
Christopher Ferris106b3a82016-08-24 12:15:38 -070098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080099 __u32 revision;
Tao Baod7db5942015-01-28 10:07:51 -0800100 __u32 flags;
101 __u32 group_id;
102 __u16 pads;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800104 __u16 links;
Tao Baod7db5942015-01-28 10:07:51 -0800105 __u32 reserved[4];
106 union {
107 struct {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800109 __u32 major;
Tao Baod7db5942015-01-28 10:07:51 -0800110 __u32 minor;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800111 } dev;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800112 struct {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800114 __u32 card;
115 __u32 device;
116 __u32 subdevice;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800117 } alsa;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800119 struct {
120 __u32 major;
121 __u32 minor;
Tao Baod7db5942015-01-28 10:07:51 -0800122 } v4l;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800124 struct {
125 __u32 major;
Tao Baod7db5942015-01-28 10:07:51 -0800126 __u32 minor;
127 } fb;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800129 int dvb;
Tao Baod7db5942015-01-28 10:07:51 -0800130 __u8 raw[184];
131 };
Ben Cheng655a7c02013-10-16 16:09:24 -0700132};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700134#define MEDIA_PAD_FL_SINK (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700135#define MEDIA_PAD_FL_SOURCE (1 << 1)
Christopher Ferris38062f92014-07-09 15:33:25 -0700136#define MEDIA_PAD_FL_MUST_CONNECT (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700137struct media_pad_desc {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800139 __u32 entity;
Tao Baod7db5942015-01-28 10:07:51 -0800140 __u16 index;
141 __u32 flags;
142 __u32 reserved[2];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700144};
Christopher Ferris38062f92014-07-09 15:33:25 -0700145#define MEDIA_LNK_FL_ENABLED (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700146#define MEDIA_LNK_FL_IMMUTABLE (1 << 1)
147#define MEDIA_LNK_FL_DYNAMIC (1 << 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149#define MEDIA_LNK_FL_LINK_TYPE (0xf << 28)
150#define MEDIA_LNK_FL_DATA_LINK (0 << 28)
151#define MEDIA_LNK_FL_INTERFACE_LINK (1 << 28)
Ben Cheng655a7c02013-10-16 16:09:24 -0700152struct media_link_desc {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800154 struct media_pad_desc source;
155 struct media_pad_desc sink;
156 __u32 flags;
157 __u32 reserved[2];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700159};
Ben Cheng655a7c02013-10-16 16:09:24 -0700160struct media_links_enum {
Tao Baod7db5942015-01-28 10:07:51 -0800161 __u32 entity;
162 struct media_pad_desc __user * pads;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800164 struct media_link_desc __user * links;
165 __u32 reserved[4];
Ben Cheng655a7c02013-10-16 16:09:24 -0700166};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700167#define MEDIA_INTF_T_DVB_BASE 0x00000100
168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169#define MEDIA_INTF_T_V4L_BASE 0x00000200
170#define MEDIA_INTF_T_ALSA_BASE 0x00000300
171#define MEDIA_INTF_T_DVB_FE (MEDIA_INTF_T_DVB_BASE)
172#define MEDIA_INTF_T_DVB_DEMUX (MEDIA_INTF_T_DVB_BASE + 1)
173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174#define MEDIA_INTF_T_DVB_DVR (MEDIA_INTF_T_DVB_BASE + 2)
175#define MEDIA_INTF_T_DVB_CA (MEDIA_INTF_T_DVB_BASE + 3)
176#define MEDIA_INTF_T_DVB_NET (MEDIA_INTF_T_DVB_BASE + 4)
177#define MEDIA_INTF_T_V4L_VIDEO (MEDIA_INTF_T_V4L_BASE)
178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179#define MEDIA_INTF_T_V4L_VBI (MEDIA_INTF_T_V4L_BASE + 1)
180#define MEDIA_INTF_T_V4L_RADIO (MEDIA_INTF_T_V4L_BASE + 2)
181#define MEDIA_INTF_T_V4L_SUBDEV (MEDIA_INTF_T_V4L_BASE + 3)
182#define MEDIA_INTF_T_V4L_SWRADIO (MEDIA_INTF_T_V4L_BASE + 4)
183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184#define MEDIA_INTF_T_ALSA_PCM_CAPTURE (MEDIA_INTF_T_ALSA_BASE)
185#define MEDIA_INTF_T_ALSA_PCM_PLAYBACK (MEDIA_INTF_T_ALSA_BASE + 1)
186#define MEDIA_INTF_T_ALSA_CONTROL (MEDIA_INTF_T_ALSA_BASE + 2)
187#define MEDIA_INTF_T_ALSA_COMPRESS (MEDIA_INTF_T_ALSA_BASE + 3)
188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189#define MEDIA_INTF_T_ALSA_RAWMIDI (MEDIA_INTF_T_ALSA_BASE + 4)
190#define MEDIA_INTF_T_ALSA_HWDEP (MEDIA_INTF_T_ALSA_BASE + 5)
191#define MEDIA_INTF_T_ALSA_SEQUENCER (MEDIA_INTF_T_ALSA_BASE + 6)
192#define MEDIA_INTF_T_ALSA_TIMER (MEDIA_INTF_T_ALSA_BASE + 7)
193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194struct media_v2_entity {
195 __u32 id;
196 char name[64];
197 __u32 function;
198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199 __u32 reserved[6];
200} __attribute__((packed));
201struct media_v2_intf_devnode {
202 __u32 major;
203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204 __u32 minor;
205} __attribute__((packed));
206struct media_v2_interface {
207 __u32 id;
208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209 __u32 intf_type;
210 __u32 flags;
211 __u32 reserved[9];
212 union {
213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
214 struct media_v2_intf_devnode devnode;
215 __u32 raw[16];
216 };
217} __attribute__((packed));
218/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219struct media_v2_pad {
220 __u32 id;
221 __u32 entity_id;
222 __u32 flags;
223/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224 __u32 reserved[5];
225} __attribute__((packed));
226struct media_v2_link {
227 __u32 id;
228/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
229 __u32 source_id;
230 __u32 sink_id;
231 __u32 flags;
232 __u32 reserved[6];
233/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
234} __attribute__((packed));
235struct media_v2_topology {
236 __u64 topology_version;
237 __u32 num_entities;
238/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
239 __u32 reserved1;
240 __u64 ptr_entities;
241 __u32 num_interfaces;
242 __u32 reserved2;
243/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
244 __u64 ptr_interfaces;
245 __u32 num_pads;
246 __u32 reserved3;
247 __u64 ptr_pads;
248/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
249 __u32 num_links;
250 __u32 reserved4;
251 __u64 ptr_links;
252} __attribute__((packed));
253/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700254#define MEDIA_IOC_DEVICE_INFO _IOWR('|', 0x00, struct media_device_info)
Christopher Ferris38062f92014-07-09 15:33:25 -0700255#define MEDIA_IOC_ENUM_ENTITIES _IOWR('|', 0x01, struct media_entity_desc)
Ben Cheng655a7c02013-10-16 16:09:24 -0700256#define MEDIA_IOC_ENUM_LINKS _IOWR('|', 0x02, struct media_links_enum)
257#define MEDIA_IOC_SETUP_LINK _IOWR('|', 0x03, struct media_link_desc)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700258/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
259#define MEDIA_IOC_G_TOPOLOGY _IOWR('|', 0x04, struct media_v2_topology)
Ben Cheng655a7c02013-10-16 16:09:24 -0700260#endif