asoc.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. /*
  2. * uapi/sound/asoc.h -- ALSA SoC Firmware Controls and DAPM
  3. *
  4. * Copyright (C) 2012 Texas Instruments Inc.
  5. * Copyright (C) 2015 Intel Corporation.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. *
  11. * Simple file API to load FW that includes mixers, coefficients, DAPM graphs,
  12. * algorithms, equalisers, DAIs, widgets etc.
  13. */
  14. #ifndef __LINUX_UAPI_SND_ASOC_H
  15. #define __LINUX_UAPI_SND_ASOC_H
  16. #include <linux/types.h>
  17. #include <sound/asound.h>
  18. /*
  19. * Maximum number of channels topology kcontrol can represent.
  20. */
  21. #define SND_SOC_TPLG_MAX_CHAN 8
  22. /*
  23. * Maximum number of PCM formats capability
  24. */
  25. #define SND_SOC_TPLG_MAX_FORMATS 16
  26. /*
  27. * Maximum number of PCM stream configs
  28. */
  29. #define SND_SOC_TPLG_STREAM_CONFIG_MAX 8
  30. /*
  31. * Maximum number of physical link's hardware configs
  32. */
  33. #define SND_SOC_TPLG_HW_CONFIG_MAX 8
  34. /* individual kcontrol info types - can be mixed with other types */
  35. #define SND_SOC_TPLG_CTL_VOLSW 1
  36. #define SND_SOC_TPLG_CTL_VOLSW_SX 2
  37. #define SND_SOC_TPLG_CTL_VOLSW_XR_SX 3
  38. #define SND_SOC_TPLG_CTL_ENUM 4
  39. #define SND_SOC_TPLG_CTL_BYTES 5
  40. #define SND_SOC_TPLG_CTL_ENUM_VALUE 6
  41. #define SND_SOC_TPLG_CTL_RANGE 7
  42. #define SND_SOC_TPLG_CTL_STROBE 8
  43. /* individual widget kcontrol info types - can be mixed with other types */
  44. #define SND_SOC_TPLG_DAPM_CTL_VOLSW 64
  45. #define SND_SOC_TPLG_DAPM_CTL_ENUM_DOUBLE 65
  46. #define SND_SOC_TPLG_DAPM_CTL_ENUM_VIRT 66
  47. #define SND_SOC_TPLG_DAPM_CTL_ENUM_VALUE 67
  48. #define SND_SOC_TPLG_DAPM_CTL_PIN 68
  49. /* DAPM widget types - add new items to the end */
  50. #define SND_SOC_TPLG_DAPM_INPUT 0
  51. #define SND_SOC_TPLG_DAPM_OUTPUT 1
  52. #define SND_SOC_TPLG_DAPM_MUX 2
  53. #define SND_SOC_TPLG_DAPM_MIXER 3
  54. #define SND_SOC_TPLG_DAPM_PGA 4
  55. #define SND_SOC_TPLG_DAPM_OUT_DRV 5
  56. #define SND_SOC_TPLG_DAPM_ADC 6
  57. #define SND_SOC_TPLG_DAPM_DAC 7
  58. #define SND_SOC_TPLG_DAPM_SWITCH 8
  59. #define SND_SOC_TPLG_DAPM_PRE 9
  60. #define SND_SOC_TPLG_DAPM_POST 10
  61. #define SND_SOC_TPLG_DAPM_AIF_IN 11
  62. #define SND_SOC_TPLG_DAPM_AIF_OUT 12
  63. #define SND_SOC_TPLG_DAPM_DAI_IN 13
  64. #define SND_SOC_TPLG_DAPM_DAI_OUT 14
  65. #define SND_SOC_TPLG_DAPM_DAI_LINK 15
  66. #define SND_SOC_TPLG_DAPM_BUFFER 16
  67. #define SND_SOC_TPLG_DAPM_SCHEDULER 17
  68. #define SND_SOC_TPLG_DAPM_EFFECT 18
  69. #define SND_SOC_TPLG_DAPM_SIGGEN 19
  70. #define SND_SOC_TPLG_DAPM_SRC 20
  71. #define SND_SOC_TPLG_DAPM_ASRC 21
  72. #define SND_SOC_TPLG_DAPM_ENCODER 22
  73. #define SND_SOC_TPLG_DAPM_DECODER 23
  74. #define SND_SOC_TPLG_DAPM_LAST SND_SOC_TPLG_DAPM_DECODER
  75. /* Header magic number and string sizes */
  76. #define SND_SOC_TPLG_MAGIC 0x41536F43 /* ASoC */
  77. /* string sizes */
  78. #define SND_SOC_TPLG_NUM_TEXTS 16
  79. /* ABI version */
  80. #define SND_SOC_TPLG_ABI_VERSION 0x5 /* current version */
  81. #define SND_SOC_TPLG_ABI_VERSION_MIN 0x4 /* oldest version supported */
  82. /* Max size of TLV data */
  83. #define SND_SOC_TPLG_TLV_SIZE 32
  84. /*
  85. * File and Block header data types.
  86. * Add new generic and vendor types to end of list.
  87. * Generic types are handled by the core whilst vendors types are passed
  88. * to the component drivers for handling.
  89. */
  90. #define SND_SOC_TPLG_TYPE_MIXER 1
  91. #define SND_SOC_TPLG_TYPE_BYTES 2
  92. #define SND_SOC_TPLG_TYPE_ENUM 3
  93. #define SND_SOC_TPLG_TYPE_DAPM_GRAPH 4
  94. #define SND_SOC_TPLG_TYPE_DAPM_WIDGET 5
  95. #define SND_SOC_TPLG_TYPE_DAI_LINK 6
  96. #define SND_SOC_TPLG_TYPE_PCM 7
  97. #define SND_SOC_TPLG_TYPE_MANIFEST 8
  98. #define SND_SOC_TPLG_TYPE_CODEC_LINK 9
  99. #define SND_SOC_TPLG_TYPE_BACKEND_LINK 10
  100. #define SND_SOC_TPLG_TYPE_PDATA 11
  101. #define SND_SOC_TPLG_TYPE_DAI 12
  102. #define SND_SOC_TPLG_TYPE_MAX SND_SOC_TPLG_TYPE_DAI
  103. /* vendor block IDs - please add new vendor types to end */
  104. #define SND_SOC_TPLG_TYPE_VENDOR_FW 1000
  105. #define SND_SOC_TPLG_TYPE_VENDOR_CONFIG 1001
  106. #define SND_SOC_TPLG_TYPE_VENDOR_COEFF 1002
  107. #define SND_SOC_TPLG_TYPEVENDOR_CODEC 1003
  108. #define SND_SOC_TPLG_STREAM_PLAYBACK 0
  109. #define SND_SOC_TPLG_STREAM_CAPTURE 1
  110. /* vendor tuple types */
  111. #define SND_SOC_TPLG_TUPLE_TYPE_UUID 0
  112. #define SND_SOC_TPLG_TUPLE_TYPE_STRING 1
  113. #define SND_SOC_TPLG_TUPLE_TYPE_BOOL 2
  114. #define SND_SOC_TPLG_TUPLE_TYPE_BYTE 3
  115. #define SND_SOC_TPLG_TUPLE_TYPE_WORD 4
  116. #define SND_SOC_TPLG_TUPLE_TYPE_SHORT 5
  117. /* DAI flags */
  118. #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_RATES (1 << 0)
  119. #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
  120. #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)
  121. /* DAI physical PCM data formats.
  122. * Add new formats to the end of the list.
  123. */
  124. #define SND_SOC_DAI_FORMAT_I2S 1 /* I2S mode */
  125. #define SND_SOC_DAI_FORMAT_RIGHT_J 2 /* Right Justified mode */
  126. #define SND_SOC_DAI_FORMAT_LEFT_J 3 /* Left Justified mode */
  127. #define SND_SOC_DAI_FORMAT_DSP_A 4 /* L data MSB after FRM LRC */
  128. #define SND_SOC_DAI_FORMAT_DSP_B 5 /* L data MSB during FRM LRC */
  129. #define SND_SOC_DAI_FORMAT_AC97 6 /* AC97 */
  130. #define SND_SOC_DAI_FORMAT_PDM 7 /* Pulse density modulation */
  131. /* left and right justified also known as MSB and LSB respectively */
  132. #define SND_SOC_DAI_FORMAT_MSB SND_SOC_DAI_FORMAT_LEFT_J
  133. #define SND_SOC_DAI_FORMAT_LSB SND_SOC_DAI_FORMAT_RIGHT_J
  134. /* DAI link flags */
  135. #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_RATES (1 << 0)
  136. #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
  137. #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)
  138. #define SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP (1 << 3)
  139. /*
  140. * Block Header.
  141. * This header precedes all object and object arrays below.
  142. */
  143. struct snd_soc_tplg_hdr {
  144. __le32 magic; /* magic number */
  145. __le32 abi; /* ABI version */
  146. __le32 version; /* optional vendor specific version details */
  147. __le32 type; /* SND_SOC_TPLG_TYPE_ */
  148. __le32 size; /* size of this structure */
  149. __le32 vendor_type; /* optional vendor specific type info */
  150. __le32 payload_size; /* data bytes, excluding this header */
  151. __le32 index; /* identifier for block */
  152. __le32 count; /* number of elements in block */
  153. } __attribute__((packed));
  154. /* vendor tuple for uuid */
  155. struct snd_soc_tplg_vendor_uuid_elem {
  156. __le32 token;
  157. char uuid[16];
  158. } __attribute__((packed));
  159. /* vendor tuple for a bool/byte/short/word value */
  160. struct snd_soc_tplg_vendor_value_elem {
  161. __le32 token;
  162. __le32 value;
  163. } __attribute__((packed));
  164. /* vendor tuple for string */
  165. struct snd_soc_tplg_vendor_string_elem {
  166. __le32 token;
  167. char string[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
  168. } __attribute__((packed));
  169. struct snd_soc_tplg_vendor_array {
  170. __le32 size; /* size in bytes of the array, including all elements */
  171. __le32 type; /* SND_SOC_TPLG_TUPLE_TYPE_ */
  172. __le32 num_elems; /* number of elements in array */
  173. union {
  174. struct snd_soc_tplg_vendor_uuid_elem uuid[0];
  175. struct snd_soc_tplg_vendor_value_elem value[0];
  176. struct snd_soc_tplg_vendor_string_elem string[0];
  177. };
  178. } __attribute__((packed));
  179. /*
  180. * Private data.
  181. * All topology objects may have private data that can be used by the driver or
  182. * firmware. Core will ignore this data.
  183. */
  184. struct snd_soc_tplg_private {
  185. __le32 size; /* in bytes of private data */
  186. union {
  187. char data[0];
  188. struct snd_soc_tplg_vendor_array array[0];
  189. };
  190. } __attribute__((packed));
  191. /*
  192. * Kcontrol TLV data.
  193. */
  194. struct snd_soc_tplg_tlv_dbscale {
  195. __le32 min;
  196. __le32 step;
  197. __le32 mute;
  198. } __attribute__((packed));
  199. struct snd_soc_tplg_ctl_tlv {
  200. __le32 size; /* in bytes of this structure */
  201. __le32 type; /* SNDRV_CTL_TLVT_*, type of TLV */
  202. union {
  203. __le32 data[SND_SOC_TPLG_TLV_SIZE];
  204. struct snd_soc_tplg_tlv_dbscale scale;
  205. };
  206. } __attribute__((packed));
  207. /*
  208. * Kcontrol channel data
  209. */
  210. struct snd_soc_tplg_channel {
  211. __le32 size; /* in bytes of this structure */
  212. __le32 reg;
  213. __le32 shift;
  214. __le32 id; /* ID maps to Left, Right, LFE etc */
  215. } __attribute__((packed));
  216. /*
  217. * Genericl Operations IDs, for binding Kcontrol or Bytes ext ops
  218. * Kcontrol ops need get/put/info.
  219. * Bytes ext ops need get/put.
  220. */
  221. struct snd_soc_tplg_io_ops {
  222. __le32 get;
  223. __le32 put;
  224. __le32 info;
  225. } __attribute__((packed));
  226. /*
  227. * kcontrol header
  228. */
  229. struct snd_soc_tplg_ctl_hdr {
  230. __le32 size; /* in bytes of this structure */
  231. __le32 type;
  232. char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
  233. __le32 access;
  234. struct snd_soc_tplg_io_ops ops;
  235. struct snd_soc_tplg_ctl_tlv tlv;
  236. } __attribute__((packed));
  237. /*
  238. * Stream Capabilities
  239. */
  240. struct snd_soc_tplg_stream_caps {
  241. __le32 size; /* in bytes of this structure */
  242. char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
  243. __le64 formats; /* supported formats SNDRV_PCM_FMTBIT_* */
  244. __le32 rates; /* supported rates SNDRV_PCM_RATE_* */
  245. __le32 rate_min; /* min rate */
  246. __le32 rate_max; /* max rate */
  247. __le32 channels_min; /* min channels */
  248. __le32 channels_max; /* max channels */
  249. __le32 periods_min; /* min number of periods */
  250. __le32 periods_max; /* max number of periods */
  251. __le32 period_size_min; /* min period size bytes */
  252. __le32 period_size_max; /* max period size bytes */
  253. __le32 buffer_size_min; /* min buffer size bytes */
  254. __le32 buffer_size_max; /* max buffer size bytes */
  255. __le32 sig_bits; /* number of bits of content */
  256. } __attribute__((packed));
  257. /*
  258. * FE or BE Stream configuration supported by SW/FW
  259. */
  260. struct snd_soc_tplg_stream {
  261. __le32 size; /* in bytes of this structure */
  262. char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* Name of the stream */
  263. __le64 format; /* SNDRV_PCM_FMTBIT_* */
  264. __le32 rate; /* SNDRV_PCM_RATE_* */
  265. __le32 period_bytes; /* size of period in bytes */
  266. __le32 buffer_bytes; /* size of buffer in bytes */
  267. __le32 channels; /* channels */
  268. } __attribute__((packed));
  269. /*
  270. * Describes a physical link's runtime supported hardware config,
  271. * i.e. hardware audio formats.
  272. */
  273. struct snd_soc_tplg_hw_config {
  274. __le32 size; /* in bytes of this structure */
  275. __le32 id; /* unique ID - - used to match */
  276. __le32 fmt; /* SND_SOC_DAI_FORMAT_ format value */
  277. __u8 clock_gated; /* 1 if clock can be gated to save power */
  278. __u8 invert_bclk; /* 1 for inverted BCLK, 0 for normal */
  279. __u8 invert_fsync; /* 1 for inverted frame clock, 0 for normal */
  280. __u8 bclk_master; /* 1 for master of BCLK, 0 for slave */
  281. __u8 fsync_master; /* 1 for master of FSYNC, 0 for slave */
  282. __u8 mclk_direction; /* 0 for input, 1 for output */
  283. __le16 reserved; /* for 32bit alignment */
  284. __le32 mclk_rate; /* MCLK or SYSCLK freqency in Hz */
  285. __le32 bclk_rate; /* BCLK freqency in Hz */
  286. __le32 fsync_rate; /* frame clock in Hz */
  287. __le32 tdm_slots; /* number of TDM slots in use */
  288. __le32 tdm_slot_width; /* width in bits for each slot */
  289. __le32 tx_slots; /* bit mask for active Tx slots */
  290. __le32 rx_slots; /* bit mask for active Rx slots */
  291. __le32 tx_channels; /* number of Tx channels */
  292. __le32 tx_chanmap[SND_SOC_TPLG_MAX_CHAN]; /* array of slot number */
  293. __le32 rx_channels; /* number of Rx channels */
  294. __le32 rx_chanmap[SND_SOC_TPLG_MAX_CHAN]; /* array of slot number */
  295. } __attribute__((packed));
  296. /*
  297. * Manifest. List totals for each payload type. Not used in parsing, but will
  298. * be passed to the component driver before any other objects in order for any
  299. * global component resource allocations.
  300. *
  301. * File block representation for manifest :-
  302. * +-----------------------------------+----+
  303. * | struct snd_soc_tplg_hdr | 1 |
  304. * +-----------------------------------+----+
  305. * | struct snd_soc_tplg_manifest | 1 |
  306. * +-----------------------------------+----+
  307. */
  308. struct snd_soc_tplg_manifest {
  309. __le32 size; /* in bytes of this structure */
  310. __le32 control_elems; /* number of control elements */
  311. __le32 widget_elems; /* number of widget elements */
  312. __le32 graph_elems; /* number of graph elements */
  313. __le32 pcm_elems; /* number of PCM elements */
  314. __le32 dai_link_elems; /* number of DAI link elements */
  315. __le32 dai_elems; /* number of physical DAI elements */
  316. __le32 reserved[20]; /* reserved for new ABI element types */
  317. struct snd_soc_tplg_private priv;
  318. } __attribute__((packed));
  319. /*
  320. * Mixer kcontrol.
  321. *
  322. * File block representation for mixer kcontrol :-
  323. * +-----------------------------------+----+
  324. * | struct snd_soc_tplg_hdr | 1 |
  325. * +-----------------------------------+----+
  326. * | struct snd_soc_tplg_mixer_control | N |
  327. * +-----------------------------------+----+
  328. */
  329. struct snd_soc_tplg_mixer_control {
  330. struct snd_soc_tplg_ctl_hdr hdr;
  331. __le32 size; /* in bytes of this structure */
  332. __le32 min;
  333. __le32 max;
  334. __le32 platform_max;
  335. __le32 invert;
  336. __le32 num_channels;
  337. struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
  338. struct snd_soc_tplg_private priv;
  339. } __attribute__((packed));
  340. /*
  341. * Enumerated kcontrol
  342. *
  343. * File block representation for enum kcontrol :-
  344. * +-----------------------------------+----+
  345. * | struct snd_soc_tplg_hdr | 1 |
  346. * +-----------------------------------+----+
  347. * | struct snd_soc_tplg_enum_control | N |
  348. * +-----------------------------------+----+
  349. */
  350. struct snd_soc_tplg_enum_control {
  351. struct snd_soc_tplg_ctl_hdr hdr;
  352. __le32 size; /* in bytes of this structure */
  353. __le32 num_channels;
  354. struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
  355. __le32 items;
  356. __le32 mask;
  357. __le32 count;
  358. char texts[SND_SOC_TPLG_NUM_TEXTS][SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
  359. __le32 values[SND_SOC_TPLG_NUM_TEXTS * SNDRV_CTL_ELEM_ID_NAME_MAXLEN / 4];
  360. struct snd_soc_tplg_private priv;
  361. } __attribute__((packed));
  362. /*
  363. * Bytes kcontrol
  364. *
  365. * File block representation for bytes kcontrol :-
  366. * +-----------------------------------+----+
  367. * | struct snd_soc_tplg_hdr | 1 |
  368. * +-----------------------------------+----+
  369. * | struct snd_soc_tplg_bytes_control | N |
  370. * +-----------------------------------+----+
  371. */
  372. struct snd_soc_tplg_bytes_control {
  373. struct snd_soc_tplg_ctl_hdr hdr;
  374. __le32 size; /* in bytes of this structure */
  375. __le32 max;
  376. __le32 mask;
  377. __le32 base;
  378. __le32 num_regs;
  379. struct snd_soc_tplg_io_ops ext_ops;
  380. struct snd_soc_tplg_private priv;
  381. } __attribute__((packed));
  382. /*
  383. * DAPM Graph Element
  384. *
  385. * File block representation for DAPM graph elements :-
  386. * +-------------------------------------+----+
  387. * | struct snd_soc_tplg_hdr | 1 |
  388. * +-------------------------------------+----+
  389. * | struct snd_soc_tplg_dapm_graph_elem | N |
  390. * +-------------------------------------+----+
  391. */
  392. struct snd_soc_tplg_dapm_graph_elem {
  393. char sink[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
  394. char control[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
  395. char source[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
  396. } __attribute__((packed));
  397. /*
  398. * DAPM Widget.
  399. *
  400. * File block representation for DAPM widget :-
  401. * +-------------------------------------+-----+
  402. * | struct snd_soc_tplg_hdr | 1 |
  403. * +-------------------------------------+-----+
  404. * | struct snd_soc_tplg_dapm_widget | N |
  405. * +-------------------------------------+-----+
  406. * | struct snd_soc_tplg_enum_control | 0|1 |
  407. * | struct snd_soc_tplg_mixer_control | 0|N |
  408. * +-------------------------------------+-----+
  409. *
  410. * Optional enum or mixer control can be appended to the end of each widget
  411. * in the block.
  412. */
  413. struct snd_soc_tplg_dapm_widget {
  414. __le32 size; /* in bytes of this structure */
  415. __le32 id; /* SND_SOC_DAPM_CTL */
  416. char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
  417. char sname[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
  418. __le32 reg; /* negative reg = no direct dapm */
  419. __le32 shift; /* bits to shift */
  420. __le32 mask; /* non-shifted mask */
  421. __le32 subseq; /* sort within widget type */
  422. __le32 invert; /* invert the power bit */
  423. __le32 ignore_suspend; /* kept enabled over suspend */
  424. __le16 event_flags;
  425. __le16 event_type;
  426. __le32 num_kcontrols;
  427. struct snd_soc_tplg_private priv;
  428. /*
  429. * kcontrols that relate to this widget
  430. * follow here after widget private data
  431. */
  432. } __attribute__((packed));
  433. /*
  434. * Describes SW/FW specific features of PCM (FE DAI & DAI link).
  435. *
  436. * File block representation for PCM :-
  437. * +-----------------------------------+-----+
  438. * | struct snd_soc_tplg_hdr | 1 |
  439. * +-----------------------------------+-----+
  440. * | struct snd_soc_tplg_pcm | N |
  441. * +-----------------------------------+-----+
  442. */
  443. struct snd_soc_tplg_pcm {
  444. __le32 size; /* in bytes of this structure */
  445. char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
  446. char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
  447. __le32 pcm_id; /* unique ID - used to match with DAI link */
  448. __le32 dai_id; /* unique ID - used to match */
  449. __le32 playback; /* supports playback mode */
  450. __le32 capture; /* supports capture mode */
  451. __le32 compress; /* 1 = compressed; 0 = PCM */
  452. struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* for DAI link */
  453. __le32 num_streams; /* number of streams */
  454. struct snd_soc_tplg_stream_caps caps[2]; /* playback and capture for DAI */
  455. __le32 flag_mask; /* bitmask of flags to configure */
  456. __le32 flags; /* SND_SOC_TPLG_LNK_FLGBIT_* flag value */
  457. struct snd_soc_tplg_private priv;
  458. } __attribute__((packed));
  459. /*
  460. * Describes the physical link runtime supported configs or params
  461. *
  462. * File block representation for physical link config :-
  463. * +-----------------------------------+-----+
  464. * | struct snd_soc_tplg_hdr | 1 |
  465. * +-----------------------------------+-----+
  466. * | struct snd_soc_tplg_link_config | N |
  467. * +-----------------------------------+-----+
  468. */
  469. struct snd_soc_tplg_link_config {
  470. __le32 size; /* in bytes of this structure */
  471. __le32 id; /* unique ID - used to match */
  472. char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* name - used to match */
  473. char stream_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* stream name - used to match */
  474. struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* supported configs playback and captrure */
  475. __le32 num_streams; /* number of streams */
  476. struct snd_soc_tplg_hw_config hw_config[SND_SOC_TPLG_HW_CONFIG_MAX]; /* hw configs */
  477. __le32 num_hw_configs; /* number of hw configs */
  478. __le32 default_hw_config_id; /* default hw config ID for init */
  479. __le32 flag_mask; /* bitmask of flags to configure */
  480. __le32 flags; /* SND_SOC_TPLG_LNK_FLGBIT_* flag value */
  481. struct snd_soc_tplg_private priv;
  482. } __attribute__((packed));
  483. /*
  484. * Describes SW/FW specific features of physical DAI.
  485. * It can be used to configure backend DAIs for DPCM.
  486. *
  487. * File block representation for physical DAI :-
  488. * +-----------------------------------+-----+
  489. * | struct snd_soc_tplg_hdr | 1 |
  490. * +-----------------------------------+-----+
  491. * | struct snd_soc_tplg_dai | N |
  492. * +-----------------------------------+-----+
  493. */
  494. struct snd_soc_tplg_dai {
  495. __le32 size; /* in bytes of this structure */
  496. char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* name - used to match */
  497. __le32 dai_id; /* unique ID - used to match */
  498. __le32 playback; /* supports playback mode */
  499. __le32 capture; /* supports capture mode */
  500. struct snd_soc_tplg_stream_caps caps[2]; /* playback and capture for DAI */
  501. __le32 flag_mask; /* bitmask of flags to configure */
  502. __le32 flags; /* SND_SOC_TPLG_DAI_FLGBIT_* */
  503. struct snd_soc_tplg_private priv;
  504. } __attribute__((packed));
  505. #endif