skl-tplg-interface.h 5.1 KB

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