cs35l41.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916
  1. /* SPDX-License-Identifier: GPL-2.0
  2. *
  3. * linux/sound/cs35l41.h -- Platform data for CS35L41
  4. *
  5. * Copyright (c) 2017-2021 Cirrus Logic Inc.
  6. *
  7. * Author: David Rhodes <david.rhodes@cirrus.com>
  8. */
  9. #ifndef __CS35L41_H
  10. #define __CS35L41_H
  11. #include <linux/regmap.h>
  12. #include <linux/firmware/cirrus/cs_dsp.h>
  13. #define CS35L41_FIRSTREG 0x00000000
  14. #define CS35L41_LASTREG 0x03804FE8
  15. #define CS35L41_DEVID 0x00000000
  16. #define CS35L41_REVID 0x00000004
  17. #define CS35L41_FABID 0x00000008
  18. #define CS35L41_RELID 0x0000000C
  19. #define CS35L41_OTPID 0x00000010
  20. #define CS35L41_SFT_RESET 0x00000020
  21. #define CS35L41_TEST_KEY_CTL 0x00000040
  22. #define CS35L41_USER_KEY_CTL 0x00000044
  23. #define CS35L41_OTP_MEM0 0x00000400
  24. #define CS35L41_OTP_MEM31 0x0000047C
  25. #define CS35L41_OTP_CTRL0 0x00000500
  26. #define CS35L41_OTP_CTRL1 0x00000504
  27. #define CS35L41_OTP_CTRL3 0x00000508
  28. #define CS35L41_OTP_CTRL4 0x0000050C
  29. #define CS35L41_OTP_CTRL5 0x00000510
  30. #define CS35L41_OTP_CTRL6 0x00000514
  31. #define CS35L41_OTP_CTRL7 0x00000518
  32. #define CS35L41_OTP_CTRL8 0x0000051C
  33. #define CS35L41_PWR_CTRL1 0x00002014
  34. #define CS35L41_PWR_CTRL2 0x00002018
  35. #define CS35L41_PWR_CTRL3 0x0000201C
  36. #define CS35L41_CTRL_OVRRIDE 0x00002020
  37. #define CS35L41_AMP_OUT_MUTE 0x00002024
  38. #define CS35L41_PROTECT_REL_ERR_IGN 0x00002034
  39. #define CS35L41_GPIO_PAD_CONTROL 0x0000242C
  40. #define CS35L41_JTAG_CONTROL 0x00002438
  41. #define CS35L41_PWRMGT_CTL 0x00002900
  42. #define CS35L41_WAKESRC_CTL 0x00002904
  43. #define CS35L41_PWRMGT_STS 0x00002908
  44. #define CS35L41_PLL_CLK_CTRL 0x00002C04
  45. #define CS35L41_DSP_CLK_CTRL 0x00002C08
  46. #define CS35L41_GLOBAL_CLK_CTRL 0x00002C0C
  47. #define CS35L41_DATA_FS_SEL 0x00002C10
  48. #define CS35L41_TST_FS_MON0 0x00002D10
  49. #define CS35L41_MDSYNC_EN 0x00003400
  50. #define CS35L41_MDSYNC_TX_ID 0x00003408
  51. #define CS35L41_MDSYNC_PWR_CTRL 0x0000340C
  52. #define CS35L41_MDSYNC_DATA_TX 0x00003410
  53. #define CS35L41_MDSYNC_TX_STATUS 0x00003414
  54. #define CS35L41_MDSYNC_DATA_RX 0x0000341C
  55. #define CS35L41_MDSYNC_RX_STATUS 0x00003420
  56. #define CS35L41_MDSYNC_ERR_STATUS 0x00003424
  57. #define CS35L41_MDSYNC_SYNC_PTE2 0x00003528
  58. #define CS35L41_MDSYNC_SYNC_PTE3 0x0000352C
  59. #define CS35L41_MDSYNC_SYNC_MSM_STATUS 0x0000353C
  60. #define CS35L41_BSTCVRT_VCTRL1 0x00003800
  61. #define CS35L41_BSTCVRT_VCTRL2 0x00003804
  62. #define CS35L41_BSTCVRT_PEAK_CUR 0x00003808
  63. #define CS35L41_BSTCVRT_SFT_RAMP 0x0000380C
  64. #define CS35L41_BSTCVRT_COEFF 0x00003810
  65. #define CS35L41_BSTCVRT_SLOPE_LBST 0x00003814
  66. #define CS35L41_BSTCVRT_SW_FREQ 0x00003818
  67. #define CS35L41_BSTCVRT_DCM_CTRL 0x0000381C
  68. #define CS35L41_BSTCVRT_DCM_MODE_FORCE 0x00003820
  69. #define CS35L41_BSTCVRT_OVERVOLT_CTRL 0x00003830
  70. #define CS35L41_VI_VOL_POL 0x00004000
  71. #define CS35L41_VIMON_SPKMON_RESYNC 0x00004100
  72. #define CS35L41_DTEMP_WARN_THLD 0x00004220
  73. #define CS35L41_DTEMP_CFG 0x00004224
  74. #define CS35L41_DTEMP_EN 0x00004308
  75. #define CS35L41_VPVBST_FS_SEL 0x00004400
  76. #define CS35L41_SP_ENABLES 0x00004800
  77. #define CS35L41_SP_RATE_CTRL 0x00004804
  78. #define CS35L41_SP_FORMAT 0x00004808
  79. #define CS35L41_SP_HIZ_CTRL 0x0000480C
  80. #define CS35L41_SP_FRAME_TX_SLOT 0x00004810
  81. #define CS35L41_SP_FRAME_RX_SLOT 0x00004820
  82. #define CS35L41_SP_TX_WL 0x00004830
  83. #define CS35L41_SP_RX_WL 0x00004840
  84. #define CS35L41_ASP_CONTROL4 0x00004854
  85. #define CS35L41_DAC_PCM1_SRC 0x00004C00
  86. #define CS35L41_ASP_TX1_SRC 0x00004C20
  87. #define CS35L41_ASP_TX2_SRC 0x00004C24
  88. #define CS35L41_ASP_TX3_SRC 0x00004C28
  89. #define CS35L41_ASP_TX4_SRC 0x00004C2C
  90. #define CS35L41_DSP1_RX1_SRC 0x00004C40
  91. #define CS35L41_DSP1_RX2_SRC 0x00004C44
  92. #define CS35L41_DSP1_RX3_SRC 0x00004C48
  93. #define CS35L41_DSP1_RX4_SRC 0x00004C4C
  94. #define CS35L41_DSP1_RX5_SRC 0x00004C50
  95. #define CS35L41_DSP1_RX6_SRC 0x00004C54
  96. #define CS35L41_DSP1_RX7_SRC 0x00004C58
  97. #define CS35L41_DSP1_RX8_SRC 0x00004C5C
  98. #define CS35L41_NGATE1_SRC 0x00004C60
  99. #define CS35L41_NGATE2_SRC 0x00004C64
  100. #define CS35L41_AMP_DIG_VOL_CTRL 0x00006000
  101. #define CS35L41_VPBR_CFG 0x00006404
  102. #define CS35L41_VBBR_CFG 0x00006408
  103. #define CS35L41_VPBR_STATUS 0x0000640C
  104. #define CS35L41_VBBR_STATUS 0x00006410
  105. #define CS35L41_OVERTEMP_CFG 0x00006414
  106. #define CS35L41_AMP_ERR_VOL 0x00006418
  107. #define CS35L41_VOL_STATUS_TO_DSP 0x00006450
  108. #define CS35L41_CLASSH_CFG 0x00006800
  109. #define CS35L41_WKFET_CFG 0x00006804
  110. #define CS35L41_NG_CFG 0x00006808
  111. #define CS35L41_AMP_GAIN_CTRL 0x00006C04
  112. #define CS35L41_DAC_MSM_CFG 0x00007400
  113. #define CS35L41_IRQ1_CFG 0x00010000
  114. #define CS35L41_IRQ1_STATUS 0x00010004
  115. #define CS35L41_IRQ1_STATUS1 0x00010010
  116. #define CS35L41_IRQ1_STATUS2 0x00010014
  117. #define CS35L41_IRQ1_STATUS3 0x00010018
  118. #define CS35L41_IRQ1_STATUS4 0x0001001C
  119. #define CS35L41_IRQ1_RAW_STATUS1 0x00010090
  120. #define CS35L41_IRQ1_RAW_STATUS2 0x00010094
  121. #define CS35L41_IRQ1_RAW_STATUS3 0x00010098
  122. #define CS35L41_IRQ1_RAW_STATUS4 0x0001009C
  123. #define CS35L41_IRQ1_MASK1 0x00010110
  124. #define CS35L41_IRQ1_MASK2 0x00010114
  125. #define CS35L41_IRQ1_MASK3 0x00010118
  126. #define CS35L41_IRQ1_MASK4 0x0001011C
  127. #define CS35L41_IRQ1_FRC1 0x00010190
  128. #define CS35L41_IRQ1_FRC2 0x00010194
  129. #define CS35L41_IRQ1_FRC3 0x00010198
  130. #define CS35L41_IRQ1_FRC4 0x0001019C
  131. #define CS35L41_IRQ1_EDGE1 0x00010210
  132. #define CS35L41_IRQ1_EDGE4 0x0001021C
  133. #define CS35L41_IRQ1_POL1 0x00010290
  134. #define CS35L41_IRQ1_POL2 0x00010294
  135. #define CS35L41_IRQ1_POL3 0x00010298
  136. #define CS35L41_IRQ1_POL4 0x0001029C
  137. #define CS35L41_IRQ1_DB3 0x00010318
  138. #define CS35L41_IRQ2_CFG 0x00010800
  139. #define CS35L41_IRQ2_STATUS 0x00010804
  140. #define CS35L41_IRQ2_STATUS1 0x00010810
  141. #define CS35L41_IRQ2_STATUS2 0x00010814
  142. #define CS35L41_IRQ2_STATUS3 0x00010818
  143. #define CS35L41_IRQ2_STATUS4 0x0001081C
  144. #define CS35L41_IRQ2_RAW_STATUS1 0x00010890
  145. #define CS35L41_IRQ2_RAW_STATUS2 0x00010894
  146. #define CS35L41_IRQ2_RAW_STATUS3 0x00010898
  147. #define CS35L41_IRQ2_RAW_STATUS4 0x0001089C
  148. #define CS35L41_IRQ2_MASK1 0x00010910
  149. #define CS35L41_IRQ2_MASK2 0x00010914
  150. #define CS35L41_IRQ2_MASK3 0x00010918
  151. #define CS35L41_IRQ2_MASK4 0x0001091C
  152. #define CS35L41_IRQ2_FRC1 0x00010990
  153. #define CS35L41_IRQ2_FRC2 0x00010994
  154. #define CS35L41_IRQ2_FRC3 0x00010998
  155. #define CS35L41_IRQ2_FRC4 0x0001099C
  156. #define CS35L41_IRQ2_EDGE1 0x00010A10
  157. #define CS35L41_IRQ2_EDGE4 0x00010A1C
  158. #define CS35L41_IRQ2_POL1 0x00010A90
  159. #define CS35L41_IRQ2_POL2 0x00010A94
  160. #define CS35L41_IRQ2_POL3 0x00010A98
  161. #define CS35L41_IRQ2_POL4 0x00010A9C
  162. #define CS35L41_IRQ2_DB3 0x00010B18
  163. #define CS35L41_GPIO_STATUS1 0x00011000
  164. #define CS35L41_GPIO1_CTRL1 0x00011008
  165. #define CS35L41_GPIO2_CTRL1 0x0001100C
  166. #define CS35L41_MIXER_NGATE_CFG 0x00012000
  167. #define CS35L41_MIXER_NGATE_CH1_CFG 0x00012004
  168. #define CS35L41_MIXER_NGATE_CH2_CFG 0x00012008
  169. #define CS35L41_DSP_MBOX_1 0x00013000
  170. #define CS35L41_DSP_MBOX_2 0x00013004
  171. #define CS35L41_DSP_MBOX_3 0x00013008
  172. #define CS35L41_DSP_MBOX_4 0x0001300C
  173. #define CS35L41_DSP_MBOX_5 0x00013010
  174. #define CS35L41_DSP_MBOX_6 0x00013014
  175. #define CS35L41_DSP_MBOX_7 0x00013018
  176. #define CS35L41_DSP_MBOX_8 0x0001301C
  177. #define CS35L41_DSP_VIRT1_MBOX_1 0x00013020
  178. #define CS35L41_DSP_VIRT1_MBOX_2 0x00013024
  179. #define CS35L41_DSP_VIRT1_MBOX_3 0x00013028
  180. #define CS35L41_DSP_VIRT1_MBOX_4 0x0001302C
  181. #define CS35L41_DSP_VIRT1_MBOX_5 0x00013030
  182. #define CS35L41_DSP_VIRT1_MBOX_6 0x00013034
  183. #define CS35L41_DSP_VIRT1_MBOX_7 0x00013038
  184. #define CS35L41_DSP_VIRT1_MBOX_8 0x0001303C
  185. #define CS35L41_DSP_VIRT2_MBOX_1 0x00013040
  186. #define CS35L41_DSP_VIRT2_MBOX_2 0x00013044
  187. #define CS35L41_DSP_VIRT2_MBOX_3 0x00013048
  188. #define CS35L41_DSP_VIRT2_MBOX_4 0x0001304C
  189. #define CS35L41_DSP_VIRT2_MBOX_5 0x00013050
  190. #define CS35L41_DSP_VIRT2_MBOX_6 0x00013054
  191. #define CS35L41_DSP_VIRT2_MBOX_7 0x00013058
  192. #define CS35L41_DSP_VIRT2_MBOX_8 0x0001305C
  193. #define CS35L41_CLOCK_DETECT_1 0x00014000
  194. #define CS35L41_TIMER1_CONTROL 0x00015000
  195. #define CS35L41_TIMER1_COUNT_PRESET 0x00015004
  196. #define CS35L41_TIMER1_START_STOP 0x0001500C
  197. #define CS35L41_TIMER1_STATUS 0x00015010
  198. #define CS35L41_TIMER1_COUNT_READBACK 0x00015014
  199. #define CS35L41_TIMER1_DSP_CLK_CFG 0x00015018
  200. #define CS35L41_TIMER1_DSP_CLK_STATUS 0x0001501C
  201. #define CS35L41_TIMER2_CONTROL 0x00015100
  202. #define CS35L41_TIMER2_COUNT_PRESET 0x00015104
  203. #define CS35L41_TIMER2_START_STOP 0x0001510C
  204. #define CS35L41_TIMER2_STATUS 0x00015110
  205. #define CS35L41_TIMER2_COUNT_READBACK 0x00015114
  206. #define CS35L41_TIMER2_DSP_CLK_CFG 0x00015118
  207. #define CS35L41_TIMER2_DSP_CLK_STATUS 0x0001511C
  208. #define CS35L41_DFT_JTAG_CONTROL 0x00016000
  209. #define CS35L41_DIE_STS1 0x00017040
  210. #define CS35L41_DIE_STS2 0x00017044
  211. #define CS35L41_TEMP_CAL1 0x00017048
  212. #define CS35L41_TEMP_CAL2 0x0001704C
  213. #define CS35L41_DSP1_XMEM_PACK_0 0x02000000
  214. #define CS35L41_DSP1_XMEM_PACK_3068 0x02002FF0
  215. #define CS35L41_DSP1_XMEM_UNPACK32_0 0x02400000
  216. #define CS35L41_DSP1_XMEM_UNPACK32_2046 0x02401FF8
  217. #define CS35L41_DSP1_TIMESTAMP_COUNT 0x025C0800
  218. #define CS35L41_DSP1_SYS_ID 0x025E0000
  219. #define CS35L41_DSP1_SYS_VERSION 0x025E0004
  220. #define CS35L41_DSP1_SYS_CORE_ID 0x025E0008
  221. #define CS35L41_DSP1_SYS_AHB_ADDR 0x025E000C
  222. #define CS35L41_DSP1_SYS_XSRAM_SIZE 0x025E0010
  223. #define CS35L41_DSP1_SYS_YSRAM_SIZE 0x025E0018
  224. #define CS35L41_DSP1_SYS_PSRAM_SIZE 0x025E0020
  225. #define CS35L41_DSP1_SYS_PM_BOOT_SIZE 0x025E0028
  226. #define CS35L41_DSP1_SYS_FEATURES 0x025E002C
  227. #define CS35L41_DSP1_SYS_FIR_FILTERS 0x025E0030
  228. #define CS35L41_DSP1_SYS_LMS_FILTERS 0x025E0034
  229. #define CS35L41_DSP1_SYS_XM_BANK_SIZE 0x025E0038
  230. #define CS35L41_DSP1_SYS_YM_BANK_SIZE 0x025E003C
  231. #define CS35L41_DSP1_SYS_PM_BANK_SIZE 0x025E0040
  232. #define CS35L41_DSP1_AHBM_WIN0_CTRL0 0x025E2000
  233. #define CS35L41_DSP1_AHBM_WIN0_CTRL1 0x025E2004
  234. #define CS35L41_DSP1_AHBM_WIN1_CTRL0 0x025E2008
  235. #define CS35L41_DSP1_AHBM_WIN1_CTRL1 0x025E200C
  236. #define CS35L41_DSP1_AHBM_WIN2_CTRL0 0x025E2010
  237. #define CS35L41_DSP1_AHBM_WIN2_CTRL1 0x025E2014
  238. #define CS35L41_DSP1_AHBM_WIN3_CTRL0 0x025E2018
  239. #define CS35L41_DSP1_AHBM_WIN3_CTRL1 0x025E201C
  240. #define CS35L41_DSP1_AHBM_WIN4_CTRL0 0x025E2020
  241. #define CS35L41_DSP1_AHBM_WIN4_CTRL1 0x025E2024
  242. #define CS35L41_DSP1_AHBM_WIN5_CTRL0 0x025E2028
  243. #define CS35L41_DSP1_AHBM_WIN5_CTRL1 0x025E202C
  244. #define CS35L41_DSP1_AHBM_WIN6_CTRL0 0x025E2030
  245. #define CS35L41_DSP1_AHBM_WIN6_CTRL1 0x025E2034
  246. #define CS35L41_DSP1_AHBM_WIN7_CTRL0 0x025E2038
  247. #define CS35L41_DSP1_AHBM_WIN7_CTRL1 0x025E203C
  248. #define CS35L41_DSP1_AHBM_WIN_DBG_CTRL0 0x025E2040
  249. #define CS35L41_DSP1_AHBM_WIN_DBG_CTRL1 0x025E2044
  250. #define CS35L41_DSP1_XMEM_UNPACK24_0 0x02800000
  251. #define CS35L41_DSP1_XMEM_UNPACK24_4093 0x02803FF4
  252. #define CS35L41_DSP1_CTRL_BASE 0x02B80000
  253. #define CS35L41_DSP1_CORE_SOFT_RESET 0x02B80010
  254. #define CS35L41_DSP1_DEBUG 0x02B80040
  255. #define CS35L41_DSP1_TIMER_CTRL 0x02B80048
  256. #define CS35L41_DSP1_STREAM_ARB_CTRL 0x02B80050
  257. #define CS35L41_DSP1_RX1_RATE 0x02B80080
  258. #define CS35L41_DSP1_RX2_RATE 0x02B80088
  259. #define CS35L41_DSP1_RX3_RATE 0x02B80090
  260. #define CS35L41_DSP1_RX4_RATE 0x02B80098
  261. #define CS35L41_DSP1_RX5_RATE 0x02B800A0
  262. #define CS35L41_DSP1_RX6_RATE 0x02B800A8
  263. #define CS35L41_DSP1_RX7_RATE 0x02B800B0
  264. #define CS35L41_DSP1_RX8_RATE 0x02B800B8
  265. #define CS35L41_DSP1_TX1_RATE 0x02B80280
  266. #define CS35L41_DSP1_TX2_RATE 0x02B80288
  267. #define CS35L41_DSP1_TX3_RATE 0x02B80290
  268. #define CS35L41_DSP1_TX4_RATE 0x02B80298
  269. #define CS35L41_DSP1_TX5_RATE 0x02B802A0
  270. #define CS35L41_DSP1_TX6_RATE 0x02B802A8
  271. #define CS35L41_DSP1_TX7_RATE 0x02B802B0
  272. #define CS35L41_DSP1_TX8_RATE 0x02B802B8
  273. #define CS35L41_DSP1_NMI_CTRL1 0x02B80480
  274. #define CS35L41_DSP1_NMI_CTRL2 0x02B80488
  275. #define CS35L41_DSP1_NMI_CTRL3 0x02B80490
  276. #define CS35L41_DSP1_NMI_CTRL4 0x02B80498
  277. #define CS35L41_DSP1_NMI_CTRL5 0x02B804A0
  278. #define CS35L41_DSP1_NMI_CTRL6 0x02B804A8
  279. #define CS35L41_DSP1_NMI_CTRL7 0x02B804B0
  280. #define CS35L41_DSP1_NMI_CTRL8 0x02B804B8
  281. #define CS35L41_DSP1_RESUME_CTRL 0x02B80500
  282. #define CS35L41_DSP1_IRQ1_CTRL 0x02B80508
  283. #define CS35L41_DSP1_IRQ2_CTRL 0x02B80510
  284. #define CS35L41_DSP1_IRQ3_CTRL 0x02B80518
  285. #define CS35L41_DSP1_IRQ4_CTRL 0x02B80520
  286. #define CS35L41_DSP1_IRQ5_CTRL 0x02B80528
  287. #define CS35L41_DSP1_IRQ6_CTRL 0x02B80530
  288. #define CS35L41_DSP1_IRQ7_CTRL 0x02B80538
  289. #define CS35L41_DSP1_IRQ8_CTRL 0x02B80540
  290. #define CS35L41_DSP1_IRQ9_CTRL 0x02B80548
  291. #define CS35L41_DSP1_IRQ10_CTRL 0x02B80550
  292. #define CS35L41_DSP1_IRQ11_CTRL 0x02B80558
  293. #define CS35L41_DSP1_IRQ12_CTRL 0x02B80560
  294. #define CS35L41_DSP1_IRQ13_CTRL 0x02B80568
  295. #define CS35L41_DSP1_IRQ14_CTRL 0x02B80570
  296. #define CS35L41_DSP1_IRQ15_CTRL 0x02B80578
  297. #define CS35L41_DSP1_IRQ16_CTRL 0x02B80580
  298. #define CS35L41_DSP1_IRQ17_CTRL 0x02B80588
  299. #define CS35L41_DSP1_IRQ18_CTRL 0x02B80590
  300. #define CS35L41_DSP1_IRQ19_CTRL 0x02B80598
  301. #define CS35L41_DSP1_IRQ20_CTRL 0x02B805A0
  302. #define CS35L41_DSP1_IRQ21_CTRL 0x02B805A8
  303. #define CS35L41_DSP1_IRQ22_CTRL 0x02B805B0
  304. #define CS35L41_DSP1_IRQ23_CTRL 0x02B805B8
  305. #define CS35L41_DSP1_SCRATCH1 0x02B805C0
  306. #define CS35L41_DSP1_SCRATCH2 0x02B805C8
  307. #define CS35L41_DSP1_SCRATCH3 0x02B805D0
  308. #define CS35L41_DSP1_SCRATCH4 0x02B805D8
  309. #define CS35L41_DSP1_CCM_CORE_CTRL 0x02BC1000
  310. #define CS35L41_DSP1_CCM_CLK_OVERRIDE 0x02BC1008
  311. #define CS35L41_DSP1_XM_MSTR_EN 0x02BC2000
  312. #define CS35L41_DSP1_XM_CORE_PRI 0x02BC2008
  313. #define CS35L41_DSP1_XM_AHB_PACK_PL_PRI 0x02BC2010
  314. #define CS35L41_DSP1_XM_AHB_UP_PL_PRI 0x02BC2018
  315. #define CS35L41_DSP1_XM_ACCEL_PL0_PRI 0x02BC2020
  316. #define CS35L41_DSP1_XM_NPL0_PRI 0x02BC2078
  317. #define CS35L41_DSP1_YM_MSTR_EN 0x02BC20C0
  318. #define CS35L41_DSP1_YM_CORE_PRI 0x02BC20C8
  319. #define CS35L41_DSP1_YM_AHB_PACK_PL_PRI 0x02BC20D0
  320. #define CS35L41_DSP1_YM_AHB_UP_PL_PRI 0x02BC20D8
  321. #define CS35L41_DSP1_YM_ACCEL_PL0_PRI 0x02BC20E0
  322. #define CS35L41_DSP1_YM_NPL0_PRI 0x02BC2138
  323. #define CS35L41_DSP1_PM_MSTR_EN 0x02BC2180
  324. #define CS35L41_DSP1_PM_PATCH0_ADDR 0x02BC2188
  325. #define CS35L41_DSP1_PM_PATCH0_EN 0x02BC218C
  326. #define CS35L41_DSP1_PM_PATCH0_DATA_LO 0x02BC2190
  327. #define CS35L41_DSP1_PM_PATCH0_DATA_HI 0x02BC2194
  328. #define CS35L41_DSP1_PM_PATCH1_ADDR 0x02BC2198
  329. #define CS35L41_DSP1_PM_PATCH1_EN 0x02BC219C
  330. #define CS35L41_DSP1_PM_PATCH1_DATA_LO 0x02BC21A0
  331. #define CS35L41_DSP1_PM_PATCH1_DATA_HI 0x02BC21A4
  332. #define CS35L41_DSP1_PM_PATCH2_ADDR 0x02BC21A8
  333. #define CS35L41_DSP1_PM_PATCH2_EN 0x02BC21AC
  334. #define CS35L41_DSP1_PM_PATCH2_DATA_LO 0x02BC21B0
  335. #define CS35L41_DSP1_PM_PATCH2_DATA_HI 0x02BC21B4
  336. #define CS35L41_DSP1_PM_PATCH3_ADDR 0x02BC21B8
  337. #define CS35L41_DSP1_PM_PATCH3_EN 0x02BC21BC
  338. #define CS35L41_DSP1_PM_PATCH3_DATA_LO 0x02BC21C0
  339. #define CS35L41_DSP1_PM_PATCH3_DATA_HI 0x02BC21C4
  340. #define CS35L41_DSP1_PM_PATCH4_ADDR 0x02BC21C8
  341. #define CS35L41_DSP1_PM_PATCH4_EN 0x02BC21CC
  342. #define CS35L41_DSP1_PM_PATCH4_DATA_LO 0x02BC21D0
  343. #define CS35L41_DSP1_PM_PATCH4_DATA_HI 0x02BC21D4
  344. #define CS35L41_DSP1_PM_PATCH5_ADDR 0x02BC21D8
  345. #define CS35L41_DSP1_PM_PATCH5_EN 0x02BC21DC
  346. #define CS35L41_DSP1_PM_PATCH5_DATA_LO 0x02BC21E0
  347. #define CS35L41_DSP1_PM_PATCH5_DATA_HI 0x02BC21E4
  348. #define CS35L41_DSP1_PM_PATCH6_ADDR 0x02BC21E8
  349. #define CS35L41_DSP1_PM_PATCH6_EN 0x02BC21EC
  350. #define CS35L41_DSP1_PM_PATCH6_DATA_LO 0x02BC21F0
  351. #define CS35L41_DSP1_PM_PATCH6_DATA_HI 0x02BC21F4
  352. #define CS35L41_DSP1_PM_PATCH7_ADDR 0x02BC21F8
  353. #define CS35L41_DSP1_PM_PATCH7_EN 0x02BC21FC
  354. #define CS35L41_DSP1_PM_PATCH7_DATA_LO 0x02BC2200
  355. #define CS35L41_DSP1_PM_PATCH7_DATA_HI 0x02BC2204
  356. #define CS35L41_DSP1_MPU_XM_ACCESS0 0x02BC3000
  357. #define CS35L41_DSP1_MPU_YM_ACCESS0 0x02BC3004
  358. #define CS35L41_DSP1_MPU_WNDW_ACCESS0 0x02BC3008
  359. #define CS35L41_DSP1_MPU_XREG_ACCESS0 0x02BC300C
  360. #define CS35L41_DSP1_MPU_YREG_ACCESS0 0x02BC3014
  361. #define CS35L41_DSP1_MPU_XM_ACCESS1 0x02BC3018
  362. #define CS35L41_DSP1_MPU_YM_ACCESS1 0x02BC301C
  363. #define CS35L41_DSP1_MPU_WNDW_ACCESS1 0x02BC3020
  364. #define CS35L41_DSP1_MPU_XREG_ACCESS1 0x02BC3024
  365. #define CS35L41_DSP1_MPU_YREG_ACCESS1 0x02BC302C
  366. #define CS35L41_DSP1_MPU_XM_ACCESS2 0x02BC3030
  367. #define CS35L41_DSP1_MPU_YM_ACCESS2 0x02BC3034
  368. #define CS35L41_DSP1_MPU_WNDW_ACCESS2 0x02BC3038
  369. #define CS35L41_DSP1_MPU_XREG_ACCESS2 0x02BC303C
  370. #define CS35L41_DSP1_MPU_YREG_ACCESS2 0x02BC3044
  371. #define CS35L41_DSP1_MPU_XM_ACCESS3 0x02BC3048
  372. #define CS35L41_DSP1_MPU_YM_ACCESS3 0x02BC304C
  373. #define CS35L41_DSP1_MPU_WNDW_ACCESS3 0x02BC3050
  374. #define CS35L41_DSP1_MPU_XREG_ACCESS3 0x02BC3054
  375. #define CS35L41_DSP1_MPU_YREG_ACCESS3 0x02BC305C
  376. #define CS35L41_DSP1_MPU_XM_VIO_ADDR 0x02BC3100
  377. #define CS35L41_DSP1_MPU_XM_VIO_STATUS 0x02BC3104
  378. #define CS35L41_DSP1_MPU_YM_VIO_ADDR 0x02BC3108
  379. #define CS35L41_DSP1_MPU_YM_VIO_STATUS 0x02BC310C
  380. #define CS35L41_DSP1_MPU_PM_VIO_ADDR 0x02BC3110
  381. #define CS35L41_DSP1_MPU_PM_VIO_STATUS 0x02BC3114
  382. #define CS35L41_DSP1_MPU_LOCK_CONFIG 0x02BC3140
  383. #define CS35L41_DSP1_MPU_WDT_RST_CTRL 0x02BC3180
  384. #define CS35L41_DSP1_STRMARB_MSTR0_CFG0 0x02BC5000
  385. #define CS35L41_DSP1_STRMARB_MSTR0_CFG1 0x02BC5004
  386. #define CS35L41_DSP1_STRMARB_MSTR0_CFG2 0x02BC5008
  387. #define CS35L41_DSP1_STRMARB_MSTR1_CFG0 0x02BC5010
  388. #define CS35L41_DSP1_STRMARB_MSTR1_CFG1 0x02BC5014
  389. #define CS35L41_DSP1_STRMARB_MSTR1_CFG2 0x02BC5018
  390. #define CS35L41_DSP1_STRMARB_MSTR2_CFG0 0x02BC5020
  391. #define CS35L41_DSP1_STRMARB_MSTR2_CFG1 0x02BC5024
  392. #define CS35L41_DSP1_STRMARB_MSTR2_CFG2 0x02BC5028
  393. #define CS35L41_DSP1_STRMARB_MSTR3_CFG0 0x02BC5030
  394. #define CS35L41_DSP1_STRMARB_MSTR3_CFG1 0x02BC5034
  395. #define CS35L41_DSP1_STRMARB_MSTR3_CFG2 0x02BC5038
  396. #define CS35L41_DSP1_STRMARB_MSTR4_CFG0 0x02BC5040
  397. #define CS35L41_DSP1_STRMARB_MSTR4_CFG1 0x02BC5044
  398. #define CS35L41_DSP1_STRMARB_MSTR4_CFG2 0x02BC5048
  399. #define CS35L41_DSP1_STRMARB_MSTR5_CFG0 0x02BC5050
  400. #define CS35L41_DSP1_STRMARB_MSTR5_CFG1 0x02BC5054
  401. #define CS35L41_DSP1_STRMARB_MSTR5_CFG2 0x02BC5058
  402. #define CS35L41_DSP1_STRMARB_MSTR6_CFG0 0x02BC5060
  403. #define CS35L41_DSP1_STRMARB_MSTR6_CFG1 0x02BC5064
  404. #define CS35L41_DSP1_STRMARB_MSTR6_CFG2 0x02BC5068
  405. #define CS35L41_DSP1_STRMARB_MSTR7_CFG0 0x02BC5070
  406. #define CS35L41_DSP1_STRMARB_MSTR7_CFG1 0x02BC5074
  407. #define CS35L41_DSP1_STRMARB_MSTR7_CFG2 0x02BC5078
  408. #define CS35L41_DSP1_STRMARB_TX0_CFG0 0x02BC5200
  409. #define CS35L41_DSP1_STRMARB_TX0_CFG1 0x02BC5204
  410. #define CS35L41_DSP1_STRMARB_TX1_CFG0 0x02BC5208
  411. #define CS35L41_DSP1_STRMARB_TX1_CFG1 0x02BC520C
  412. #define CS35L41_DSP1_STRMARB_TX2_CFG0 0x02BC5210
  413. #define CS35L41_DSP1_STRMARB_TX2_CFG1 0x02BC5214
  414. #define CS35L41_DSP1_STRMARB_TX3_CFG0 0x02BC5218
  415. #define CS35L41_DSP1_STRMARB_TX3_CFG1 0x02BC521C
  416. #define CS35L41_DSP1_STRMARB_TX4_CFG0 0x02BC5220
  417. #define CS35L41_DSP1_STRMARB_TX4_CFG1 0x02BC5224
  418. #define CS35L41_DSP1_STRMARB_TX5_CFG0 0x02BC5228
  419. #define CS35L41_DSP1_STRMARB_TX5_CFG1 0x02BC522C
  420. #define CS35L41_DSP1_STRMARB_TX6_CFG0 0x02BC5230
  421. #define CS35L41_DSP1_STRMARB_TX6_CFG1 0x02BC5234
  422. #define CS35L41_DSP1_STRMARB_TX7_CFG0 0x02BC5238
  423. #define CS35L41_DSP1_STRMARB_TX7_CFG1 0x02BC523C
  424. #define CS35L41_DSP1_STRMARB_RX0_CFG0 0x02BC5400
  425. #define CS35L41_DSP1_STRMARB_RX0_CFG1 0x02BC5404
  426. #define CS35L41_DSP1_STRMARB_RX1_CFG0 0x02BC5408
  427. #define CS35L41_DSP1_STRMARB_RX1_CFG1 0x02BC540C
  428. #define CS35L41_DSP1_STRMARB_RX2_CFG0 0x02BC5410
  429. #define CS35L41_DSP1_STRMARB_RX2_CFG1 0x02BC5414
  430. #define CS35L41_DSP1_STRMARB_RX3_CFG0 0x02BC5418
  431. #define CS35L41_DSP1_STRMARB_RX3_CFG1 0x02BC541C
  432. #define CS35L41_DSP1_STRMARB_RX4_CFG0 0x02BC5420
  433. #define CS35L41_DSP1_STRMARB_RX4_CFG1 0x02BC5424
  434. #define CS35L41_DSP1_STRMARB_RX5_CFG0 0x02BC5428
  435. #define CS35L41_DSP1_STRMARB_RX5_CFG1 0x02BC542C
  436. #define CS35L41_DSP1_STRMARB_RX6_CFG0 0x02BC5430
  437. #define CS35L41_DSP1_STRMARB_RX6_CFG1 0x02BC5434
  438. #define CS35L41_DSP1_STRMARB_RX7_CFG0 0x02BC5438
  439. #define CS35L41_DSP1_STRMARB_RX7_CFG1 0x02BC543C
  440. #define CS35L41_DSP1_STRMARB_IRQ0_CFG0 0x02BC5600
  441. #define CS35L41_DSP1_STRMARB_IRQ0_CFG1 0x02BC5604
  442. #define CS35L41_DSP1_STRMARB_IRQ0_CFG2 0x02BC5608
  443. #define CS35L41_DSP1_STRMARB_IRQ1_CFG0 0x02BC5610
  444. #define CS35L41_DSP1_STRMARB_IRQ1_CFG1 0x02BC5614
  445. #define CS35L41_DSP1_STRMARB_IRQ1_CFG2 0x02BC5618
  446. #define CS35L41_DSP1_STRMARB_IRQ2_CFG0 0x02BC5620
  447. #define CS35L41_DSP1_STRMARB_IRQ2_CFG1 0x02BC5624
  448. #define CS35L41_DSP1_STRMARB_IRQ2_CFG2 0x02BC5628
  449. #define CS35L41_DSP1_STRMARB_IRQ3_CFG0 0x02BC5630
  450. #define CS35L41_DSP1_STRMARB_IRQ3_CFG1 0x02BC5634
  451. #define CS35L41_DSP1_STRMARB_IRQ3_CFG2 0x02BC5638
  452. #define CS35L41_DSP1_STRMARB_IRQ4_CFG0 0x02BC5640
  453. #define CS35L41_DSP1_STRMARB_IRQ4_CFG1 0x02BC5644
  454. #define CS35L41_DSP1_STRMARB_IRQ4_CFG2 0x02BC5648
  455. #define CS35L41_DSP1_STRMARB_IRQ5_CFG0 0x02BC5650
  456. #define CS35L41_DSP1_STRMARB_IRQ5_CFG1 0x02BC5654
  457. #define CS35L41_DSP1_STRMARB_IRQ5_CFG2 0x02BC5658
  458. #define CS35L41_DSP1_STRMARB_IRQ6_CFG0 0x02BC5660
  459. #define CS35L41_DSP1_STRMARB_IRQ6_CFG1 0x02BC5664
  460. #define CS35L41_DSP1_STRMARB_IRQ6_CFG2 0x02BC5668
  461. #define CS35L41_DSP1_STRMARB_IRQ7_CFG0 0x02BC5670
  462. #define CS35L41_DSP1_STRMARB_IRQ7_CFG1 0x02BC5674
  463. #define CS35L41_DSP1_STRMARB_IRQ7_CFG2 0x02BC5678
  464. #define CS35L41_DSP1_STRMARB_RESYNC_MSK 0x02BC5A00
  465. #define CS35L41_DSP1_STRMARB_ERR_STATUS 0x02BC5A08
  466. #define CS35L41_DSP1_INTPCTL_RES_STATIC 0x02BC6000
  467. #define CS35L41_DSP1_INTPCTL_RES_DYN 0x02BC6004
  468. #define CS35L41_DSP1_INTPCTL_NMI_CTRL 0x02BC6008
  469. #define CS35L41_DSP1_INTPCTL_IRQ_INV 0x02BC6010
  470. #define CS35L41_DSP1_INTPCTL_IRQ_MODE 0x02BC6014
  471. #define CS35L41_DSP1_INTPCTL_IRQ_EN 0x02BC6018
  472. #define CS35L41_DSP1_INTPCTL_IRQ_MSK 0x02BC601C
  473. #define CS35L41_DSP1_INTPCTL_IRQ_FLUSH 0x02BC6020
  474. #define CS35L41_DSP1_INTPCTL_IRQ_MSKCLR 0x02BC6024
  475. #define CS35L41_DSP1_INTPCTL_IRQ_FRC 0x02BC6028
  476. #define CS35L41_DSP1_INTPCTL_IRQ_MSKSET 0x02BC602C
  477. #define CS35L41_DSP1_INTPCTL_IRQ_ERR 0x02BC6030
  478. #define CS35L41_DSP1_INTPCTL_IRQ_PEND 0x02BC6034
  479. #define CS35L41_DSP1_INTPCTL_IRQ_GEN 0x02BC6038
  480. #define CS35L41_DSP1_INTPCTL_TESTBITS 0x02BC6040
  481. #define CS35L41_DSP1_WDT_CONTROL 0x02BC7000
  482. #define CS35L41_DSP1_WDT_STATUS 0x02BC7008
  483. #define CS35L41_DSP1_YMEM_PACK_0 0x02C00000
  484. #define CS35L41_DSP1_YMEM_PACK_1532 0x02C017F0
  485. #define CS35L41_DSP1_YMEM_UNPACK32_0 0x03000000
  486. #define CS35L41_DSP1_YMEM_UNPACK32_1022 0x03000FF8
  487. #define CS35L41_DSP1_YMEM_UNPACK24_0 0x03400000
  488. #define CS35L41_DSP1_YMEM_UNPACK24_2045 0x03401FF4
  489. #define CS35L41_DSP1_PMEM_0 0x03800000
  490. #define CS35L41_DSP1_PMEM_5114 0x03804FE8
  491. /*test regs for emulation bringup*/
  492. #define CS35L41_PLL_OVR 0x00003018
  493. #define CS35L41_BST_TEST_DUTY 0x00003900
  494. #define CS35L41_DIGPWM_IOCTRL 0x0000706C
  495. /*registers populated by OTP*/
  496. #define CS35L41_OTP_TRIM_1 0x0000208c
  497. #define CS35L41_OTP_TRIM_2 0x00002090
  498. #define CS35L41_OTP_TRIM_3 0x00003010
  499. #define CS35L41_OTP_TRIM_4 0x0000300C
  500. #define CS35L41_OTP_TRIM_5 0x0000394C
  501. #define CS35L41_OTP_TRIM_6 0x00003950
  502. #define CS35L41_OTP_TRIM_7 0x00003954
  503. #define CS35L41_OTP_TRIM_8 0x00003958
  504. #define CS35L41_OTP_TRIM_9 0x0000395C
  505. #define CS35L41_OTP_TRIM_10 0x0000416C
  506. #define CS35L41_OTP_TRIM_11 0x00004160
  507. #define CS35L41_OTP_TRIM_12 0x00004170
  508. #define CS35L41_OTP_TRIM_13 0x00004360
  509. #define CS35L41_OTP_TRIM_14 0x00004448
  510. #define CS35L41_OTP_TRIM_15 0x0000444C
  511. #define CS35L41_OTP_TRIM_16 0x00006E30
  512. #define CS35L41_OTP_TRIM_17 0x00006E34
  513. #define CS35L41_OTP_TRIM_18 0x00006E38
  514. #define CS35L41_OTP_TRIM_19 0x00006E3C
  515. #define CS35L41_OTP_TRIM_20 0x00006E40
  516. #define CS35L41_OTP_TRIM_21 0x00006E44
  517. #define CS35L41_OTP_TRIM_22 0x00006E48
  518. #define CS35L41_OTP_TRIM_23 0x00006E4C
  519. #define CS35L41_OTP_TRIM_24 0x00006E50
  520. #define CS35L41_OTP_TRIM_25 0x00006E54
  521. #define CS35L41_OTP_TRIM_26 0x00006E58
  522. #define CS35L41_OTP_TRIM_27 0x00006E5C
  523. #define CS35L41_OTP_TRIM_28 0x00006E60
  524. #define CS35L41_OTP_TRIM_29 0x00006E64
  525. #define CS35L41_OTP_TRIM_30 0x00007418
  526. #define CS35L41_OTP_TRIM_31 0x0000741C
  527. #define CS35L41_OTP_TRIM_32 0x00007434
  528. #define CS35L41_OTP_TRIM_33 0x00007068
  529. #define CS35L41_OTP_TRIM_34 0x0000410C
  530. #define CS35L41_OTP_TRIM_35 0x0000400C
  531. #define CS35L41_OTP_TRIM_36 0x00002030
  532. #define CS35L41_MAX_CACHE_REG 36
  533. #define CS35L41_OTP_SIZE_WORDS 32
  534. #define CS35L41_NUM_SUPPLIES 2
  535. #define CS35L41_SCLK_MSTR_MASK 0x10
  536. #define CS35L41_SCLK_MSTR_SHIFT 4
  537. #define CS35L41_LRCLK_MSTR_MASK 0x01
  538. #define CS35L41_LRCLK_MSTR_SHIFT 0
  539. #define CS35L41_SCLK_INV_MASK 0x40
  540. #define CS35L41_SCLK_INV_SHIFT 6
  541. #define CS35L41_LRCLK_INV_MASK 0x04
  542. #define CS35L41_LRCLK_INV_SHIFT 2
  543. #define CS35L41_SCLK_FRC_MASK 0x20
  544. #define CS35L41_SCLK_FRC_SHIFT 5
  545. #define CS35L41_LRCLK_FRC_MASK 0x02
  546. #define CS35L41_LRCLK_FRC_SHIFT 1
  547. #define CS35L41_AMP_GAIN_PCM_MASK 0x3E0
  548. #define CS35L41_AMP_GAIN_PCM_SHIFT 5
  549. #define CS35L41_AMP_GAIN_PDM_MASK 0x1F
  550. #define CS35L41_AMP_GAIN_PDM_SHIFT 0
  551. #define CS35L41_AMP_GAIN_PCM_MAX 20
  552. #define CS35L41_AMP_GAIN_PDM_MAX 20
  553. #define CS35L41_AMP_GAIN_ZC_MASK 0x0400
  554. #define CS35L41_AMP_GAIN_ZC_SHIFT 10
  555. #define CS35L41_BST_CTL_MASK 0xFF
  556. #define CS35L41_BST_CTL_SEL_MASK 0x03
  557. #define CS35L41_BST_CTL_SEL_REG 0x00
  558. #define CS35L41_BST_CTL_SEL_CLASSH 0x01
  559. #define CS35L41_BST_IPK_MASK 0x7F
  560. #define CS35L41_BST_IPK_SHIFT 0
  561. #define CS35L41_BST_LIM_MASK 0x4
  562. #define CS35L41_BST_LIM_SHIFT 2
  563. #define CS35L41_BST_K1_MASK 0x000000FF
  564. #define CS35L41_BST_K1_SHIFT 0
  565. #define CS35L41_BST_K2_MASK 0x0000FF00
  566. #define CS35L41_BST_K2_SHIFT 8
  567. #define CS35L41_BST_SLOPE_MASK 0x0000FF00
  568. #define CS35L41_BST_SLOPE_SHIFT 8
  569. #define CS35L41_BST_LBST_VAL_MASK 0x00000003
  570. #define CS35L41_BST_LBST_VAL_SHIFT 0
  571. #define CS35L41_TEMP_THLD_MASK 0x03
  572. #define CS35L41_VMON_IMON_VOL_MASK 0x07FF07FF
  573. #define CS35L41_PDM_MODE_MASK 0x01
  574. #define CS35L41_PDM_MODE_SHIFT 0
  575. #define CS35L41_CH_MEM_DEPTH_MASK 0x07
  576. #define CS35L41_CH_MEM_DEPTH_SHIFT 0
  577. #define CS35L41_CH_HDRM_CTL_MASK 0x007F0000
  578. #define CS35L41_CH_HDRM_CTL_SHIFT 16
  579. #define CS35L41_CH_REL_RATE_MASK 0xFF00
  580. #define CS35L41_CH_REL_RATE_SHIFT 8
  581. #define CS35L41_CH_WKFET_DLY_MASK 0x001C
  582. #define CS35L41_CH_WKFET_DLY_SHIFT 2
  583. #define CS35L41_CH_WKFET_THLD_MASK 0x0F00
  584. #define CS35L41_CH_WKFET_THLD_SHIFT 8
  585. #define CS35L41_HW_NG_SEL_MASK 0x3F00
  586. #define CS35L41_HW_NG_SEL_SHIFT 8
  587. #define CS35L41_HW_NG_DLY_MASK 0x0070
  588. #define CS35L41_HW_NG_DLY_SHIFT 4
  589. #define CS35L41_HW_NG_THLD_MASK 0x0007
  590. #define CS35L41_HW_NG_THLD_SHIFT 0
  591. #define CS35L41_DSP_NG_ENABLE_MASK 0x00010000
  592. #define CS35L41_DSP_NG_ENABLE_SHIFT 16
  593. #define CS35L41_DSP_NG_THLD_MASK 0x7
  594. #define CS35L41_DSP_NG_THLD_SHIFT 0
  595. #define CS35L41_DSP_NG_DELAY_MASK 0x0F00
  596. #define CS35L41_DSP_NG_DELAY_SHIFT 8
  597. #define CS35L41_ASP_FMT_MASK 0x0700
  598. #define CS35L41_ASP_FMT_SHIFT 8
  599. #define CS35L41_ASP_DOUT_HIZ_MASK 0x03
  600. #define CS35L41_ASP_DOUT_HIZ_SHIFT 0
  601. #define CS35L41_ASP_WIDTH_16 0x10
  602. #define CS35L41_ASP_WIDTH_24 0x18
  603. #define CS35L41_ASP_WIDTH_32 0x20
  604. #define CS35L41_ASP_WIDTH_TX_MASK 0xFF0000
  605. #define CS35L41_ASP_WIDTH_TX_SHIFT 16
  606. #define CS35L41_ASP_WIDTH_RX_MASK 0xFF000000
  607. #define CS35L41_ASP_WIDTH_RX_SHIFT 24
  608. #define CS35L41_ASP_RX1_SLOT_MASK 0x3F
  609. #define CS35L41_ASP_RX1_SLOT_SHIFT 0
  610. #define CS35L41_ASP_RX2_SLOT_MASK 0x3F00
  611. #define CS35L41_ASP_RX2_SLOT_SHIFT 8
  612. #define CS35L41_ASP_RX_WL_MASK 0x3F
  613. #define CS35L41_ASP_TX_WL_MASK 0x3F
  614. #define CS35L41_ASP_RX_WL_SHIFT 0
  615. #define CS35L41_ASP_TX_WL_SHIFT 0
  616. #define CS35L41_ASP_SOURCE_MASK 0x7F
  617. #define CS35L41_INPUT_SRC_ASPRX1 0x08
  618. #define CS35L41_INPUT_SRC_ASPRX2 0x09
  619. #define CS35L41_INPUT_SRC_VMON 0x18
  620. #define CS35L41_INPUT_SRC_IMON 0x19
  621. #define CS35L41_INPUT_SRC_CLASSH 0x21
  622. #define CS35L41_INPUT_SRC_VPMON 0x28
  623. #define CS35L41_INPUT_SRC_VBSTMON 0x29
  624. #define CS35L41_INPUT_SRC_TEMPMON 0x3A
  625. #define CS35L41_INPUT_SRC_RSVD 0x3B
  626. #define CS35L41_INPUT_DSP_TX1 0x32
  627. #define CS35L41_INPUT_DSP_TX2 0x33
  628. #define CS35L41_WR_PEND_STS_MASK 0x2
  629. #define CS35L41_PLL_CLK_SEL_MASK 0x07
  630. #define CS35L41_PLL_CLK_SEL_SHIFT 0
  631. #define CS35L41_PLL_CLK_EN_MASK 0x10
  632. #define CS35L41_PLL_CLK_EN_SHIFT 4
  633. #define CS35L41_PLL_OPENLOOP_MASK 0x0800
  634. #define CS35L41_PLL_OPENLOOP_SHIFT 11
  635. #define CS35L41_PLLSRC_SCLK 0
  636. #define CS35L41_PLLSRC_LRCLK 1
  637. #define CS35L41_PLLSRC_SELF 3
  638. #define CS35L41_PLLSRC_PDMCLK 4
  639. #define CS35L41_PLLSRC_MCLK 5
  640. #define CS35L41_PLLSRC_SWIRE 7
  641. #define CS35L41_REFCLK_FREQ_MASK 0x7E0
  642. #define CS35L41_REFCLK_FREQ_SHIFT 5
  643. #define CS35L41_GLOBAL_FS_MASK 0x1F
  644. #define CS35L41_GLOBAL_FS_SHIFT 0
  645. #define CS35L41_GLOBAL_EN_MASK 0x01
  646. #define CS35L41_GLOBAL_EN_SHIFT 0
  647. #define CS35L41_BST_EN_MASK 0x0030
  648. #define CS35L41_BST_EN_SHIFT 4
  649. #define CS35L41_BST_DIS_FET_OFF 0x00
  650. #define CS35L41_BST_EN_DEFAULT 0x2
  651. #define CS35L41_AMP_EN_SHIFT 0
  652. #define CS35L41_AMP_EN_MASK 1
  653. #define CS35L41_VMON_EN_MASK 0x1000
  654. #define CS35L41_VMON_EN_SHIFT 12
  655. #define CS35L41_IMON_EN_MASK 0x2000
  656. #define CS35L41_IMON_EN_SHIFT 13
  657. #define CS35L41_PDN_DONE_MASK 0x00800000
  658. #define CS35L41_PDN_DONE_SHIFT 23
  659. #define CS35L41_PUP_DONE_MASK 0x01000000
  660. #define CS35L41_PUP_DONE_SHIFT 24
  661. #define CS35L36_PUP_DONE_IRQ_UNMASK 0x5F
  662. #define CS35L36_PUP_DONE_IRQ_MASK 0xBF
  663. #define CS35L41_SYNC_EN_MASK BIT(8)
  664. #define CS35L41_AMP_SHORT_ERR 0x80000000
  665. #define CS35L41_BST_SHORT_ERR 0x0100
  666. #define CS35L41_TEMP_WARN 0x8000
  667. #define CS35L41_TEMP_ERR 0x00020000
  668. #define CS35L41_BST_OVP_ERR 0x40
  669. #define CS35L41_BST_DCM_UVP_ERR 0x80
  670. #define CS35L41_OTP_BOOT_DONE 0x02
  671. #define CS35L41_PLL_UNLOCK 0x10
  672. #define CS35L41_PLL_LOCK BIT(1)
  673. #define CS35L41_OTP_BOOT_ERR 0x80000000
  674. #define CS35L41_AMP_SHORT_ERR_RLS 0x02
  675. #define CS35L41_BST_SHORT_ERR_RLS 0x04
  676. #define CS35L41_BST_OVP_ERR_RLS 0x08
  677. #define CS35L41_BST_UVP_ERR_RLS 0x10
  678. #define CS35L41_TEMP_WARN_ERR_RLS 0x20
  679. #define CS35L41_TEMP_ERR_RLS 0x40
  680. #define CS35L41_AMP_SHORT_ERR_RLS_SHIFT 1
  681. #define CS35L41_BST_SHORT_ERR_RLS_SHIFT 2
  682. #define CS35L41_BST_OVP_ERR_RLS_SHIFT 3
  683. #define CS35L41_BST_UVP_ERR_RLS_SHIFT 4
  684. #define CS35L41_TEMP_WARN_ERR_RLS_SHIFT 5
  685. #define CS35L41_TEMP_ERR_RLS_SHIFT 6
  686. #define CS35L41_INT1_MASK_DEFAULT 0x7FFCFE3F
  687. #define CS35L41_INT1_UNMASK_PUP 0xFEFFFFFF
  688. #define CS35L41_INT1_UNMASK_PDN 0xFF7FFFFF
  689. #define CS35L41_INT3_PLL_LOCK_SHIFT 1
  690. #define CS35L41_INT3_PLL_LOCK_MASK BIT(CS35L41_INT3_PLL_LOCK_SHIFT)
  691. #define CS35L41_GPIO_DIR_MASK 0x80000000
  692. #define CS35L41_GPIO_DIR_SHIFT 31
  693. #define CS35L41_GPIO1_CTRL_MASK 0x00030000
  694. #define CS35L41_GPIO1_CTRL_SHIFT 16
  695. #define CS35L41_GPIO2_CTRL_MASK 0x07000000
  696. #define CS35L41_GPIO2_CTRL_SHIFT 24
  697. #define CS35L41_GPIO_LVL_SHIFT 15
  698. #define CS35L41_GPIO_LVL_MASK BIT(CS35L41_GPIO_LVL_SHIFT)
  699. #define CS35L41_GPIO_POL_MASK 0x1000
  700. #define CS35L41_GPIO_POL_SHIFT 12
  701. #define CS35L41_AMP_INV_PCM_SHIFT 14
  702. #define CS35L41_AMP_INV_PCM_MASK BIT(CS35L41_AMP_INV_PCM_SHIFT)
  703. #define CS35L41_AMP_PCM_VOL_SHIFT 3
  704. #define CS35L41_AMP_PCM_VOL_MASK (0x7FF << 3)
  705. #define CS35L41_AMP_PCM_VOL_MUTE 0x4CF
  706. #define CS35L41_CHIP_ID 0x35a40
  707. #define CS35L41R_CHIP_ID 0x35b40
  708. #define CS35L41_MTLREVID_MASK 0x0F
  709. #define CS35L41_REVID_A0 0xA0
  710. #define CS35L41_REVID_B0 0xB0
  711. #define CS35L41_REVID_B2 0xB2
  712. #define CS35L41_HALO_CORE_RESET 0x00000200
  713. #define CS35L41_SOFTWARE_RESET 0x5A000000
  714. #define CS35L41_FS1_WINDOW_MASK 0x000007FF
  715. #define CS35L41_FS2_WINDOW_MASK 0x00FFF800
  716. #define CS35L41_FS2_WINDOW_SHIFT 12
  717. #define CS35L41_SPI_MAX_FREQ 4000000
  718. #define CS35L41_REGSTRIDE 4
  719. enum cs35l41_boost_type {
  720. CS35L41_INT_BOOST,
  721. CS35L41_EXT_BOOST,
  722. CS35L41_SHD_BOOST_ACTV,
  723. CS35L41_SHD_BOOST_PASS,
  724. // Not present in Binding Documentation, so no system should use this value.
  725. // This value is only used in CLSA0100 Laptop
  726. CS35L41_EXT_BOOST_NO_VSPK_SWITCH,
  727. };
  728. enum cs35l41_clk_ids {
  729. CS35L41_CLKID_SCLK = 0,
  730. CS35L41_CLKID_LRCLK = 1,
  731. CS35L41_CLKID_MCLK = 4,
  732. };
  733. enum cs35l41_gpio1_func {
  734. CS35L41_GPIO1_HIZ,
  735. CS35L41_GPIO1_GPIO,
  736. CS35L41_GPIO1_MDSYNC,
  737. CS35L41_GPIO1_MCLK,
  738. CS35L41_GPIO1_PDM_CLK,
  739. CS35L41_GPIO1_PDM_DATA,
  740. };
  741. enum cs35l41_gpio2_func {
  742. CS35L41_GPIO2_HIZ,
  743. CS35L41_GPIO2_GPIO,
  744. CS35L41_GPIO2_INT_OPEN_DRAIN,
  745. CS35L41_GPIO2_MCLK,
  746. CS35L41_GPIO2_INT_PUSH_PULL_LOW,
  747. CS35L41_GPIO2_INT_PUSH_PULL_HIGH,
  748. CS35L41_GPIO2_PDM_CLK,
  749. CS35L41_GPIO2_PDM_DATA,
  750. };
  751. struct cs35l41_gpio_cfg {
  752. bool valid;
  753. bool pol_inv;
  754. bool out_en;
  755. unsigned int func;
  756. };
  757. struct cs35l41_hw_cfg {
  758. bool valid;
  759. int bst_ind;
  760. int bst_ipk;
  761. int bst_cap;
  762. int dout_hiz;
  763. struct cs35l41_gpio_cfg gpio1;
  764. struct cs35l41_gpio_cfg gpio2;
  765. unsigned int spk_pos;
  766. enum cs35l41_boost_type bst_type;
  767. };
  768. struct cs35l41_otp_packed_element_t {
  769. u32 reg;
  770. u8 shift;
  771. u8 size;
  772. };
  773. struct cs35l41_otp_map_element_t {
  774. u32 id;
  775. u32 num_elements;
  776. const struct cs35l41_otp_packed_element_t *map;
  777. u32 bit_offset;
  778. u32 word_offset;
  779. };
  780. enum cs35l41_cspl_mbox_status {
  781. CSPL_MBOX_STS_ERROR = U32_MAX,
  782. CSPL_MBOX_STS_ERROR2 = 0x00ffffff, // firmware not always sign-extending 24-bit value
  783. CSPL_MBOX_STS_RUNNING = 0,
  784. CSPL_MBOX_STS_PAUSED = 1,
  785. CSPL_MBOX_STS_RDY_FOR_REINIT = 2,
  786. };
  787. enum cs35l41_cspl_mbox_cmd {
  788. CSPL_MBOX_CMD_NONE = 0,
  789. CSPL_MBOX_CMD_PAUSE = 1,
  790. CSPL_MBOX_CMD_RESUME = 2,
  791. CSPL_MBOX_CMD_REINIT = 3,
  792. CSPL_MBOX_CMD_STOP_PRE_REINIT = 4,
  793. CSPL_MBOX_CMD_HIBERNATE = 5,
  794. CSPL_MBOX_CMD_OUT_OF_HIBERNATE = 6,
  795. CSPL_MBOX_CMD_SPK_OUT_ENABLE = 7,
  796. CSPL_MBOX_CMD_UNKNOWN_CMD = -1,
  797. CSPL_MBOX_CMD_INVALID_SEQUENCE = -2,
  798. };
  799. /*
  800. * IRQs
  801. */
  802. #define CS35L41_IRQ(_irq, _name, _hand) \
  803. { \
  804. .irq = CS35L41_ ## _irq ## _IRQ,\
  805. .name = _name, \
  806. .handler = _hand, \
  807. }
  808. struct cs35l41_irq {
  809. int irq;
  810. const char *name;
  811. irqreturn_t (*handler)(int irq, void *data);
  812. };
  813. #define CS35L41_REG_IRQ(_reg, _irq) \
  814. [CS35L41_ ## _irq ## _IRQ] = { \
  815. .reg_offset = (CS35L41_ ## _reg) - CS35L41_IRQ1_STATUS1,\
  816. .mask = CS35L41_ ## _irq ## _MASK \
  817. }
  818. /* (0x0000E010) CS35L41_IRQ1_STATUS1 */
  819. #define CS35L41_BST_OVP_ERR_SHIFT 6
  820. #define CS35L41_BST_OVP_ERR_MASK BIT(CS35L41_BST_OVP_ERR_SHIFT)
  821. #define CS35L41_BST_DCM_UVP_ERR_SHIFT 7
  822. #define CS35L41_BST_DCM_UVP_ERR_MASK BIT(CS35L41_BST_DCM_UVP_ERR_SHIFT)
  823. #define CS35L41_BST_SHORT_ERR_SHIFT 8
  824. #define CS35L41_BST_SHORT_ERR_MASK BIT(CS35L41_BST_SHORT_ERR_SHIFT)
  825. #define CS35L41_TEMP_WARN_SHIFT 15
  826. #define CS35L41_TEMP_WARN_MASK BIT(CS35L41_TEMP_WARN_SHIFT)
  827. #define CS35L41_TEMP_ERR_SHIFT 17
  828. #define CS35L41_TEMP_ERR_MASK BIT(CS35L41_TEMP_ERR_SHIFT)
  829. #define CS35L41_AMP_SHORT_ERR_SHIFT 31
  830. #define CS35L41_AMP_SHORT_ERR_MASK BIT(CS35L41_AMP_SHORT_ERR_SHIFT)
  831. enum cs35l41_irq_list {
  832. CS35L41_BST_OVP_ERR_IRQ,
  833. CS35L41_BST_DCM_UVP_ERR_IRQ,
  834. CS35L41_BST_SHORT_ERR_IRQ,
  835. CS35L41_TEMP_WARN_IRQ,
  836. CS35L41_TEMP_ERR_IRQ,
  837. CS35L41_AMP_SHORT_ERR_IRQ,
  838. CS35L41_NUM_IRQ
  839. };
  840. extern struct regmap_config cs35l41_regmap_i2c;
  841. extern struct regmap_config cs35l41_regmap_spi;
  842. int cs35l41_test_key_unlock(struct device *dev, struct regmap *regmap);
  843. int cs35l41_test_key_lock(struct device *dev, struct regmap *regmap);
  844. int cs35l41_otp_unpack(struct device *dev, struct regmap *regmap);
  845. int cs35l41_register_errata_patch(struct device *dev, struct regmap *reg, unsigned int reg_revid);
  846. int cs35l41_set_channels(struct device *dev, struct regmap *reg,
  847. unsigned int tx_num, const unsigned int *tx_slot,
  848. unsigned int rx_num, const unsigned int *rx_slot);
  849. int cs35l41_gpio_config(struct regmap *regmap, struct cs35l41_hw_cfg *hw_cfg);
  850. void cs35l41_configure_cs_dsp(struct device *dev, struct regmap *reg, struct cs_dsp *dsp);
  851. int cs35l41_set_cspl_mbox_cmd(struct device *dev, struct regmap *regmap,
  852. enum cs35l41_cspl_mbox_cmd cmd);
  853. int cs35l41_write_fs_errata(struct device *dev, struct regmap *regmap);
  854. int cs35l41_enter_hibernate(struct device *dev, struct regmap *regmap,
  855. enum cs35l41_boost_type b_type);
  856. int cs35l41_exit_hibernate(struct device *dev, struct regmap *regmap);
  857. int cs35l41_init_boost(struct device *dev, struct regmap *regmap,
  858. struct cs35l41_hw_cfg *hw_cfg);
  859. bool cs35l41_safe_reset(struct regmap *regmap, enum cs35l41_boost_type b_type);
  860. int cs35l41_mdsync_up(struct regmap *regmap);
  861. int cs35l41_global_enable(struct device *dev, struct regmap *regmap, enum cs35l41_boost_type b_type,
  862. int enable, struct cs_dsp *dsp);
  863. #endif /* __CS35L41_H */