skl-tplg-interface.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * skl-tplg-interface.h - Intel DSP FW private data interface
  4. *
  5. * Copyright (C) 2015 Intel Corp
  6. * Author: Jeeja KP <jeeja.kp@intel.com>
  7. * Nilofer, Samreen <samreen.nilofer@intel.com>
  8. */
  9. #ifndef __HDA_TPLG_INTERFACE_H__
  10. #define __HDA_TPLG_INTERFACE_H__
  11. #include <linux/types.h>
  12. /*
  13. * Default types range from 0~12. type can range from 0 to 0xff
  14. * SST types start at higher to avoid any overlapping in future
  15. */
  16. #define SKL_CONTROL_TYPE_BYTE_TLV 0x100
  17. #define SKL_CONTROL_TYPE_MIC_SELECT 0x102
  18. #define SKL_CONTROL_TYPE_MULTI_IO_SELECT 0x103
  19. #define SKL_CONTROL_TYPE_MULTI_IO_SELECT_DMIC 0x104
  20. #define HDA_SST_CFG_MAX 900 /* size of copier cfg*/
  21. #define MAX_IN_QUEUE 8
  22. #define MAX_OUT_QUEUE 8
  23. #define SKL_UUID_STR_SZ 40
  24. /* Event types goes here */
  25. /* Reserve event type 0 for no event handlers */
  26. enum skl_event_types {
  27. SKL_EVENT_NONE = 0,
  28. SKL_MIXER_EVENT,
  29. SKL_MUX_EVENT,
  30. SKL_VMIXER_EVENT,
  31. SKL_PGA_EVENT
  32. };
  33. /**
  34. * enum skl_ch_cfg - channel configuration
  35. *
  36. * @SKL_CH_CFG_MONO: One channel only
  37. * @SKL_CH_CFG_STEREO: L & R
  38. * @SKL_CH_CFG_2_1: L, R & LFE
  39. * @SKL_CH_CFG_3_0: L, C & R
  40. * @SKL_CH_CFG_3_1: L, C, R & LFE
  41. * @SKL_CH_CFG_QUATRO: L, R, Ls & Rs
  42. * @SKL_CH_CFG_4_0: L, C, R & Cs
  43. * @SKL_CH_CFG_5_0: L, C, R, Ls & Rs
  44. * @SKL_CH_CFG_5_1: L, C, R, Ls, Rs & LFE
  45. * @SKL_CH_CFG_DUAL_MONO: One channel replicated in two
  46. * @SKL_CH_CFG_I2S_DUAL_STEREO_0: Stereo(L,R) in 4 slots, 1st stream:[ L, R, -, - ]
  47. * @SKL_CH_CFG_I2S_DUAL_STEREO_1: Stereo(L,R) in 4 slots, 2nd stream:[ -, -, L, R ]
  48. * @SKL_CH_CFG_INVALID: Invalid
  49. */
  50. enum skl_ch_cfg {
  51. SKL_CH_CFG_MONO = 0,
  52. SKL_CH_CFG_STEREO = 1,
  53. SKL_CH_CFG_2_1 = 2,
  54. SKL_CH_CFG_3_0 = 3,
  55. SKL_CH_CFG_3_1 = 4,
  56. SKL_CH_CFG_QUATRO = 5,
  57. SKL_CH_CFG_4_0 = 6,
  58. SKL_CH_CFG_5_0 = 7,
  59. SKL_CH_CFG_5_1 = 8,
  60. SKL_CH_CFG_DUAL_MONO = 9,
  61. SKL_CH_CFG_I2S_DUAL_STEREO_0 = 10,
  62. SKL_CH_CFG_I2S_DUAL_STEREO_1 = 11,
  63. SKL_CH_CFG_7_1 = 12,
  64. SKL_CH_CFG_4_CHANNEL = SKL_CH_CFG_7_1,
  65. SKL_CH_CFG_INVALID
  66. };
  67. enum skl_module_type {
  68. SKL_MODULE_TYPE_MIXER = 0,
  69. SKL_MODULE_TYPE_COPIER,
  70. SKL_MODULE_TYPE_UPDWMIX,
  71. SKL_MODULE_TYPE_SRCINT,
  72. SKL_MODULE_TYPE_ALGO,
  73. SKL_MODULE_TYPE_BASE_OUTFMT,
  74. SKL_MODULE_TYPE_KPB,
  75. SKL_MODULE_TYPE_MIC_SELECT,
  76. };
  77. enum skl_core_affinity {
  78. SKL_AFFINITY_CORE_0 = 0,
  79. SKL_AFFINITY_CORE_1,
  80. SKL_AFFINITY_CORE_MAX
  81. };
  82. enum skl_pipe_conn_type {
  83. SKL_PIPE_CONN_TYPE_NONE = 0,
  84. SKL_PIPE_CONN_TYPE_FE,
  85. SKL_PIPE_CONN_TYPE_BE
  86. };
  87. enum skl_hw_conn_type {
  88. SKL_CONN_NONE = 0,
  89. SKL_CONN_SOURCE = 1,
  90. SKL_CONN_SINK = 2
  91. };
  92. enum skl_dev_type {
  93. SKL_DEVICE_BT = 0x0,
  94. SKL_DEVICE_DMIC = 0x1,
  95. SKL_DEVICE_I2S = 0x2,
  96. SKL_DEVICE_SLIMBUS = 0x3,
  97. SKL_DEVICE_HDALINK = 0x4,
  98. SKL_DEVICE_HDAHOST = 0x5,
  99. SKL_DEVICE_NONE
  100. };
  101. /**
  102. * enum skl_interleaving - interleaving style
  103. *
  104. * @SKL_INTERLEAVING_PER_CHANNEL: [s1_ch1...s1_chN,...,sM_ch1...sM_chN]
  105. * @SKL_INTERLEAVING_PER_SAMPLE: [s1_ch1...sM_ch1,...,s1_chN...sM_chN]
  106. */
  107. enum skl_interleaving {
  108. SKL_INTERLEAVING_PER_CHANNEL = 0,
  109. SKL_INTERLEAVING_PER_SAMPLE = 1,
  110. };
  111. enum skl_sample_type {
  112. SKL_SAMPLE_TYPE_INT_MSB = 0,
  113. SKL_SAMPLE_TYPE_INT_LSB = 1,
  114. SKL_SAMPLE_TYPE_INT_SIGNED = 2,
  115. SKL_SAMPLE_TYPE_INT_UNSIGNED = 3,
  116. SKL_SAMPLE_TYPE_FLOAT = 4
  117. };
  118. enum module_pin_type {
  119. /* All pins of the module takes same PCM inputs or outputs
  120. * e.g. mixout
  121. */
  122. SKL_PIN_TYPE_HOMOGENEOUS,
  123. /* All pins of the module takes different PCM inputs or outputs
  124. * e.g mux
  125. */
  126. SKL_PIN_TYPE_HETEROGENEOUS,
  127. };
  128. enum skl_module_param_type {
  129. SKL_PARAM_DEFAULT = 0,
  130. SKL_PARAM_INIT,
  131. SKL_PARAM_SET,
  132. SKL_PARAM_BIND
  133. };
  134. struct skl_dfw_algo_data {
  135. __u32 set_params:2;
  136. __u32 rsvd:30;
  137. __u32 param_id;
  138. __u32 max;
  139. char params[];
  140. } __attribute__((packed));
  141. enum skl_tkn_dir {
  142. SKL_DIR_IN,
  143. SKL_DIR_OUT
  144. };
  145. enum skl_tuple_type {
  146. SKL_TYPE_TUPLE,
  147. SKL_TYPE_DATA
  148. };
  149. /* v4 configuration data */
  150. struct skl_dfw_v4_module_pin {
  151. __u16 module_id;
  152. __u16 instance_id;
  153. } __attribute__((packed));
  154. struct skl_dfw_v4_module_fmt {
  155. __u32 channels;
  156. __u32 freq;
  157. __u32 bit_depth;
  158. __u32 valid_bit_depth;
  159. __u32 ch_cfg;
  160. __u32 interleaving_style;
  161. __u32 sample_type;
  162. __u32 ch_map;
  163. } __attribute__((packed));
  164. struct skl_dfw_v4_module_caps {
  165. __u32 set_params:2;
  166. __u32 rsvd:30;
  167. __u32 param_id;
  168. __u32 caps_size;
  169. __u32 caps[HDA_SST_CFG_MAX];
  170. } __attribute__((packed));
  171. struct skl_dfw_v4_pipe {
  172. __u8 pipe_id;
  173. __u8 pipe_priority;
  174. __u16 conn_type:4;
  175. __u16 rsvd:4;
  176. __u16 memory_pages:8;
  177. } __attribute__((packed));
  178. struct skl_dfw_v4_module {
  179. char uuid[SKL_UUID_STR_SZ];
  180. __u16 module_id;
  181. __u16 instance_id;
  182. __u32 max_mcps;
  183. __u32 mem_pages;
  184. __u32 obs;
  185. __u32 ibs;
  186. __u32 vbus_id;
  187. __u32 max_in_queue:8;
  188. __u32 max_out_queue:8;
  189. __u32 time_slot:8;
  190. __u32 core_id:4;
  191. __u32 rsvd1:4;
  192. __u32 module_type:8;
  193. __u32 conn_type:4;
  194. __u32 dev_type:4;
  195. __u32 hw_conn_type:4;
  196. __u32 rsvd2:12;
  197. __u32 params_fixup:8;
  198. __u32 converter:8;
  199. __u32 input_pin_type:1;
  200. __u32 output_pin_type:1;
  201. __u32 is_dynamic_in_pin:1;
  202. __u32 is_dynamic_out_pin:1;
  203. __u32 is_loadable:1;
  204. __u32 rsvd3:11;
  205. struct skl_dfw_v4_pipe pipe;
  206. struct skl_dfw_v4_module_fmt in_fmt[MAX_IN_QUEUE];
  207. struct skl_dfw_v4_module_fmt out_fmt[MAX_OUT_QUEUE];
  208. struct skl_dfw_v4_module_pin in_pin[MAX_IN_QUEUE];
  209. struct skl_dfw_v4_module_pin out_pin[MAX_OUT_QUEUE];
  210. struct skl_dfw_v4_module_caps caps;
  211. } __attribute__((packed));
  212. #endif