msm-dolby-common.h 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2013-2014, 2016, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _MSM_DOLBY_COMMON_H_
  6. #define _MSM_DOLBY_COMMON_H_
  7. #include <sound/soc.h>
  8. #define DOLBY_BUNDLE_MODULE_ID 0x00010723
  9. #define DOLBY_VISUALIZER_MODULE_ID 0x0001072B
  10. #define DOLBY_PARAM_ID_VDHE 0x0001074D
  11. #define DOLBY_PARAM_ID_VSPE 0x00010750
  12. #define DOLBY_PARAM_ID_DSSF 0x00010753
  13. #define DOLBY_PARAM_ID_DVLI 0x0001073E
  14. #define DOLBY_PARAM_ID_DVLO 0x0001073F
  15. #define DOLBY_PARAM_ID_DVLE 0x0001073C
  16. #define DOLBY_PARAM_ID_DVMC 0x00010741
  17. #define DOLBY_PARAM_ID_DVME 0x00010740
  18. #define DOLBY_PARAM_ID_IENB 0x00010744
  19. #define DOLBY_PARAM_ID_IEBF 0x00010745
  20. #define DOLBY_PARAM_ID_IEON 0x00010743
  21. #define DOLBY_PARAM_ID_DEON 0x00010738
  22. #define DOLBY_PARAM_ID_NGON 0x00010736
  23. #define DOLBY_PARAM_ID_GEON 0x00010748
  24. #define DOLBY_PARAM_ID_GENB 0x00010749
  25. #define DOLBY_PARAM_ID_GEBF 0x0001074A
  26. #define DOLBY_PARAM_ID_AONB 0x0001075B
  27. #define DOLBY_PARAM_ID_AOBF 0x0001075C
  28. #define DOLBY_PARAM_ID_AOBG 0x0001075D
  29. #define DOLBY_PARAM_ID_AOON 0x00010759
  30. #define DOLBY_PARAM_ID_ARNB 0x0001075F
  31. #define DOLBY_PARAM_ID_ARBF 0x00010760
  32. #define DOLBY_PARAM_ID_PLB 0x00010768
  33. #define DOLBY_PARAM_ID_PLMD 0x00010767
  34. #define DOLBY_PARAM_ID_DHSB 0x0001074E
  35. #define DOLBY_PARAM_ID_DHRG 0x0001074F
  36. #define DOLBY_PARAM_ID_DSSB 0x00010751
  37. #define DOLBY_PARAM_ID_DSSA 0x00010752
  38. #define DOLBY_PARAM_ID_DVLA 0x0001073D
  39. #define DOLBY_PARAM_ID_IEBT 0x00010746
  40. #define DOLBY_PARAM_ID_IEA 0x0001076A
  41. #define DOLBY_PARAM_ID_DEA 0x00010739
  42. #define DOLBY_PARAM_ID_DED 0x0001073A
  43. #define DOLBY_PARAM_ID_GEBG 0x0001074B
  44. #define DOLBY_PARAM_ID_AOCC 0x0001075A
  45. #define DOLBY_PARAM_ID_ARBI 0x00010761
  46. #define DOLBY_PARAM_ID_ARBL 0x00010762
  47. #define DOLBY_PARAM_ID_ARBH 0x00010763
  48. #define DOLBY_PARAM_ID_AROD 0x00010764
  49. #define DOLBY_PARAM_ID_ARTP 0x00010765
  50. #define DOLBY_PARAM_ID_VMON 0x00010756
  51. #define DOLBY_PARAM_ID_VMB 0x00010757
  52. #define DOLBY_PARAM_ID_VCNB 0x00010733
  53. #define DOLBY_PARAM_ID_VCBF 0x00010734
  54. #define DOLBY_PARAM_ID_PREG 0x00010728
  55. #define DOLBY_PARAM_ID_VEN 0x00010732
  56. #define DOLBY_PARAM_ID_PSTG 0x00010729
  57. #define DOLBY_PARAM_ID_INIT_ENDP 0x00010727
  58. /* Not Used with Set Param kcontrol, only to query using Get Param */
  59. #define DOLBY_PARAM_ID_VER 0x00010726
  60. #define DOLBY_PARAM_ID_VCBG 0x00010730
  61. #define DOLBY_PARAM_ID_VCBE 0x00010731
  62. /* DOLBY DAP control params */
  63. #define DOLBY_COMMIT_ALL_TO_DSP 0x70000001
  64. #define DOLBY_COMMIT_TO_DSP 0x70000002
  65. #define DOLBY_USE_CACHE 0x70000003
  66. #define DOLBY_AUTO_ENDP 0x70000004
  67. #define DOLBY_AUTO_ENDDEP_PARAMS 0x70000005
  68. #define DOLBY_DAP_BYPASS 0x70000006
  69. #define DOLBY_ENABLE_CUSTOM_STEREO 0x000108c7
  70. /* DOLBY DAP offsets start */
  71. #define DOLBY_PARAM_VDHE_LENGTH 1
  72. #define DOLBY_PARAM_VDHE_OFFSET 0
  73. #define DOLBY_PARAM_VSPE_LENGTH 1
  74. #define DOLBY_PARAM_VSPE_OFFSET (DOLBY_PARAM_VDHE_OFFSET + \
  75. DOLBY_PARAM_VDHE_LENGTH)
  76. #define DOLBY_PARAM_DSSF_LENGTH 1
  77. #define DOLBY_PARAM_DSSF_OFFSET (DOLBY_PARAM_VSPE_OFFSET + \
  78. DOLBY_PARAM_VSPE_LENGTH)
  79. #define DOLBY_PARAM_DVLI_LENGTH 1
  80. #define DOLBY_PARAM_DVLI_OFFSET (DOLBY_PARAM_DSSF_OFFSET + \
  81. DOLBY_PARAM_DSSF_LENGTH)
  82. #define DOLBY_PARAM_DVLO_LENGTH 1
  83. #define DOLBY_PARAM_DVLO_OFFSET (DOLBY_PARAM_DVLI_OFFSET + \
  84. DOLBY_PARAM_DVLI_LENGTH)
  85. #define DOLBY_PARAM_DVLE_LENGTH 1
  86. #define DOLBY_PARAM_DVLE_OFFSET (DOLBY_PARAM_DVLO_OFFSET + \
  87. DOLBY_PARAM_DVLO_LENGTH)
  88. #define DOLBY_PARAM_DVMC_LENGTH 1
  89. #define DOLBY_PARAM_DVMC_OFFSET (DOLBY_PARAM_DVLE_OFFSET + \
  90. DOLBY_PARAM_DVLE_LENGTH)
  91. #define DOLBY_PARAM_DVME_LENGTH 1
  92. #define DOLBY_PARAM_DVME_OFFSET (DOLBY_PARAM_DVMC_OFFSET + \
  93. DOLBY_PARAM_DVMC_LENGTH)
  94. #define DOLBY_PARAM_IENB_LENGTH 1
  95. #define DOLBY_PARAM_IENB_OFFSET (DOLBY_PARAM_DVME_OFFSET + \
  96. DOLBY_PARAM_DVME_LENGTH)
  97. #define DOLBY_PARAM_IEBF_LENGTH 40
  98. #define DOLBY_PARAM_IEBF_OFFSET (DOLBY_PARAM_IENB_OFFSET + \
  99. DOLBY_PARAM_IENB_LENGTH)
  100. #define DOLBY_PARAM_IEON_LENGTH 1
  101. #define DOLBY_PARAM_IEON_OFFSET (DOLBY_PARAM_IEBF_OFFSET + \
  102. DOLBY_PARAM_IEBF_LENGTH)
  103. #define DOLBY_PARAM_DEON_LENGTH 1
  104. #define DOLBY_PARAM_DEON_OFFSET (DOLBY_PARAM_IEON_OFFSET + \
  105. DOLBY_PARAM_IEON_LENGTH)
  106. #define DOLBY_PARAM_NGON_LENGTH 1
  107. #define DOLBY_PARAM_NGON_OFFSET (DOLBY_PARAM_DEON_OFFSET + \
  108. DOLBY_PARAM_DEON_LENGTH)
  109. #define DOLBY_PARAM_GEON_LENGTH 1
  110. #define DOLBY_PARAM_GEON_OFFSET (DOLBY_PARAM_NGON_OFFSET + \
  111. DOLBY_PARAM_NGON_LENGTH)
  112. #define DOLBY_PARAM_GENB_LENGTH 1
  113. #define DOLBY_PARAM_GENB_OFFSET (DOLBY_PARAM_GEON_OFFSET + \
  114. DOLBY_PARAM_GEON_LENGTH)
  115. #define DOLBY_PARAM_GEBF_LENGTH 40
  116. #define DOLBY_PARAM_GEBF_OFFSET (DOLBY_PARAM_GENB_OFFSET + \
  117. DOLBY_PARAM_GENB_LENGTH)
  118. #define DOLBY_PARAM_AONB_LENGTH 1
  119. #define DOLBY_PARAM_AONB_OFFSET (DOLBY_PARAM_GEBF_OFFSET + \
  120. DOLBY_PARAM_GEBF_LENGTH)
  121. #define DOLBY_PARAM_AOBF_LENGTH 40
  122. #define DOLBY_PARAM_AOBF_OFFSET (DOLBY_PARAM_AONB_OFFSET + \
  123. DOLBY_PARAM_AONB_LENGTH)
  124. #define DOLBY_PARAM_AOBG_LENGTH 329
  125. #define DOLBY_PARAM_AOBG_OFFSET (DOLBY_PARAM_AOBF_OFFSET + \
  126. DOLBY_PARAM_AOBF_LENGTH)
  127. #define DOLBY_PARAM_AOON_LENGTH 1
  128. #define DOLBY_PARAM_AOON_OFFSET (DOLBY_PARAM_AOBG_OFFSET + \
  129. DOLBY_PARAM_AOBG_LENGTH)
  130. #define DOLBY_PARAM_ARNB_LENGTH 1
  131. #define DOLBY_PARAM_ARNB_OFFSET (DOLBY_PARAM_AOON_OFFSET + \
  132. DOLBY_PARAM_AOON_LENGTH)
  133. #define DOLBY_PARAM_ARBF_LENGTH 40
  134. #define DOLBY_PARAM_ARBF_OFFSET (DOLBY_PARAM_ARNB_OFFSET + \
  135. DOLBY_PARAM_ARNB_LENGTH)
  136. #define DOLBY_PARAM_PLB_LENGTH 1
  137. #define DOLBY_PARAM_PLB_OFFSET (DOLBY_PARAM_ARBF_OFFSET + \
  138. DOLBY_PARAM_ARBF_LENGTH)
  139. #define DOLBY_PARAM_PLMD_LENGTH 1
  140. #define DOLBY_PARAM_PLMD_OFFSET (DOLBY_PARAM_PLB_OFFSET + \
  141. DOLBY_PARAM_PLB_LENGTH)
  142. #define DOLBY_PARAM_DHSB_LENGTH 1
  143. #define DOLBY_PARAM_DHSB_OFFSET (DOLBY_PARAM_PLMD_OFFSET + \
  144. DOLBY_PARAM_PLMD_LENGTH)
  145. #define DOLBY_PARAM_DHRG_LENGTH 1
  146. #define DOLBY_PARAM_DHRG_OFFSET (DOLBY_PARAM_DHSB_OFFSET + \
  147. DOLBY_PARAM_DHSB_LENGTH)
  148. #define DOLBY_PARAM_DSSB_LENGTH 1
  149. #define DOLBY_PARAM_DSSB_OFFSET (DOLBY_PARAM_DHRG_OFFSET + \
  150. DOLBY_PARAM_DHRG_LENGTH)
  151. #define DOLBY_PARAM_DSSA_LENGTH 1
  152. #define DOLBY_PARAM_DSSA_OFFSET (DOLBY_PARAM_DSSB_OFFSET + \
  153. DOLBY_PARAM_DSSB_LENGTH)
  154. #define DOLBY_PARAM_DVLA_LENGTH 1
  155. #define DOLBY_PARAM_DVLA_OFFSET (DOLBY_PARAM_DSSA_OFFSET + \
  156. DOLBY_PARAM_DSSA_LENGTH)
  157. #define DOLBY_PARAM_IEBT_LENGTH 40
  158. #define DOLBY_PARAM_IEBT_OFFSET (DOLBY_PARAM_DVLA_OFFSET + \
  159. DOLBY_PARAM_DVLA_LENGTH)
  160. #define DOLBY_PARAM_IEA_LENGTH 1
  161. #define DOLBY_PARAM_IEA_OFFSET (DOLBY_PARAM_IEBT_OFFSET + \
  162. DOLBY_PARAM_IEBT_LENGTH)
  163. #define DOLBY_PARAM_DEA_LENGTH 1
  164. #define DOLBY_PARAM_DEA_OFFSET (DOLBY_PARAM_IEA_OFFSET + \
  165. DOLBY_PARAM_IEA_LENGTH)
  166. #define DOLBY_PARAM_DED_LENGTH 1
  167. #define DOLBY_PARAM_DED_OFFSET (DOLBY_PARAM_DEA_OFFSET + \
  168. DOLBY_PARAM_DEA_LENGTH)
  169. #define DOLBY_PARAM_GEBG_LENGTH 40
  170. #define DOLBY_PARAM_GEBG_OFFSET (DOLBY_PARAM_DED_OFFSET + \
  171. DOLBY_PARAM_DED_LENGTH)
  172. #define DOLBY_PARAM_AOCC_LENGTH 1
  173. #define DOLBY_PARAM_AOCC_OFFSET (DOLBY_PARAM_GEBG_OFFSET + \
  174. DOLBY_PARAM_GEBG_LENGTH)
  175. #define DOLBY_PARAM_ARBI_LENGTH 40
  176. #define DOLBY_PARAM_ARBI_OFFSET (DOLBY_PARAM_AOCC_OFFSET + \
  177. DOLBY_PARAM_AOCC_LENGTH)
  178. #define DOLBY_PARAM_ARBL_LENGTH 40
  179. #define DOLBY_PARAM_ARBL_OFFSET (DOLBY_PARAM_ARBI_OFFSET + \
  180. DOLBY_PARAM_ARBI_LENGTH)
  181. #define DOLBY_PARAM_ARBH_LENGTH 40
  182. #define DOLBY_PARAM_ARBH_OFFSET (DOLBY_PARAM_ARBL_OFFSET + \
  183. DOLBY_PARAM_ARBL_LENGTH)
  184. #define DOLBY_PARAM_AROD_LENGTH 1
  185. #define DOLBY_PARAM_AROD_OFFSET (DOLBY_PARAM_ARBH_OFFSET + \
  186. DOLBY_PARAM_ARBH_LENGTH)
  187. #define DOLBY_PARAM_ARTP_LENGTH 1
  188. #define DOLBY_PARAM_ARTP_OFFSET (DOLBY_PARAM_AROD_OFFSET + \
  189. DOLBY_PARAM_AROD_LENGTH)
  190. #define DOLBY_PARAM_VMON_LENGTH 1
  191. #define DOLBY_PARAM_VMON_OFFSET (DOLBY_PARAM_ARTP_OFFSET + \
  192. DOLBY_PARAM_ARTP_LENGTH)
  193. #define DOLBY_PARAM_VMB_LENGTH 1
  194. #define DOLBY_PARAM_VMB_OFFSET (DOLBY_PARAM_VMON_OFFSET + \
  195. DOLBY_PARAM_VMON_LENGTH)
  196. #define DOLBY_PARAM_VCNB_LENGTH 1
  197. #define DOLBY_PARAM_VCNB_OFFSET (DOLBY_PARAM_VMB_OFFSET + \
  198. DOLBY_PARAM_VMB_LENGTH)
  199. #define DOLBY_PARAM_VCBF_LENGTH 20
  200. #define DOLBY_PARAM_VCBF_OFFSET (DOLBY_PARAM_VCNB_OFFSET + \
  201. DOLBY_PARAM_VCNB_LENGTH)
  202. #define DOLBY_PARAM_PREG_LENGTH 1
  203. #define DOLBY_PARAM_PREG_OFFSET (DOLBY_PARAM_VCBF_OFFSET + \
  204. DOLBY_PARAM_VCBF_LENGTH)
  205. #define DOLBY_PARAM_VEN_LENGTH 1
  206. #define DOLBY_PARAM_VEN_OFFSET (DOLBY_PARAM_PREG_OFFSET + \
  207. DOLBY_PARAM_PREG_LENGTH)
  208. #define DOLBY_PARAM_PSTG_LENGTH 1
  209. #define DOLBY_PARAM_PSTG_OFFSET (DOLBY_PARAM_VEN_OFFSET + \
  210. DOLBY_PARAM_VEN_LENGTH)
  211. #define DOLBY_PARAM_INT_ENDP_LENGTH 1
  212. #define DOLBY_PARAM_PAYLOAD_SIZE 3
  213. #define DOLBY_MAX_LENGTH_INDIVIDUAL_PARAM 329
  214. #define TOTAL_LENGTH_DOLBY_PARAM 745
  215. #define DOLBY_VIS_PARAM_HEADER_SIZE 25
  216. #define DOLBY_PARAM_VCNB_MAX_LENGTH 40
  217. #define DOLBY_INVALID_PORT_ID -1
  218. enum {
  219. DEVICE_NONE = 0x0,
  220. /* output devices */
  221. EARPIECE = 0x1,
  222. SPEAKER = 0x2,
  223. WIRED_HEADSET = 0x4,
  224. WIRED_HEADPHONE = 0x8,
  225. BLUETOOTH_SCO = 0x10,
  226. BLUETOOTH_SCO_HEADSET = 0x20,
  227. BLUETOOTH_SCO_CARKIT = 0x40,
  228. BLUETOOTH_A2DP = 0x80,
  229. BLUETOOTH_A2DP_HEADPHONES = 0x100,
  230. BLUETOOTH_A2DP_SPEAKER = 0x200,
  231. AUX_DIGITAL = 0x400,
  232. ANLG_DOCK_HEADSET = 0x800,
  233. DGTL_DOCK_HEADSET = 0x1000,
  234. USB_ACCESSORY = 0x2000,
  235. USB_DEVICE = 0x4000,
  236. REMOTE_SUBMIX = 0x8000,
  237. ANC_HEADSET = 0x10000,
  238. ANC_HEADPHONE = 0x20000,
  239. PROXY = 0x2000000,
  240. FM = 0x100000,
  241. FM_TX = 0x1000000,
  242. DEVICE_OUT_DEFAULT = 0x40000000,
  243. DEVICE_OUT_ALL = 0x403FFFFF,
  244. };
  245. #endif