| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
#ifndef __LINUX_UAPI_SND_ASOC_H |
| 16 |
#define __LINUX_UAPI_SND_ASOC_H |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#define SND_SOC_TPLG_MAX_CHAN 8 |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
#define SND_SOC_TPLG_MAX_FORMATS 16 |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
#define SND_SOC_TPLG_STREAM_CONFIG_MAX 8 |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
#define SND_SOC_TPLG_HW_CONFIG_MAX 8 |
| 37 |
|
| 38 |
|
| 39 |
#define SND_SOC_TPLG_CTL_VOLSW 1 |
| 40 |
#define SND_SOC_TPLG_CTL_VOLSW_SX 2 |
| 41 |
#define SND_SOC_TPLG_CTL_VOLSW_XR_SX 3 |
| 42 |
#define SND_SOC_TPLG_CTL_ENUM 4 |
| 43 |
#define SND_SOC_TPLG_CTL_BYTES 5 |
| 44 |
#define SND_SOC_TPLG_CTL_ENUM_VALUE 6 |
| 45 |
#define SND_SOC_TPLG_CTL_RANGE 7 |
| 46 |
#define SND_SOC_TPLG_CTL_STROBE 8 |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
#define SND_SOC_TPLG_DAPM_CTL_VOLSW 64 |
| 51 |
#define SND_SOC_TPLG_DAPM_CTL_ENUM_DOUBLE 65 |
| 52 |
#define SND_SOC_TPLG_DAPM_CTL_ENUM_VIRT 66 |
| 53 |
#define SND_SOC_TPLG_DAPM_CTL_ENUM_VALUE 67 |
| 54 |
#define SND_SOC_TPLG_DAPM_CTL_PIN 68 |
| 55 |
|
| 56 |
|
| 57 |
#define SND_SOC_TPLG_DAPM_INPUT 0 |
| 58 |
#define SND_SOC_TPLG_DAPM_OUTPUT 1 |
| 59 |
#define SND_SOC_TPLG_DAPM_MUX 2 |
| 60 |
#define SND_SOC_TPLG_DAPM_MIXER 3 |
| 61 |
#define SND_SOC_TPLG_DAPM_PGA 4 |
| 62 |
#define SND_SOC_TPLG_DAPM_OUT_DRV 5 |
| 63 |
#define SND_SOC_TPLG_DAPM_ADC 6 |
| 64 |
#define SND_SOC_TPLG_DAPM_DAC 7 |
| 65 |
#define SND_SOC_TPLG_DAPM_SWITCH 8 |
| 66 |
#define SND_SOC_TPLG_DAPM_PRE 9 |
| 67 |
#define SND_SOC_TPLG_DAPM_POST 10 |
| 68 |
#define SND_SOC_TPLG_DAPM_AIF_IN 11 |
| 69 |
#define SND_SOC_TPLG_DAPM_AIF_OUT 12 |
| 70 |
#define SND_SOC_TPLG_DAPM_DAI_IN 13 |
| 71 |
#define SND_SOC_TPLG_DAPM_DAI_OUT 14 |
| 72 |
#define SND_SOC_TPLG_DAPM_DAI_LINK 15 |
| 73 |
#define SND_SOC_TPLG_DAPM_LAST SND_SOC_TPLG_DAPM_DAI_LINK |
| 74 |
|
| 75 |
|
| 76 |
#define SND_SOC_TPLG_MAGIC 0x41536F43 |
| 77 |
|
| 78 |
|
| 79 |
#define SND_SOC_TPLG_NUM_TEXTS 16 |
| 80 |
|
| 81 |
|
| 82 |
#define SND_SOC_TPLG_ABI_VERSION 0x5 |
| 83 |
#define SND_SOC_TPLG_ABI_VERSION_MIN 0x4 |
| 84 |
|
| 85 |
|
| 86 |
#define SND_SOC_TPLG_TLV_SIZE 32 |
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
#define SND_SOC_TPLG_TYPE_MIXER 1 |
| 95 |
#define SND_SOC_TPLG_TYPE_BYTES 2 |
| 96 |
#define SND_SOC_TPLG_TYPE_ENUM 3 |
| 97 |
#define SND_SOC_TPLG_TYPE_DAPM_GRAPH 4 |
| 98 |
#define SND_SOC_TPLG_TYPE_DAPM_WIDGET 5 |
| 99 |
#define SND_SOC_TPLG_TYPE_DAI_LINK 6 |
| 100 |
#define SND_SOC_TPLG_TYPE_PCM 7 |
| 101 |
#define SND_SOC_TPLG_TYPE_MANIFEST 8 |
| 102 |
#define SND_SOC_TPLG_TYPE_CODEC_LINK 9 |
| 103 |
#define SND_SOC_TPLG_TYPE_BACKEND_LINK 10 |
| 104 |
#define SND_SOC_TPLG_TYPE_PDATA 11 |
| 105 |
#define SND_SOC_TPLG_TYPE_DAI 12 |
| 106 |
#define SND_SOC_TPLG_TYPE_MAX SND_SOC_TPLG_TYPE_DAI |
| 107 |
|
| 108 |
|
| 109 |
#define SND_SOC_TPLG_TYPE_VENDOR_FW 1000 |
| 110 |
#define SND_SOC_TPLG_TYPE_VENDOR_CONFIG 1001 |
| 111 |
#define SND_SOC_TPLG_TYPE_VENDOR_COEFF 1002 |
| 112 |
#define SND_SOC_TPLG_TYPEVENDOR_CODEC 1003 |
| 113 |
|
| 114 |
#define SND_SOC_TPLG_STREAM_PLAYBACK 0 |
| 115 |
#define SND_SOC_TPLG_STREAM_CAPTURE 1 |
| 116 |
|
| 117 |
|
| 118 |
#define SND_SOC_TPLG_TUPLE_TYPE_UUID 0 |
| 119 |
#define SND_SOC_TPLG_TUPLE_TYPE_STRING 1 |
| 120 |
#define SND_SOC_TPLG_TUPLE_TYPE_BOOL 2 |
| 121 |
#define SND_SOC_TPLG_TUPLE_TYPE_BYTE 3 |
| 122 |
#define SND_SOC_TPLG_TUPLE_TYPE_WORD 4 |
| 123 |
#define SND_SOC_TPLG_TUPLE_TYPE_SHORT 5 |
| 124 |
|
| 125 |
|
| 126 |
#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_RATES (1 << 0) |
| 127 |
#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS (1 << 1) |
| 128 |
#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2) |
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
#define SND_SOC_DAI_FORMAT_I2S 1 |
| 134 |
#define SND_SOC_DAI_FORMAT_RIGHT_J 2 |
| 135 |
#define SND_SOC_DAI_FORMAT_LEFT_J 3 |
| 136 |
#define SND_SOC_DAI_FORMAT_DSP_A 4 |
| 137 |
#define SND_SOC_DAI_FORMAT_DSP_B 5 |
| 138 |
#define SND_SOC_DAI_FORMAT_AC97 6 |
| 139 |
#define SND_SOC_DAI_FORMAT_PDM 7 |
| 140 |
|
| 141 |
|
| 142 |
#define SND_SOC_DAI_FORMAT_MSB SND_SOC_DAI_FORMAT_LEFT_J |
| 143 |
#define SND_SOC_DAI_FORMAT_LSB SND_SOC_DAI_FORMAT_RIGHT_J |
| 144 |
|
| 145 |
|
| 146 |
#define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_RATES (1 << 0) |
| 147 |
#define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_CHANNELS (1 << 1) |
| 148 |
#define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2) |
| 149 |
#define SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP (1 << 3) |
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
struct snd_soc_tplg_hdr { |
| 156 |
__le32 magic; |
| 157 |
__le32 abi; |
| 158 |
__le32 version; |
| 159 |
__le32 type; |
| 160 |
__le32 size; |
| 161 |
__le32 vendor_type; |
| 162 |
__le32 payload_size; |
| 163 |
__le32 index; |
| 164 |
__le32 count; |
| 165 |
} __attribute__((packed)); |
| 166 |
|
| 167 |
|
| 168 |
struct snd_soc_tplg_vendor_uuid_elem { |
| 169 |
__le32 token; |
| 170 |
char uuid[16]; |
| 171 |
} __attribute__((packed)); |
| 172 |
|
| 173 |
|
| 174 |
struct snd_soc_tplg_vendor_value_elem { |
| 175 |
__le32 token; |
| 176 |
__le32 value; |
| 177 |
} __attribute__((packed)); |
| 178 |
|
| 179 |
|
| 180 |
struct snd_soc_tplg_vendor_string_elem { |
| 181 |
__le32 token; |
| 182 |
char string[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; |
| 183 |
} __attribute__((packed)); |
| 184 |
|
| 185 |
struct snd_soc_tplg_vendor_array { |
| 186 |
__le32 size; |
| 187 |
__le32 type; |
| 188 |
__le32 num_elems; |
| 189 |
union { |
| 190 |
struct snd_soc_tplg_vendor_uuid_elem uuid[0]; |
| 191 |
struct snd_soc_tplg_vendor_value_elem value[0]; |
| 192 |
struct snd_soc_tplg_vendor_string_elem string[0]; |
| 193 |
}; |
| 194 |
} __attribute__((packed)); |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
struct snd_soc_tplg_private { |
| 202 |
__le32 size; |
| 203 |
union { |
| 204 |
char data[0]; |
| 205 |
struct snd_soc_tplg_vendor_array array[0]; |
| 206 |
}; |
| 207 |
} __attribute__((packed)); |
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
struct snd_soc_tplg_tlv_dbscale { |
| 213 |
__le32 min; |
| 214 |
__le32 step; |
| 215 |
__le32 mute; |
| 216 |
} __attribute__((packed)); |
| 217 |
|
| 218 |
struct snd_soc_tplg_ctl_tlv { |
| 219 |
__le32 size; |
| 220 |
__le32 type; |
| 221 |
union { |
| 222 |
__le32 data[SND_SOC_TPLG_TLV_SIZE]; |
| 223 |
struct snd_soc_tplg_tlv_dbscale scale; |
| 224 |
}; |
| 225 |
} __attribute__((packed)); |
| 226 |
|
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
struct snd_soc_tplg_channel { |
| 231 |
__le32 size; |
| 232 |
__le32 reg; |
| 233 |
__le32 shift; |
| 234 |
__le32 id; |
| 235 |
} __attribute__((packed)); |
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
struct snd_soc_tplg_io_ops { |
| 243 |
__le32 get; |
| 244 |
__le32 put; |
| 245 |
__le32 info; |
| 246 |
} __attribute__((packed)); |
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
struct snd_soc_tplg_ctl_hdr { |
| 252 |
__le32 size; |
| 253 |
__le32 type; |
| 254 |
char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; |
| 255 |
__le32 access; |
| 256 |
struct snd_soc_tplg_io_ops ops; |
| 257 |
struct snd_soc_tplg_ctl_tlv tlv; |
| 258 |
} __attribute__((packed)); |
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
struct snd_soc_tplg_stream_caps { |
| 264 |
__le32 size; |
| 265 |
char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; |
| 266 |
__le64 formats; |
| 267 |
__le32 rates; |
| 268 |
__le32 rate_min; |
| 269 |
__le32 rate_max; |
| 270 |
__le32 channels_min; |
| 271 |
__le32 channels_max; |
| 272 |
__le32 periods_min; |
| 273 |
__le32 periods_max; |
| 274 |
__le32 period_size_min; |
| 275 |
__le32 period_size_max; |
| 276 |
__le32 buffer_size_min; |
| 277 |
__le32 buffer_size_max; |
| 278 |
__le32 sig_bits; |
| 279 |
} __attribute__((packed)); |
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
struct snd_soc_tplg_stream { |
| 285 |
__le32 size; |
| 286 |
char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; |
| 287 |
__le64 format; |
| 288 |
__le32 rate; |
| 289 |
__le32 period_bytes; |
| 290 |
__le32 buffer_bytes; |
| 291 |
__le32 channels; |
| 292 |
} __attribute__((packed)); |
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
struct snd_soc_tplg_hw_config { |
| 300 |
__le32 size; |
| 301 |
__le32 id; |
| 302 |
__le32 fmt; |
| 303 |
__u8 clock_gated; |
| 304 |
__u8 invert_bclk; |
| 305 |
__u8 invert_fsync; |
| 306 |
__u8 bclk_master; |
| 307 |
__u8 fsync_master; |
| 308 |
__u8 mclk_direction; |
| 309 |
__le16 reserved; |
| 310 |
__le32 mclk_rate; |
| 311 |
__le32 bclk_rate; |
| 312 |
__le32 fsync_rate; |
| 313 |
__le32 tdm_slots; |
| 314 |
__le32 tdm_slot_width; |
| 315 |
__le32 tx_slots; |
| 316 |
__le32 rx_slots; |
| 317 |
__le32 tx_channels; |
| 318 |
__le32 tx_chanmap[SND_SOC_TPLG_MAX_CHAN]; |
| 319 |
__le32 rx_channels; |
| 320 |
__le32 rx_chanmap[SND_SOC_TPLG_MAX_CHAN]; |
| 321 |
} __attribute__((packed)); |
| 322 |
|
| 323 |
|
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
struct snd_soc_tplg_manifest { |
| 336 |
__le32 size; |
| 337 |
__le32 control_elems; |
| 338 |
__le32 widget_elems; |
| 339 |
__le32 graph_elems; |
| 340 |
__le32 pcm_elems; |
| 341 |
__le32 dai_link_elems; |
| 342 |
__le32 dai_elems; |
| 343 |
__le32 reserved[20]; |
| 344 |
struct snd_soc_tplg_private priv; |
| 345 |
} __attribute__((packed)); |
| 346 |
|
| 347 |
|
| 348 |
|
| 349 |
|
| 350 |
|
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
struct snd_soc_tplg_mixer_control { |
| 358 |
struct snd_soc_tplg_ctl_hdr hdr; |
| 359 |
__le32 size; |
| 360 |
__le32 min; |
| 361 |
__le32 max; |
| 362 |
__le32 platform_max; |
| 363 |
__le32 invert; |
| 364 |
__le32 num_channels; |
| 365 |
struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN]; |
| 366 |
struct snd_soc_tplg_private priv; |
| 367 |
} __attribute__((packed)); |
| 368 |
|
| 369 |
|
| 370 |
|
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
|
| 378 |
|
| 379 |
struct snd_soc_tplg_enum_control { |
| 380 |
struct snd_soc_tplg_ctl_hdr hdr; |
| 381 |
__le32 size; |
| 382 |
__le32 num_channels; |
| 383 |
struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN]; |
| 384 |
__le32 items; |
| 385 |
__le32 mask; |
| 386 |
__le32 count; |
| 387 |
char texts[SND_SOC_TPLG_NUM_TEXTS][SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; |
| 388 |
__le32 values[SND_SOC_TPLG_NUM_TEXTS * SNDRV_CTL_ELEM_ID_NAME_MAXLEN / 4]; |
| 389 |
struct snd_soc_tplg_private priv; |
| 390 |
} __attribute__((packed)); |
| 391 |
|
| 392 |
|
| 393 |
|
| 394 |
|
| 395 |
|
| 396 |
|
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
struct snd_soc_tplg_bytes_control { |
| 403 |
struct snd_soc_tplg_ctl_hdr hdr; |
| 404 |
__le32 size; |
| 405 |
__le32 max; |
| 406 |
__le32 mask; |
| 407 |
__le32 base; |
| 408 |
__le32 num_regs; |
| 409 |
struct snd_soc_tplg_io_ops ext_ops; |
| 410 |
struct snd_soc_tplg_private priv; |
| 411 |
} __attribute__((packed)); |
| 412 |
|
| 413 |
|
| 414 |
|
| 415 |
|
| 416 |
|
| 417 |
|
| 418 |
|
| 419 |
|
| 420 |
|
| 421 |
|
| 422 |
|
| 423 |
struct snd_soc_tplg_dapm_graph_elem { |
| 424 |
char sink[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; |
| 425 |
char control[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; |
| 426 |
char source[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; |
| 427 |
} __attribute__((packed)); |
| 428 |
|
| 429 |
|
| 430 |
|
| 431 |
|
| 432 |
|
| 433 |
|
| 434 |
|
| 435 |
|
| 436 |
|
| 437 |
|
| 438 |
|
| 439 |
|
| 440 |
|
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
|
| 445 |
struct snd_soc_tplg_dapm_widget { |
| 446 |
__le32 size; |
| 447 |
__le32 id; |
| 448 |
char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; |
| 449 |
char sname[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; |
| 450 |
|
| 451 |
__le32 reg; |
| 452 |
__le32 shift; |
| 453 |
__le32 mask; |
| 454 |
__le32 subseq; |
| 455 |
__le32 invert; |
| 456 |
__le32 ignore_suspend; |
| 457 |
__le16 event_flags; |
| 458 |
__le16 event_type; |
| 459 |
__le32 num_kcontrols; |
| 460 |
struct snd_soc_tplg_private priv; |
| 461 |
|
| 462 |
|
| 463 |
|
| 464 |
|
| 465 |
} __attribute__((packed)); |
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
|
| 471 |
|
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
|
| 476 |
|
| 477 |
|
| 478 |
struct snd_soc_tplg_pcm { |
| 479 |
__le32 size; |
| 480 |
char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; |
| 481 |
char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; |
| 482 |
__le32 pcm_id; |
| 483 |
__le32 dai_id; |
| 484 |
__le32 playback; |
| 485 |
__le32 capture; |
| 486 |
__le32 compress; |
| 487 |
struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; |
| 488 |
__le32 num_streams; |
| 489 |
struct snd_soc_tplg_stream_caps caps[2]; |
| 490 |
__le32 flag_mask; |
| 491 |
__le32 flags; |
| 492 |
struct snd_soc_tplg_private priv; |
| 493 |
} __attribute__((packed)); |
| 494 |
|
| 495 |
|
| 496 |
|
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
|
| 501 |
|
| 502 |
|
| 503 |
|
| 504 |
|
| 505 |
|
| 506 |
struct snd_soc_tplg_link_config { |
| 507 |
__le32 size; |
| 508 |
__le32 id; |
| 509 |
char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; |
| 510 |
char stream_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; |
| 511 |
struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; |
| 512 |
__le32 num_streams; |
| 513 |
struct snd_soc_tplg_hw_config hw_config[SND_SOC_TPLG_HW_CONFIG_MAX]; |
| 514 |
__le32 num_hw_configs; |
| 515 |
__le32 default_hw_config_id; |
| 516 |
__le32 flag_mask; |
| 517 |
__le32 flags; |
| 518 |
struct snd_soc_tplg_private priv; |
| 519 |
} __attribute__((packed)); |
| 520 |
|
| 521 |
|
| 522 |
|
| 523 |
|
| 524 |
|
| 525 |
|
| 526 |
|
| 527 |
|
| 528 |
|
| 529 |
|
| 530 |
|
| 531 |
|
| 532 |
struct snd_soc_tplg_dai { |
| 533 |
__le32 size; |
| 534 |
char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; |
| 535 |
__le32 dai_id; |
| 536 |
__le32 playback; |
| 537 |
__le32 capture; |
| 538 |
struct snd_soc_tplg_stream_caps caps[2]; |
| 539 |
__le32 flag_mask; |
| 540 |
__le32 flags; |
| 541 |
struct snd_soc_tplg_private priv; |
| 542 |
} __attribute__((packed)); |
| 543 |
#endif |