Home | History | Annotate | Download | only in sound
      1 /****************************************************************************
      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_UAPI_SND_ASOC_H
     20 #define __LINUX_UAPI_SND_ASOC_H
     21 #include <linux/types.h>
     22 #include <sound/asound.h>
     23 #define SND_SOC_TPLG_MAX_CHAN 8
     24 #define SND_SOC_TPLG_MAX_FORMATS 16
     25 #define SND_SOC_TPLG_STREAM_CONFIG_MAX 8
     26 #define SND_SOC_TPLG_HW_CONFIG_MAX 8
     27 #define SND_SOC_TPLG_CTL_VOLSW 1
     28 #define SND_SOC_TPLG_CTL_VOLSW_SX 2
     29 #define SND_SOC_TPLG_CTL_VOLSW_XR_SX 3
     30 #define SND_SOC_TPLG_CTL_ENUM 4
     31 #define SND_SOC_TPLG_CTL_BYTES 5
     32 #define SND_SOC_TPLG_CTL_ENUM_VALUE 6
     33 #define SND_SOC_TPLG_CTL_RANGE 7
     34 #define SND_SOC_TPLG_CTL_STROBE 8
     35 #define SND_SOC_TPLG_DAPM_CTL_VOLSW 64
     36 #define SND_SOC_TPLG_DAPM_CTL_ENUM_DOUBLE 65
     37 #define SND_SOC_TPLG_DAPM_CTL_ENUM_VIRT 66
     38 #define SND_SOC_TPLG_DAPM_CTL_ENUM_VALUE 67
     39 #define SND_SOC_TPLG_DAPM_CTL_PIN 68
     40 #define SND_SOC_TPLG_DAPM_INPUT 0
     41 #define SND_SOC_TPLG_DAPM_OUTPUT 1
     42 #define SND_SOC_TPLG_DAPM_MUX 2
     43 #define SND_SOC_TPLG_DAPM_MIXER 3
     44 #define SND_SOC_TPLG_DAPM_PGA 4
     45 #define SND_SOC_TPLG_DAPM_OUT_DRV 5
     46 #define SND_SOC_TPLG_DAPM_ADC 6
     47 #define SND_SOC_TPLG_DAPM_DAC 7
     48 #define SND_SOC_TPLG_DAPM_SWITCH 8
     49 #define SND_SOC_TPLG_DAPM_PRE 9
     50 #define SND_SOC_TPLG_DAPM_POST 10
     51 #define SND_SOC_TPLG_DAPM_AIF_IN 11
     52 #define SND_SOC_TPLG_DAPM_AIF_OUT 12
     53 #define SND_SOC_TPLG_DAPM_DAI_IN 13
     54 #define SND_SOC_TPLG_DAPM_DAI_OUT 14
     55 #define SND_SOC_TPLG_DAPM_DAI_LINK 15
     56 #define SND_SOC_TPLG_DAPM_LAST SND_SOC_TPLG_DAPM_DAI_LINK
     57 #define SND_SOC_TPLG_MAGIC 0x41536F43
     58 #define SND_SOC_TPLG_NUM_TEXTS 16
     59 #define SND_SOC_TPLG_ABI_VERSION 0x5
     60 #define SND_SOC_TPLG_ABI_VERSION_MIN 0x4
     61 #define SND_SOC_TPLG_TLV_SIZE 32
     62 #define SND_SOC_TPLG_TYPE_MIXER 1
     63 #define SND_SOC_TPLG_TYPE_BYTES 2
     64 #define SND_SOC_TPLG_TYPE_ENUM 3
     65 #define SND_SOC_TPLG_TYPE_DAPM_GRAPH 4
     66 #define SND_SOC_TPLG_TYPE_DAPM_WIDGET 5
     67 #define SND_SOC_TPLG_TYPE_DAI_LINK 6
     68 #define SND_SOC_TPLG_TYPE_PCM 7
     69 #define SND_SOC_TPLG_TYPE_MANIFEST 8
     70 #define SND_SOC_TPLG_TYPE_CODEC_LINK 9
     71 #define SND_SOC_TPLG_TYPE_BACKEND_LINK 10
     72 #define SND_SOC_TPLG_TYPE_PDATA 11
     73 #define SND_SOC_TPLG_TYPE_DAI 12
     74 #define SND_SOC_TPLG_TYPE_MAX SND_SOC_TPLG_TYPE_DAI
     75 #define SND_SOC_TPLG_TYPE_VENDOR_FW 1000
     76 #define SND_SOC_TPLG_TYPE_VENDOR_CONFIG 1001
     77 #define SND_SOC_TPLG_TYPE_VENDOR_COEFF 1002
     78 #define SND_SOC_TPLG_TYPEVENDOR_CODEC 1003
     79 #define SND_SOC_TPLG_STREAM_PLAYBACK 0
     80 #define SND_SOC_TPLG_STREAM_CAPTURE 1
     81 #define SND_SOC_TPLG_TUPLE_TYPE_UUID 0
     82 #define SND_SOC_TPLG_TUPLE_TYPE_STRING 1
     83 #define SND_SOC_TPLG_TUPLE_TYPE_BOOL 2
     84 #define SND_SOC_TPLG_TUPLE_TYPE_BYTE 3
     85 #define SND_SOC_TPLG_TUPLE_TYPE_WORD 4
     86 #define SND_SOC_TPLG_TUPLE_TYPE_SHORT 5
     87 #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_RATES (1 << 0)
     88 #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
     89 #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)
     90 #define SND_SOC_DAI_FORMAT_I2S 1
     91 #define SND_SOC_DAI_FORMAT_RIGHT_J 2
     92 #define SND_SOC_DAI_FORMAT_LEFT_J 3
     93 #define SND_SOC_DAI_FORMAT_DSP_A 4
     94 #define SND_SOC_DAI_FORMAT_DSP_B 5
     95 #define SND_SOC_DAI_FORMAT_AC97 6
     96 #define SND_SOC_DAI_FORMAT_PDM 7
     97 #define SND_SOC_DAI_FORMAT_MSB SND_SOC_DAI_FORMAT_LEFT_J
     98 #define SND_SOC_DAI_FORMAT_LSB SND_SOC_DAI_FORMAT_RIGHT_J
     99 #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_RATES (1 << 0)
    100 #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
    101 #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)
    102 #define SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP (1 << 3)
    103 struct snd_soc_tplg_hdr {
    104   __le32 magic;
    105   __le32 abi;
    106   __le32 version;
    107   __le32 type;
    108   __le32 size;
    109   __le32 vendor_type;
    110   __le32 payload_size;
    111   __le32 index;
    112   __le32 count;
    113 } __attribute__((packed));
    114 struct snd_soc_tplg_vendor_uuid_elem {
    115   __le32 token;
    116   char uuid[16];
    117 } __attribute__((packed));
    118 struct snd_soc_tplg_vendor_value_elem {
    119   __le32 token;
    120   __le32 value;
    121 } __attribute__((packed));
    122 struct snd_soc_tplg_vendor_string_elem {
    123   __le32 token;
    124   char string[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
    125 } __attribute__((packed));
    126 struct snd_soc_tplg_vendor_array {
    127   __le32 size;
    128   __le32 type;
    129   __le32 num_elems;
    130   union {
    131     struct snd_soc_tplg_vendor_uuid_elem uuid[0];
    132     struct snd_soc_tplg_vendor_value_elem value[0];
    133     struct snd_soc_tplg_vendor_string_elem string[0];
    134   };
    135 } __attribute__((packed));
    136 struct snd_soc_tplg_private {
    137   __le32 size;
    138   union {
    139     char data[0];
    140     struct snd_soc_tplg_vendor_array array[0];
    141   };
    142 } __attribute__((packed));
    143 struct snd_soc_tplg_tlv_dbscale {
    144   __le32 min;
    145   __le32 step;
    146   __le32 mute;
    147 } __attribute__((packed));
    148 struct snd_soc_tplg_ctl_tlv {
    149   __le32 size;
    150   __le32 type;
    151   union {
    152     __le32 data[SND_SOC_TPLG_TLV_SIZE];
    153     struct snd_soc_tplg_tlv_dbscale scale;
    154   };
    155 } __attribute__((packed));
    156 struct snd_soc_tplg_channel {
    157   __le32 size;
    158   __le32 reg;
    159   __le32 shift;
    160   __le32 id;
    161 } __attribute__((packed));
    162 struct snd_soc_tplg_io_ops {
    163   __le32 get;
    164   __le32 put;
    165   __le32 info;
    166 } __attribute__((packed));
    167 struct snd_soc_tplg_ctl_hdr {
    168   __le32 size;
    169   __le32 type;
    170   char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
    171   __le32 access;
    172   struct snd_soc_tplg_io_ops ops;
    173   struct snd_soc_tplg_ctl_tlv tlv;
    174 } __attribute__((packed));
    175 struct snd_soc_tplg_stream_caps {
    176   __le32 size;
    177   char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
    178   __le64 formats;
    179   __le32 rates;
    180   __le32 rate_min;
    181   __le32 rate_max;
    182   __le32 channels_min;
    183   __le32 channels_max;
    184   __le32 periods_min;
    185   __le32 periods_max;
    186   __le32 period_size_min;
    187   __le32 period_size_max;
    188   __le32 buffer_size_min;
    189   __le32 buffer_size_max;
    190   __le32 sig_bits;
    191 } __attribute__((packed));
    192 struct snd_soc_tplg_stream {
    193   __le32 size;
    194   char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
    195   __le64 format;
    196   __le32 rate;
    197   __le32 period_bytes;
    198   __le32 buffer_bytes;
    199   __le32 channels;
    200 } __attribute__((packed));
    201 struct snd_soc_tplg_hw_config {
    202   __le32 size;
    203   __le32 id;
    204   __le32 fmt;
    205   __u8 clock_gated;
    206   __u8 invert_bclk;
    207   __u8 invert_fsync;
    208   __u8 bclk_master;
    209   __u8 fsync_master;
    210   __u8 mclk_direction;
    211   __le16 reserved;
    212   __le32 mclk_rate;
    213   __le32 bclk_rate;
    214   __le32 fsync_rate;
    215   __le32 tdm_slots;
    216   __le32 tdm_slot_width;
    217   __le32 tx_slots;
    218   __le32 rx_slots;
    219   __le32 tx_channels;
    220   __le32 tx_chanmap[SND_SOC_TPLG_MAX_CHAN];
    221   __le32 rx_channels;
    222   __le32 rx_chanmap[SND_SOC_TPLG_MAX_CHAN];
    223 } __attribute__((packed));
    224 struct snd_soc_tplg_manifest {
    225   __le32 size;
    226   __le32 control_elems;
    227   __le32 widget_elems;
    228   __le32 graph_elems;
    229   __le32 pcm_elems;
    230   __le32 dai_link_elems;
    231   __le32 dai_elems;
    232   __le32 reserved[20];
    233   struct snd_soc_tplg_private priv;
    234 } __attribute__((packed));
    235 struct snd_soc_tplg_mixer_control {
    236   struct snd_soc_tplg_ctl_hdr hdr;
    237   __le32 size;
    238   __le32 min;
    239   __le32 max;
    240   __le32 platform_max;
    241   __le32 invert;
    242   __le32 num_channels;
    243   struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
    244   struct snd_soc_tplg_private priv;
    245 } __attribute__((packed));
    246 struct snd_soc_tplg_enum_control {
    247   struct snd_soc_tplg_ctl_hdr hdr;
    248   __le32 size;
    249   __le32 num_channels;
    250   struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
    251   __le32 items;
    252   __le32 mask;
    253   __le32 count;
    254   char texts[SND_SOC_TPLG_NUM_TEXTS][SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
    255   __le32 values[SND_SOC_TPLG_NUM_TEXTS * SNDRV_CTL_ELEM_ID_NAME_MAXLEN / 4];
    256   struct snd_soc_tplg_private priv;
    257 } __attribute__((packed));
    258 struct snd_soc_tplg_bytes_control {
    259   struct snd_soc_tplg_ctl_hdr hdr;
    260   __le32 size;
    261   __le32 max;
    262   __le32 mask;
    263   __le32 base;
    264   __le32 num_regs;
    265   struct snd_soc_tplg_io_ops ext_ops;
    266   struct snd_soc_tplg_private priv;
    267 } __attribute__((packed));
    268 struct snd_soc_tplg_dapm_graph_elem {
    269   char sink[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
    270   char control[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
    271   char source[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
    272 } __attribute__((packed));
    273 struct snd_soc_tplg_dapm_widget {
    274   __le32 size;
    275   __le32 id;
    276   char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
    277   char sname[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
    278   __le32 reg;
    279   __le32 shift;
    280   __le32 mask;
    281   __le32 subseq;
    282   __le32 invert;
    283   __le32 ignore_suspend;
    284   __le16 event_flags;
    285   __le16 event_type;
    286   __le32 num_kcontrols;
    287   struct snd_soc_tplg_private priv;
    288 } __attribute__((packed));
    289 struct snd_soc_tplg_pcm {
    290   __le32 size;
    291   char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
    292   char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
    293   __le32 pcm_id;
    294   __le32 dai_id;
    295   __le32 playback;
    296   __le32 capture;
    297   __le32 compress;
    298   struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX];
    299   __le32 num_streams;
    300   struct snd_soc_tplg_stream_caps caps[2];
    301   __le32 flag_mask;
    302   __le32 flags;
    303   struct snd_soc_tplg_private priv;
    304 } __attribute__((packed));
    305 struct snd_soc_tplg_link_config {
    306   __le32 size;
    307   __le32 id;
    308   char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
    309   char stream_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
    310   struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX];
    311   __le32 num_streams;
    312   struct snd_soc_tplg_hw_config hw_config[SND_SOC_TPLG_HW_CONFIG_MAX];
    313   __le32 num_hw_configs;
    314   __le32 default_hw_config_id;
    315   __le32 flag_mask;
    316   __le32 flags;
    317   struct snd_soc_tplg_private priv;
    318 } __attribute__((packed));
    319 struct snd_soc_tplg_dai {
    320   __le32 size;
    321   char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
    322   __le32 dai_id;
    323   __le32 playback;
    324   __le32 capture;
    325   struct snd_soc_tplg_stream_caps caps[2];
    326   __le32 flag_mask;
    327   __le32 flags;
    328   struct snd_soc_tplg_private priv;
    329 } __attribute__((packed));
    330 #endif
    331