rt5663.h 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * rt5663.h -- RT5663 ALSA SoC audio driver
  4. *
  5. * Copyright 2016 Realtek Microelectronics
  6. * Author: Jack Yu <[email protected]>
  7. */
  8. #ifndef __RT5663_H__
  9. #define __RT5663_H__
  10. #include <sound/rt5663.h>
  11. /* Info */
  12. #define RT5663_RESET 0x0000
  13. #define RT5663_VENDOR_ID 0x00fd
  14. #define RT5663_VENDOR_ID_1 0x00fe
  15. #define RT5663_VENDOR_ID_2 0x00ff
  16. #define RT5663_LOUT_CTRL 0x0001
  17. #define RT5663_HP_AMP_2 0x0003
  18. #define RT5663_MONO_OUT 0x0004
  19. #define RT5663_MONO_GAIN 0x0007
  20. #define RT5663_AEC_BST 0x000b
  21. #define RT5663_IN1_IN2 0x000c
  22. #define RT5663_IN3_IN4 0x000d
  23. #define RT5663_INL1_INR1 0x000f
  24. #define RT5663_CBJ_TYPE_2 0x0011
  25. #define RT5663_CBJ_TYPE_3 0x0012
  26. #define RT5663_CBJ_TYPE_4 0x0013
  27. #define RT5663_CBJ_TYPE_5 0x0014
  28. #define RT5663_CBJ_TYPE_8 0x0017
  29. /* I/O - ADC/DAC/DMIC */
  30. #define RT5663_DAC3_DIG_VOL 0x001a
  31. #define RT5663_DAC3_CTRL 0x001b
  32. #define RT5663_MONO_ADC_DIG_VOL 0x001d
  33. #define RT5663_STO2_ADC_DIG_VOL 0x001e
  34. #define RT5663_MONO_ADC_BST_GAIN 0x0020
  35. #define RT5663_STO2_ADC_BST_GAIN 0x0021
  36. #define RT5663_SIDETONE_CTRL 0x0024
  37. /* Mixer - D-D */
  38. #define RT5663_MONO1_ADC_MIXER 0x0027
  39. #define RT5663_STO2_ADC_MIXER 0x0028
  40. #define RT5663_MONO_DAC_MIXER 0x002b
  41. #define RT5663_DAC2_SRC_CTRL 0x002e
  42. #define RT5663_IF_3_4_DATA_CTL 0x002f
  43. #define RT5663_IF_5_DATA_CTL 0x0030
  44. #define RT5663_PDM_OUT_CTL 0x0031
  45. #define RT5663_PDM_I2C_DATA_CTL1 0x0032
  46. #define RT5663_PDM_I2C_DATA_CTL2 0x0033
  47. #define RT5663_PDM_I2C_DATA_CTL3 0x0034
  48. #define RT5663_PDM_I2C_DATA_CTL4 0x0035
  49. /*Mixer - Analog*/
  50. #define RT5663_RECMIX1_NEW 0x003a
  51. #define RT5663_RECMIX1L_0 0x003b
  52. #define RT5663_RECMIX1L 0x003c
  53. #define RT5663_RECMIX1R_0 0x003d
  54. #define RT5663_RECMIX1R 0x003e
  55. #define RT5663_RECMIX2_NEW 0x003f
  56. #define RT5663_RECMIX2_L_2 0x0041
  57. #define RT5663_RECMIX2_R 0x0042
  58. #define RT5663_RECMIX2_R_2 0x0043
  59. #define RT5663_CALIB_REC_LR 0x0044
  60. #define RT5663_ALC_BK_GAIN 0x0049
  61. #define RT5663_MONOMIX_GAIN 0x004a
  62. #define RT5663_MONOMIX_IN_GAIN 0x004b
  63. #define RT5663_OUT_MIXL_GAIN 0x004d
  64. #define RT5663_OUT_LMIX_IN_GAIN 0x004e
  65. #define RT5663_OUT_RMIX_IN_GAIN 0x004f
  66. #define RT5663_OUT_RMIX_IN_GAIN1 0x0050
  67. #define RT5663_LOUT_MIXER_CTRL 0x0052
  68. /* Power */
  69. #define RT5663_PWR_VOL 0x0067
  70. #define RT5663_ADCDAC_RST 0x006d
  71. /* Format - ADC/DAC */
  72. #define RT5663_I2S34_SDP 0x0071
  73. #define RT5663_I2S5_SDP 0x0072
  74. /* Function - Analog */
  75. #define RT5663_ASRC_3 0x0085
  76. #define RT5663_ASRC_6 0x0088
  77. #define RT5663_ASRC_7 0x0089
  78. #define RT5663_PLL_TRK_13 0x0099
  79. #define RT5663_I2S_M_CLK_CTL 0x00a0
  80. #define RT5663_FDIV_I2S34_M_CLK 0x00a1
  81. #define RT5663_FDIV_I2S34_M_CLK2 0x00a2
  82. #define RT5663_FDIV_I2S5_M_CLK 0x00a3
  83. #define RT5663_FDIV_I2S5_M_CLK2 0x00a4
  84. /* Function - Digital */
  85. #define RT5663_V2_IRQ_4 0x00b9
  86. #define RT5663_GPIO_3 0x00c2
  87. #define RT5663_GPIO_4 0x00c3
  88. #define RT5663_GPIO_STA2 0x00c4
  89. #define RT5663_HP_AMP_DET1 0x00d0
  90. #define RT5663_HP_AMP_DET2 0x00d1
  91. #define RT5663_HP_AMP_DET3 0x00d2
  92. #define RT5663_MID_BD_HP_AMP 0x00d3
  93. #define RT5663_LOW_BD_HP_AMP 0x00d4
  94. #define RT5663_SOF_VOL_ZC2 0x00da
  95. #define RT5663_ADC_STO2_ADJ1 0x00ee
  96. #define RT5663_ADC_STO2_ADJ2 0x00ef
  97. /* General Control */
  98. #define RT5663_A_JD_CTRL 0x00f0
  99. #define RT5663_JD1_TRES_CTRL 0x00f1
  100. #define RT5663_JD2_TRES_CTRL 0x00f2
  101. #define RT5663_V2_JD_CTRL2 0x00f7
  102. #define RT5663_DUM_REG_2 0x00fb
  103. #define RT5663_DUM_REG_3 0x00fc
  104. #define RT5663_DACADC_DIG_VOL2 0x0101
  105. #define RT5663_DIG_IN_PIN2 0x0133
  106. #define RT5663_PAD_DRV_CTL1 0x0136
  107. #define RT5663_SOF_RAM_DEPOP 0x0138
  108. #define RT5663_VOL_TEST 0x013f
  109. #define RT5663_MONO_DYNA_1 0x0170
  110. #define RT5663_MONO_DYNA_2 0x0171
  111. #define RT5663_MONO_DYNA_3 0x0172
  112. #define RT5663_MONO_DYNA_4 0x0173
  113. #define RT5663_MONO_DYNA_5 0x0174
  114. #define RT5663_MONO_DYNA_6 0x0175
  115. #define RT5663_STO1_SIL_DET 0x0190
  116. #define RT5663_MONOL_SIL_DET 0x0191
  117. #define RT5663_MONOR_SIL_DET 0x0192
  118. #define RT5663_STO2_DAC_SIL 0x0193
  119. #define RT5663_PWR_SAV_CTL1 0x0194
  120. #define RT5663_PWR_SAV_CTL2 0x0195
  121. #define RT5663_PWR_SAV_CTL3 0x0196
  122. #define RT5663_PWR_SAV_CTL4 0x0197
  123. #define RT5663_PWR_SAV_CTL5 0x0198
  124. #define RT5663_PWR_SAV_CTL6 0x0199
  125. #define RT5663_MONO_AMP_CAL1 0x01a0
  126. #define RT5663_MONO_AMP_CAL2 0x01a1
  127. #define RT5663_MONO_AMP_CAL3 0x01a2
  128. #define RT5663_MONO_AMP_CAL4 0x01a3
  129. #define RT5663_MONO_AMP_CAL5 0x01a4
  130. #define RT5663_MONO_AMP_CAL6 0x01a5
  131. #define RT5663_MONO_AMP_CAL7 0x01a6
  132. #define RT5663_MONO_AMP_CAL_ST1 0x01a7
  133. #define RT5663_MONO_AMP_CAL_ST2 0x01a8
  134. #define RT5663_MONO_AMP_CAL_ST3 0x01a9
  135. #define RT5663_MONO_AMP_CAL_ST4 0x01aa
  136. #define RT5663_MONO_AMP_CAL_ST5 0x01ab
  137. #define RT5663_V2_HP_IMP_SEN_13 0x01b9
  138. #define RT5663_V2_HP_IMP_SEN_14 0x01ba
  139. #define RT5663_V2_HP_IMP_SEN_6 0x01bb
  140. #define RT5663_V2_HP_IMP_SEN_7 0x01bc
  141. #define RT5663_V2_HP_IMP_SEN_8 0x01bd
  142. #define RT5663_V2_HP_IMP_SEN_9 0x01be
  143. #define RT5663_V2_HP_IMP_SEN_10 0x01bf
  144. #define RT5663_HP_LOGIC_3 0x01dc
  145. #define RT5663_HP_CALIB_ST10 0x01f3
  146. #define RT5663_HP_CALIB_ST11 0x01f4
  147. #define RT5663_PRO_REG_TBL_4 0x0203
  148. #define RT5663_PRO_REG_TBL_5 0x0204
  149. #define RT5663_PRO_REG_TBL_6 0x0205
  150. #define RT5663_PRO_REG_TBL_7 0x0206
  151. #define RT5663_PRO_REG_TBL_8 0x0207
  152. #define RT5663_PRO_REG_TBL_9 0x0208
  153. #define RT5663_SAR_ADC_INL_1 0x0210
  154. #define RT5663_SAR_ADC_INL_2 0x0211
  155. #define RT5663_SAR_ADC_INL_3 0x0212
  156. #define RT5663_SAR_ADC_INL_4 0x0213
  157. #define RT5663_SAR_ADC_INL_5 0x0214
  158. #define RT5663_SAR_ADC_INL_6 0x0215
  159. #define RT5663_SAR_ADC_INL_7 0x0216
  160. #define RT5663_SAR_ADC_INL_8 0x0217
  161. #define RT5663_SAR_ADC_INL_9 0x0218
  162. #define RT5663_SAR_ADC_INL_10 0x0219
  163. #define RT5663_SAR_ADC_INL_11 0x021a
  164. #define RT5663_SAR_ADC_INL_12 0x021b
  165. #define RT5663_DRC_CTRL_1 0x02ff
  166. #define RT5663_DRC1_CTRL_2 0x0301
  167. #define RT5663_DRC1_CTRL_3 0x0302
  168. #define RT5663_DRC1_CTRL_4 0x0303
  169. #define RT5663_DRC1_CTRL_5 0x0304
  170. #define RT5663_DRC1_CTRL_6 0x0305
  171. #define RT5663_DRC1_HD_CTRL_1 0x0306
  172. #define RT5663_DRC1_HD_CTRL_2 0x0307
  173. #define RT5663_DRC1_PRI_REG_1 0x0310
  174. #define RT5663_DRC1_PRI_REG_2 0x0311
  175. #define RT5663_DRC1_PRI_REG_3 0x0312
  176. #define RT5663_DRC1_PRI_REG_4 0x0313
  177. #define RT5663_DRC1_PRI_REG_5 0x0314
  178. #define RT5663_DRC1_PRI_REG_6 0x0315
  179. #define RT5663_DRC1_PRI_REG_7 0x0316
  180. #define RT5663_DRC1_PRI_REG_8 0x0317
  181. #define RT5663_ALC_PGA_CTL_1 0x0330
  182. #define RT5663_ALC_PGA_CTL_2 0x0331
  183. #define RT5663_ALC_PGA_CTL_3 0x0332
  184. #define RT5663_ALC_PGA_CTL_4 0x0333
  185. #define RT5663_ALC_PGA_CTL_5 0x0334
  186. #define RT5663_ALC_PGA_CTL_6 0x0335
  187. #define RT5663_ALC_PGA_CTL_7 0x0336
  188. #define RT5663_ALC_PGA_CTL_8 0x0337
  189. #define RT5663_ALC_PGA_REG_1 0x0338
  190. #define RT5663_ALC_PGA_REG_2 0x0339
  191. #define RT5663_ALC_PGA_REG_3 0x033a
  192. #define RT5663_ADC_EQ_RECOV_1 0x03c0
  193. #define RT5663_ADC_EQ_RECOV_2 0x03c1
  194. #define RT5663_ADC_EQ_RECOV_3 0x03c2
  195. #define RT5663_ADC_EQ_RECOV_4 0x03c3
  196. #define RT5663_ADC_EQ_RECOV_5 0x03c4
  197. #define RT5663_ADC_EQ_RECOV_6 0x03c5
  198. #define RT5663_ADC_EQ_RECOV_7 0x03c6
  199. #define RT5663_ADC_EQ_RECOV_8 0x03c7
  200. #define RT5663_ADC_EQ_RECOV_9 0x03c8
  201. #define RT5663_ADC_EQ_RECOV_10 0x03c9
  202. #define RT5663_ADC_EQ_RECOV_11 0x03ca
  203. #define RT5663_ADC_EQ_RECOV_12 0x03cb
  204. #define RT5663_ADC_EQ_RECOV_13 0x03cc
  205. #define RT5663_VID_HIDDEN 0x03fe
  206. #define RT5663_VID_CUSTOMER 0x03ff
  207. #define RT5663_SCAN_MODE 0x07f0
  208. #define RT5663_I2C_BYPA 0x07fa
  209. /* Headphone Amp Control 2 (0x0003) */
  210. #define RT5663_EN_DAC_HPO_MASK (0x1 << 14)
  211. #define RT5663_EN_DAC_HPO_SHIFT 14
  212. #define RT5663_EN_DAC_HPO_DIS (0x0 << 14)
  213. #define RT5663_EN_DAC_HPO_EN (0x1 << 14)
  214. /*Headphone Amp L/R Analog Gain and Digital NG2 Gain Control (0x0005 0x0006)*/
  215. #define RT5663_GAIN_HP (0x1f << 8)
  216. #define RT5663_GAIN_HP_SHIFT 8
  217. /* AEC BST Control (0x000b) */
  218. #define RT5663_GAIN_CBJ_MASK (0xf << 8)
  219. #define RT5663_GAIN_CBJ_SHIFT 8
  220. /* IN1 Control / MIC GND REF (0x000c) */
  221. #define RT5663_IN1_DF_MASK (0x1 << 15)
  222. #define RT5663_IN1_DF_SHIFT 15
  223. /* Combo Jack and Type Detection Control 1 (0x0010) */
  224. #define RT5663_CBJ_DET_MASK (0x1 << 15)
  225. #define RT5663_CBJ_DET_SHIFT 15
  226. #define RT5663_CBJ_DET_DIS (0x0 << 15)
  227. #define RT5663_CBJ_DET_EN (0x1 << 15)
  228. #define RT5663_DET_TYPE_MASK (0x1 << 12)
  229. #define RT5663_DET_TYPE_SHIFT 12
  230. #define RT5663_DET_TYPE_WLCSP (0x0 << 12)
  231. #define RT5663_DET_TYPE_QFN (0x1 << 12)
  232. #define RT5663_VREF_BIAS_MASK (0x1 << 6)
  233. #define RT5663_VREF_BIAS_SHIFT 6
  234. #define RT5663_VREF_BIAS_FSM (0x0 << 6)
  235. #define RT5663_VREF_BIAS_REG (0x1 << 6)
  236. /* REC Left Mixer Control 2 (0x003c) */
  237. #define RT5663_RECMIX1L_BST1_CBJ (0x1 << 7)
  238. #define RT5663_RECMIX1L_BST1_CBJ_SHIFT 7
  239. #define RT5663_RECMIX1L_BST2 (0x1 << 4)
  240. #define RT5663_RECMIX1L_BST2_SHIFT 4
  241. /* REC Right Mixer Control 2 (0x003e) */
  242. #define RT5663_RECMIX1R_BST2 (0x1 << 4)
  243. #define RT5663_RECMIX1R_BST2_SHIFT 4
  244. /* DAC1 Digital Volume (0x0019) */
  245. #define RT5663_DAC_L1_VOL_MASK (0xff << 8)
  246. #define RT5663_DAC_L1_VOL_SHIFT 8
  247. #define RT5663_DAC_R1_VOL_MASK (0xff)
  248. #define RT5663_DAC_R1_VOL_SHIFT 0
  249. /* ADC Digital Volume Control (0x001c) */
  250. #define RT5663_ADC_L_MUTE_MASK (0x1 << 15)
  251. #define RT5663_ADC_L_MUTE_SHIFT 15
  252. #define RT5663_ADC_L_VOL_MASK (0x7f << 8)
  253. #define RT5663_ADC_L_VOL_SHIFT 8
  254. #define RT5663_ADC_R_MUTE_MASK (0x1 << 7)
  255. #define RT5663_ADC_R_MUTE_SHIFT 7
  256. #define RT5663_ADC_R_VOL_MASK (0x7f)
  257. #define RT5663_ADC_R_VOL_SHIFT 0
  258. /* Stereo ADC Mixer Control (0x0026) */
  259. #define RT5663_M_STO1_ADC_L1 (0x1 << 15)
  260. #define RT5663_M_STO1_ADC_L1_SHIFT 15
  261. #define RT5663_M_STO1_ADC_L2 (0x1 << 14)
  262. #define RT5663_M_STO1_ADC_L2_SHIFT 14
  263. #define RT5663_STO1_ADC_L1_SRC (0x1 << 13)
  264. #define RT5663_STO1_ADC_L1_SRC_SHIFT 13
  265. #define RT5663_STO1_ADC_L2_SRC (0x1 << 12)
  266. #define RT5663_STO1_ADC_L2_SRC_SHIFT 12
  267. #define RT5663_STO1_ADC_L_SRC (0x3 << 10)
  268. #define RT5663_STO1_ADC_L_SRC_SHIFT 10
  269. #define RT5663_M_STO1_ADC_R1 (0x1 << 7)
  270. #define RT5663_M_STO1_ADC_R1_SHIFT 7
  271. #define RT5663_M_STO1_ADC_R2 (0x1 << 6)
  272. #define RT5663_M_STO1_ADC_R2_SHIFT 6
  273. #define RT5663_STO1_ADC_R1_SRC (0x1 << 5)
  274. #define RT5663_STO1_ADC_R1_SRC_SHIFT 5
  275. #define RT5663_STO1_ADC_R2_SRC (0x1 << 4)
  276. #define RT5663_STO1_ADC_R2_SRC_SHIFT 4
  277. #define RT5663_STO1_ADC_R_SRC (0x3 << 2)
  278. #define RT5663_STO1_ADC_R_SRC_SHIFT 2
  279. /* ADC Mixer to DAC Mixer Control (0x0029) */
  280. #define RT5663_M_ADCMIX_L (0x1 << 15)
  281. #define RT5663_M_ADCMIX_L_SHIFT 15
  282. #define RT5663_M_DAC1_L (0x1 << 14)
  283. #define RT5663_M_DAC1_L_SHIFT 14
  284. #define RT5663_M_ADCMIX_R (0x1 << 7)
  285. #define RT5663_M_ADCMIX_R_SHIFT 7
  286. #define RT5663_M_DAC1_R (0x1 << 6)
  287. #define RT5663_M_DAC1_R_SHIFT 6
  288. /* Stereo DAC Mixer Control (0x002a) */
  289. #define RT5663_M_DAC_L1_STO_L (0x1 << 15)
  290. #define RT5663_M_DAC_L1_STO_L_SHIFT 15
  291. #define RT5663_M_DAC_R1_STO_L (0x1 << 13)
  292. #define RT5663_M_DAC_R1_STO_L_SHIFT 13
  293. #define RT5663_M_DAC_L1_STO_R (0x1 << 7)
  294. #define RT5663_M_DAC_L1_STO_R_SHIFT 7
  295. #define RT5663_M_DAC_R1_STO_R (0x1 << 5)
  296. #define RT5663_M_DAC_R1_STO_R_SHIFT 5
  297. /* Power Management for Digital 1 (0x0061) */
  298. #define RT5663_PWR_I2S1 (0x1 << 15)
  299. #define RT5663_PWR_I2S1_SHIFT 15
  300. #define RT5663_PWR_DAC_L1 (0x1 << 11)
  301. #define RT5663_PWR_DAC_L1_SHIFT 11
  302. #define RT5663_PWR_DAC_R1 (0x1 << 10)
  303. #define RT5663_PWR_DAC_R1_SHIFT 10
  304. #define RT5663_PWR_LDO_DACREF_MASK (0x1 << 8)
  305. #define RT5663_PWR_LDO_DACREF_SHIFT 8
  306. #define RT5663_PWR_LDO_DACREF_ON (0x1 << 8)
  307. #define RT5663_PWR_LDO_DACREF_DOWN (0x0 << 8)
  308. #define RT5663_PWR_LDO_SHIFT 8
  309. #define RT5663_PWR_ADC_L1 (0x1 << 4)
  310. #define RT5663_PWR_ADC_L1_SHIFT 4
  311. #define RT5663_PWR_ADC_R1 (0x1 << 3)
  312. #define RT5663_PWR_ADC_R1_SHIFT 3
  313. /* Power Management for Digital 2 (0x0062) */
  314. #define RT5663_PWR_ADC_S1F (0x1 << 15)
  315. #define RT5663_PWR_ADC_S1F_SHIFT 15
  316. #define RT5663_PWR_DAC_S1F (0x1 << 10)
  317. #define RT5663_PWR_DAC_S1F_SHIFT 10
  318. /* Power Management for Analog 1 (0x0063) */
  319. #define RT5663_PWR_VREF1 (0x1 << 15)
  320. #define RT5663_PWR_VREF1_MASK (0x1 << 15)
  321. #define RT5663_PWR_VREF1_SHIFT 15
  322. #define RT5663_PWR_FV1 (0x1 << 14)
  323. #define RT5663_PWR_FV1_MASK (0x1 << 14)
  324. #define RT5663_PWR_FV1_SHIFT 14
  325. #define RT5663_PWR_VREF2 (0x1 << 13)
  326. #define RT5663_PWR_VREF2_MASK (0x1 << 13)
  327. #define RT5663_PWR_VREF2_SHIFT 13
  328. #define RT5663_PWR_FV2 (0x1 << 12)
  329. #define RT5663_PWR_FV2_MASK (0x1 << 12)
  330. #define RT5663_PWR_FV2_SHIFT 12
  331. #define RT5663_PWR_MB (0x1 << 9)
  332. #define RT5663_PWR_MB_MASK (0x1 << 9)
  333. #define RT5663_PWR_MB_SHIFT 9
  334. #define RT5663_AMP_HP_MASK (0x3 << 2)
  335. #define RT5663_AMP_HP_SHIFT 2
  336. #define RT5663_AMP_HP_1X (0x0 << 2)
  337. #define RT5663_AMP_HP_3X (0x1 << 2)
  338. #define RT5663_AMP_HP_5X (0x3 << 2)
  339. #define RT5663_LDO1_DVO_MASK (0x3)
  340. #define RT5663_LDO1_DVO_SHIFT 0
  341. #define RT5663_LDO1_DVO_0_9V (0x0)
  342. #define RT5663_LDO1_DVO_1_0V (0x1)
  343. #define RT5663_LDO1_DVO_1_2V (0x2)
  344. #define RT5663_LDO1_DVO_1_4V (0x3)
  345. /* Power Management for Analog 2 (0x0064) */
  346. #define RT5663_PWR_BST1 (0x1 << 15)
  347. #define RT5663_PWR_BST1_MASK (0x1 << 15)
  348. #define RT5663_PWR_BST1_SHIFT 15
  349. #define RT5663_PWR_BST1_OFF (0x0 << 15)
  350. #define RT5663_PWR_BST1_ON (0x1 << 15)
  351. #define RT5663_PWR_BST2 (0x1 << 14)
  352. #define RT5663_PWR_BST2_MASK (0x1 << 14)
  353. #define RT5663_PWR_BST2_SHIFT 14
  354. #define RT5663_PWR_MB1 (0x1 << 11)
  355. #define RT5663_PWR_MB1_SHIFT 11
  356. #define RT5663_PWR_MB2 (0x1 << 10)
  357. #define RT5663_PWR_MB2_SHIFT 10
  358. #define RT5663_PWR_BST2_OP (0x1 << 6)
  359. #define RT5663_PWR_BST2_OP_MASK (0x1 << 6)
  360. #define RT5663_PWR_BST2_OP_SHIFT 6
  361. #define RT5663_PWR_JD1 (0x1 << 3)
  362. #define RT5663_PWR_JD1_MASK (0x1 << 3)
  363. #define RT5663_PWR_JD1_SHIFT 3
  364. #define RT5663_PWR_JD2 (0x1 << 2)
  365. #define RT5663_PWR_JD2_MASK (0x1 << 2)
  366. #define RT5663_PWR_JD2_SHIFT 2
  367. #define RT5663_PWR_RECMIX1 (0x1 << 1)
  368. #define RT5663_PWR_RECMIX1_SHIFT 1
  369. #define RT5663_PWR_RECMIX2 (0x1)
  370. #define RT5663_PWR_RECMIX2_SHIFT 0
  371. /* Power Management for Analog 3 (0x0065) */
  372. #define RT5663_PWR_CBJ_MASK (0x1 << 9)
  373. #define RT5663_PWR_CBJ_SHIFT 9
  374. #define RT5663_PWR_CBJ_OFF (0x0 << 9)
  375. #define RT5663_PWR_CBJ_ON (0x1 << 9)
  376. #define RT5663_PWR_PLL (0x1 << 6)
  377. #define RT5663_PWR_PLL_SHIFT 6
  378. #define RT5663_PWR_LDO2 (0x1 << 2)
  379. #define RT5663_PWR_LDO2_SHIFT 2
  380. /* Power Management for Volume (0x0067) */
  381. #define RT5663_V2_PWR_MIC_DET (0x1 << 5)
  382. #define RT5663_V2_PWR_MIC_DET_SHIFT 5
  383. /* MCLK and System Clock Detection Control (0x006b) */
  384. #define RT5663_EN_ANA_CLK_DET_MASK (0x1 << 15)
  385. #define RT5663_EN_ANA_CLK_DET_SHIFT 15
  386. #define RT5663_EN_ANA_CLK_DET_DIS (0x0 << 15)
  387. #define RT5663_EN_ANA_CLK_DET_AUTO (0x1 << 15)
  388. #define RT5663_PWR_CLK_DET_MASK (0x1)
  389. #define RT5663_PWR_CLK_DET_SHIFT 0
  390. #define RT5663_PWR_CLK_DET_DIS (0x0)
  391. #define RT5663_PWR_CLK_DET_EN (0x1)
  392. /* I2S1 Audio Serial Data Port Control (0x0070) */
  393. #define RT5663_I2S_MS_MASK (0x1 << 15)
  394. #define RT5663_I2S_MS_SHIFT 15
  395. #define RT5663_I2S_MS_M (0x0 << 15)
  396. #define RT5663_I2S_MS_S (0x1 << 15)
  397. #define RT5663_I2S_BP_MASK (0x1 << 8)
  398. #define RT5663_I2S_BP_SHIFT 8
  399. #define RT5663_I2S_BP_NOR (0x0 << 8)
  400. #define RT5663_I2S_BP_INV (0x1 << 8)
  401. #define RT5663_I2S_DL_MASK (0x3 << 4)
  402. #define RT5663_I2S_DL_SHIFT 4
  403. #define RT5663_I2S_DL_16 (0x0 << 4)
  404. #define RT5663_I2S_DL_20 (0x1 << 4)
  405. #define RT5663_I2S_DL_24 (0x2 << 4)
  406. #define RT5663_I2S_DL_8 (0x3 << 4)
  407. #define RT5663_I2S_DF_MASK (0x7)
  408. #define RT5663_I2S_DF_SHIFT 0
  409. #define RT5663_I2S_DF_I2S (0x0)
  410. #define RT5663_I2S_DF_LEFT (0x1)
  411. #define RT5663_I2S_DF_PCM_A (0x2)
  412. #define RT5663_I2S_DF_PCM_B (0x3)
  413. #define RT5663_I2S_DF_PCM_A_N (0x6)
  414. #define RT5663_I2S_DF_PCM_B_N (0x7)
  415. /* ADC/DAC Clock Control 1 (0x0073) */
  416. #define RT5663_I2S_PD1_MASK (0x7 << 12)
  417. #define RT5663_I2S_PD1_SHIFT 12
  418. #define RT5663_M_I2S_DIV_MASK (0x7 << 8)
  419. #define RT5663_M_I2S_DIV_SHIFT 8
  420. #define RT5663_CLK_SRC_MASK (0x3 << 4)
  421. #define RT5663_CLK_SRC_MCLK (0x0 << 4)
  422. #define RT5663_CLK_SRC_PLL_OUT (0x1 << 4)
  423. #define RT5663_CLK_SRC_DIV (0x2 << 4)
  424. #define RT5663_CLK_SRC_RC (0x3 << 4)
  425. #define RT5663_DAC_OSR_MASK (0x3 << 2)
  426. #define RT5663_DAC_OSR_SHIFT 2
  427. #define RT5663_DAC_OSR_128 (0x0 << 2)
  428. #define RT5663_DAC_OSR_64 (0x1 << 2)
  429. #define RT5663_DAC_OSR_32 (0x2 << 2)
  430. #define RT5663_ADC_OSR_MASK (0x3)
  431. #define RT5663_ADC_OSR_SHIFT 0
  432. #define RT5663_ADC_OSR_128 (0x0)
  433. #define RT5663_ADC_OSR_64 (0x1)
  434. #define RT5663_ADC_OSR_32 (0x2)
  435. /* TDM1 control 1 (0x0078) */
  436. #define RT5663_TDM_MODE_MASK (0x1 << 15)
  437. #define RT5663_TDM_MODE_SHIFT 15
  438. #define RT5663_TDM_MODE_I2S (0x0 << 15)
  439. #define RT5663_TDM_MODE_TDM (0x1 << 15)
  440. #define RT5663_TDM_IN_CH_MASK (0x3 << 10)
  441. #define RT5663_TDM_IN_CH_SHIFT 10
  442. #define RT5663_TDM_IN_CH_2 (0x0 << 10)
  443. #define RT5663_TDM_IN_CH_4 (0x1 << 10)
  444. #define RT5663_TDM_IN_CH_6 (0x2 << 10)
  445. #define RT5663_TDM_IN_CH_8 (0x3 << 10)
  446. #define RT5663_TDM_OUT_CH_MASK (0x3 << 8)
  447. #define RT5663_TDM_OUT_CH_SHIFT 8
  448. #define RT5663_TDM_OUT_CH_2 (0x0 << 8)
  449. #define RT5663_TDM_OUT_CH_4 (0x1 << 8)
  450. #define RT5663_TDM_OUT_CH_6 (0x2 << 8)
  451. #define RT5663_TDM_OUT_CH_8 (0x3 << 8)
  452. #define RT5663_TDM_IN_LEN_MASK (0x3 << 6)
  453. #define RT5663_TDM_IN_LEN_SHIFT 6
  454. #define RT5663_TDM_IN_LEN_16 (0x0 << 6)
  455. #define RT5663_TDM_IN_LEN_20 (0x1 << 6)
  456. #define RT5663_TDM_IN_LEN_24 (0x2 << 6)
  457. #define RT5663_TDM_IN_LEN_32 (0x3 << 6)
  458. #define RT5663_TDM_OUT_LEN_MASK (0x3 << 4)
  459. #define RT5663_TDM_OUT_LEN_SHIFT 4
  460. #define RT5663_TDM_OUT_LEN_16 (0x0 << 4)
  461. #define RT5663_TDM_OUT_LEN_20 (0x1 << 4)
  462. #define RT5663_TDM_OUT_LEN_24 (0x2 << 4)
  463. #define RT5663_TDM_OUT_LEN_32 (0x3 << 4)
  464. /* Global Clock Control (0x0080) */
  465. #define RT5663_SCLK_SRC_MASK (0x3 << 14)
  466. #define RT5663_SCLK_SRC_SHIFT 14
  467. #define RT5663_SCLK_SRC_MCLK (0x0 << 14)
  468. #define RT5663_SCLK_SRC_PLL1 (0x1 << 14)
  469. #define RT5663_SCLK_SRC_RCCLK (0x2 << 14)
  470. #define RT5663_PLL1_SRC_MASK (0x7 << 11)
  471. #define RT5663_PLL1_SRC_SHIFT 11
  472. #define RT5663_PLL1_SRC_MCLK (0x0 << 11)
  473. #define RT5663_PLL1_SRC_BCLK1 (0x1 << 11)
  474. #define RT5663_V2_PLL1_SRC_MASK (0x7 << 8)
  475. #define RT5663_V2_PLL1_SRC_SHIFT 8
  476. #define RT5663_V2_PLL1_SRC_MCLK (0x0 << 8)
  477. #define RT5663_V2_PLL1_SRC_BCLK1 (0x1 << 8)
  478. #define RT5663_PLL1_PD_MASK (0x1 << 4)
  479. #define RT5663_PLL1_PD_SHIFT 4
  480. #define RT5663_PLL_INP_MAX 40000000
  481. #define RT5663_PLL_INP_MIN 256000
  482. /* PLL M/N/K Code Control 1 (0x0081) */
  483. #define RT5663_PLL_N_MAX 0x001ff
  484. #define RT5663_PLL_N_MASK (RT5663_PLL_N_MAX << 7)
  485. #define RT5663_PLL_N_SHIFT 7
  486. #define RT5663_PLL_K_MAX 0x001f
  487. #define RT5663_PLL_K_MASK (RT5663_PLL_K_MAX)
  488. #define RT5663_PLL_K_SHIFT 0
  489. /* PLL M/N/K Code Control 2 (0x0082) */
  490. #define RT5663_PLL_M_MAX 0x00f
  491. #define RT5663_PLL_M_MASK (RT5663_PLL_M_MAX << 12)
  492. #define RT5663_PLL_M_SHIFT 12
  493. #define RT5663_PLL_M_BP (0x1 << 11)
  494. #define RT5663_PLL_M_BP_SHIFT 11
  495. /* PLL tracking mode 1 (0x0083) */
  496. #define RT5663_V2_I2S1_ASRC_MASK (0x1 << 13)
  497. #define RT5663_V2_I2S1_ASRC_SHIFT 13
  498. #define RT5663_V2_DAC_STO1_ASRC_MASK (0x1 << 12)
  499. #define RT5663_V2_DAC_STO1_ASRC_SHIFT 12
  500. #define RT5663_V2_ADC_STO1_ASRC_MASK (0x1 << 4)
  501. #define RT5663_V2_ADC_STO1_ASRC_SHIFT 4
  502. /* PLL tracking mode 2 (0x0084)*/
  503. #define RT5663_DA_STO1_TRACK_MASK (0x7 << 12)
  504. #define RT5663_DA_STO1_TRACK_SHIFT 12
  505. #define RT5663_DA_STO1_TRACK_SYSCLK (0x0 << 12)
  506. #define RT5663_DA_STO1_TRACK_I2S1 (0x1 << 12)
  507. /* PLL tracking mode 3 (0x0085)*/
  508. #define RT5663_V2_AD_STO1_TRACK_MASK (0x7 << 12)
  509. #define RT5663_V2_AD_STO1_TRACK_SHIFT 12
  510. #define RT5663_V2_AD_STO1_TRACK_SYSCLK (0x0 << 12)
  511. #define RT5663_V2_AD_STO1_TRACK_I2S1 (0x1 << 12)
  512. /* HPOUT Charge pump control 1 (0x0091) */
  513. #define RT5663_OSW_HP_L_MASK (0x1 << 11)
  514. #define RT5663_OSW_HP_L_SHIFT 11
  515. #define RT5663_OSW_HP_L_EN (0x1 << 11)
  516. #define RT5663_OSW_HP_L_DIS (0x0 << 11)
  517. #define RT5663_OSW_HP_R_MASK (0x1 << 10)
  518. #define RT5663_OSW_HP_R_SHIFT 10
  519. #define RT5663_OSW_HP_R_EN (0x1 << 10)
  520. #define RT5663_OSW_HP_R_DIS (0x0 << 10)
  521. #define RT5663_SEL_PM_HP_MASK (0x3 << 8)
  522. #define RT5663_SEL_PM_HP_SHIFT 8
  523. #define RT5663_SEL_PM_HP_0_6 (0x0 << 8)
  524. #define RT5663_SEL_PM_HP_0_9 (0x1 << 8)
  525. #define RT5663_SEL_PM_HP_1_8 (0x2 << 8)
  526. #define RT5663_SEL_PM_HP_HIGH (0x3 << 8)
  527. #define RT5663_OVCD_HP_MASK (0x1 << 2)
  528. #define RT5663_OVCD_HP_SHIFT 2
  529. #define RT5663_OVCD_HP_EN (0x1 << 2)
  530. #define RT5663_OVCD_HP_DIS (0x0 << 2)
  531. /* RC Clock Control (0x0094) */
  532. #define RT5663_DIG_25M_CLK_MASK (0x1 << 9)
  533. #define RT5663_DIG_25M_CLK_SHIFT 9
  534. #define RT5663_DIG_25M_CLK_DIS (0x0 << 9)
  535. #define RT5663_DIG_25M_CLK_EN (0x1 << 9)
  536. #define RT5663_DIG_1M_CLK_MASK (0x1 << 8)
  537. #define RT5663_DIG_1M_CLK_SHIFT 8
  538. #define RT5663_DIG_1M_CLK_DIS (0x0 << 8)
  539. #define RT5663_DIG_1M_CLK_EN (0x1 << 8)
  540. /* Auto Turn On 1M RC CLK (0x009f) */
  541. #define RT5663_IRQ_POW_SAV_MASK (0x1 << 15)
  542. #define RT5663_IRQ_POW_SAV_SHIFT 15
  543. #define RT5663_IRQ_POW_SAV_DIS (0x0 << 15)
  544. #define RT5663_IRQ_POW_SAV_EN (0x1 << 15)
  545. #define RT5663_IRQ_POW_SAV_JD1_MASK (0x1 << 14)
  546. #define RT5663_IRQ_POW_SAV_JD1_SHIFT 14
  547. #define RT5663_IRQ_POW_SAV_JD1_DIS (0x0 << 14)
  548. #define RT5663_IRQ_POW_SAV_JD1_EN (0x1 << 14)
  549. #define RT5663_IRQ_MANUAL_MASK (0x1 << 8)
  550. #define RT5663_IRQ_MANUAL_SHIFT 8
  551. #define RT5663_IRQ_MANUAL_DIS (0x0 << 8)
  552. #define RT5663_IRQ_MANUAL_EN (0x1 << 8)
  553. /* IRQ Control 1 (0x00b6) */
  554. #define RT5663_EN_CB_JD_MASK (0x1 << 3)
  555. #define RT5663_EN_CB_JD_SHIFT 3
  556. #define RT5663_EN_CB_JD_EN (0x1 << 3)
  557. #define RT5663_EN_CB_JD_DIS (0x0 << 3)
  558. /* IRQ Control 3 (0x00b8) */
  559. #define RT5663_V2_EN_IRQ_INLINE_MASK (0x1 << 6)
  560. #define RT5663_V2_EN_IRQ_INLINE_SHIFT 6
  561. #define RT5663_V2_EN_IRQ_INLINE_BYP (0x0 << 6)
  562. #define RT5663_V2_EN_IRQ_INLINE_NOR (0x1 << 6)
  563. /* GPIO Control 1 (0x00c0) */
  564. #define RT5663_GP1_PIN_MASK (0x1 << 15)
  565. #define RT5663_GP1_PIN_SHIFT 15
  566. #define RT5663_GP1_PIN_GPIO1 (0x0 << 15)
  567. #define RT5663_GP1_PIN_IRQ (0x1 << 15)
  568. /* GPIO Control 2 (0x00c1) */
  569. #define RT5663_GP4_PIN_CONF_MASK (0x1 << 5)
  570. #define RT5663_GP4_PIN_CONF_SHIFT 5
  571. #define RT5663_GP4_PIN_CONF_INPUT (0x0 << 5)
  572. #define RT5663_GP4_PIN_CONF_OUTPUT (0x1 << 5)
  573. /* GPIO Control 2 (0x00c2) */
  574. #define RT5663_GP8_PIN_CONF_MASK (0x1 << 13)
  575. #define RT5663_GP8_PIN_CONF_SHIFT 13
  576. #define RT5663_GP8_PIN_CONF_INPUT (0x0 << 13)
  577. #define RT5663_GP8_PIN_CONF_OUTPUT (0x1 << 13)
  578. /* 4 Buttons Inline Command Function 1 (0x00df) */
  579. #define RT5663_4BTN_CLK_DEB_MASK (0x3 << 2)
  580. #define RT5663_4BTN_CLK_DEB_SHIFT 2
  581. #define RT5663_4BTN_CLK_DEB_8MS (0x0 << 2)
  582. #define RT5663_4BTN_CLK_DEB_16MS (0x1 << 2)
  583. #define RT5663_4BTN_CLK_DEB_32MS (0x2 << 2)
  584. #define RT5663_4BTN_CLK_DEB_65MS (0x3 << 2)
  585. /* Inline Command Function 6 (0x00e0) */
  586. #define RT5663_EN_4BTN_INL_MASK (0x1 << 15)
  587. #define RT5663_EN_4BTN_INL_SHIFT 15
  588. #define RT5663_EN_4BTN_INL_DIS (0x0 << 15)
  589. #define RT5663_EN_4BTN_INL_EN (0x1 << 15)
  590. #define RT5663_RESET_4BTN_INL_MASK (0x1 << 14)
  591. #define RT5663_RESET_4BTN_INL_SHIFT 14
  592. #define RT5663_RESET_4BTN_INL_RESET (0x0 << 14)
  593. #define RT5663_RESET_4BTN_INL_NOR (0x1 << 14)
  594. /* Digital Misc Control (0x00fa) */
  595. #define RT5663_DIG_GATE_CTRL_MASK 0x1
  596. #define RT5663_DIG_GATE_CTRL_SHIFT (0)
  597. #define RT5663_DIG_GATE_CTRL_DIS 0x0
  598. #define RT5663_DIG_GATE_CTRL_EN 0x1
  599. /* Chopper and Clock control for DAC L (0x013a)*/
  600. #define RT5663_CKXEN_DAC1_MASK (0x1 << 13)
  601. #define RT5663_CKXEN_DAC1_SHIFT 13
  602. #define RT5663_CKGEN_DAC1_MASK (0x1 << 12)
  603. #define RT5663_CKGEN_DAC1_SHIFT 12
  604. /* Chopper and Clock control for ADC (0x013b)*/
  605. #define RT5663_CKXEN_ADCC_MASK (0x1 << 13)
  606. #define RT5663_CKXEN_ADCC_SHIFT 13
  607. #define RT5663_CKGEN_ADCC_MASK (0x1 << 12)
  608. #define RT5663_CKGEN_ADCC_SHIFT 12
  609. /* HP Behavior Logic Control 2 (0x01db) */
  610. #define RT5663_HP_SIG_SRC1_MASK (0x3)
  611. #define RT5663_HP_SIG_SRC1_SHIFT 0
  612. #define RT5663_HP_SIG_SRC1_HP_DC (0x0)
  613. #define RT5663_HP_SIG_SRC1_HP_CALIB (0x1)
  614. #define RT5663_HP_SIG_SRC1_REG (0x2)
  615. #define RT5663_HP_SIG_SRC1_SILENCE (0x3)
  616. /* RT5663 specific register */
  617. #define RT5663_HP_OUT_EN 0x0002
  618. #define RT5663_HP_LCH_DRE 0x0005
  619. #define RT5663_HP_RCH_DRE 0x0006
  620. #define RT5663_CALIB_BST 0x000a
  621. #define RT5663_RECMIX 0x0010
  622. #define RT5663_SIL_DET_CTL 0x0015
  623. #define RT5663_PWR_SAV_SILDET 0x0016
  624. #define RT5663_SIDETONE_CTL 0x0018
  625. #define RT5663_STO1_DAC_DIG_VOL 0x0019
  626. #define RT5663_STO1_ADC_DIG_VOL 0x001c
  627. #define RT5663_STO1_BOOST 0x001f
  628. #define RT5663_HP_IMP_GAIN_1 0x0022
  629. #define RT5663_HP_IMP_GAIN_2 0x0023
  630. #define RT5663_STO1_ADC_MIXER 0x0026
  631. #define RT5663_AD_DA_MIXER 0x0029
  632. #define RT5663_STO_DAC_MIXER 0x002a
  633. #define RT5663_DIG_SIDE_MIXER 0x002c
  634. #define RT5663_BYPASS_STO_DAC 0x002d
  635. #define RT5663_CALIB_REC_MIX 0x0040
  636. #define RT5663_PWR_DIG_1 0x0061
  637. #define RT5663_PWR_DIG_2 0x0062
  638. #define RT5663_PWR_ANLG_1 0x0063
  639. #define RT5663_PWR_ANLG_2 0x0064
  640. #define RT5663_PWR_ANLG_3 0x0065
  641. #define RT5663_PWR_MIXER 0x0066
  642. #define RT5663_SIG_CLK_DET 0x006b
  643. #define RT5663_PRE_DIV_GATING_1 0x006e
  644. #define RT5663_PRE_DIV_GATING_2 0x006f
  645. #define RT5663_I2S1_SDP 0x0070
  646. #define RT5663_ADDA_CLK_1 0x0073
  647. #define RT5663_ADDA_RST 0x0074
  648. #define RT5663_FRAC_DIV_1 0x0075
  649. #define RT5663_FRAC_DIV_2 0x0076
  650. #define RT5663_TDM_1 0x0077
  651. #define RT5663_TDM_2 0x0078
  652. #define RT5663_TDM_3 0x0079
  653. #define RT5663_TDM_4 0x007a
  654. #define RT5663_TDM_5 0x007b
  655. #define RT5663_TDM_6 0x007c
  656. #define RT5663_TDM_7 0x007d
  657. #define RT5663_TDM_8 0x007e
  658. #define RT5663_TDM_9 0x007f
  659. #define RT5663_GLB_CLK 0x0080
  660. #define RT5663_PLL_1 0x0081
  661. #define RT5663_PLL_2 0x0082
  662. #define RT5663_ASRC_1 0x0083
  663. #define RT5663_ASRC_2 0x0084
  664. #define RT5663_ASRC_4 0x0086
  665. #define RT5663_DUMMY_REG 0x0087
  666. #define RT5663_ASRC_8 0x008a
  667. #define RT5663_ASRC_9 0x008b
  668. #define RT5663_ASRC_11 0x008c
  669. #define RT5663_DEPOP_1 0x008e
  670. #define RT5663_DEPOP_2 0x008f
  671. #define RT5663_DEPOP_3 0x0090
  672. #define RT5663_HP_CHARGE_PUMP_1 0x0091
  673. #define RT5663_HP_CHARGE_PUMP_2 0x0092
  674. #define RT5663_MICBIAS_1 0x0093
  675. #define RT5663_RC_CLK 0x0094
  676. #define RT5663_ASRC_11_2 0x0097
  677. #define RT5663_DUMMY_REG_2 0x0098
  678. #define RT5663_REC_PATH_GAIN 0x009a
  679. #define RT5663_AUTO_1MRC_CLK 0x009f
  680. #define RT5663_ADC_EQ_1 0x00ae
  681. #define RT5663_ADC_EQ_2 0x00af
  682. #define RT5663_IRQ_1 0x00b6
  683. #define RT5663_IRQ_2 0x00b7
  684. #define RT5663_IRQ_3 0x00b8
  685. #define RT5663_IRQ_4 0x00ba
  686. #define RT5663_IRQ_5 0x00bb
  687. #define RT5663_INT_ST_1 0x00be
  688. #define RT5663_INT_ST_2 0x00bf
  689. #define RT5663_GPIO_1 0x00c0
  690. #define RT5663_GPIO_2 0x00c1
  691. #define RT5663_GPIO_STA1 0x00c5
  692. #define RT5663_SIN_GEN_1 0x00cb
  693. #define RT5663_SIN_GEN_2 0x00cc
  694. #define RT5663_SIN_GEN_3 0x00cd
  695. #define RT5663_SOF_VOL_ZC1 0x00d9
  696. #define RT5663_IL_CMD_1 0x00db
  697. #define RT5663_IL_CMD_2 0x00dc
  698. #define RT5663_IL_CMD_3 0x00dd
  699. #define RT5663_IL_CMD_4 0x00de
  700. #define RT5663_IL_CMD_5 0x00df
  701. #define RT5663_IL_CMD_6 0x00e0
  702. #define RT5663_IL_CMD_7 0x00e1
  703. #define RT5663_IL_CMD_8 0x00e2
  704. #define RT5663_IL_CMD_PWRSAV1 0x00e4
  705. #define RT5663_IL_CMD_PWRSAV2 0x00e5
  706. #define RT5663_EM_JACK_TYPE_1 0x00e6
  707. #define RT5663_EM_JACK_TYPE_2 0x00e7
  708. #define RT5663_EM_JACK_TYPE_3 0x00e8
  709. #define RT5663_EM_JACK_TYPE_4 0x00e9
  710. #define RT5663_EM_JACK_TYPE_5 0x00ea
  711. #define RT5663_EM_JACK_TYPE_6 0x00eb
  712. #define RT5663_STO1_HPF_ADJ1 0x00ec
  713. #define RT5663_STO1_HPF_ADJ2 0x00ed
  714. #define RT5663_FAST_OFF_MICBIAS 0x00f4
  715. #define RT5663_JD_CTRL1 0x00f6
  716. #define RT5663_JD_CTRL2 0x00f8
  717. #define RT5663_DIG_MISC 0x00fa
  718. #define RT5663_DIG_VOL_ZCD 0x0100
  719. #define RT5663_ANA_BIAS_CUR_1 0x0108
  720. #define RT5663_ANA_BIAS_CUR_2 0x0109
  721. #define RT5663_ANA_BIAS_CUR_3 0x010a
  722. #define RT5663_ANA_BIAS_CUR_4 0x010b
  723. #define RT5663_ANA_BIAS_CUR_5 0x010c
  724. #define RT5663_ANA_BIAS_CUR_6 0x010d
  725. #define RT5663_BIAS_CUR_5 0x010e
  726. #define RT5663_BIAS_CUR_6 0x010f
  727. #define RT5663_BIAS_CUR_7 0x0110
  728. #define RT5663_BIAS_CUR_8 0x0111
  729. #define RT5663_DACREF_LDO 0x0112
  730. #define RT5663_DUMMY_REG_3 0x0113
  731. #define RT5663_BIAS_CUR_9 0x0114
  732. #define RT5663_DUMMY_REG_4 0x0116
  733. #define RT5663_VREFADJ_OP 0x0117
  734. #define RT5663_VREF_RECMIX 0x0118
  735. #define RT5663_CHARGE_PUMP_1 0x0125
  736. #define RT5663_CHARGE_PUMP_1_2 0x0126
  737. #define RT5663_CHARGE_PUMP_1_3 0x0127
  738. #define RT5663_CHARGE_PUMP_2 0x0128
  739. #define RT5663_DIG_IN_PIN1 0x0132
  740. #define RT5663_PAD_DRV_CTL 0x0137
  741. #define RT5663_PLL_INT_REG 0x0139
  742. #define RT5663_CHOP_DAC_L 0x013a
  743. #define RT5663_CHOP_ADC 0x013b
  744. #define RT5663_CALIB_ADC 0x013c
  745. #define RT5663_CHOP_DAC_R 0x013d
  746. #define RT5663_DUMMY_CTL_DACLR 0x013e
  747. #define RT5663_DUMMY_REG_5 0x0140
  748. #define RT5663_SOFT_RAMP 0x0141
  749. #define RT5663_TEST_MODE_1 0x0144
  750. #define RT5663_TEST_MODE_2 0x0145
  751. #define RT5663_TEST_MODE_3 0x0146
  752. #define RT5663_TEST_MODE_4 0x0147
  753. #define RT5663_TEST_MODE_5 0x0148
  754. #define RT5663_STO_DRE_1 0x0160
  755. #define RT5663_STO_DRE_2 0x0161
  756. #define RT5663_STO_DRE_3 0x0162
  757. #define RT5663_STO_DRE_4 0x0163
  758. #define RT5663_STO_DRE_5 0x0164
  759. #define RT5663_STO_DRE_6 0x0165
  760. #define RT5663_STO_DRE_7 0x0166
  761. #define RT5663_STO_DRE_8 0x0167
  762. #define RT5663_STO_DRE_9 0x0168
  763. #define RT5663_STO_DRE_10 0x0169
  764. #define RT5663_MIC_DECRO_1 0x0180
  765. #define RT5663_MIC_DECRO_2 0x0181
  766. #define RT5663_MIC_DECRO_3 0x0182
  767. #define RT5663_MIC_DECRO_4 0x0183
  768. #define RT5663_MIC_DECRO_5 0x0184
  769. #define RT5663_MIC_DECRO_6 0x0185
  770. #define RT5663_HP_DECRO_1 0x01b0
  771. #define RT5663_HP_DECRO_2 0x01b1
  772. #define RT5663_HP_DECRO_3 0x01b2
  773. #define RT5663_HP_DECRO_4 0x01b3
  774. #define RT5663_HP_DECOUP 0x01b4
  775. #define RT5663_HP_IMP_SEN_MAP8 0x01b5
  776. #define RT5663_HP_IMP_SEN_MAP9 0x01b6
  777. #define RT5663_HP_IMP_SEN_MAP10 0x01b7
  778. #define RT5663_HP_IMP_SEN_MAP11 0x01b8
  779. #define RT5663_HP_IMP_SEN_1 0x01c0
  780. #define RT5663_HP_IMP_SEN_2 0x01c1
  781. #define RT5663_HP_IMP_SEN_3 0x01c2
  782. #define RT5663_HP_IMP_SEN_4 0x01c3
  783. #define RT5663_HP_IMP_SEN_5 0x01c4
  784. #define RT5663_HP_IMP_SEN_6 0x01c5
  785. #define RT5663_HP_IMP_SEN_7 0x01c6
  786. #define RT5663_HP_IMP_SEN_8 0x01c7
  787. #define RT5663_HP_IMP_SEN_9 0x01c8
  788. #define RT5663_HP_IMP_SEN_10 0x01c9
  789. #define RT5663_HP_IMP_SEN_11 0x01ca
  790. #define RT5663_HP_IMP_SEN_12 0x01cb
  791. #define RT5663_HP_IMP_SEN_13 0x01cc
  792. #define RT5663_HP_IMP_SEN_14 0x01cd
  793. #define RT5663_HP_IMP_SEN_15 0x01ce
  794. #define RT5663_HP_IMP_SEN_16 0x01cf
  795. #define RT5663_HP_IMP_SEN_17 0x01d0
  796. #define RT5663_HP_IMP_SEN_18 0x01d1
  797. #define RT5663_HP_IMP_SEN_19 0x01d2
  798. #define RT5663_HP_IMPSEN_DIG5 0x01d3
  799. #define RT5663_HP_IMPSEN_MAP1 0x01d4
  800. #define RT5663_HP_IMPSEN_MAP2 0x01d5
  801. #define RT5663_HP_IMPSEN_MAP3 0x01d6
  802. #define RT5663_HP_IMPSEN_MAP4 0x01d7
  803. #define RT5663_HP_IMPSEN_MAP5 0x01d8
  804. #define RT5663_HP_IMPSEN_MAP7 0x01d9
  805. #define RT5663_HP_LOGIC_1 0x01da
  806. #define RT5663_HP_LOGIC_2 0x01db
  807. #define RT5663_HP_CALIB_1 0x01dd
  808. #define RT5663_HP_CALIB_1_1 0x01de
  809. #define RT5663_HP_CALIB_2 0x01df
  810. #define RT5663_HP_CALIB_3 0x01e0
  811. #define RT5663_HP_CALIB_4 0x01e1
  812. #define RT5663_HP_CALIB_5 0x01e2
  813. #define RT5663_HP_CALIB_5_1 0x01e3
  814. #define RT5663_HP_CALIB_6 0x01e4
  815. #define RT5663_HP_CALIB_7 0x01e5
  816. #define RT5663_HP_CALIB_9 0x01e6
  817. #define RT5663_HP_CALIB_10 0x01e7
  818. #define RT5663_HP_CALIB_11 0x01e8
  819. #define RT5663_HP_CALIB_ST1 0x01ea
  820. #define RT5663_HP_CALIB_ST2 0x01eb
  821. #define RT5663_HP_CALIB_ST3 0x01ec
  822. #define RT5663_HP_CALIB_ST4 0x01ed
  823. #define RT5663_HP_CALIB_ST5 0x01ee
  824. #define RT5663_HP_CALIB_ST6 0x01ef
  825. #define RT5663_HP_CALIB_ST7 0x01f0
  826. #define RT5663_HP_CALIB_ST8 0x01f1
  827. #define RT5663_HP_CALIB_ST9 0x01f2
  828. #define RT5663_HP_AMP_DET 0x0200
  829. #define RT5663_DUMMY_REG_6 0x0201
  830. #define RT5663_HP_BIAS 0x0202
  831. #define RT5663_CBJ_1 0x0250
  832. #define RT5663_CBJ_2 0x0251
  833. #define RT5663_CBJ_3 0x0252
  834. #define RT5663_DUMMY_1 0x02fa
  835. #define RT5663_DUMMY_2 0x02fb
  836. #define RT5663_DUMMY_3 0x02fc
  837. #define RT5663_ANA_JD 0x0300
  838. #define RT5663_ADC_LCH_LPF1_A1 0x03d0
  839. #define RT5663_ADC_RCH_LPF1_A1 0x03d1
  840. #define RT5663_ADC_LCH_LPF1_H0 0x03d2
  841. #define RT5663_ADC_RCH_LPF1_H0 0x03d3
  842. #define RT5663_ADC_LCH_BPF1_A1 0x03d4
  843. #define RT5663_ADC_RCH_BPF1_A1 0x03d5
  844. #define RT5663_ADC_LCH_BPF1_A2 0x03d6
  845. #define RT5663_ADC_RCH_BPF1_A2 0x03d7
  846. #define RT5663_ADC_LCH_BPF1_H0 0x03d8
  847. #define RT5663_ADC_RCH_BPF1_H0 0x03d9
  848. #define RT5663_ADC_LCH_BPF2_A1 0x03da
  849. #define RT5663_ADC_RCH_BPF2_A1 0x03db
  850. #define RT5663_ADC_LCH_BPF2_A2 0x03dc
  851. #define RT5663_ADC_RCH_BPF2_A2 0x03dd
  852. #define RT5663_ADC_LCH_BPF2_H0 0x03de
  853. #define RT5663_ADC_RCH_BPF2_H0 0x03df
  854. #define RT5663_ADC_LCH_BPF3_A1 0x03e0
  855. #define RT5663_ADC_RCH_BPF3_A1 0x03e1
  856. #define RT5663_ADC_LCH_BPF3_A2 0x03e2
  857. #define RT5663_ADC_RCH_BPF3_A2 0x03e3
  858. #define RT5663_ADC_LCH_BPF3_H0 0x03e4
  859. #define RT5663_ADC_RCH_BPF3_H0 0x03e5
  860. #define RT5663_ADC_LCH_BPF4_A1 0x03e6
  861. #define RT5663_ADC_RCH_BPF4_A1 0x03e7
  862. #define RT5663_ADC_LCH_BPF4_A2 0x03e8
  863. #define RT5663_ADC_RCH_BPF4_A2 0x03e9
  864. #define RT5663_ADC_LCH_BPF4_H0 0x03ea
  865. #define RT5663_ADC_RCH_BPF4_H0 0x03eb
  866. #define RT5663_ADC_LCH_HPF1_A1 0x03ec
  867. #define RT5663_ADC_RCH_HPF1_A1 0x03ed
  868. #define RT5663_ADC_LCH_HPF1_H0 0x03ee
  869. #define RT5663_ADC_RCH_HPF1_H0 0x03ef
  870. #define RT5663_ADC_EQ_PRE_VOL_L 0x03f0
  871. #define RT5663_ADC_EQ_PRE_VOL_R 0x03f1
  872. #define RT5663_ADC_EQ_POST_VOL_L 0x03f2
  873. #define RT5663_ADC_EQ_POST_VOL_R 0x03f3
  874. /* RECMIX Control (0x0010) */
  875. #define RT5663_RECMIX1_BST1_MASK (0x1)
  876. #define RT5663_RECMIX1_BST1_SHIFT 0
  877. #define RT5663_RECMIX1_BST1_ON (0x0)
  878. #define RT5663_RECMIX1_BST1_OFF (0x1)
  879. /* Bypass Stereo1 DAC Mixer Control (0x002d) */
  880. #define RT5663_DACL1_SRC_MASK (0x1 << 3)
  881. #define RT5663_DACL1_SRC_SHIFT 3
  882. #define RT5663_DACR1_SRC_MASK (0x1 << 2)
  883. #define RT5663_DACR1_SRC_SHIFT 2
  884. /* TDM control 2 (0x0078) */
  885. #define RT5663_DATA_SWAP_ADCDAT1_MASK (0x3 << 14)
  886. #define RT5663_DATA_SWAP_ADCDAT1_SHIFT 14
  887. #define RT5663_DATA_SWAP_ADCDAT1_LR (0x0 << 14)
  888. #define RT5663_DATA_SWAP_ADCDAT1_RL (0x1 << 14)
  889. #define RT5663_DATA_SWAP_ADCDAT1_LL (0x2 << 14)
  890. #define RT5663_DATA_SWAP_ADCDAT1_RR (0x3 << 14)
  891. /* TDM control 5 (0x007b) */
  892. #define RT5663_TDM_LENGTN_MASK (0x3)
  893. #define RT5663_TDM_LENGTN_SHIFT 0
  894. #define RT5663_TDM_LENGTN_16 (0x0)
  895. #define RT5663_TDM_LENGTN_20 (0x1)
  896. #define RT5663_TDM_LENGTN_24 (0x2)
  897. #define RT5663_TDM_LENGTN_32 (0x3)
  898. /* PLL tracking mode 1 (0x0083) */
  899. #define RT5663_I2S1_ASRC_MASK (0x1 << 11)
  900. #define RT5663_I2S1_ASRC_SHIFT 11
  901. #define RT5663_DAC_STO1_ASRC_MASK (0x1 << 10)
  902. #define RT5663_DAC_STO1_ASRC_SHIFT 10
  903. #define RT5663_ADC_STO1_ASRC_MASK (0x1 << 3)
  904. #define RT5663_ADC_STO1_ASRC_SHIFT 3
  905. /* PLL tracking mode 2 (0x0084)*/
  906. #define RT5663_DA_STO1_TRACK_MASK (0x7 << 12)
  907. #define RT5663_DA_STO1_TRACK_SHIFT 12
  908. #define RT5663_DA_STO1_TRACK_SYSCLK (0x0 << 12)
  909. #define RT5663_DA_STO1_TRACK_I2S1 (0x1 << 12)
  910. #define RT5663_AD_STO1_TRACK_MASK (0x7)
  911. #define RT5663_AD_STO1_TRACK_SHIFT 0
  912. #define RT5663_AD_STO1_TRACK_SYSCLK (0x0)
  913. #define RT5663_AD_STO1_TRACK_I2S1 (0x1)
  914. /* HPOUT Charge pump control 1 (0x0091) */
  915. #define RT5663_SI_HP_MASK (0x1 << 12)
  916. #define RT5663_SI_HP_SHIFT 12
  917. #define RT5663_SI_HP_EN (0x1 << 12)
  918. #define RT5663_SI_HP_DIS (0x0 << 12)
  919. /* GPIO Control 2 (0x00b6) */
  920. #define RT5663_GP1_PIN_CONF_MASK (0x1 << 2)
  921. #define RT5663_GP1_PIN_CONF_SHIFT 2
  922. #define RT5663_GP1_PIN_CONF_OUTPUT (0x1 << 2)
  923. #define RT5663_GP1_PIN_CONF_INPUT (0x0 << 2)
  924. /* GPIO Control 2 (0x00b7) */
  925. #define RT5663_EN_IRQ_INLINE_MASK (0x1 << 3)
  926. #define RT5663_EN_IRQ_INLINE_SHIFT 3
  927. #define RT5663_EN_IRQ_INLINE_NOR (0x1 << 3)
  928. #define RT5663_EN_IRQ_INLINE_BYP (0x0 << 3)
  929. /* GPIO Control 1 (0x00c0) */
  930. #define RT5663_GPIO1_TYPE_MASK (0x1 << 15)
  931. #define RT5663_GPIO1_TYPE_SHIFT 15
  932. #define RT5663_GPIO1_TYPE_EN (0x1 << 15)
  933. #define RT5663_GPIO1_TYPE_DIS (0x0 << 15)
  934. /* IRQ Control 1 (0x00c1) */
  935. #define RT5663_EN_IRQ_JD1_MASK (0x1 << 6)
  936. #define RT5663_EN_IRQ_JD1_SHIFT 6
  937. #define RT5663_EN_IRQ_JD1_EN (0x1 << 6)
  938. #define RT5663_EN_IRQ_JD1_DIS (0x0 << 6)
  939. #define RT5663_SEL_GPIO1_MASK (0x1 << 2)
  940. #define RT5663_SEL_GPIO1_SHIFT 6
  941. #define RT5663_SEL_GPIO1_EN (0x1 << 2)
  942. #define RT5663_SEL_GPIO1_DIS (0x0 << 2)
  943. /* Inline Command Function 2 (0x00dc) */
  944. #define RT5663_PWR_MIC_DET_MASK (0x1)
  945. #define RT5663_PWR_MIC_DET_SHIFT 0
  946. #define RT5663_PWR_MIC_DET_ON (0x1)
  947. #define RT5663_PWR_MIC_DET_OFF (0x0)
  948. /* Embeeded Jack and Type Detection Control 1 (0x00e6)*/
  949. #define RT5663_CBJ_DET_MASK (0x1 << 15)
  950. #define RT5663_CBJ_DET_SHIFT 15
  951. #define RT5663_CBJ_DET_DIS (0x0 << 15)
  952. #define RT5663_CBJ_DET_EN (0x1 << 15)
  953. #define RT5663_EXT_JD_MASK (0x1 << 11)
  954. #define RT5663_EXT_JD_SHIFT 11
  955. #define RT5663_EXT_JD_EN (0x1 << 11)
  956. #define RT5663_EXT_JD_DIS (0x0 << 11)
  957. #define RT5663_POL_EXT_JD_MASK (0x1 << 10)
  958. #define RT5663_POL_EXT_JD_SHIFT 10
  959. #define RT5663_POL_EXT_JD_EN (0x1 << 10)
  960. #define RT5663_POL_EXT_JD_DIS (0x0 << 10)
  961. #define RT5663_EM_JD_MASK (0x1 << 7)
  962. #define RT5663_EM_JD_SHIFT 7
  963. #define RT5663_EM_JD_NOR (0x1 << 7)
  964. #define RT5663_EM_JD_RST (0x0 << 7)
  965. /* DACREF LDO Control (0x0112)*/
  966. #define RT5663_PWR_LDO_DACREFL_MASK (0x1 << 9)
  967. #define RT5663_PWR_LDO_DACREFL_SHIFT 9
  968. #define RT5663_PWR_LDO_DACREFR_MASK (0x1 << 1)
  969. #define RT5663_PWR_LDO_DACREFR_SHIFT 1
  970. /* Stereo Dynamic Range Enhancement Control 9 (0x0168, 0x0169)*/
  971. #define RT5663_DRE_GAIN_HP_MASK (0x1f)
  972. #define RT5663_DRE_GAIN_HP_SHIFT 0
  973. /* Combo Jack Control (0x0250) */
  974. #define RT5663_INBUF_CBJ_BST1_MASK (0x1 << 11)
  975. #define RT5663_INBUF_CBJ_BST1_SHIFT 11
  976. #define RT5663_INBUF_CBJ_BST1_ON (0x1 << 11)
  977. #define RT5663_INBUF_CBJ_BST1_OFF (0x0 << 11)
  978. #define RT5663_CBJ_SENSE_BST1_MASK (0x1 << 10)
  979. #define RT5663_CBJ_SENSE_BST1_SHIFT 10
  980. #define RT5663_CBJ_SENSE_BST1_L (0x1 << 10)
  981. #define RT5663_CBJ_SENSE_BST1_R (0x0 << 10)
  982. /* Combo Jack Control (0x0251) */
  983. #define RT5663_GAIN_BST1_MASK (0xf)
  984. #define RT5663_GAIN_BST1_SHIFT 0
  985. /* Dummy register 1 (0x02fa) */
  986. #define RT5663_EMB_CLK_MASK (0x1 << 9)
  987. #define RT5663_EMB_CLK_SHIFT 9
  988. #define RT5663_EMB_CLK_EN (0x1 << 9)
  989. #define RT5663_EMB_CLK_DIS (0x0 << 9)
  990. #define RT5663_HPA_CPL_BIAS_MASK (0x7 << 6)
  991. #define RT5663_HPA_CPL_BIAS_SHIFT 6
  992. #define RT5663_HPA_CPL_BIAS_0_5 (0x0 << 6)
  993. #define RT5663_HPA_CPL_BIAS_1 (0x1 << 6)
  994. #define RT5663_HPA_CPL_BIAS_2 (0x2 << 6)
  995. #define RT5663_HPA_CPL_BIAS_3 (0x3 << 6)
  996. #define RT5663_HPA_CPL_BIAS_4_1 (0x4 << 6)
  997. #define RT5663_HPA_CPL_BIAS_4_2 (0x5 << 6)
  998. #define RT5663_HPA_CPL_BIAS_6 (0x6 << 6)
  999. #define RT5663_HPA_CPL_BIAS_8 (0x7 << 6)
  1000. #define RT5663_HPA_CPR_BIAS_MASK (0x7 << 3)
  1001. #define RT5663_HPA_CPR_BIAS_SHIFT 3
  1002. #define RT5663_HPA_CPR_BIAS_0_5 (0x0 << 3)
  1003. #define RT5663_HPA_CPR_BIAS_1 (0x1 << 3)
  1004. #define RT5663_HPA_CPR_BIAS_2 (0x2 << 3)
  1005. #define RT5663_HPA_CPR_BIAS_3 (0x3 << 3)
  1006. #define RT5663_HPA_CPR_BIAS_4_1 (0x4 << 3)
  1007. #define RT5663_HPA_CPR_BIAS_4_2 (0x5 << 3)
  1008. #define RT5663_HPA_CPR_BIAS_6 (0x6 << 3)
  1009. #define RT5663_HPA_CPR_BIAS_8 (0x7 << 3)
  1010. #define RT5663_DUMMY_BIAS_MASK (0x7)
  1011. #define RT5663_DUMMY_BIAS_SHIFT 0
  1012. #define RT5663_DUMMY_BIAS_0_5 (0x0)
  1013. #define RT5663_DUMMY_BIAS_1 (0x1)
  1014. #define RT5663_DUMMY_BIAS_2 (0x2)
  1015. #define RT5663_DUMMY_BIAS_3 (0x3)
  1016. #define RT5663_DUMMY_BIAS_4_1 (0x4)
  1017. #define RT5663_DUMMY_BIAS_4_2 (0x5)
  1018. #define RT5663_DUMMY_BIAS_6 (0x6)
  1019. #define RT5663_DUMMY_BIAS_8 (0x7)
  1020. /* System Clock Source */
  1021. enum {
  1022. RT5663_SCLK_S_MCLK,
  1023. RT5663_SCLK_S_PLL1,
  1024. RT5663_SCLK_S_RCCLK,
  1025. };
  1026. /* PLL1 Source */
  1027. enum {
  1028. RT5663_PLL1_S_MCLK,
  1029. RT5663_PLL1_S_BCLK1,
  1030. };
  1031. enum {
  1032. RT5663_AIF,
  1033. RT5663_AIFS,
  1034. };
  1035. /* asrc clock source */
  1036. enum {
  1037. RT5663_CLK_SEL_SYS = 0x0,
  1038. RT5663_CLK_SEL_I2S1_ASRC = 0x1,
  1039. };
  1040. /* filter mask */
  1041. enum {
  1042. RT5663_DA_STEREO_FILTER = 0x1,
  1043. RT5663_AD_STEREO_FILTER = 0x2,
  1044. };
  1045. int rt5663_sel_asrc_clk_src(struct snd_soc_component *component,
  1046. unsigned int filter_mask, unsigned int clk_src);
  1047. #endif /* __RT5663_H__ */