msm-dolby-common.h 9.9 KB

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