| 1 |
|
| 2 | |
| 3 | * uapi/sound/asoc.h -- ALSA SoC Firmware Controls and DAPM
|
| 4 | *
|
| 5 | * Copyright (C) 2012 Texas Instruments Inc.
|
| 6 | * Copyright (C) 2015 Intel Corporation.
|
| 7 | *
|
| 8 | * Simple file API to load FW that includes mixers, coefficients, DAPM graphs,
|
| 9 | * algorithms, equalisers, DAIs, widgets etc.
|
| 10 |
|
| 11 |
|
| 12 | #ifndef __LINUX_UAPI_SND_ASOC_H
|
| 13 | #define __LINUX_UAPI_SND_ASOC_H
|
| 14 |
|
| 15 | #include <linux/types.h>
|
| 16 | #include <sound/asound.h>
|
| 17 |
|
| 18 | |
| 19 | * Maximum number of channels topology kcontrol can represent.
|
| 20 |
|
| 21 | #define SND_SOC_TPLG_MAX_CHAN 8
|
| 22 |
|
| 23 | |
| 24 | * Maximum number of PCM formats capability
|
| 25 |
|
| 26 | #define SND_SOC_TPLG_MAX_FORMATS 16
|
| 27 |
|
| 28 | |
| 29 | * Maximum number of PCM stream configs
|
| 30 |
|
| 31 | #define SND_SOC_TPLG_STREAM_CONFIG_MAX 8
|
| 32 |
|
| 33 | |
| 34 | * Maximum number of physical link's hardware configs
|
| 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_BUFFER 16
|
| 74 | #define SND_SOC_TPLG_DAPM_SCHEDULER 17
|
| 75 | #define SND_SOC_TPLG_DAPM_EFFECT 18
|
| 76 | #define SND_SOC_TPLG_DAPM_SIGGEN 19
|
| 77 | #define SND_SOC_TPLG_DAPM_SRC 20
|
| 78 | #define SND_SOC_TPLG_DAPM_ASRC 21
|
| 79 | #define SND_SOC_TPLG_DAPM_ENCODER 22
|
| 80 | #define SND_SOC_TPLG_DAPM_DECODER 23
|
| 81 | #define SND_SOC_TPLG_DAPM_LAST SND_SOC_TPLG_DAPM_DECODER
|
| 82 |
|
| 83 |
|
| 84 | #define SND_SOC_TPLG_MAGIC 0x41536F43
|
| 85 |
|
| 86 |
|
| 87 | #define SND_SOC_TPLG_NUM_TEXTS 16
|
| 88 |
|
| 89 |
|
| 90 | #define SND_SOC_TPLG_ABI_VERSION 0x5
|
| 91 | #define SND_SOC_TPLG_ABI_VERSION_MIN 0x5
|
| 92 |
|
| 93 |
|
| 94 | #define SND_SOC_TPLG_TLV_SIZE 32
|
| 95 |
|
| 96 | |
| 97 | * File and Block header data types.
|
| 98 | * Add new generic and vendor types to end of list.
|
| 99 | * Generic types are handled by the core whilst vendors types are passed
|
| 100 | * to the component drivers for handling.
|
| 101 |
|
| 102 | #define SND_SOC_TPLG_TYPE_MIXER 1
|
| 103 | #define SND_SOC_TPLG_TYPE_BYTES 2
|
| 104 | #define SND_SOC_TPLG_TYPE_ENUM 3
|
| 105 | #define SND_SOC_TPLG_TYPE_DAPM_GRAPH 4
|
| 106 | #define SND_SOC_TPLG_TYPE_DAPM_WIDGET 5
|
| 107 | #define SND_SOC_TPLG_TYPE_DAI_LINK 6
|
| 108 | #define SND_SOC_TPLG_TYPE_PCM 7
|
| 109 | #define SND_SOC_TPLG_TYPE_MANIFEST 8
|
| 110 | #define SND_SOC_TPLG_TYPE_CODEC_LINK 9
|
| 111 | #define SND_SOC_TPLG_TYPE_BACKEND_LINK 10
|
| 112 | #define SND_SOC_TPLG_TYPE_PDATA 11
|
| 113 | #define SND_SOC_TPLG_TYPE_DAI 12
|
| 114 | #define SND_SOC_TPLG_TYPE_MAX SND_SOC_TPLG_TYPE_DAI
|
| 115 |
|
| 116 |
|
| 117 | #define SND_SOC_TPLG_TYPE_VENDOR_FW 1000
|
| 118 | #define SND_SOC_TPLG_TYPE_VENDOR_CONFIG 1001
|
| 119 | #define SND_SOC_TPLG_TYPE_VENDOR_COEFF 1002
|
| 120 | #define SND_SOC_TPLG_TYPEVENDOR_CODEC 1003
|
| 121 |
|
| 122 | #define SND_SOC_TPLG_STREAM_PLAYBACK 0
|
| 123 | #define SND_SOC_TPLG_STREAM_CAPTURE 1
|
| 124 |
|
| 125 |
|
| 126 | #define SND_SOC_TPLG_TUPLE_TYPE_UUID 0
|
| 127 | #define SND_SOC_TPLG_TUPLE_TYPE_STRING 1
|
| 128 | #define SND_SOC_TPLG_TUPLE_TYPE_BOOL 2
|
| 129 | #define SND_SOC_TPLG_TUPLE_TYPE_BYTE 3
|
| 130 | #define SND_SOC_TPLG_TUPLE_TYPE_WORD 4
|
| 131 | #define SND_SOC_TPLG_TUPLE_TYPE_SHORT 5
|
| 132 |
|
| 133 |
|
| 134 | #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_RATES (1 << 0)
|
| 135 | #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
|
| 136 | #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)
|
| 137 |
|
| 138 |
|
| 139 | #define SND_SOC_TPLG_DAI_CLK_GATE_UNDEFINED 0
|
| 140 | #define SND_SOC_TPLG_DAI_CLK_GATE_GATED 1
|
| 141 | #define SND_SOC_TPLG_DAI_CLK_GATE_CONT 2
|
| 142 |
|
| 143 |
|
| 144 | #define SND_SOC_TPLG_MCLK_CO 0
|
| 145 | #define SND_SOC_TPLG_MCLK_CI 1
|
| 146 |
|
| 147 | |
| 148 | * Add new formats to the end of the list.
|
| 149 |
|
| 150 | #define SND_SOC_DAI_FORMAT_I2S 1
|
| 151 | #define SND_SOC_DAI_FORMAT_RIGHT_J 2
|
| 152 | #define SND_SOC_DAI_FORMAT_LEFT_J 3
|
| 153 | #define SND_SOC_DAI_FORMAT_DSP_A 4
|
| 154 | #define SND_SOC_DAI_FORMAT_DSP_B 5
|
| 155 | #define SND_SOC_DAI_FORMAT_AC97 6
|
| 156 | #define SND_SOC_DAI_FORMAT_PDM 7
|
| 157 |
|
| 158 |
|
| 159 | #define SND_SOC_DAI_FORMAT_MSB SND_SOC_DAI_FORMAT_LEFT_J
|
| 160 | #define SND_SOC_DAI_FORMAT_LSB SND_SOC_DAI_FORMAT_RIGHT_J
|
| 161 |
|
| 162 |
|
| 163 | #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_RATES (1 << 0)
|
| 164 | #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
|
| 165 | #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)
|
| 166 | #define SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP (1 << 3)
|
| 167 |
|
| 168 | |
| 169 | * For the backwards capability, by default codec is bclk provider
|
| 170 |
|
| 171 | #define SND_SOC_TPLG_BCLK_CP 0
|
| 172 | #define SND_SOC_TPLG_BCLK_CC 1
|
| 173 |
|
| 174 | #define SND_SOC_TPLG_BCLK_CM SND_SOC_TPLG_BCLK_CP
|
| 175 | #define SND_SOC_TPLG_BCLK_CS SND_SOC_TPLG_BCLK_CC
|
| 176 |
|
| 177 | |
| 178 | * For the backwards capability, by default codec is fsync provider
|
| 179 |
|
| 180 | #define SND_SOC_TPLG_FSYNC_CP 0
|
| 181 | #define SND_SOC_TPLG_FSYNC_CC 1
|
| 182 |
|
| 183 | #define SND_SOC_TPLG_FSYNC_CM SND_SOC_TPLG_FSYNC_CP
|
| 184 | #define SND_SOC_TPLG_FSYNC_CS SND_SOC_TPLG_FSYNC_CC
|
| 185 |
|
| 186 | |
| 187 | * Block Header.
|
| 188 | * This header precedes all object and object arrays below.
|
| 189 |
|
| 190 | struct snd_soc_tplg_hdr {
|
| 191 | __le32 magic;
|
| 192 | __le32 abi;
|
| 193 | __le32 version;
|
| 194 | __le32 type;
|
| 195 | __le32 size;
|
| 196 | __le32 vendor_type;
|
| 197 | __le32 payload_size;
|
| 198 | __le32 index;
|
| 199 | __le32 count;
|
| 200 | } __attribute__((packed));
|
| 201 |
|
| 202 |
|
| 203 | struct snd_soc_tplg_vendor_uuid_elem {
|
| 204 | __le32 token;
|
| 205 | char uuid[16];
|
| 206 | } __attribute__((packed));
|
| 207 |
|
| 208 |
|
| 209 | struct snd_soc_tplg_vendor_value_elem {
|
| 210 | __le32 token;
|
| 211 | __le32 value;
|
| 212 | } __attribute__((packed));
|
| 213 |
|
| 214 |
|
| 215 | struct snd_soc_tplg_vendor_string_elem {
|
| 216 | __le32 token;
|
| 217 | char string[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
| 218 | } __attribute__((packed));
|
| 219 |
|
| 220 | struct snd_soc_tplg_vendor_array {
|
| 221 | __le32 size;
|
| 222 | __le32 type;
|
| 223 | __le32 num_elems;
|
| 224 | union {
|
| 225 | __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_uuid_elem, uuid);
|
| 226 | __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_value_elem, value);
|
| 227 | __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_string_elem, string);
|
| 228 | };
|
| 229 | } __attribute__((packed));
|
| 230 |
|
| 231 | |
| 232 | * Private data.
|
| 233 | * All topology objects may have private data that can be used by the driver or
|
| 234 | * firmware. Core will ignore this data.
|
| 235 |
|
| 236 | struct snd_soc_tplg_private {
|
| 237 | __le32 size;
|
| 238 | union {
|
| 239 | __DECLARE_FLEX_ARRAY(char, data);
|
| 240 | __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_array, array);
|
| 241 | };
|
| 242 | } __attribute__((packed));
|
| 243 |
|
| 244 | |
| 245 | * Kcontrol TLV data.
|
| 246 |
|
| 247 | struct snd_soc_tplg_tlv_dbscale {
|
| 248 | __le32 min;
|
| 249 | __le32 step;
|
| 250 | __le32 mute;
|
| 251 | } __attribute__((packed));
|
| 252 |
|
| 253 | struct snd_soc_tplg_ctl_tlv {
|
| 254 | __le32 size;
|
| 255 | __le32 type;
|
| 256 | union {
|
| 257 | __le32 data[SND_SOC_TPLG_TLV_SIZE];
|
| 258 | struct snd_soc_tplg_tlv_dbscale scale;
|
| 259 | };
|
| 260 | } __attribute__((packed));
|
| 261 |
|
| 262 | |
| 263 | * Kcontrol channel data
|
| 264 |
|
| 265 | struct snd_soc_tplg_channel {
|
| 266 | __le32 size;
|
| 267 | __le32 reg;
|
| 268 | __le32 shift;
|
| 269 | __le32 id;
|
| 270 | } __attribute__((packed));
|
| 271 |
|
| 272 | |
| 273 | * Genericl Operations IDs, for binding Kcontrol or Bytes ext ops
|
| 274 | * Kcontrol ops need get/put/info.
|
| 275 | * Bytes ext ops need get/put.
|
| 276 |
|
| 277 | struct snd_soc_tplg_io_ops {
|
| 278 | __le32 get;
|
| 279 | __le32 put;
|
| 280 | __le32 info;
|
| 281 | } __attribute__((packed));
|
| 282 |
|
| 283 | |
| 284 | * kcontrol header
|
| 285 |
|
| 286 | struct snd_soc_tplg_ctl_hdr {
|
| 287 | __le32 size;
|
| 288 | __le32 type;
|
| 289 | char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
| 290 | __le32 access;
|
| 291 | struct snd_soc_tplg_io_ops ops;
|
| 292 | struct snd_soc_tplg_ctl_tlv tlv;
|
| 293 | } __attribute__((packed));
|
| 294 |
|
| 295 | |
| 296 | * Stream Capabilities
|
| 297 |
|
| 298 | struct snd_soc_tplg_stream_caps {
|
| 299 | __le32 size;
|
| 300 | char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
| 301 | __le64 formats;
|
| 302 | __le32 rates;
|
| 303 | __le32 rate_min;
|
| 304 | __le32 rate_max;
|
| 305 | __le32 channels_min;
|
| 306 | __le32 channels_max;
|
| 307 | __le32 periods_min;
|
| 308 | __le32 periods_max;
|
| 309 | __le32 period_size_min;
|
| 310 | __le32 period_size_max;
|
| 311 | __le32 buffer_size_min;
|
| 312 | __le32 buffer_size_max;
|
| 313 | __le32 sig_bits;
|
| 314 | } __attribute__((packed));
|
| 315 |
|
| 316 | |
| 317 | * FE or BE Stream configuration supported by SW/FW
|
| 318 |
|
| 319 | struct snd_soc_tplg_stream {
|
| 320 | __le32 size;
|
| 321 | char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
| 322 | __le64 format;
|
| 323 | __le32 rate;
|
| 324 | __le32 period_bytes;
|
| 325 | __le32 buffer_bytes;
|
| 326 | __le32 channels;
|
| 327 | } __attribute__((packed));
|
| 328 |
|
| 329 |
|
| 330 | |
| 331 | * Describes a physical link's runtime supported hardware config,
|
| 332 | * i.e. hardware audio formats.
|
| 333 |
|
| 334 | struct snd_soc_tplg_hw_config {
|
| 335 | __le32 size;
|
| 336 | __le32 id;
|
| 337 | __le32 fmt;
|
| 338 | __u8 clock_gated;
|
| 339 | __u8 invert_bclk;
|
| 340 | __u8 invert_fsync;
|
| 341 | __u8 bclk_provider;
|
| 342 | __u8 fsync_provider;
|
| 343 | __u8 mclk_direction;
|
| 344 | __le16 reserved;
|
| 345 | __le32 mclk_rate;
|
| 346 | __le32 bclk_rate;
|
| 347 | __le32 fsync_rate;
|
| 348 | __le32 tdm_slots;
|
| 349 | __le32 tdm_slot_width;
|
| 350 | __le32 tx_slots;
|
| 351 | __le32 rx_slots;
|
| 352 | __le32 tx_channels;
|
| 353 | __le32 tx_chanmap[SND_SOC_TPLG_MAX_CHAN];
|
| 354 | __le32 rx_channels;
|
| 355 | __le32 rx_chanmap[SND_SOC_TPLG_MAX_CHAN];
|
| 356 | } __attribute__((packed));
|
| 357 |
|
| 358 | |
| 359 | * Manifest. List totals for each payload type. Not used in parsing, but will
|
| 360 | * be passed to the component driver before any other objects in order for any
|
| 361 | * global component resource allocations.
|
| 362 | *
|
| 363 | * File block representation for manifest :-
|
| 364 | * +-----------------------------------+----+
|
| 365 | * | struct snd_soc_tplg_hdr | 1 |
|
| 366 | * +-----------------------------------+----+
|
| 367 | * | struct snd_soc_tplg_manifest | 1 |
|
| 368 | * +-----------------------------------+----+
|
| 369 |
|
| 370 | struct snd_soc_tplg_manifest {
|
| 371 | __le32 size;
|
| 372 | __le32 control_elems;
|
| 373 | __le32 widget_elems;
|
| 374 | __le32 graph_elems;
|
| 375 | __le32 pcm_elems;
|
| 376 | __le32 dai_link_elems;
|
| 377 | __le32 dai_elems;
|
| 378 | __le32 reserved[20];
|
| 379 | struct snd_soc_tplg_private priv;
|
| 380 | } __attribute__((packed));
|
| 381 |
|
| 382 | |
| 383 | * Mixer kcontrol.
|
| 384 | *
|
| 385 | * File block representation for mixer kcontrol :-
|
| 386 | * +-----------------------------------+----+
|
| 387 | * | struct snd_soc_tplg_hdr | 1 |
|
| 388 | * +-----------------------------------+----+
|
| 389 | * | struct snd_soc_tplg_mixer_control | N |
|
| 390 | * +-----------------------------------+----+
|
| 391 |
|
| 392 | struct snd_soc_tplg_mixer_control {
|
| 393 | struct snd_soc_tplg_ctl_hdr hdr;
|
| 394 | __le32 size;
|
| 395 | __le32 min;
|
| 396 | __le32 max;
|
| 397 | __le32 platform_max;
|
| 398 | __le32 invert;
|
| 399 | __le32 num_channels;
|
| 400 | struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
|
| 401 | struct snd_soc_tplg_private priv;
|
| 402 | } __attribute__((packed));
|
| 403 |
|
| 404 | |
| 405 | * Enumerated kcontrol
|
| 406 | *
|
| 407 | * File block representation for enum kcontrol :-
|
| 408 | * +-----------------------------------+----+
|
| 409 | * | struct snd_soc_tplg_hdr | 1 |
|
| 410 | * +-----------------------------------+----+
|
| 411 | * | struct snd_soc_tplg_enum_control | N |
|
| 412 | * +-----------------------------------+----+
|
| 413 |
|
| 414 | struct snd_soc_tplg_enum_control {
|
| 415 | struct snd_soc_tplg_ctl_hdr hdr;
|
| 416 | __le32 size;
|
| 417 | __le32 num_channels;
|
| 418 | struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
|
| 419 | __le32 items;
|
| 420 | __le32 mask;
|
| 421 | __le32 count;
|
| 422 | char texts[SND_SOC_TPLG_NUM_TEXTS][SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
| 423 | __le32 values[SND_SOC_TPLG_NUM_TEXTS * SNDRV_CTL_ELEM_ID_NAME_MAXLEN / 4];
|
| 424 | struct snd_soc_tplg_private priv;
|
| 425 | } __attribute__((packed));
|
| 426 |
|
| 427 | |
| 428 | * Bytes kcontrol
|
| 429 | *
|
| 430 | * File block representation for bytes kcontrol :-
|
| 431 | * +-----------------------------------+----+
|
| 432 | * | struct snd_soc_tplg_hdr | 1 |
|
| 433 | * +-----------------------------------+----+
|
| 434 | * | struct snd_soc_tplg_bytes_control | N |
|
| 435 | * +-----------------------------------+----+
|
| 436 |
|
| 437 | struct snd_soc_tplg_bytes_control {
|
| 438 | struct snd_soc_tplg_ctl_hdr hdr;
|
| 439 | __le32 size;
|
| 440 | __le32 max;
|
| 441 | __le32 mask;
|
| 442 | __le32 base;
|
| 443 | __le32 num_regs;
|
| 444 | struct snd_soc_tplg_io_ops ext_ops;
|
| 445 | struct snd_soc_tplg_private priv;
|
| 446 | } __attribute__((packed));
|
| 447 |
|
| 448 | |
| 449 | * DAPM Graph Element
|
| 450 | *
|
| 451 | * File block representation for DAPM graph elements :-
|
| 452 | * +-------------------------------------+----+
|
| 453 | * | struct snd_soc_tplg_hdr | 1 |
|
| 454 | * +-------------------------------------+----+
|
| 455 | * | struct snd_soc_tplg_dapm_graph_elem | N |
|
| 456 | * +-------------------------------------+----+
|
| 457 |
|
| 458 | struct snd_soc_tplg_dapm_graph_elem {
|
| 459 | char sink[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
| 460 | char control[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
| 461 | char source[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
| 462 | } __attribute__((packed));
|
| 463 |
|
| 464 | |
| 465 | * DAPM Widget.
|
| 466 | *
|
| 467 | * File block representation for DAPM widget :-
|
| 468 | * +-------------------------------------+-----+
|
| 469 | * | struct snd_soc_tplg_hdr | 1 |
|
| 470 | * +-------------------------------------+-----+
|
| 471 | * | struct snd_soc_tplg_dapm_widget | N |
|
| 472 | * +-------------------------------------+-----+
|
| 473 | * | struct snd_soc_tplg_enum_control | 0|1 |
|
| 474 | * | struct snd_soc_tplg_mixer_control | 0|N |
|
| 475 | * +-------------------------------------+-----+
|
| 476 | *
|
| 477 | * Optional enum or mixer control can be appended to the end of each widget
|
| 478 | * in the block.
|
| 479 |
|
| 480 | struct snd_soc_tplg_dapm_widget {
|
| 481 | __le32 size;
|
| 482 | __le32 id;
|
| 483 | char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
| 484 | char sname[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
| 485 |
|
| 486 | __le32 reg;
|
| 487 | __le32 shift;
|
| 488 | __le32 mask;
|
| 489 | __le32 subseq;
|
| 490 | __le32 invert;
|
| 491 | __le32 ignore_suspend;
|
| 492 | __le16 event_flags;
|
| 493 | __le16 event_type;
|
| 494 | __le32 num_kcontrols;
|
| 495 | struct snd_soc_tplg_private priv;
|
| 496 | |
| 497 | * kcontrols that relate to this widget
|
| 498 | * follow here after widget private data
|
| 499 |
|
| 500 | } __attribute__((packed));
|
| 501 |
|
| 502 |
|
| 503 | |
| 504 | * Describes SW/FW specific features of PCM (FE DAI & DAI link).
|
| 505 | *
|
| 506 | * File block representation for PCM :-
|
| 507 | * +-----------------------------------+-----+
|
| 508 | * | struct snd_soc_tplg_hdr | 1 |
|
| 509 | * +-----------------------------------+-----+
|
| 510 | * | struct snd_soc_tplg_pcm | N |
|
| 511 | * +-----------------------------------+-----+
|
| 512 |
|
| 513 | struct snd_soc_tplg_pcm {
|
| 514 | __le32 size;
|
| 515 | char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
| 516 | char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
| 517 | __le32 pcm_id;
|
| 518 | __le32 dai_id;
|
| 519 | __le32 playback;
|
| 520 | __le32 capture;
|
| 521 | __le32 compress;
|
| 522 | struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX];
|
| 523 | __le32 num_streams;
|
| 524 | struct snd_soc_tplg_stream_caps caps[2];
|
| 525 | __le32 flag_mask;
|
| 526 | __le32 flags;
|
| 527 | struct snd_soc_tplg_private priv;
|
| 528 | } __attribute__((packed));
|
| 529 |
|
| 530 |
|
| 531 | |
| 532 | * Describes the physical link runtime supported configs or params
|
| 533 | *
|
| 534 | * File block representation for physical link config :-
|
| 535 | * +-----------------------------------+-----+
|
| 536 | * | struct snd_soc_tplg_hdr | 1 |
|
| 537 | * +-----------------------------------+-----+
|
| 538 | * | struct snd_soc_tplg_link_config | N |
|
| 539 | * +-----------------------------------+-----+
|
| 540 |
|
| 541 | struct snd_soc_tplg_link_config {
|
| 542 | __le32 size;
|
| 543 | __le32 id;
|
| 544 | char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
| 545 | char stream_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
| 546 | struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX];
|
| 547 | __le32 num_streams;
|
| 548 | struct snd_soc_tplg_hw_config hw_config[SND_SOC_TPLG_HW_CONFIG_MAX];
|
| 549 | __le32 num_hw_configs;
|
| 550 | __le32 default_hw_config_id;
|
| 551 | __le32 flag_mask;
|
| 552 | __le32 flags;
|
| 553 | struct snd_soc_tplg_private priv;
|
| 554 | } __attribute__((packed));
|
| 555 |
|
| 556 | |
| 557 | * Describes SW/FW specific features of physical DAI.
|
| 558 | * It can be used to configure backend DAIs for DPCM.
|
| 559 | *
|
| 560 | * File block representation for physical DAI :-
|
| 561 | * +-----------------------------------+-----+
|
| 562 | * | struct snd_soc_tplg_hdr | 1 |
|
| 563 | * +-----------------------------------+-----+
|
| 564 | * | struct snd_soc_tplg_dai | N |
|
| 565 | * +-----------------------------------+-----+
|
| 566 |
|
| 567 | struct snd_soc_tplg_dai {
|
| 568 | __le32 size;
|
| 569 | char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
| 570 | __le32 dai_id;
|
| 571 | __le32 playback;
|
| 572 | __le32 capture;
|
| 573 | struct snd_soc_tplg_stream_caps caps[2];
|
| 574 | __le32 flag_mask;
|
| 575 | __le32 flags;
|
| 576 | struct snd_soc_tplg_private priv;
|
| 577 | } __attribute__((packed));
|
| 578 |
|
| 579 | #endif
|