3333 */
3434#define SND_SOC_TPLG_STREAM_CONFIG_MAX 8
3535
36+ /*
37+ * Maximum number of physical link's hardware configs
38+ */
39+ #define SND_SOC_TPLG_HW_CONFIG_MAX 8
40+
3641/* individual kcontrol info types - can be mixed with other types */
3742#define SND_SOC_TPLG_CTL_VOLSW 1
3843#define SND_SOC_TPLG_CTL_VOLSW_SX 2
7782#define SND_SOC_TPLG_NUM_TEXTS 16
7883
7984/* ABI version */
80- #define SND_SOC_TPLG_ABI_VERSION 0x5
85+ #define SND_SOC_TPLG_ABI_VERSION 0x5 /* current version */
86+ #define SND_SOC_TPLG_ABI_VERSION_MIN 0x4 /* oldest version supported */
8187
8288/* Max size of TLV data */
8389#define SND_SOC_TPLG_TLV_SIZE 32
99105#define SND_SOC_TPLG_TYPE_CODEC_LINK 9
100106#define SND_SOC_TPLG_TYPE_BACKEND_LINK 10
101107#define SND_SOC_TPLG_TYPE_PDATA 11
102- #define SND_SOC_TPLG_TYPE_BE_DAI 12
103- #define SND_SOC_TPLG_TYPE_MAX SND_SOC_TPLG_TYPE_BE_DAI
108+ #define SND_SOC_TPLG_TYPE_DAI 12
109+ #define SND_SOC_TPLG_TYPE_MAX SND_SOC_TPLG_TYPE_DAI
104110
105111/* vendor block IDs - please add new vendor types to end */
106112#define SND_SOC_TPLG_TYPE_VENDOR_FW 1000
119125#define SND_SOC_TPLG_TUPLE_TYPE_WORD 4
120126#define SND_SOC_TPLG_TUPLE_TYPE_SHORT 5
121127
122- /* BE DAI flags */
128+ /* DAI flags */
123129#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_RATES (1 << 0)
124130#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
125131#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)
126132
133+ /* DAI physical PCM data formats.
134+ * Add new formats to the end of the list.
135+ */
136+ #define SND_SOC_DAI_FORMAT_I2S 1 /* I2S mode */
137+ #define SND_SOC_DAI_FORMAT_RIGHT_J 2 /* Right Justified mode */
138+ #define SND_SOC_DAI_FORMAT_LEFT_J 3 /* Left Justified mode */
139+ #define SND_SOC_DAI_FORMAT_DSP_A 4 /* L data MSB after FRM LRC */
140+ #define SND_SOC_DAI_FORMAT_DSP_B 5 /* L data MSB during FRM LRC */
141+ #define SND_SOC_DAI_FORMAT_AC97 6 /* AC97 */
142+ #define SND_SOC_DAI_FORMAT_PDM 7 /* Pulse density modulation */
143+
144+ /* left and right justified also known as MSB and LSB respectively */
145+ #define SND_SOC_DAI_FORMAT_MSB SND_SOC_DAI_FORMAT_LEFT_J
146+ #define SND_SOC_DAI_FORMAT_LSB SND_SOC_DAI_FORMAT_RIGHT_J
147+
148+ /* DAI link flags */
149+ #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_RATES (1 << 0)
150+ #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
151+ #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)
152+ #define SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP (1 << 3)
153+
127154/*
128155 * Block Header.
129156 * This header precedes all object and object arrays below.
@@ -267,6 +294,35 @@ struct snd_soc_tplg_stream {
267294 __le32 channels ; /* channels */
268295} __attribute__((packed ));
269296
297+
298+ /*
299+ * Describes a physical link's runtime supported hardware config,
300+ * i.e. hardware audio formats.
301+ */
302+ struct snd_soc_tplg_hw_config {
303+ __le32 size ; /* in bytes of this structure */
304+ __le32 id ; /* unique ID - - used to match */
305+ __le32 fmt ; /* SND_SOC_DAI_FORMAT_ format value */
306+ __u8 clock_gated ; /* 1 if clock can be gated to save power */
307+ __u8 invert_bclk ; /* 1 for inverted BCLK, 0 for normal */
308+ __u8 invert_fsync ; /* 1 for inverted frame clock, 0 for normal */
309+ __u8 bclk_master ; /* 1 for master of BCLK, 0 for slave */
310+ __u8 fsync_master ; /* 1 for master of FSYNC, 0 for slave */
311+ __u8 mclk_direction ; /* 0 for input, 1 for output */
312+ __le16 reserved ; /* for 32bit alignment */
313+ __le32 mclk_rate ; /* MCLK or SYSCLK freqency in Hz */
314+ __le32 bclk_rate ; /* BCLK freqency in Hz */
315+ __le32 fsync_rate ; /* frame clock in Hz */
316+ __le32 tdm_slots ; /* number of TDM slots in use */
317+ __le32 tdm_slot_width ; /* width in bits for each slot */
318+ __le32 tx_slots ; /* bit mask for active Tx slots */
319+ __le32 rx_slots ; /* bit mask for active Rx slots */
320+ __le32 tx_channels ; /* number of Tx channels */
321+ __le32 tx_chanmap [SND_SOC_TPLG_MAX_CHAN ]; /* array of slot number */
322+ __le32 rx_channels ; /* number of Rx channels */
323+ __le32 rx_chanmap [SND_SOC_TPLG_MAX_CHAN ]; /* array of slot number */
324+ } __attribute__((packed ));
325+
270326/*
271327 * Manifest. List totals for each payload type. Not used in parsing, but will
272328 * be passed to the component driver before any other objects in order for any
@@ -286,7 +342,7 @@ struct snd_soc_tplg_manifest {
286342 __le32 graph_elems ; /* number of graph elements */
287343 __le32 pcm_elems ; /* number of PCM elements */
288344 __le32 dai_link_elems ; /* number of DAI link elements */
289- __le32 be_dai_elems ; /* number of BE DAI elements */
345+ __le32 dai_elems ; /* number of physical DAI elements */
290346 __le32 reserved [20 ]; /* reserved for new ABI element types */
291347 struct snd_soc_tplg_private priv ;
292348} __attribute__((packed ));
@@ -434,13 +490,16 @@ struct snd_soc_tplg_pcm {
434490 struct snd_soc_tplg_stream stream [SND_SOC_TPLG_STREAM_CONFIG_MAX ]; /* for DAI link */
435491 __le32 num_streams ; /* number of streams */
436492 struct snd_soc_tplg_stream_caps caps [2 ]; /* playback and capture for DAI */
493+ __le32 flag_mask ; /* bitmask of flags to configure */
494+ __le32 flags ; /* SND_SOC_TPLG_LNK_FLGBIT_* flag value */
495+ struct snd_soc_tplg_private priv ;
437496} __attribute__((packed ));
438497
439498
440499/*
441- * Describes the BE or CC link runtime supported configs or params
500+ * Describes the physical link runtime supported configs or params
442501 *
443- * File block representation for BE/CC link config :-
502+ * File block representation for physical link config :-
444503 * +-----------------------------------+-----+
445504 * | struct snd_soc_tplg_hdr | 1 |
446505 * +-----------------------------------+-----+
@@ -450,21 +509,30 @@ struct snd_soc_tplg_pcm {
450509struct snd_soc_tplg_link_config {
451510 __le32 size ; /* in bytes of this structure */
452511 __le32 id ; /* unique ID - used to match */
512+ char name [SNDRV_CTL_ELEM_ID_NAME_MAXLEN ]; /* name - used to match */
513+ char stream_name [SNDRV_CTL_ELEM_ID_NAME_MAXLEN ]; /* stream name - used to match */
453514 struct snd_soc_tplg_stream stream [SND_SOC_TPLG_STREAM_CONFIG_MAX ]; /* supported configs playback and captrure */
454515 __le32 num_streams ; /* number of streams */
516+ struct snd_soc_tplg_hw_config hw_config [SND_SOC_TPLG_HW_CONFIG_MAX ]; /* hw configs */
517+ __le32 num_hw_configs ; /* number of hw configs */
518+ __le32 default_hw_config_id ; /* default hw config ID for init */
519+ __le32 flag_mask ; /* bitmask of flags to configure */
520+ __le32 flags ; /* SND_SOC_TPLG_LNK_FLGBIT_* flag value */
521+ struct snd_soc_tplg_private priv ;
455522} __attribute__((packed ));
456523
457524/*
458- * Describes SW/FW specific features of BE DAI.
525+ * Describes SW/FW specific features of physical DAI.
526+ * It can be used to configure backend DAIs for DPCM.
459527 *
460- * File block representation for BE DAI :-
528+ * File block representation for physical DAI :-
461529 * +-----------------------------------+-----+
462530 * | struct snd_soc_tplg_hdr | 1 |
463531 * +-----------------------------------+-----+
464- * | struct snd_soc_tplg_be_dai | N |
532+ * | struct snd_soc_tplg_dai | N |
465533 * +-----------------------------------+-----+
466534 */
467- struct snd_soc_tplg_be_dai {
535+ struct snd_soc_tplg_dai {
468536 __le32 size ; /* in bytes of this structure */
469537 char dai_name [SNDRV_CTL_ELEM_ID_NAME_MAXLEN ]; /* name - used to match */
470538 __le32 dai_id ; /* unique ID - used to match */
0 commit comments