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_BUFFER 16 57 #define SND_SOC_TPLG_DAPM_SCHEDULER 17 58 #define SND_SOC_TPLG_DAPM_EFFECT 18 59 #define SND_SOC_TPLG_DAPM_SIGGEN 19 60 #define SND_SOC_TPLG_DAPM_SRC 20 61 #define SND_SOC_TPLG_DAPM_ASRC 21 62 #define SND_SOC_TPLG_DAPM_ENCODER 22 63 #define SND_SOC_TPLG_DAPM_DECODER 23 64 #define SND_SOC_TPLG_DAPM_LAST SND_SOC_TPLG_DAPM_DECODER 65 #define SND_SOC_TPLG_MAGIC 0x41536F43 66 #define SND_SOC_TPLG_NUM_TEXTS 16 67 #define SND_SOC_TPLG_ABI_VERSION 0x5 68 #define SND_SOC_TPLG_ABI_VERSION_MIN 0x4 69 #define SND_SOC_TPLG_TLV_SIZE 32 70 #define SND_SOC_TPLG_TYPE_MIXER 1 71 #define SND_SOC_TPLG_TYPE_BYTES 2 72 #define SND_SOC_TPLG_TYPE_ENUM 3 73 #define SND_SOC_TPLG_TYPE_DAPM_GRAPH 4 74 #define SND_SOC_TPLG_TYPE_DAPM_WIDGET 5 75 #define SND_SOC_TPLG_TYPE_DAI_LINK 6 76 #define SND_SOC_TPLG_TYPE_PCM 7 77 #define SND_SOC_TPLG_TYPE_MANIFEST 8 78 #define SND_SOC_TPLG_TYPE_CODEC_LINK 9 79 #define SND_SOC_TPLG_TYPE_BACKEND_LINK 10 80 #define SND_SOC_TPLG_TYPE_PDATA 11 81 #define SND_SOC_TPLG_TYPE_DAI 12 82 #define SND_SOC_TPLG_TYPE_MAX SND_SOC_TPLG_TYPE_DAI 83 #define SND_SOC_TPLG_TYPE_VENDOR_FW 1000 84 #define SND_SOC_TPLG_TYPE_VENDOR_CONFIG 1001 85 #define SND_SOC_TPLG_TYPE_VENDOR_COEFF 1002 86 #define SND_SOC_TPLG_TYPEVENDOR_CODEC 1003 87 #define SND_SOC_TPLG_STREAM_PLAYBACK 0 88 #define SND_SOC_TPLG_STREAM_CAPTURE 1 89 #define SND_SOC_TPLG_TUPLE_TYPE_UUID 0 90 #define SND_SOC_TPLG_TUPLE_TYPE_STRING 1 91 #define SND_SOC_TPLG_TUPLE_TYPE_BOOL 2 92 #define SND_SOC_TPLG_TUPLE_TYPE_BYTE 3 93 #define SND_SOC_TPLG_TUPLE_TYPE_WORD 4 94 #define SND_SOC_TPLG_TUPLE_TYPE_SHORT 5 95 #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_RATES (1 << 0) 96 #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS (1 << 1) 97 #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2) 98 #define SND_SOC_TPLG_DAI_CLK_GATE_UNDEFINED 0 99 #define SND_SOC_TPLG_DAI_CLK_GATE_GATED 1 100 #define SND_SOC_TPLG_DAI_CLK_GATE_CONT 2 101 #define SND_SOC_TPLG_MCLK_CO 0 102 #define SND_SOC_TPLG_MCLK_CI 1 103 #define SND_SOC_DAI_FORMAT_I2S 1 104 #define SND_SOC_DAI_FORMAT_RIGHT_J 2 105 #define SND_SOC_DAI_FORMAT_LEFT_J 3 106 #define SND_SOC_DAI_FORMAT_DSP_A 4 107 #define SND_SOC_DAI_FORMAT_DSP_B 5 108 #define SND_SOC_DAI_FORMAT_AC97 6 109 #define SND_SOC_DAI_FORMAT_PDM 7 110 #define SND_SOC_DAI_FORMAT_MSB SND_SOC_DAI_FORMAT_LEFT_J 111 #define SND_SOC_DAI_FORMAT_LSB SND_SOC_DAI_FORMAT_RIGHT_J 112 #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_RATES (1 << 0) 113 #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_CHANNELS (1 << 1) 114 #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2) 115 #define SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP (1 << 3) 116 #define SND_SOC_TPLG_BCLK_CP 0 117 #define SND_SOC_TPLG_BCLK_CC 1 118 #define SND_SOC_TPLG_BCLK_CM SND_SOC_TPLG_BCLK_CP 119 #define SND_SOC_TPLG_BCLK_CS SND_SOC_TPLG_BCLK_CC 120 #define SND_SOC_TPLG_FSYNC_CP 0 121 #define SND_SOC_TPLG_FSYNC_CC 1 122 #define SND_SOC_TPLG_FSYNC_CM SND_SOC_TPLG_FSYNC_CP 123 #define SND_SOC_TPLG_FSYNC_CS SND_SOC_TPLG_FSYNC_CC 124 struct snd_soc_tplg_hdr { 125 __le32 magic; 126 __le32 abi; 127 __le32 version; 128 __le32 type; 129 __le32 size; 130 __le32 vendor_type; 131 __le32 payload_size; 132 __le32 index; 133 __le32 count; 134 } __attribute__((packed)); 135 struct snd_soc_tplg_vendor_uuid_elem { 136 __le32 token; 137 char uuid[16]; 138 } __attribute__((packed)); 139 struct snd_soc_tplg_vendor_value_elem { 140 __le32 token; 141 __le32 value; 142 } __attribute__((packed)); 143 struct snd_soc_tplg_vendor_string_elem { 144 __le32 token; 145 char string[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 146 } __attribute__((packed)); 147 struct snd_soc_tplg_vendor_array { 148 __le32 size; 149 __le32 type; 150 __le32 num_elems; 151 union { 152 struct snd_soc_tplg_vendor_uuid_elem uuid[0]; 153 struct snd_soc_tplg_vendor_value_elem value[0]; 154 struct snd_soc_tplg_vendor_string_elem string[0]; 155 }; 156 } __attribute__((packed)); 157 struct snd_soc_tplg_private { 158 __le32 size; 159 union { 160 __DECLARE_FLEX_ARRAY(char, data); 161 __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_array, array); 162 }; 163 } __attribute__((packed)); 164 struct snd_soc_tplg_tlv_dbscale { 165 __le32 min; 166 __le32 step; 167 __le32 mute; 168 } __attribute__((packed)); 169 struct snd_soc_tplg_ctl_tlv { 170 __le32 size; 171 __le32 type; 172 union { 173 __le32 data[SND_SOC_TPLG_TLV_SIZE]; 174 struct snd_soc_tplg_tlv_dbscale scale; 175 }; 176 } __attribute__((packed)); 177 struct snd_soc_tplg_channel { 178 __le32 size; 179 __le32 reg; 180 __le32 shift; 181 __le32 id; 182 } __attribute__((packed)); 183 struct snd_soc_tplg_io_ops { 184 __le32 get; 185 __le32 put; 186 __le32 info; 187 } __attribute__((packed)); 188 struct snd_soc_tplg_ctl_hdr { 189 __le32 size; 190 __le32 type; 191 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 192 __le32 access; 193 struct snd_soc_tplg_io_ops ops; 194 struct snd_soc_tplg_ctl_tlv tlv; 195 } __attribute__((packed)); 196 struct snd_soc_tplg_stream_caps { 197 __le32 size; 198 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 199 __le64 formats; 200 __le32 rates; 201 __le32 rate_min; 202 __le32 rate_max; 203 __le32 channels_min; 204 __le32 channels_max; 205 __le32 periods_min; 206 __le32 periods_max; 207 __le32 period_size_min; 208 __le32 period_size_max; 209 __le32 buffer_size_min; 210 __le32 buffer_size_max; 211 __le32 sig_bits; 212 } __attribute__((packed)); 213 struct snd_soc_tplg_stream { 214 __le32 size; 215 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 216 __le64 format; 217 __le32 rate; 218 __le32 period_bytes; 219 __le32 buffer_bytes; 220 __le32 channels; 221 } __attribute__((packed)); 222 struct snd_soc_tplg_hw_config { 223 __le32 size; 224 __le32 id; 225 __le32 fmt; 226 __u8 clock_gated; 227 __u8 invert_bclk; 228 __u8 invert_fsync; 229 __u8 bclk_provider; 230 __u8 fsync_provider; 231 __u8 mclk_direction; 232 __le16 reserved; 233 __le32 mclk_rate; 234 __le32 bclk_rate; 235 __le32 fsync_rate; 236 __le32 tdm_slots; 237 __le32 tdm_slot_width; 238 __le32 tx_slots; 239 __le32 rx_slots; 240 __le32 tx_channels; 241 __le32 tx_chanmap[SND_SOC_TPLG_MAX_CHAN]; 242 __le32 rx_channels; 243 __le32 rx_chanmap[SND_SOC_TPLG_MAX_CHAN]; 244 } __attribute__((packed)); 245 struct snd_soc_tplg_manifest { 246 __le32 size; 247 __le32 control_elems; 248 __le32 widget_elems; 249 __le32 graph_elems; 250 __le32 pcm_elems; 251 __le32 dai_link_elems; 252 __le32 dai_elems; 253 __le32 reserved[20]; 254 struct snd_soc_tplg_private priv; 255 } __attribute__((packed)); 256 struct snd_soc_tplg_mixer_control { 257 struct snd_soc_tplg_ctl_hdr hdr; 258 __le32 size; 259 __le32 min; 260 __le32 max; 261 __le32 platform_max; 262 __le32 invert; 263 __le32 num_channels; 264 struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN]; 265 struct snd_soc_tplg_private priv; 266 } __attribute__((packed)); 267 struct snd_soc_tplg_enum_control { 268 struct snd_soc_tplg_ctl_hdr hdr; 269 __le32 size; 270 __le32 num_channels; 271 struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN]; 272 __le32 items; 273 __le32 mask; 274 __le32 count; 275 char texts[SND_SOC_TPLG_NUM_TEXTS][SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 276 __le32 values[SND_SOC_TPLG_NUM_TEXTS * SNDRV_CTL_ELEM_ID_NAME_MAXLEN / 4]; 277 struct snd_soc_tplg_private priv; 278 } __attribute__((packed)); 279 struct snd_soc_tplg_bytes_control { 280 struct snd_soc_tplg_ctl_hdr hdr; 281 __le32 size; 282 __le32 max; 283 __le32 mask; 284 __le32 base; 285 __le32 num_regs; 286 struct snd_soc_tplg_io_ops ext_ops; 287 struct snd_soc_tplg_private priv; 288 } __attribute__((packed)); 289 struct snd_soc_tplg_dapm_graph_elem { 290 char sink[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 291 char control[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 292 char source[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 293 } __attribute__((packed)); 294 struct snd_soc_tplg_dapm_widget { 295 __le32 size; 296 __le32 id; 297 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 298 char sname[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 299 __le32 reg; 300 __le32 shift; 301 __le32 mask; 302 __le32 subseq; 303 __le32 invert; 304 __le32 ignore_suspend; 305 __le16 event_flags; 306 __le16 event_type; 307 __le32 num_kcontrols; 308 struct snd_soc_tplg_private priv; 309 } __attribute__((packed)); 310 struct snd_soc_tplg_pcm { 311 __le32 size; 312 char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 313 char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 314 __le32 pcm_id; 315 __le32 dai_id; 316 __le32 playback; 317 __le32 capture; 318 __le32 compress; 319 struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; 320 __le32 num_streams; 321 struct snd_soc_tplg_stream_caps caps[2]; 322 __le32 flag_mask; 323 __le32 flags; 324 struct snd_soc_tplg_private priv; 325 } __attribute__((packed)); 326 struct snd_soc_tplg_link_config { 327 __le32 size; 328 __le32 id; 329 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 330 char stream_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 331 struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; 332 __le32 num_streams; 333 struct snd_soc_tplg_hw_config hw_config[SND_SOC_TPLG_HW_CONFIG_MAX]; 334 __le32 num_hw_configs; 335 __le32 default_hw_config_id; 336 __le32 flag_mask; 337 __le32 flags; 338 struct snd_soc_tplg_private priv; 339 } __attribute__((packed)); 340 struct snd_soc_tplg_dai { 341 __le32 size; 342 char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 343 __le32 dai_id; 344 __le32 playback; 345 __le32 capture; 346 struct snd_soc_tplg_stream_caps caps[2]; 347 __le32 flag_mask; 348 __le32 flags; 349 struct snd_soc_tplg_private priv; 350 } __attribute__((packed)); 351 struct snd_soc_tplg_manifest_v4 { 352 __le32 size; 353 __le32 control_elems; 354 __le32 widget_elems; 355 __le32 graph_elems; 356 __le32 pcm_elems; 357 __le32 dai_link_elems; 358 struct snd_soc_tplg_private priv; 359 } __attribute__((__packed__)); 360 struct snd_soc_tplg_stream_caps_v4 { 361 __le32 size; 362 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 363 __le64 formats; 364 __le32 rates; 365 __le32 rate_min; 366 __le32 rate_max; 367 __le32 channels_min; 368 __le32 channels_max; 369 __le32 periods_min; 370 __le32 periods_max; 371 __le32 period_size_min; 372 __le32 period_size_max; 373 __le32 buffer_size_min; 374 __le32 buffer_size_max; 375 } __attribute__((__packed__)); 376 struct snd_soc_tplg_pcm_v4 { 377 __le32 size; 378 char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 379 char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 380 __le32 pcm_id; 381 __le32 dai_id; 382 __le32 playback; 383 __le32 capture; 384 __le32 compress; 385 struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; 386 __le32 num_streams; 387 struct snd_soc_tplg_stream_caps_v4 caps[2]; 388 } __attribute__((__packed__)); 389 struct snd_soc_tplg_link_config_v4 { 390 __le32 size; 391 __le32 id; 392 struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; 393 __le32 num_streams; 394 } __attribute__((__packed__)); 395 #endif 396