blob: 63f66b419504b84860d11aa7809492d76d8959d2 [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 _UAPI__SOUND_ASOUND_H
20#define _UAPI__SOUND_ASOUND_H
Christopher Ferris106b3a82016-08-24 12:15:38 -070021#ifdef __linux__
Ben Cheng655a7c02013-10-16 16:09:24 -070022#include <linux/types.h>
Christopher Ferris106b3a82016-08-24 12:15:38 -070023#else
24#include <sys/ioctl.h>
25#endif
Christopher Ferris05d08e92016-02-04 13:16:38 -080026#include <stdlib.h>
Christopher Ferris05d08e92016-02-04 13:16:38 -080027#define SNDRV_PROTOCOL_VERSION(major,minor,subminor) (((major) << 16) | ((minor) << 8) | (subminor))
Tao Baod7db5942015-01-28 10:07:51 -080028#define SNDRV_PROTOCOL_MAJOR(version) (((version) >> 16) & 0xffff)
29#define SNDRV_PROTOCOL_MINOR(version) (((version) >> 8) & 0xff)
30#define SNDRV_PROTOCOL_MICRO(version) ((version) & 0xff)
Christopher Ferris05d08e92016-02-04 13:16:38 -080031#define SNDRV_PROTOCOL_INCOMPATIBLE(kversion,uversion) (SNDRV_PROTOCOL_MAJOR(kversion) != SNDRV_PROTOCOL_MAJOR(uversion) || (SNDRV_PROTOCOL_MAJOR(kversion) == SNDRV_PROTOCOL_MAJOR(uversion) && SNDRV_PROTOCOL_MINOR(kversion) != SNDRV_PROTOCOL_MINOR(uversion)))
Ben Cheng655a7c02013-10-16 16:09:24 -070032struct snd_aes_iec958 {
Tao Baod7db5942015-01-28 10:07:51 -080033 unsigned char status[24];
34 unsigned char subcode[147];
Christopher Ferris05d08e92016-02-04 13:16:38 -080035 unsigned char pad;
Tao Baod7db5942015-01-28 10:07:51 -080036 unsigned char dig_subframe[4];
Ben Cheng655a7c02013-10-16 16:09:24 -070037};
38struct snd_cea_861_aud_if {
Christopher Ferris05d08e92016-02-04 13:16:38 -080039 unsigned char db1_ct_cc;
Tao Baod7db5942015-01-28 10:07:51 -080040 unsigned char db2_sf_ss;
41 unsigned char db3;
42 unsigned char db4_ca;
Christopher Ferris05d08e92016-02-04 13:16:38 -080043 unsigned char db5_dminh_lsv;
Ben Cheng655a7c02013-10-16 16:09:24 -070044};
45#define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
46enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -080047 SNDRV_HWDEP_IFACE_OPL2 = 0,
Tao Baod7db5942015-01-28 10:07:51 -080048 SNDRV_HWDEP_IFACE_OPL3,
49 SNDRV_HWDEP_IFACE_OPL4,
50 SNDRV_HWDEP_IFACE_SB16CSP,
Christopher Ferris05d08e92016-02-04 13:16:38 -080051 SNDRV_HWDEP_IFACE_EMU10K1,
Tao Baod7db5942015-01-28 10:07:51 -080052 SNDRV_HWDEP_IFACE_YSS225,
53 SNDRV_HWDEP_IFACE_ICS2115,
54 SNDRV_HWDEP_IFACE_SSCAPE,
Christopher Ferris05d08e92016-02-04 13:16:38 -080055 SNDRV_HWDEP_IFACE_VX,
Tao Baod7db5942015-01-28 10:07:51 -080056 SNDRV_HWDEP_IFACE_MIXART,
57 SNDRV_HWDEP_IFACE_USX2Y,
58 SNDRV_HWDEP_IFACE_EMUX_WAVETABLE,
Christopher Ferris05d08e92016-02-04 13:16:38 -080059 SNDRV_HWDEP_IFACE_BLUETOOTH,
Tao Baod7db5942015-01-28 10:07:51 -080060 SNDRV_HWDEP_IFACE_USX2Y_PCM,
61 SNDRV_HWDEP_IFACE_PCXHR,
62 SNDRV_HWDEP_IFACE_SB_RC,
Christopher Ferris05d08e92016-02-04 13:16:38 -080063 SNDRV_HWDEP_IFACE_HDA,
Tao Baod7db5942015-01-28 10:07:51 -080064 SNDRV_HWDEP_IFACE_USB_STREAM,
65 SNDRV_HWDEP_IFACE_FW_DICE,
66 SNDRV_HWDEP_IFACE_FW_FIREWORKS,
Christopher Ferris05d08e92016-02-04 13:16:38 -080067 SNDRV_HWDEP_IFACE_FW_BEBOB,
68 SNDRV_HWDEP_IFACE_FW_OXFW,
69 SNDRV_HWDEP_IFACE_FW_DIGI00X,
70 SNDRV_HWDEP_IFACE_FW_TASCAM,
Christopher Ferris6a9755d2017-01-13 14:09:31 -080071 SNDRV_HWDEP_IFACE_LINE6,
Christopher Ferris525ce912017-07-26 13:12:53 -070072 SNDRV_HWDEP_IFACE_FW_MOTU,
73 SNDRV_HWDEP_IFACE_FW_FIREFACE,
74 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_FW_FIREFACE
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070075};
Christopher Ferris38062f92014-07-09 15:33:25 -070076struct snd_hwdep_info {
Christopher Ferris6a9755d2017-01-13 14:09:31 -080077 unsigned int device;
Tao Baod7db5942015-01-28 10:07:51 -080078 int card;
79 unsigned char id[64];
80 unsigned char name[80];
Christopher Ferris6a9755d2017-01-13 14:09:31 -080081 int iface;
Tao Baod7db5942015-01-28 10:07:51 -080082 unsigned char reserved[64];
Ben Cheng655a7c02013-10-16 16:09:24 -070083};
Christopher Ferris38062f92014-07-09 15:33:25 -070084struct snd_hwdep_dsp_status {
Christopher Ferris6a9755d2017-01-13 14:09:31 -080085 unsigned int version;
Tao Baod7db5942015-01-28 10:07:51 -080086 unsigned char id[32];
87 unsigned int num_dsps;
88 unsigned int dsp_loaded;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080089 unsigned int chip_ready;
Tao Baod7db5942015-01-28 10:07:51 -080090 unsigned char reserved[16];
Ben Cheng655a7c02013-10-16 16:09:24 -070091};
Christopher Ferris38062f92014-07-09 15:33:25 -070092struct snd_hwdep_dsp_image {
Christopher Ferris6a9755d2017-01-13 14:09:31 -080093 unsigned int index;
Tao Baod7db5942015-01-28 10:07:51 -080094 unsigned char name[64];
95 unsigned char __user * image;
96 size_t length;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080097 unsigned long driver_data;
Ben Cheng655a7c02013-10-16 16:09:24 -070098};
Tao Baod7db5942015-01-28 10:07:51 -080099#define SNDRV_HWDEP_IOCTL_PVERSION _IOR('H', 0x00, int)
100#define SNDRV_HWDEP_IOCTL_INFO _IOR('H', 0x01, struct snd_hwdep_info)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800101#define SNDRV_HWDEP_IOCTL_DSP_STATUS _IOR('H', 0x02, struct snd_hwdep_dsp_status)
Ben Cheng655a7c02013-10-16 16:09:24 -0700102#define SNDRV_HWDEP_IOCTL_DSP_LOAD _IOW('H', 0x03, struct snd_hwdep_dsp_image)
Christopher Ferris1308ad32017-11-14 17:32:13 -0800103#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 14)
Christopher Ferris38062f92014-07-09 15:33:25 -0700104typedef unsigned long snd_pcm_uframes_t;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800105typedef signed long snd_pcm_sframes_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700106enum {
Tao Baod7db5942015-01-28 10:07:51 -0800107 SNDRV_PCM_CLASS_GENERIC = 0,
108 SNDRV_PCM_CLASS_MULTI,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800109 SNDRV_PCM_CLASS_MODEM,
Tao Baod7db5942015-01-28 10:07:51 -0800110 SNDRV_PCM_CLASS_DIGITIZER,
111 SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER,
Christopher Ferris38062f92014-07-09 15:33:25 -0700112};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800113enum {
Tao Baod7db5942015-01-28 10:07:51 -0800114 SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0,
115 SNDRV_PCM_SUBCLASS_MULTI_MIX,
116 SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800117};
Ben Cheng655a7c02013-10-16 16:09:24 -0700118enum {
Tao Baod7db5942015-01-28 10:07:51 -0800119 SNDRV_PCM_STREAM_PLAYBACK = 0,
120 SNDRV_PCM_STREAM_CAPTURE,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800121 SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700122};
123typedef int __bitwise snd_pcm_access_t;
Christopher Ferris38062f92014-07-09 15:33:25 -0700124#define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((__force snd_pcm_access_t) 0)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800125#define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((__force snd_pcm_access_t) 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700126#define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((__force snd_pcm_access_t) 2)
127#define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((__force snd_pcm_access_t) 3)
Christopher Ferris38062f92014-07-09 15:33:25 -0700128#define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((__force snd_pcm_access_t) 4)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800129#define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED
Ben Cheng655a7c02013-10-16 16:09:24 -0700130typedef int __bitwise snd_pcm_format_t;
131#define SNDRV_PCM_FORMAT_S8 ((__force snd_pcm_format_t) 0)
Christopher Ferris38062f92014-07-09 15:33:25 -0700132#define SNDRV_PCM_FORMAT_U8 ((__force snd_pcm_format_t) 1)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800133#define SNDRV_PCM_FORMAT_S16_LE ((__force snd_pcm_format_t) 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700134#define SNDRV_PCM_FORMAT_S16_BE ((__force snd_pcm_format_t) 3)
135#define SNDRV_PCM_FORMAT_U16_LE ((__force snd_pcm_format_t) 4)
Christopher Ferris38062f92014-07-09 15:33:25 -0700136#define SNDRV_PCM_FORMAT_U16_BE ((__force snd_pcm_format_t) 5)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800137#define SNDRV_PCM_FORMAT_S24_LE ((__force snd_pcm_format_t) 6)
Ben Cheng655a7c02013-10-16 16:09:24 -0700138#define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7)
139#define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8)
Christopher Ferris38062f92014-07-09 15:33:25 -0700140#define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800141#define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10)
Ben Cheng655a7c02013-10-16 16:09:24 -0700142#define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11)
143#define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12)
Christopher Ferris38062f92014-07-09 15:33:25 -0700144#define SNDRV_PCM_FORMAT_U32_BE ((__force snd_pcm_format_t) 13)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800145#define SNDRV_PCM_FORMAT_FLOAT_LE ((__force snd_pcm_format_t) 14)
Ben Cheng655a7c02013-10-16 16:09:24 -0700146#define SNDRV_PCM_FORMAT_FLOAT_BE ((__force snd_pcm_format_t) 15)
147#define SNDRV_PCM_FORMAT_FLOAT64_LE ((__force snd_pcm_format_t) 16)
Christopher Ferris38062f92014-07-09 15:33:25 -0700148#define SNDRV_PCM_FORMAT_FLOAT64_BE ((__force snd_pcm_format_t) 17)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800149#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((__force snd_pcm_format_t) 18)
Ben Cheng655a7c02013-10-16 16:09:24 -0700150#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((__force snd_pcm_format_t) 19)
151#define SNDRV_PCM_FORMAT_MU_LAW ((__force snd_pcm_format_t) 20)
Christopher Ferris38062f92014-07-09 15:33:25 -0700152#define SNDRV_PCM_FORMAT_A_LAW ((__force snd_pcm_format_t) 21)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800153#define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22)
Ben Cheng655a7c02013-10-16 16:09:24 -0700154#define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23)
155#define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24)
Christopher Ferris38062f92014-07-09 15:33:25 -0700156#define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800157#define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32)
Ben Cheng655a7c02013-10-16 16:09:24 -0700158#define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33)
159#define SNDRV_PCM_FORMAT_U24_3LE ((__force snd_pcm_format_t) 34)
Christopher Ferris38062f92014-07-09 15:33:25 -0700160#define SNDRV_PCM_FORMAT_U24_3BE ((__force snd_pcm_format_t) 35)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800161#define SNDRV_PCM_FORMAT_S20_3LE ((__force snd_pcm_format_t) 36)
Ben Cheng655a7c02013-10-16 16:09:24 -0700162#define SNDRV_PCM_FORMAT_S20_3BE ((__force snd_pcm_format_t) 37)
163#define SNDRV_PCM_FORMAT_U20_3LE ((__force snd_pcm_format_t) 38)
Christopher Ferris38062f92014-07-09 15:33:25 -0700164#define SNDRV_PCM_FORMAT_U20_3BE ((__force snd_pcm_format_t) 39)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800165#define SNDRV_PCM_FORMAT_S18_3LE ((__force snd_pcm_format_t) 40)
Ben Cheng655a7c02013-10-16 16:09:24 -0700166#define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41)
167#define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42)
Christopher Ferris38062f92014-07-09 15:33:25 -0700168#define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800169#define SNDRV_PCM_FORMAT_G723_24 ((__force snd_pcm_format_t) 44)
Ben Cheng655a7c02013-10-16 16:09:24 -0700170#define SNDRV_PCM_FORMAT_G723_24_1B ((__force snd_pcm_format_t) 45)
171#define SNDRV_PCM_FORMAT_G723_40 ((__force snd_pcm_format_t) 46)
Christopher Ferris38062f92014-07-09 15:33:25 -0700172#define SNDRV_PCM_FORMAT_G723_40_1B ((__force snd_pcm_format_t) 47)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800173#define SNDRV_PCM_FORMAT_DSD_U8 ((__force snd_pcm_format_t) 48)
Ben Cheng655a7c02013-10-16 16:09:24 -0700174#define SNDRV_PCM_FORMAT_DSD_U16_LE ((__force snd_pcm_format_t) 49)
Christopher Ferris82d75042015-01-26 10:57:07 -0800175#define SNDRV_PCM_FORMAT_DSD_U32_LE ((__force snd_pcm_format_t) 50)
176#define SNDRV_PCM_FORMAT_DSD_U16_BE ((__force snd_pcm_format_t) 51)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800177#define SNDRV_PCM_FORMAT_DSD_U32_BE ((__force snd_pcm_format_t) 52)
Christopher Ferris82d75042015-01-26 10:57:07 -0800178#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U32_BE
Christopher Ferris38062f92014-07-09 15:33:25 -0700179#ifdef SNDRV_LITTLE_ENDIAN
Ben Cheng655a7c02013-10-16 16:09:24 -0700180#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800181#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE
Ben Cheng655a7c02013-10-16 16:09:24 -0700182#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE
Christopher Ferris38062f92014-07-09 15:33:25 -0700183#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE
Ben Cheng655a7c02013-10-16 16:09:24 -0700184#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800185#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE
Ben Cheng655a7c02013-10-16 16:09:24 -0700186#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE
Christopher Ferris38062f92014-07-09 15:33:25 -0700187#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE
Ben Cheng655a7c02013-10-16 16:09:24 -0700188#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800189#endif
Ben Cheng655a7c02013-10-16 16:09:24 -0700190#ifdef SNDRV_BIG_ENDIAN
Christopher Ferris38062f92014-07-09 15:33:25 -0700191#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE
Ben Cheng655a7c02013-10-16 16:09:24 -0700192#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800193#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE
Ben Cheng655a7c02013-10-16 16:09:24 -0700194#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE
Christopher Ferris38062f92014-07-09 15:33:25 -0700195#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE
Ben Cheng655a7c02013-10-16 16:09:24 -0700196#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800197#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE
Ben Cheng655a7c02013-10-16 16:09:24 -0700198#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE
Christopher Ferris38062f92014-07-09 15:33:25 -0700199#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE
Ben Cheng655a7c02013-10-16 16:09:24 -0700200#endif
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800201typedef int __bitwise snd_pcm_subformat_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700202#define SNDRV_PCM_SUBFORMAT_STD ((__force snd_pcm_subformat_t) 0)
Christopher Ferris38062f92014-07-09 15:33:25 -0700203#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD
Ben Cheng655a7c02013-10-16 16:09:24 -0700204#define SNDRV_PCM_INFO_MMAP 0x00000001
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800205#define SNDRV_PCM_INFO_MMAP_VALID 0x00000002
Ben Cheng655a7c02013-10-16 16:09:24 -0700206#define SNDRV_PCM_INFO_DOUBLE 0x00000004
Christopher Ferris38062f92014-07-09 15:33:25 -0700207#define SNDRV_PCM_INFO_BATCH 0x00000010
Christopher Ferris1308ad32017-11-14 17:32:13 -0800208#define SNDRV_PCM_INFO_SYNC_APPLPTR 0x00000020
Ben Cheng655a7c02013-10-16 16:09:24 -0700209#define SNDRV_PCM_INFO_INTERLEAVED 0x00000100
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800210#define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200
Ben Cheng655a7c02013-10-16 16:09:24 -0700211#define SNDRV_PCM_INFO_COMPLEX 0x00000400
Christopher Ferris38062f92014-07-09 15:33:25 -0700212#define SNDRV_PCM_INFO_BLOCK_TRANSFER 0x00010000
Ben Cheng655a7c02013-10-16 16:09:24 -0700213#define SNDRV_PCM_INFO_OVERRANGE 0x00020000
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800214#define SNDRV_PCM_INFO_RESUME 0x00040000
Ben Cheng655a7c02013-10-16 16:09:24 -0700215#define SNDRV_PCM_INFO_PAUSE 0x00080000
Christopher Ferris38062f92014-07-09 15:33:25 -0700216#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000
Ben Cheng655a7c02013-10-16 16:09:24 -0700217#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800218#define SNDRV_PCM_INFO_SYNC_START 0x00400000
Ben Cheng655a7c02013-10-16 16:09:24 -0700219#define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000
Christopher Ferris38062f92014-07-09 15:33:25 -0700220#define SNDRV_PCM_INFO_HAS_WALL_CLOCK 0x01000000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800221#define SNDRV_PCM_INFO_HAS_LINK_ATIME 0x01000000
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800222#define SNDRV_PCM_INFO_HAS_LINK_ABSOLUTE_ATIME 0x02000000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800223#define SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME 0x04000000
224#define SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME 0x08000000
225#define SNDRV_PCM_INFO_DRAIN_TRIGGER 0x40000000
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800226#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800227typedef int __bitwise snd_pcm_state_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700228#define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0)
Christopher Ferris38062f92014-07-09 15:33:25 -0700229#define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800230#define SNDRV_PCM_STATE_PREPARED ((__force snd_pcm_state_t) 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800231#define SNDRV_PCM_STATE_RUNNING ((__force snd_pcm_state_t) 3)
Ben Cheng655a7c02013-10-16 16:09:24 -0700232#define SNDRV_PCM_STATE_XRUN ((__force snd_pcm_state_t) 4)
Christopher Ferris38062f92014-07-09 15:33:25 -0700233#define SNDRV_PCM_STATE_DRAINING ((__force snd_pcm_state_t) 5)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800234#define SNDRV_PCM_STATE_PAUSED ((__force snd_pcm_state_t) 6)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800235#define SNDRV_PCM_STATE_SUSPENDED ((__force snd_pcm_state_t) 7)
Ben Cheng655a7c02013-10-16 16:09:24 -0700236#define SNDRV_PCM_STATE_DISCONNECTED ((__force snd_pcm_state_t) 8)
Christopher Ferris38062f92014-07-09 15:33:25 -0700237#define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800238enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800239 SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000,
Tao Baod7db5942015-01-28 10:07:51 -0800240 SNDRV_PCM_MMAP_OFFSET_STATUS = 0x80000000,
241 SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800242};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800243union snd_pcm_sync_id {
Tao Baod7db5942015-01-28 10:07:51 -0800244 unsigned char id[16];
245 unsigned short id16[8];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800246 unsigned int id32[4];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800247};
Ben Cheng655a7c02013-10-16 16:09:24 -0700248struct snd_pcm_info {
Tao Baod7db5942015-01-28 10:07:51 -0800249 unsigned int device;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800250 unsigned int subdevice;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800251 int stream;
Tao Baod7db5942015-01-28 10:07:51 -0800252 int card;
253 unsigned char id[64];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800254 unsigned char name[80];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800255 unsigned char subname[32];
Tao Baod7db5942015-01-28 10:07:51 -0800256 int dev_class;
257 int dev_subclass;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800258 unsigned int subdevices_count;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800259 unsigned int subdevices_avail;
Tao Baod7db5942015-01-28 10:07:51 -0800260 union snd_pcm_sync_id sync;
261 unsigned char reserved[64];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800262};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800263typedef int snd_pcm_hw_param_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700264#define SNDRV_PCM_HW_PARAM_ACCESS 0
Christopher Ferris38062f92014-07-09 15:33:25 -0700265#define SNDRV_PCM_HW_PARAM_FORMAT 1
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800266#define SNDRV_PCM_HW_PARAM_SUBFORMAT 2
Christopher Ferris05d08e92016-02-04 13:16:38 -0800267#define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS
Ben Cheng655a7c02013-10-16 16:09:24 -0700268#define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT
Christopher Ferris38062f92014-07-09 15:33:25 -0700269#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800270#define SNDRV_PCM_HW_PARAM_FRAME_BITS 9
Christopher Ferris05d08e92016-02-04 13:16:38 -0800271#define SNDRV_PCM_HW_PARAM_CHANNELS 10
Ben Cheng655a7c02013-10-16 16:09:24 -0700272#define SNDRV_PCM_HW_PARAM_RATE 11
Christopher Ferris38062f92014-07-09 15:33:25 -0700273#define SNDRV_PCM_HW_PARAM_PERIOD_TIME 12
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800274#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13
Christopher Ferris05d08e92016-02-04 13:16:38 -0800275#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14
Ben Cheng655a7c02013-10-16 16:09:24 -0700276#define SNDRV_PCM_HW_PARAM_PERIODS 15
Christopher Ferris38062f92014-07-09 15:33:25 -0700277#define SNDRV_PCM_HW_PARAM_BUFFER_TIME 16
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800278#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17
Christopher Ferris05d08e92016-02-04 13:16:38 -0800279#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18
Ben Cheng655a7c02013-10-16 16:09:24 -0700280#define SNDRV_PCM_HW_PARAM_TICK_TIME 19
Christopher Ferris38062f92014-07-09 15:33:25 -0700281#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800282#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
Christopher Ferris05d08e92016-02-04 13:16:38 -0800283#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800284#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1 << 1)
285#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1 << 2)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800286struct snd_interval {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800287 unsigned int min, max;
Tao Baod7db5942015-01-28 10:07:51 -0800288 unsigned int openmin : 1, openmax : 1, integer : 1, empty : 1;
Ben Cheng655a7c02013-10-16 16:09:24 -0700289};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800290#define SNDRV_MASK_MAX 256
Christopher Ferris05d08e92016-02-04 13:16:38 -0800291struct snd_mask {
Tao Baod7db5942015-01-28 10:07:51 -0800292 __u32 bits[(SNDRV_MASK_MAX + 31) / 32];
Ben Cheng655a7c02013-10-16 16:09:24 -0700293};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800294struct snd_pcm_hw_params {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800295 unsigned int flags;
Tao Baod7db5942015-01-28 10:07:51 -0800296 struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
297 struct snd_mask mres[5];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800298 struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800299 struct snd_interval ires[9];
Tao Baod7db5942015-01-28 10:07:51 -0800300 unsigned int rmask;
301 unsigned int cmask;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800302 unsigned int info;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800303 unsigned int msbits;
Tao Baod7db5942015-01-28 10:07:51 -0800304 unsigned int rate_num;
305 unsigned int rate_den;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800306 snd_pcm_uframes_t fifo_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800307 unsigned char reserved[64];
Christopher Ferris38062f92014-07-09 15:33:25 -0700308};
Ben Cheng655a7c02013-10-16 16:09:24 -0700309enum {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800310 SNDRV_PCM_TSTAMP_NONE = 0,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800311 SNDRV_PCM_TSTAMP_ENABLE,
Tao Baod7db5942015-01-28 10:07:51 -0800312 SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700313};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800314struct snd_pcm_sw_params {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800315 int tstamp_mode;
Tao Baod7db5942015-01-28 10:07:51 -0800316 unsigned int period_step;
317 unsigned int sleep_min;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800318 snd_pcm_uframes_t avail_min;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800319 snd_pcm_uframes_t xfer_align;
Tao Baod7db5942015-01-28 10:07:51 -0800320 snd_pcm_uframes_t start_threshold;
321 snd_pcm_uframes_t stop_threshold;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800322 snd_pcm_uframes_t silence_threshold;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800323 snd_pcm_uframes_t silence_size;
Tao Baod7db5942015-01-28 10:07:51 -0800324 snd_pcm_uframes_t boundary;
325 unsigned int proto;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800326 unsigned int tstamp_type;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800327 unsigned char reserved[56];
Ben Cheng655a7c02013-10-16 16:09:24 -0700328};
329struct snd_pcm_channel_info {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800330 unsigned int channel;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800331 __kernel_off_t offset;
Tao Baod7db5942015-01-28 10:07:51 -0800332 unsigned int first;
333 unsigned int step;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800334};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800335enum {
336 SNDRV_PCM_AUDIO_TSTAMP_TYPE_COMPAT = 0,
337 SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT = 1,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800338 SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK = 2,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800339 SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ABSOLUTE = 3,
340 SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ESTIMATED = 4,
341 SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED = 5,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800342 SNDRV_PCM_AUDIO_TSTAMP_TYPE_LAST = SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED
Christopher Ferris05d08e92016-02-04 13:16:38 -0800343};
344struct snd_pcm_status {
Tao Baod7db5942015-01-28 10:07:51 -0800345 snd_pcm_state_t state;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800346 struct timespec trigger_tstamp;
Tao Baod7db5942015-01-28 10:07:51 -0800347 struct timespec tstamp;
348 snd_pcm_uframes_t appl_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800349 snd_pcm_uframes_t hw_ptr;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800350 snd_pcm_sframes_t delay;
Tao Baod7db5942015-01-28 10:07:51 -0800351 snd_pcm_uframes_t avail;
352 snd_pcm_uframes_t avail_max;
Tao Baod7db5942015-01-28 10:07:51 -0800353 snd_pcm_uframes_t overrange;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800354 snd_pcm_state_t suspended_state;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800355 __u32 audio_tstamp_data;
356 struct timespec audio_tstamp;
357 struct timespec driver_tstamp;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800358 __u32 audio_tstamp_accuracy;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800359 unsigned char reserved[52 - 2 * sizeof(struct timespec)];
Ben Cheng655a7c02013-10-16 16:09:24 -0700360};
Christopher Ferris38062f92014-07-09 15:33:25 -0700361struct snd_pcm_mmap_status {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800362 snd_pcm_state_t state;
Tao Baod7db5942015-01-28 10:07:51 -0800363 int pad1;
364 snd_pcm_uframes_t hw_ptr;
365 struct timespec tstamp;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800366 snd_pcm_state_t suspended_state;
Tao Baod7db5942015-01-28 10:07:51 -0800367 struct timespec audio_tstamp;
Ben Cheng655a7c02013-10-16 16:09:24 -0700368};
Christopher Ferris38062f92014-07-09 15:33:25 -0700369struct snd_pcm_mmap_control {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800370 snd_pcm_uframes_t appl_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800371 snd_pcm_uframes_t avail_min;
Ben Cheng655a7c02013-10-16 16:09:24 -0700372};
Tao Baod7db5942015-01-28 10:07:51 -0800373#define SNDRV_PCM_SYNC_PTR_HWSYNC (1 << 0)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800374#define SNDRV_PCM_SYNC_PTR_APPL (1 << 1)
Tao Baod7db5942015-01-28 10:07:51 -0800375#define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700376struct snd_pcm_sync_ptr {
Tao Baod7db5942015-01-28 10:07:51 -0800377 unsigned int flags;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800378 union {
Tao Baod7db5942015-01-28 10:07:51 -0800379 struct snd_pcm_mmap_status status;
380 unsigned char reserved[64];
381 } s;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800382 union {
Tao Baod7db5942015-01-28 10:07:51 -0800383 struct snd_pcm_mmap_control control;
384 unsigned char reserved[64];
385 } c;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800386};
Tao Baod7db5942015-01-28 10:07:51 -0800387struct snd_xferi {
388 snd_pcm_sframes_t result;
389 void __user * buf;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800390 snd_pcm_uframes_t frames;
Ben Cheng655a7c02013-10-16 16:09:24 -0700391};
392struct snd_xfern {
Tao Baod7db5942015-01-28 10:07:51 -0800393 snd_pcm_sframes_t result;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800394 void __user * __user * bufs;
Tao Baod7db5942015-01-28 10:07:51 -0800395 snd_pcm_uframes_t frames;
Ben Cheng655a7c02013-10-16 16:09:24 -0700396};
Christopher Ferris38062f92014-07-09 15:33:25 -0700397enum {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800398 SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0,
Tao Baod7db5942015-01-28 10:07:51 -0800399 SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
400 SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
401 SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800402};
Ben Cheng655a7c02013-10-16 16:09:24 -0700403enum {
Tao Baod7db5942015-01-28 10:07:51 -0800404 SNDRV_CHMAP_UNKNOWN = 0,
405 SNDRV_CHMAP_NA,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800406 SNDRV_CHMAP_MONO,
Tao Baod7db5942015-01-28 10:07:51 -0800407 SNDRV_CHMAP_FL,
408 SNDRV_CHMAP_FR,
409 SNDRV_CHMAP_RL,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800410 SNDRV_CHMAP_RR,
Tao Baod7db5942015-01-28 10:07:51 -0800411 SNDRV_CHMAP_FC,
412 SNDRV_CHMAP_LFE,
413 SNDRV_CHMAP_SL,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800414 SNDRV_CHMAP_SR,
Tao Baod7db5942015-01-28 10:07:51 -0800415 SNDRV_CHMAP_RC,
416 SNDRV_CHMAP_FLC,
417 SNDRV_CHMAP_FRC,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800418 SNDRV_CHMAP_RLC,
Tao Baod7db5942015-01-28 10:07:51 -0800419 SNDRV_CHMAP_RRC,
420 SNDRV_CHMAP_FLW,
421 SNDRV_CHMAP_FRW,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800422 SNDRV_CHMAP_FLH,
Tao Baod7db5942015-01-28 10:07:51 -0800423 SNDRV_CHMAP_FCH,
424 SNDRV_CHMAP_FRH,
425 SNDRV_CHMAP_TC,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800426 SNDRV_CHMAP_TFL,
Tao Baod7db5942015-01-28 10:07:51 -0800427 SNDRV_CHMAP_TFR,
428 SNDRV_CHMAP_TFC,
429 SNDRV_CHMAP_TRL,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800430 SNDRV_CHMAP_TRR,
Tao Baod7db5942015-01-28 10:07:51 -0800431 SNDRV_CHMAP_TRC,
432 SNDRV_CHMAP_TFLC,
433 SNDRV_CHMAP_TFRC,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800434 SNDRV_CHMAP_TSL,
Tao Baod7db5942015-01-28 10:07:51 -0800435 SNDRV_CHMAP_TSR,
436 SNDRV_CHMAP_LLFE,
437 SNDRV_CHMAP_RLFE,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800438 SNDRV_CHMAP_BC,
Tao Baod7db5942015-01-28 10:07:51 -0800439 SNDRV_CHMAP_BLC,
440 SNDRV_CHMAP_BRC,
441 SNDRV_CHMAP_LAST = SNDRV_CHMAP_BRC,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800442};
Ben Cheng655a7c02013-10-16 16:09:24 -0700443#define SNDRV_CHMAP_POSITION_MASK 0xffff
444#define SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16)
445#define SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800446#define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int)
Ben Cheng655a7c02013-10-16 16:09:24 -0700447#define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info)
448#define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int)
449#define SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int)
Christopher Ferris1308ad32017-11-14 17:32:13 -0800450#define SNDRV_PCM_IOCTL_USER_PVERSION _IOW('A', 0x04, int)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800451#define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params)
Ben Cheng655a7c02013-10-16 16:09:24 -0700452#define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params)
453#define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12)
454#define SNDRV_PCM_IOCTL_SW_PARAMS _IOWR('A', 0x13, struct snd_pcm_sw_params)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800455#define SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct snd_pcm_status)
Ben Cheng655a7c02013-10-16 16:09:24 -0700456#define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t)
457#define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22)
458#define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800459#define SNDRV_PCM_IOCTL_STATUS_EXT _IOWR('A', 0x24, struct snd_pcm_status)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800460#define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info)
Ben Cheng655a7c02013-10-16 16:09:24 -0700461#define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40)
462#define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800463#define SNDRV_PCM_IOCTL_START _IO('A', 0x42)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800464#define SNDRV_PCM_IOCTL_DROP _IO('A', 0x43)
Ben Cheng655a7c02013-10-16 16:09:24 -0700465#define SNDRV_PCM_IOCTL_DRAIN _IO('A', 0x44)
466#define SNDRV_PCM_IOCTL_PAUSE _IOW('A', 0x45, int)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800467#define SNDRV_PCM_IOCTL_REWIND _IOW('A', 0x46, snd_pcm_uframes_t)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800468#define SNDRV_PCM_IOCTL_RESUME _IO('A', 0x47)
Ben Cheng655a7c02013-10-16 16:09:24 -0700469#define SNDRV_PCM_IOCTL_XRUN _IO('A', 0x48)
470#define SNDRV_PCM_IOCTL_FORWARD _IOW('A', 0x49, snd_pcm_uframes_t)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800471#define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800472#define SNDRV_PCM_IOCTL_READI_FRAMES _IOR('A', 0x51, struct snd_xferi)
Ben Cheng655a7c02013-10-16 16:09:24 -0700473#define SNDRV_PCM_IOCTL_WRITEN_FRAMES _IOW('A', 0x52, struct snd_xfern)
474#define SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct snd_xfern)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800475#define SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800476#define SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61)
Ben Cheng655a7c02013-10-16 16:09:24 -0700477#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0)
478enum {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800479 SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800480 SNDRV_RAWMIDI_STREAM_INPUT,
Tao Baod7db5942015-01-28 10:07:51 -0800481 SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700482};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800483#define SNDRV_RAWMIDI_INFO_OUTPUT 0x00000001
Christopher Ferris05d08e92016-02-04 13:16:38 -0800484#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
Ben Cheng655a7c02013-10-16 16:09:24 -0700485#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
486struct snd_rawmidi_info {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800487 unsigned int device;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800488 unsigned int subdevice;
Tao Baod7db5942015-01-28 10:07:51 -0800489 int stream;
490 int card;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800491 unsigned int flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800492 unsigned char id[64];
Tao Baod7db5942015-01-28 10:07:51 -0800493 unsigned char name[80];
494 unsigned char subname[32];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800495 unsigned int subdevices_count;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800496 unsigned int subdevices_avail;
Tao Baod7db5942015-01-28 10:07:51 -0800497 unsigned char reserved[64];
Ben Cheng655a7c02013-10-16 16:09:24 -0700498};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800499struct snd_rawmidi_params {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800500 int stream;
Tao Baod7db5942015-01-28 10:07:51 -0800501 size_t buffer_size;
502 size_t avail_min;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800503 unsigned int no_active_sensing : 1;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800504 unsigned char reserved[16];
Ben Cheng655a7c02013-10-16 16:09:24 -0700505};
506struct snd_rawmidi_status {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800507 int stream;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800508 struct timespec tstamp;
Tao Baod7db5942015-01-28 10:07:51 -0800509 size_t avail;
510 size_t xruns;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800511 unsigned char reserved[16];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800512};
Ben Cheng655a7c02013-10-16 16:09:24 -0700513#define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)
514#define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800515#define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800516#define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)
Ben Cheng655a7c02013-10-16 16:09:24 -0700517#define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)
518#define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800519#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800520enum {
Tao Baod7db5942015-01-28 10:07:51 -0800521 SNDRV_TIMER_CLASS_NONE = - 1,
522 SNDRV_TIMER_CLASS_SLAVE = 0,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800523 SNDRV_TIMER_CLASS_GLOBAL,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800524 SNDRV_TIMER_CLASS_CARD,
Tao Baod7db5942015-01-28 10:07:51 -0800525 SNDRV_TIMER_CLASS_PCM,
526 SNDRV_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_PCM,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800527};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800528enum {
Tao Baod7db5942015-01-28 10:07:51 -0800529 SNDRV_TIMER_SCLASS_NONE = 0,
530 SNDRV_TIMER_SCLASS_APPLICATION,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800531 SNDRV_TIMER_SCLASS_SEQUENCER,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800532 SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
Tao Baod7db5942015-01-28 10:07:51 -0800533 SNDRV_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
Ben Cheng655a7c02013-10-16 16:09:24 -0700534};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800535#define SNDRV_TIMER_GLOBAL_SYSTEM 0
Christopher Ferris05d08e92016-02-04 13:16:38 -0800536#define SNDRV_TIMER_GLOBAL_RTC 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700537#define SNDRV_TIMER_GLOBAL_HPET 2
538#define SNDRV_TIMER_GLOBAL_HRTIMER 3
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800539#define SNDRV_TIMER_FLG_SLAVE (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800540struct snd_timer_id {
Tao Baod7db5942015-01-28 10:07:51 -0800541 int dev_class;
542 int dev_sclass;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800543 int card;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800544 int device;
Tao Baod7db5942015-01-28 10:07:51 -0800545 int subdevice;
Ben Cheng655a7c02013-10-16 16:09:24 -0700546};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800547struct snd_timer_ginfo {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800548 struct snd_timer_id tid;
Tao Baod7db5942015-01-28 10:07:51 -0800549 unsigned int flags;
550 int card;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800551 unsigned char id[64];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800552 unsigned char name[80];
Tao Baod7db5942015-01-28 10:07:51 -0800553 unsigned long reserved0;
554 unsigned long resolution;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800555 unsigned long resolution_min;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800556 unsigned long resolution_max;
Tao Baod7db5942015-01-28 10:07:51 -0800557 unsigned int clients;
558 unsigned char reserved[32];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800559};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800560struct snd_timer_gparams {
Tao Baod7db5942015-01-28 10:07:51 -0800561 struct snd_timer_id tid;
562 unsigned long period_num;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800563 unsigned long period_den;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800564 unsigned char reserved[32];
Ben Cheng655a7c02013-10-16 16:09:24 -0700565};
566struct snd_timer_gstatus {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800567 struct snd_timer_id tid;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800568 unsigned long resolution;
Tao Baod7db5942015-01-28 10:07:51 -0800569 unsigned long resolution_num;
570 unsigned long resolution_den;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800571 unsigned char reserved[32];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800572};
Ben Cheng655a7c02013-10-16 16:09:24 -0700573struct snd_timer_select {
Tao Baod7db5942015-01-28 10:07:51 -0800574 struct snd_timer_id id;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800575 unsigned char reserved[32];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800576};
Ben Cheng655a7c02013-10-16 16:09:24 -0700577struct snd_timer_info {
Tao Baod7db5942015-01-28 10:07:51 -0800578 unsigned int flags;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800579 int card;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800580 unsigned char id[64];
Tao Baod7db5942015-01-28 10:07:51 -0800581 unsigned char name[80];
582 unsigned long reserved0;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800583 unsigned long resolution;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800584 unsigned char reserved[64];
Ben Cheng655a7c02013-10-16 16:09:24 -0700585};
Tao Baod7db5942015-01-28 10:07:51 -0800586#define SNDRV_TIMER_PSFLG_AUTO (1 << 0)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800587#define SNDRV_TIMER_PSFLG_EXCLUSIVE (1 << 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800588#define SNDRV_TIMER_PSFLG_EARLY_EVENT (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700589struct snd_timer_params {
Tao Baod7db5942015-01-28 10:07:51 -0800590 unsigned int flags;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800591 unsigned int ticks;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800592 unsigned int queue_size;
Tao Baod7db5942015-01-28 10:07:51 -0800593 unsigned int reserved0;
594 unsigned int filter;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800595 unsigned char reserved[60];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800596};
Ben Cheng655a7c02013-10-16 16:09:24 -0700597struct snd_timer_status {
Tao Baod7db5942015-01-28 10:07:51 -0800598 struct timespec tstamp;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800599 unsigned int resolution;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800600 unsigned int lost;
Tao Baod7db5942015-01-28 10:07:51 -0800601 unsigned int overrun;
602 unsigned int queue;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800603 unsigned char reserved[64];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800604};
Ben Cheng655a7c02013-10-16 16:09:24 -0700605#define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int)
606#define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800607#define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800608#define SNDRV_TIMER_IOCTL_GINFO _IOWR('T', 0x03, struct snd_timer_ginfo)
Ben Cheng655a7c02013-10-16 16:09:24 -0700609#define SNDRV_TIMER_IOCTL_GPARAMS _IOW('T', 0x04, struct snd_timer_gparams)
610#define SNDRV_TIMER_IOCTL_GSTATUS _IOWR('T', 0x05, struct snd_timer_gstatus)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800611#define SNDRV_TIMER_IOCTL_SELECT _IOW('T', 0x10, struct snd_timer_select)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800612#define SNDRV_TIMER_IOCTL_INFO _IOR('T', 0x11, struct snd_timer_info)
Ben Cheng655a7c02013-10-16 16:09:24 -0700613#define SNDRV_TIMER_IOCTL_PARAMS _IOW('T', 0x12, struct snd_timer_params)
614#define SNDRV_TIMER_IOCTL_STATUS _IOR('T', 0x14, struct snd_timer_status)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800615#define SNDRV_TIMER_IOCTL_START _IO('T', 0xa0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800616#define SNDRV_TIMER_IOCTL_STOP _IO('T', 0xa1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700617#define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2)
618#define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800619struct snd_timer_read {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800620 unsigned int resolution;
Tao Baod7db5942015-01-28 10:07:51 -0800621 unsigned int ticks;
Ben Cheng655a7c02013-10-16 16:09:24 -0700622};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800623enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800624 SNDRV_TIMER_EVENT_RESOLUTION = 0,
Tao Baod7db5942015-01-28 10:07:51 -0800625 SNDRV_TIMER_EVENT_TICK,
626 SNDRV_TIMER_EVENT_START,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800627 SNDRV_TIMER_EVENT_STOP,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800628 SNDRV_TIMER_EVENT_CONTINUE,
Tao Baod7db5942015-01-28 10:07:51 -0800629 SNDRV_TIMER_EVENT_PAUSE,
630 SNDRV_TIMER_EVENT_EARLY,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800631 SNDRV_TIMER_EVENT_SUSPEND,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800632 SNDRV_TIMER_EVENT_RESUME,
Tao Baod7db5942015-01-28 10:07:51 -0800633 SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10,
634 SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800635 SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800636 SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10,
Tao Baod7db5942015-01-28 10:07:51 -0800637 SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10,
638 SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800639};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800640struct snd_timer_tread {
Tao Baod7db5942015-01-28 10:07:51 -0800641 int event;
642 struct timespec tstamp;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800643 unsigned int val;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800644};
Ben Cheng655a7c02013-10-16 16:09:24 -0700645#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)
646struct snd_ctl_card_info {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800647 int card;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800648 int pad;
Tao Baod7db5942015-01-28 10:07:51 -0800649 unsigned char id[16];
650 unsigned char driver[16];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800651 unsigned char name[32];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800652 unsigned char longname[80];
Tao Baod7db5942015-01-28 10:07:51 -0800653 unsigned char reserved_[16];
654 unsigned char mixername[80];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800655 unsigned char components[128];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800656};
Ben Cheng655a7c02013-10-16 16:09:24 -0700657typedef int __bitwise snd_ctl_elem_type_t;
658#define SNDRV_CTL_ELEM_TYPE_NONE ((__force snd_ctl_elem_type_t) 0)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800659#define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((__force snd_ctl_elem_type_t) 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800660#define SNDRV_CTL_ELEM_TYPE_INTEGER ((__force snd_ctl_elem_type_t) 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700661#define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((__force snd_ctl_elem_type_t) 3)
662#define SNDRV_CTL_ELEM_TYPE_BYTES ((__force snd_ctl_elem_type_t) 4)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800663#define SNDRV_CTL_ELEM_TYPE_IEC958 ((__force snd_ctl_elem_type_t) 5)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800664#define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((__force snd_ctl_elem_type_t) 6)
Ben Cheng655a7c02013-10-16 16:09:24 -0700665#define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64
666typedef int __bitwise snd_ctl_elem_iface_t;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800667#define SNDRV_CTL_ELEM_IFACE_CARD ((__force snd_ctl_elem_iface_t) 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800668#define SNDRV_CTL_ELEM_IFACE_HWDEP ((__force snd_ctl_elem_iface_t) 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700669#define SNDRV_CTL_ELEM_IFACE_MIXER ((__force snd_ctl_elem_iface_t) 2)
670#define SNDRV_CTL_ELEM_IFACE_PCM ((__force snd_ctl_elem_iface_t) 3)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800671#define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((__force snd_ctl_elem_iface_t) 4)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800672#define SNDRV_CTL_ELEM_IFACE_TIMER ((__force snd_ctl_elem_iface_t) 5)
Ben Cheng655a7c02013-10-16 16:09:24 -0700673#define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((__force snd_ctl_elem_iface_t) 6)
674#define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800675#define SNDRV_CTL_ELEM_ACCESS_READ (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800676#define SNDRV_CTL_ELEM_ACCESS_WRITE (1 << 1)
Tao Baod7db5942015-01-28 10:07:51 -0800677#define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE)
678#define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1 << 2)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800679#define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (1 << 3)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800680#define SNDRV_CTL_ELEM_ACCESS_TLV_READ (1 << 4)
Tao Baod7db5942015-01-28 10:07:51 -0800681#define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (1 << 5)
682#define SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE (SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800683#define SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND (1 << 6)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800684#define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1 << 8)
Tao Baod7db5942015-01-28 10:07:51 -0800685#define SNDRV_CTL_ELEM_ACCESS_LOCK (1 << 9)
686#define SNDRV_CTL_ELEM_ACCESS_OWNER (1 << 10)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800687#define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1 << 28)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800688#define SNDRV_CTL_ELEM_ACCESS_USER (1 << 29)
Ben Cheng655a7c02013-10-16 16:09:24 -0700689#define SNDRV_CTL_POWER_D0 0x0000
690#define SNDRV_CTL_POWER_D1 0x0100
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800691#define SNDRV_CTL_POWER_D2 0x0200
Christopher Ferris05d08e92016-02-04 13:16:38 -0800692#define SNDRV_CTL_POWER_D3 0x0300
Tao Baod7db5942015-01-28 10:07:51 -0800693#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3 | 0x0000)
694#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3 | 0x0001)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800695#define SNDRV_CTL_ELEM_ID_NAME_MAXLEN 44
Christopher Ferris05d08e92016-02-04 13:16:38 -0800696struct snd_ctl_elem_id {
Tao Baod7db5942015-01-28 10:07:51 -0800697 unsigned int numid;
698 snd_ctl_elem_iface_t iface;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800699 unsigned int device;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800700 unsigned int subdevice;
701 unsigned char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
Tao Baod7db5942015-01-28 10:07:51 -0800702 unsigned int index;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800703};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800704struct snd_ctl_elem_list {
Tao Baod7db5942015-01-28 10:07:51 -0800705 unsigned int offset;
706 unsigned int space;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800707 unsigned int used;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800708 unsigned int count;
Tao Baod7db5942015-01-28 10:07:51 -0800709 struct snd_ctl_elem_id __user * pids;
710 unsigned char reserved[50];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800711};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800712struct snd_ctl_elem_info {
Tao Baod7db5942015-01-28 10:07:51 -0800713 struct snd_ctl_elem_id id;
714 snd_ctl_elem_type_t type;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800715 unsigned int access;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800716 unsigned int count;
Tao Baod7db5942015-01-28 10:07:51 -0800717 __kernel_pid_t owner;
718 union {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800719 struct {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800720 long min;
Tao Baod7db5942015-01-28 10:07:51 -0800721 long max;
722 long step;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800723 } integer;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800724 struct {
Tao Baod7db5942015-01-28 10:07:51 -0800725 long long min;
726 long long max;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800727 long long step;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800728 } integer64;
Tao Baod7db5942015-01-28 10:07:51 -0800729 struct {
730 unsigned int items;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800731 unsigned int item;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800732 char name[64];
Tao Baod7db5942015-01-28 10:07:51 -0800733 __u64 names_ptr;
734 unsigned int names_length;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800735 } enumerated;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800736 unsigned char reserved[128];
Tao Baod7db5942015-01-28 10:07:51 -0800737 } value;
738 union {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800739 unsigned short d[4];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800740 unsigned short * d_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800741 } dimen;
742 unsigned char reserved[64 - 4 * sizeof(unsigned short)];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800743};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800744struct snd_ctl_elem_value {
Tao Baod7db5942015-01-28 10:07:51 -0800745 struct snd_ctl_elem_id id;
746 unsigned int indirect : 1;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800747 union {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800748 union {
Tao Baod7db5942015-01-28 10:07:51 -0800749 long value[128];
750 long * value_ptr;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800751 } integer;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800752 union {
Tao Baod7db5942015-01-28 10:07:51 -0800753 long long value[64];
754 long long * value_ptr;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800755 } integer64;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800756 union {
Tao Baod7db5942015-01-28 10:07:51 -0800757 unsigned int item[128];
758 unsigned int * item_ptr;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800759 } enumerated;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800760 union {
Tao Baod7db5942015-01-28 10:07:51 -0800761 unsigned char data[512];
762 unsigned char * data_ptr;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800763 } bytes;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800764 struct snd_aes_iec958 iec958;
Tao Baod7db5942015-01-28 10:07:51 -0800765 } value;
766 struct timespec tstamp;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800767 unsigned char reserved[128 - sizeof(struct timespec)];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800768};
Tao Baod7db5942015-01-28 10:07:51 -0800769struct snd_ctl_tlv {
770 unsigned int numid;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800771 unsigned int length;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800772 unsigned int tlv[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700773};
774#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800775#define SNDRV_CTL_IOCTL_CARD_INFO _IOR('U', 0x01, struct snd_ctl_card_info)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800776#define SNDRV_CTL_IOCTL_ELEM_LIST _IOWR('U', 0x10, struct snd_ctl_elem_list)
Ben Cheng655a7c02013-10-16 16:09:24 -0700777#define SNDRV_CTL_IOCTL_ELEM_INFO _IOWR('U', 0x11, struct snd_ctl_elem_info)
778#define SNDRV_CTL_IOCTL_ELEM_READ _IOWR('U', 0x12, struct snd_ctl_elem_value)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800779#define SNDRV_CTL_IOCTL_ELEM_WRITE _IOWR('U', 0x13, struct snd_ctl_elem_value)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800780#define SNDRV_CTL_IOCTL_ELEM_LOCK _IOW('U', 0x14, struct snd_ctl_elem_id)
Ben Cheng655a7c02013-10-16 16:09:24 -0700781#define SNDRV_CTL_IOCTL_ELEM_UNLOCK _IOW('U', 0x15, struct snd_ctl_elem_id)
782#define SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS _IOWR('U', 0x16, int)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800783#define SNDRV_CTL_IOCTL_ELEM_ADD _IOWR('U', 0x17, struct snd_ctl_elem_info)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800784#define SNDRV_CTL_IOCTL_ELEM_REPLACE _IOWR('U', 0x18, struct snd_ctl_elem_info)
Ben Cheng655a7c02013-10-16 16:09:24 -0700785#define SNDRV_CTL_IOCTL_ELEM_REMOVE _IOWR('U', 0x19, struct snd_ctl_elem_id)
786#define SNDRV_CTL_IOCTL_TLV_READ _IOWR('U', 0x1a, struct snd_ctl_tlv)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800787#define SNDRV_CTL_IOCTL_TLV_WRITE _IOWR('U', 0x1b, struct snd_ctl_tlv)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800788#define SNDRV_CTL_IOCTL_TLV_COMMAND _IOWR('U', 0x1c, struct snd_ctl_tlv)
Ben Cheng655a7c02013-10-16 16:09:24 -0700789#define SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE _IOWR('U', 0x20, int)
790#define SNDRV_CTL_IOCTL_HWDEP_INFO _IOR('U', 0x21, struct snd_hwdep_info)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800791#define SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE _IOR('U', 0x30, int)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800792#define SNDRV_CTL_IOCTL_PCM_INFO _IOWR('U', 0x31, struct snd_pcm_info)
Ben Cheng655a7c02013-10-16 16:09:24 -0700793#define SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE _IOW('U', 0x32, int)
794#define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800795#define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800796#define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int)
Ben Cheng655a7c02013-10-16 16:09:24 -0700797#define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int)
798#define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800799enum sndrv_ctl_event_type {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800800 SNDRV_CTL_EVENT_ELEM = 0,
Tao Baod7db5942015-01-28 10:07:51 -0800801 SNDRV_CTL_EVENT_LAST = SNDRV_CTL_EVENT_ELEM,
Ben Cheng655a7c02013-10-16 16:09:24 -0700802};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800803#define SNDRV_CTL_EVENT_MASK_VALUE (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800804#define SNDRV_CTL_EVENT_MASK_INFO (1 << 1)
Tao Baod7db5942015-01-28 10:07:51 -0800805#define SNDRV_CTL_EVENT_MASK_ADD (1 << 2)
806#define SNDRV_CTL_EVENT_MASK_TLV (1 << 3)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800807#define SNDRV_CTL_EVENT_MASK_REMOVE (~0U)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800808struct snd_ctl_event {
Tao Baod7db5942015-01-28 10:07:51 -0800809 int type;
810 union {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800811 struct {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800812 unsigned int mask;
Tao Baod7db5942015-01-28 10:07:51 -0800813 struct snd_ctl_elem_id id;
814 } elem;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800815 unsigned char data8[60];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800816 } data;
Ben Cheng655a7c02013-10-16 16:09:24 -0700817};
818#define SNDRV_CTL_NAME_NONE ""
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800819#define SNDRV_CTL_NAME_PLAYBACK "Playback "
Christopher Ferris05d08e92016-02-04 13:16:38 -0800820#define SNDRV_CTL_NAME_CAPTURE "Capture "
Ben Cheng655a7c02013-10-16 16:09:24 -0700821#define SNDRV_CTL_NAME_IEC958_NONE ""
822#define SNDRV_CTL_NAME_IEC958_SWITCH "Switch"
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800823#define SNDRV_CTL_NAME_IEC958_VOLUME "Volume"
Christopher Ferris05d08e92016-02-04 13:16:38 -0800824#define SNDRV_CTL_NAME_IEC958_DEFAULT "Default"
Ben Cheng655a7c02013-10-16 16:09:24 -0700825#define SNDRV_CTL_NAME_IEC958_MASK "Mask"
826#define SNDRV_CTL_NAME_IEC958_CON_MASK "Con Mask"
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800827#define SNDRV_CTL_NAME_IEC958_PRO_MASK "Pro Mask"
Christopher Ferris05d08e92016-02-04 13:16:38 -0800828#define SNDRV_CTL_NAME_IEC958_PCM_STREAM "PCM Stream"
Tao Baod7db5942015-01-28 10:07:51 -0800829#define SNDRV_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SNDRV_CTL_NAME_ ##direction SNDRV_CTL_NAME_IEC958_ ##what
Ben Cheng655a7c02013-10-16 16:09:24 -0700830#endif