asoc.h 18 KB

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