asoc.h 18 KB

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