33
33
*/
34
34
#define SND_SOC_TPLG_STREAM_CONFIG_MAX 8
35
35
36
+ /*
37
+ * Maximum number of physical link's hardware configs
38
+ */
39
+ #define SND_SOC_TPLG_HW_CONFIG_MAX 8
40
+
36
41
/* individual kcontrol info types - can be mixed with other types */
37
42
#define SND_SOC_TPLG_CTL_VOLSW 1
38
43
#define SND_SOC_TPLG_CTL_VOLSW_SX 2
77
82
#define SND_SOC_TPLG_NUM_TEXTS 16
78
83
79
84
/* 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 */
81
87
82
88
/* Max size of TLV data */
83
89
#define SND_SOC_TPLG_TLV_SIZE 32
99
105
#define SND_SOC_TPLG_TYPE_CODEC_LINK 9
100
106
#define SND_SOC_TPLG_TYPE_BACKEND_LINK 10
101
107
#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
104
110
105
111
/* vendor block IDs - please add new vendor types to end */
106
112
#define SND_SOC_TPLG_TYPE_VENDOR_FW 1000
119
125
#define SND_SOC_TPLG_TUPLE_TYPE_WORD 4
120
126
#define SND_SOC_TPLG_TUPLE_TYPE_SHORT 5
121
127
122
- /* BE DAI flags */
128
+ /* DAI flags */
123
129
#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_RATES (1 << 0)
124
130
#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
125
131
#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)
126
132
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
+
127
154
/*
128
155
* Block Header.
129
156
* This header precedes all object and object arrays below.
@@ -267,6 +294,35 @@ struct snd_soc_tplg_stream {
267
294
__le32 channels ; /* channels */
268
295
} __attribute__((packed ));
269
296
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
+
270
326
/*
271
327
* Manifest. List totals for each payload type. Not used in parsing, but will
272
328
* be passed to the component driver before any other objects in order for any
@@ -286,7 +342,7 @@ struct snd_soc_tplg_manifest {
286
342
__le32 graph_elems ; /* number of graph elements */
287
343
__le32 pcm_elems ; /* number of PCM elements */
288
344
__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 */
290
346
__le32 reserved [20 ]; /* reserved for new ABI element types */
291
347
struct snd_soc_tplg_private priv ;
292
348
} __attribute__((packed ));
@@ -434,13 +490,16 @@ struct snd_soc_tplg_pcm {
434
490
struct snd_soc_tplg_stream stream [SND_SOC_TPLG_STREAM_CONFIG_MAX ]; /* for DAI link */
435
491
__le32 num_streams ; /* number of streams */
436
492
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 ;
437
496
} __attribute__((packed ));
438
497
439
498
440
499
/*
441
- * Describes the BE or CC link runtime supported configs or params
500
+ * Describes the physical link runtime supported configs or params
442
501
*
443
- * File block representation for BE/CC link config :-
502
+ * File block representation for physical link config :-
444
503
* +-----------------------------------+-----+
445
504
* | struct snd_soc_tplg_hdr | 1 |
446
505
* +-----------------------------------+-----+
@@ -450,21 +509,30 @@ struct snd_soc_tplg_pcm {
450
509
struct snd_soc_tplg_link_config {
451
510
__le32 size ; /* in bytes of this structure */
452
511
__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 */
453
514
struct snd_soc_tplg_stream stream [SND_SOC_TPLG_STREAM_CONFIG_MAX ]; /* supported configs playback and captrure */
454
515
__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 ;
455
522
} __attribute__((packed ));
456
523
457
524
/*
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.
459
527
*
460
- * File block representation for BE DAI :-
528
+ * File block representation for physical DAI :-
461
529
* +-----------------------------------+-----+
462
530
* | struct snd_soc_tplg_hdr | 1 |
463
531
* +-----------------------------------+-----+
464
- * | struct snd_soc_tplg_be_dai | N |
532
+ * | struct snd_soc_tplg_dai | N |
465
533
* +-----------------------------------+-----+
466
534
*/
467
- struct snd_soc_tplg_be_dai {
535
+ struct snd_soc_tplg_dai {
468
536
__le32 size ; /* in bytes of this structure */
469
537
char dai_name [SNDRV_CTL_ELEM_ID_NAME_MAXLEN ]; /* name - used to match */
470
538
__le32 dai_id ; /* unique ID - used to match */
0 commit comments