da7218.h 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416
  1. /*
  2. * da7218.h - DA7218 ALSA SoC Codec Driver
  3. *
  4. * Copyright (c) 2015 Dialog Semiconductor
  5. *
  6. * Author: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. */
  13. #ifndef _DA7218_H
  14. #define _DA7218_H
  15. #include <linux/regmap.h>
  16. #include <linux/regulator/consumer.h>
  17. #include <sound/da7218.h>
  18. /*
  19. * Registers
  20. */
  21. #define DA7218_SYSTEM_ACTIVE 0x0
  22. #define DA7218_CIF_CTRL 0x1
  23. #define DA7218_CHIP_ID1 0x4
  24. #define DA7218_CHIP_ID2 0x5
  25. #define DA7218_CHIP_REVISION 0x6
  26. #define DA7218_SPARE1 0x7
  27. #define DA7218_STATUS1 0x8
  28. #define DA7218_SOFT_RESET 0x9
  29. #define DA7218_SR 0xB
  30. #define DA7218_PC_COUNT 0xC
  31. #define DA7218_GAIN_RAMP_CTRL 0xD
  32. #define DA7218_CIF_TIMEOUT_CTRL 0x10
  33. #define DA7218_SYSTEM_MODES_INPUT 0x14
  34. #define DA7218_SYSTEM_MODES_OUTPUT 0x15
  35. #define DA7218_SYSTEM_STATUS 0x16
  36. #define DA7218_IN_1L_FILTER_CTRL 0x18
  37. #define DA7218_IN_1R_FILTER_CTRL 0x19
  38. #define DA7218_IN_2L_FILTER_CTRL 0x1A
  39. #define DA7218_IN_2R_FILTER_CTRL 0x1B
  40. #define DA7218_OUT_1L_FILTER_CTRL 0x20
  41. #define DA7218_OUT_1R_FILTER_CTRL 0x21
  42. #define DA7218_OUT_1_HPF_FILTER_CTRL 0x24
  43. #define DA7218_OUT_1_EQ_12_FILTER_CTRL 0x25
  44. #define DA7218_OUT_1_EQ_34_FILTER_CTRL 0x26
  45. #define DA7218_OUT_1_EQ_5_FILTER_CTRL 0x27
  46. #define DA7218_OUT_1_BIQ_5STAGE_CTRL 0x28
  47. #define DA7218_OUT_1_BIQ_5STAGE_DATA 0x29
  48. #define DA7218_OUT_1_BIQ_5STAGE_ADDR 0x2A
  49. #define DA7218_MIXIN_1_CTRL 0x2C
  50. #define DA7218_MIXIN_1_GAIN 0x2D
  51. #define DA7218_MIXIN_2_CTRL 0x2E
  52. #define DA7218_MIXIN_2_GAIN 0x2F
  53. #define DA7218_ALC_CTRL1 0x30
  54. #define DA7218_ALC_CTRL2 0x31
  55. #define DA7218_ALC_CTRL3 0x32
  56. #define DA7218_ALC_NOISE 0x33
  57. #define DA7218_ALC_TARGET_MIN 0x34
  58. #define DA7218_ALC_TARGET_MAX 0x35
  59. #define DA7218_ALC_GAIN_LIMITS 0x36
  60. #define DA7218_ALC_ANA_GAIN_LIMITS 0x37
  61. #define DA7218_ALC_ANTICLIP_CTRL 0x38
  62. #define DA7218_AGS_ENABLE 0x3C
  63. #define DA7218_AGS_TRIGGER 0x3D
  64. #define DA7218_AGS_ATT_MAX 0x3E
  65. #define DA7218_AGS_TIMEOUT 0x3F
  66. #define DA7218_AGS_ANTICLIP_CTRL 0x40
  67. #define DA7218_CALIB_CTRL 0x44
  68. #define DA7218_CALIB_OFFSET_AUTO_M_1 0x45
  69. #define DA7218_CALIB_OFFSET_AUTO_U_1 0x46
  70. #define DA7218_CALIB_OFFSET_AUTO_M_2 0x47
  71. #define DA7218_CALIB_OFFSET_AUTO_U_2 0x48
  72. #define DA7218_ENV_TRACK_CTRL 0x4C
  73. #define DA7218_LVL_DET_CTRL 0x50
  74. #define DA7218_LVL_DET_LEVEL 0x51
  75. #define DA7218_DGS_TRIGGER 0x54
  76. #define DA7218_DGS_ENABLE 0x55
  77. #define DA7218_DGS_RISE_FALL 0x56
  78. #define DA7218_DGS_SYNC_DELAY 0x57
  79. #define DA7218_DGS_SYNC_DELAY2 0x58
  80. #define DA7218_DGS_SYNC_DELAY3 0x59
  81. #define DA7218_DGS_LEVELS 0x5A
  82. #define DA7218_DGS_GAIN_CTRL 0x5B
  83. #define DA7218_DROUTING_OUTDAI_1L 0x5C
  84. #define DA7218_DMIX_OUTDAI_1L_INFILT_1L_GAIN 0x5D
  85. #define DA7218_DMIX_OUTDAI_1L_INFILT_1R_GAIN 0x5E
  86. #define DA7218_DMIX_OUTDAI_1L_INFILT_2L_GAIN 0x5F
  87. #define DA7218_DMIX_OUTDAI_1L_INFILT_2R_GAIN 0x60
  88. #define DA7218_DMIX_OUTDAI_1L_TONEGEN_GAIN 0x61
  89. #define DA7218_DMIX_OUTDAI_1L_INDAI_1L_GAIN 0x62
  90. #define DA7218_DMIX_OUTDAI_1L_INDAI_1R_GAIN 0x63
  91. #define DA7218_DROUTING_OUTDAI_1R 0x64
  92. #define DA7218_DMIX_OUTDAI_1R_INFILT_1L_GAIN 0x65
  93. #define DA7218_DMIX_OUTDAI_1R_INFILT_1R_GAIN 0x66
  94. #define DA7218_DMIX_OUTDAI_1R_INFILT_2L_GAIN 0x67
  95. #define DA7218_DMIX_OUTDAI_1R_INFILT_2R_GAIN 0x68
  96. #define DA7218_DMIX_OUTDAI_1R_TONEGEN_GAIN 0x69
  97. #define DA7218_DMIX_OUTDAI_1R_INDAI_1L_GAIN 0x6A
  98. #define DA7218_DMIX_OUTDAI_1R_INDAI_1R_GAIN 0x6B
  99. #define DA7218_DROUTING_OUTFILT_1L 0x6C
  100. #define DA7218_DMIX_OUTFILT_1L_INFILT_1L_GAIN 0x6D
  101. #define DA7218_DMIX_OUTFILT_1L_INFILT_1R_GAIN 0x6E
  102. #define DA7218_DMIX_OUTFILT_1L_INFILT_2L_GAIN 0x6F
  103. #define DA7218_DMIX_OUTFILT_1L_INFILT_2R_GAIN 0x70
  104. #define DA7218_DMIX_OUTFILT_1L_TONEGEN_GAIN 0x71
  105. #define DA7218_DMIX_OUTFILT_1L_INDAI_1L_GAIN 0x72
  106. #define DA7218_DMIX_OUTFILT_1L_INDAI_1R_GAIN 0x73
  107. #define DA7218_DROUTING_OUTFILT_1R 0x74
  108. #define DA7218_DMIX_OUTFILT_1R_INFILT_1L_GAIN 0x75
  109. #define DA7218_DMIX_OUTFILT_1R_INFILT_1R_GAIN 0x76
  110. #define DA7218_DMIX_OUTFILT_1R_INFILT_2L_GAIN 0x77
  111. #define DA7218_DMIX_OUTFILT_1R_INFILT_2R_GAIN 0x78
  112. #define DA7218_DMIX_OUTFILT_1R_TONEGEN_GAIN 0x79
  113. #define DA7218_DMIX_OUTFILT_1R_INDAI_1L_GAIN 0x7A
  114. #define DA7218_DMIX_OUTFILT_1R_INDAI_1R_GAIN 0x7B
  115. #define DA7218_DROUTING_OUTDAI_2L 0x7C
  116. #define DA7218_DMIX_OUTDAI_2L_INFILT_1L_GAIN 0x7D
  117. #define DA7218_DMIX_OUTDAI_2L_INFILT_1R_GAIN 0x7E
  118. #define DA7218_DMIX_OUTDAI_2L_INFILT_2L_GAIN 0x7F
  119. #define DA7218_DMIX_OUTDAI_2L_INFILT_2R_GAIN 0x80
  120. #define DA7218_DMIX_OUTDAI_2L_TONEGEN_GAIN 0x81
  121. #define DA7218_DMIX_OUTDAI_2L_INDAI_1L_GAIN 0x82
  122. #define DA7218_DMIX_OUTDAI_2L_INDAI_1R_GAIN 0x83
  123. #define DA7218_DROUTING_OUTDAI_2R 0x84
  124. #define DA7218_DMIX_OUTDAI_2R_INFILT_1L_GAIN 0x85
  125. #define DA7218_DMIX_OUTDAI_2R_INFILT_1R_GAIN 0x86
  126. #define DA7218_DMIX_OUTDAI_2R_INFILT_2L_GAIN 0x87
  127. #define DA7218_DMIX_OUTDAI_2R_INFILT_2R_GAIN 0x88
  128. #define DA7218_DMIX_OUTDAI_2R_TONEGEN_GAIN 0x89
  129. #define DA7218_DMIX_OUTDAI_2R_INDAI_1L_GAIN 0x8A
  130. #define DA7218_DMIX_OUTDAI_2R_INDAI_1R_GAIN 0x8B
  131. #define DA7218_DAI_CTRL 0x8C
  132. #define DA7218_DAI_TDM_CTRL 0x8D
  133. #define DA7218_DAI_OFFSET_LOWER 0x8E
  134. #define DA7218_DAI_OFFSET_UPPER 0x8F
  135. #define DA7218_DAI_CLK_MODE 0x90
  136. #define DA7218_PLL_CTRL 0x91
  137. #define DA7218_PLL_FRAC_TOP 0x92
  138. #define DA7218_PLL_FRAC_BOT 0x93
  139. #define DA7218_PLL_INTEGER 0x94
  140. #define DA7218_PLL_STATUS 0x95
  141. #define DA7218_PLL_REFOSC_CAL 0x98
  142. #define DA7218_DAC_NG_CTRL 0x9C
  143. #define DA7218_DAC_NG_SETUP_TIME 0x9D
  144. #define DA7218_DAC_NG_OFF_THRESH 0x9E
  145. #define DA7218_DAC_NG_ON_THRESH 0x9F
  146. #define DA7218_TONE_GEN_CFG1 0xA0
  147. #define DA7218_TONE_GEN_CFG2 0xA1
  148. #define DA7218_TONE_GEN_FREQ1_L 0xA2
  149. #define DA7218_TONE_GEN_FREQ1_U 0xA3
  150. #define DA7218_TONE_GEN_FREQ2_L 0xA4
  151. #define DA7218_TONE_GEN_FREQ2_U 0xA5
  152. #define DA7218_TONE_GEN_CYCLES 0xA6
  153. #define DA7218_TONE_GEN_ON_PER 0xA7
  154. #define DA7218_TONE_GEN_OFF_PER 0xA8
  155. #define DA7218_CP_CTRL 0xAC
  156. #define DA7218_CP_DELAY 0xAD
  157. #define DA7218_CP_VOL_THRESHOLD1 0xAE
  158. #define DA7218_MIC_1_CTRL 0xB4
  159. #define DA7218_MIC_1_GAIN 0xB5
  160. #define DA7218_MIC_1_SELECT 0xB7
  161. #define DA7218_MIC_2_CTRL 0xB8
  162. #define DA7218_MIC_2_GAIN 0xB9
  163. #define DA7218_MIC_2_SELECT 0xBB
  164. #define DA7218_IN_1_HPF_FILTER_CTRL 0xBC
  165. #define DA7218_IN_2_HPF_FILTER_CTRL 0xBD
  166. #define DA7218_ADC_1_CTRL 0xC0
  167. #define DA7218_ADC_2_CTRL 0xC1
  168. #define DA7218_ADC_MODE 0xC2
  169. #define DA7218_MIXOUT_L_CTRL 0xCC
  170. #define DA7218_MIXOUT_L_GAIN 0xCD
  171. #define DA7218_MIXOUT_R_CTRL 0xCE
  172. #define DA7218_MIXOUT_R_GAIN 0xCF
  173. #define DA7218_HP_L_CTRL 0xD0
  174. #define DA7218_HP_L_GAIN 0xD1
  175. #define DA7218_HP_R_CTRL 0xD2
  176. #define DA7218_HP_R_GAIN 0xD3
  177. #define DA7218_HP_SNGL_CTRL 0xD4
  178. #define DA7218_HP_DIFF_CTRL 0xD5
  179. #define DA7218_HP_DIFF_UNLOCK 0xD7
  180. #define DA7218_HPLDET_JACK 0xD8
  181. #define DA7218_HPLDET_CTRL 0xD9
  182. #define DA7218_HPLDET_TEST 0xDA
  183. #define DA7218_REFERENCES 0xDC
  184. #define DA7218_IO_CTRL 0xE0
  185. #define DA7218_LDO_CTRL 0xE1
  186. #define DA7218_SIDETONE_CTRL 0xE4
  187. #define DA7218_SIDETONE_IN_SELECT 0xE5
  188. #define DA7218_SIDETONE_GAIN 0xE6
  189. #define DA7218_DROUTING_ST_OUTFILT_1L 0xE8
  190. #define DA7218_DROUTING_ST_OUTFILT_1R 0xE9
  191. #define DA7218_SIDETONE_BIQ_3STAGE_DATA 0xEA
  192. #define DA7218_SIDETONE_BIQ_3STAGE_ADDR 0xEB
  193. #define DA7218_EVENT_STATUS 0xEC
  194. #define DA7218_EVENT 0xED
  195. #define DA7218_EVENT_MASK 0xEE
  196. #define DA7218_DMIC_1_CTRL 0xF0
  197. #define DA7218_DMIC_2_CTRL 0xF1
  198. #define DA7218_IN_1L_GAIN 0xF4
  199. #define DA7218_IN_1R_GAIN 0xF5
  200. #define DA7218_IN_2L_GAIN 0xF6
  201. #define DA7218_IN_2R_GAIN 0xF7
  202. #define DA7218_OUT_1L_GAIN 0xF8
  203. #define DA7218_OUT_1R_GAIN 0xF9
  204. #define DA7218_MICBIAS_CTRL 0xFC
  205. #define DA7218_MICBIAS_EN 0xFD
  206. /*
  207. * Bit Fields
  208. */
  209. #define DA7218_SWITCH_EN_MAX 0x1
  210. /* DA7218_SYSTEM_ACTIVE = 0x0 */
  211. #define DA7218_SYSTEM_ACTIVE_SHIFT 0
  212. #define DA7218_SYSTEM_ACTIVE_MASK (0x1 << 0)
  213. /* DA7218_CIF_CTRL = 0x1 */
  214. #define DA7218_CIF_I2C_WRITE_MODE_SHIFT 0
  215. #define DA7218_CIF_I2C_WRITE_MODE_MASK (0x1 << 0)
  216. /* DA7218_CHIP_ID1 = 0x4 */
  217. #define DA7218_CHIP_ID1_SHIFT 0
  218. #define DA7218_CHIP_ID1_MASK (0xFF << 0)
  219. /* DA7218_CHIP_ID2 = 0x5 */
  220. #define DA7218_CHIP_ID2_SHIFT 0
  221. #define DA7218_CHIP_ID2_MASK (0xFF << 0)
  222. /* DA7218_CHIP_REVISION = 0x6 */
  223. #define DA7218_CHIP_MINOR_SHIFT 0
  224. #define DA7218_CHIP_MINOR_MASK (0xF << 0)
  225. #define DA7218_CHIP_MAJOR_SHIFT 4
  226. #define DA7218_CHIP_MAJOR_MASK (0xF << 4)
  227. /* DA7218_SPARE1 = 0x7 */
  228. #define DA7218_SPARE1_SHIFT 0
  229. #define DA7218_SPARE1_MASK (0xFF << 0)
  230. /* DA7218_STATUS1 = 0x8 */
  231. #define DA7218_STATUS_SPARE1_SHIFT 0
  232. #define DA7218_STATUS_SPARE1_MASK (0xFF << 0)
  233. /* DA7218_SOFT_RESET = 0x9 */
  234. #define DA7218_CIF_REG_SOFT_RESET_SHIFT 7
  235. #define DA7218_CIF_REG_SOFT_RESET_MASK (0x1 << 7)
  236. /* DA7218_SR = 0xB */
  237. #define DA7218_SR_ADC_SHIFT 0
  238. #define DA7218_SR_ADC_MASK (0xF << 0)
  239. #define DA7218_SR_DAC_SHIFT 4
  240. #define DA7218_SR_DAC_MASK (0xF << 4)
  241. #define DA7218_SR_8000 0x01
  242. #define DA7218_SR_11025 0x02
  243. #define DA7218_SR_12000 0x03
  244. #define DA7218_SR_16000 0x05
  245. #define DA7218_SR_22050 0x06
  246. #define DA7218_SR_24000 0x07
  247. #define DA7218_SR_32000 0x09
  248. #define DA7218_SR_44100 0x0A
  249. #define DA7218_SR_48000 0x0B
  250. #define DA7218_SR_88200 0x0E
  251. #define DA7218_SR_96000 0x0F
  252. /* DA7218_PC_COUNT = 0xC */
  253. #define DA7218_PC_FREERUN_SHIFT 0
  254. #define DA7218_PC_FREERUN_MASK (0x1 << 0)
  255. #define DA7218_PC_RESYNC_AUTO_SHIFT 1
  256. #define DA7218_PC_RESYNC_AUTO_MASK (0x1 << 1)
  257. /* DA7218_GAIN_RAMP_CTRL = 0xD */
  258. #define DA7218_GAIN_RAMP_RATE_SHIFT 0
  259. #define DA7218_GAIN_RAMP_RATE_MASK (0x3 << 0)
  260. #define DA7218_GAIN_RAMP_RATE_MAX 4
  261. /* DA7218_CIF_TIMEOUT_CTRL = 0x10 */
  262. #define DA7218_I2C_TIMEOUT_EN_SHIFT 0
  263. #define DA7218_I2C_TIMEOUT_EN_MASK (0x1 << 0)
  264. /* DA7218_SYSTEM_MODES_INPUT = 0x14 */
  265. #define DA7218_MODE_SUBMIT_SHIFT 0
  266. #define DA7218_MODE_SUBMIT_MASK (0x1 << 0)
  267. #define DA7218_ADC_MODE_SHIFT 1
  268. #define DA7218_ADC_MODE_MASK (0x7F << 1)
  269. /* DA7218_SYSTEM_MODES_OUTPUT = 0x15 */
  270. #define DA7218_MODE_SUBMIT_SHIFT 0
  271. #define DA7218_MODE_SUBMIT_MASK (0x1 << 0)
  272. #define DA7218_DAC_MODE_SHIFT 1
  273. #define DA7218_DAC_MODE_MASK (0x7F << 1)
  274. /* DA7218_SYSTEM_STATUS = 0x16 */
  275. #define DA7218_SC1_BUSY_SHIFT 0
  276. #define DA7218_SC1_BUSY_MASK (0x1 << 0)
  277. #define DA7218_SC2_BUSY_SHIFT 1
  278. #define DA7218_SC2_BUSY_MASK (0x1 << 1)
  279. /* DA7218_IN_1L_FILTER_CTRL = 0x18 */
  280. #define DA7218_IN_1L_RAMP_EN_SHIFT 5
  281. #define DA7218_IN_1L_RAMP_EN_MASK (0x1 << 5)
  282. #define DA7218_IN_1L_MUTE_EN_SHIFT 6
  283. #define DA7218_IN_1L_MUTE_EN_MASK (0x1 << 6)
  284. #define DA7218_IN_1L_FILTER_EN_SHIFT 7
  285. #define DA7218_IN_1L_FILTER_EN_MASK (0x1 << 7)
  286. /* DA7218_IN_1R_FILTER_CTRL = 0x19 */
  287. #define DA7218_IN_1R_RAMP_EN_SHIFT 5
  288. #define DA7218_IN_1R_RAMP_EN_MASK (0x1 << 5)
  289. #define DA7218_IN_1R_MUTE_EN_SHIFT 6
  290. #define DA7218_IN_1R_MUTE_EN_MASK (0x1 << 6)
  291. #define DA7218_IN_1R_FILTER_EN_SHIFT 7
  292. #define DA7218_IN_1R_FILTER_EN_MASK (0x1 << 7)
  293. /* DA7218_IN_2L_FILTER_CTRL = 0x1A */
  294. #define DA7218_IN_2L_RAMP_EN_SHIFT 5
  295. #define DA7218_IN_2L_RAMP_EN_MASK (0x1 << 5)
  296. #define DA7218_IN_2L_MUTE_EN_SHIFT 6
  297. #define DA7218_IN_2L_MUTE_EN_MASK (0x1 << 6)
  298. #define DA7218_IN_2L_FILTER_EN_SHIFT 7
  299. #define DA7218_IN_2L_FILTER_EN_MASK (0x1 << 7)
  300. /* DA7218_IN_2R_FILTER_CTRL = 0x1B */
  301. #define DA7218_IN_2R_RAMP_EN_SHIFT 5
  302. #define DA7218_IN_2R_RAMP_EN_MASK (0x1 << 5)
  303. #define DA7218_IN_2R_MUTE_EN_SHIFT 6
  304. #define DA7218_IN_2R_MUTE_EN_MASK (0x1 << 6)
  305. #define DA7218_IN_2R_FILTER_EN_SHIFT 7
  306. #define DA7218_IN_2R_FILTER_EN_MASK (0x1 << 7)
  307. /* DA7218_OUT_1L_FILTER_CTRL = 0x20 */
  308. #define DA7218_OUT_1L_BIQ_5STAGE_SEL_SHIFT 3
  309. #define DA7218_OUT_1L_BIQ_5STAGE_SEL_MASK (0x1 << 3)
  310. #define DA7218_OUT_BIQ_5STAGE_SEL_MAX 2
  311. #define DA7218_OUT_1L_SUBRANGE_EN_SHIFT 4
  312. #define DA7218_OUT_1L_SUBRANGE_EN_MASK (0x1 << 4)
  313. #define DA7218_OUT_1L_RAMP_EN_SHIFT 5
  314. #define DA7218_OUT_1L_RAMP_EN_MASK (0x1 << 5)
  315. #define DA7218_OUT_1L_MUTE_EN_SHIFT 6
  316. #define DA7218_OUT_1L_MUTE_EN_MASK (0x1 << 6)
  317. #define DA7218_OUT_1L_FILTER_EN_SHIFT 7
  318. #define DA7218_OUT_1L_FILTER_EN_MASK (0x1 << 7)
  319. /* DA7218_OUT_1R_FILTER_CTRL = 0x21 */
  320. #define DA7218_OUT_1R_BIQ_5STAGE_SEL_SHIFT 3
  321. #define DA7218_OUT_1R_BIQ_5STAGE_SEL_MASK (0x1 << 3)
  322. #define DA7218_OUT_1R_SUBRANGE_EN_SHIFT 4
  323. #define DA7218_OUT_1R_SUBRANGE_EN_MASK (0x1 << 4)
  324. #define DA7218_OUT_1R_RAMP_EN_SHIFT 5
  325. #define DA7218_OUT_1R_RAMP_EN_MASK (0x1 << 5)
  326. #define DA7218_OUT_1R_MUTE_EN_SHIFT 6
  327. #define DA7218_OUT_1R_MUTE_EN_MASK (0x1 << 6)
  328. #define DA7218_OUT_1R_FILTER_EN_SHIFT 7
  329. #define DA7218_OUT_1R_FILTER_EN_MASK (0x1 << 7)
  330. /* DA7218_OUT_1_HPF_FILTER_CTRL = 0x24 */
  331. #define DA7218_OUT_1_VOICE_HPF_CORNER_SHIFT 0
  332. #define DA7218_OUT_1_VOICE_HPF_CORNER_MASK (0x7 << 0)
  333. #define DA7218_VOICE_HPF_CORNER_MAX 8
  334. #define DA7218_OUT_1_VOICE_EN_SHIFT 3
  335. #define DA7218_OUT_1_VOICE_EN_MASK (0x1 << 3)
  336. #define DA7218_OUT_1_AUDIO_HPF_CORNER_SHIFT 4
  337. #define DA7218_OUT_1_AUDIO_HPF_CORNER_MASK (0x3 << 4)
  338. #define DA7218_AUDIO_HPF_CORNER_MAX 4
  339. #define DA7218_OUT_1_HPF_EN_SHIFT 7
  340. #define DA7218_OUT_1_HPF_EN_MASK (0x1 << 7)
  341. #define DA7218_HPF_MODE_SHIFT 0
  342. #define DA7218_HPF_DISABLED ((0x0 << 3) | (0x0 << 7))
  343. #define DA7218_HPF_AUDIO_EN ((0x0 << 3) | (0x1 << 7))
  344. #define DA7218_HPF_VOICE_EN ((0x1 << 3) | (0x1 << 7))
  345. #define DA7218_HPF_MODE_MASK ((0x1 << 3) | (0x1 << 7))
  346. #define DA7218_HPF_MODE_MAX 3
  347. /* DA7218_OUT_1_EQ_12_FILTER_CTRL = 0x25 */
  348. #define DA7218_OUT_1_EQ_BAND1_SHIFT 0
  349. #define DA7218_OUT_1_EQ_BAND1_MASK (0xF << 0)
  350. #define DA7218_OUT_EQ_BAND_MAX 0xF
  351. #define DA7218_OUT_1_EQ_BAND2_SHIFT 4
  352. #define DA7218_OUT_1_EQ_BAND2_MASK (0xF << 4)
  353. /* DA7218_OUT_1_EQ_34_FILTER_CTRL = 0x26 */
  354. #define DA7218_OUT_1_EQ_BAND3_SHIFT 0
  355. #define DA7218_OUT_1_EQ_BAND3_MASK (0xF << 0)
  356. #define DA7218_OUT_1_EQ_BAND4_SHIFT 4
  357. #define DA7218_OUT_1_EQ_BAND4_MASK (0xF << 4)
  358. /* DA7218_OUT_1_EQ_5_FILTER_CTRL = 0x27 */
  359. #define DA7218_OUT_1_EQ_BAND5_SHIFT 0
  360. #define DA7218_OUT_1_EQ_BAND5_MASK (0xF << 0)
  361. #define DA7218_OUT_1_EQ_EN_SHIFT 7
  362. #define DA7218_OUT_1_EQ_EN_MASK (0x1 << 7)
  363. /* DA7218_OUT_1_BIQ_5STAGE_CTRL = 0x28 */
  364. #define DA7218_OUT_1_BIQ_5STAGE_MUTE_EN_SHIFT 6
  365. #define DA7218_OUT_1_BIQ_5STAGE_MUTE_EN_MASK (0x1 << 6)
  366. #define DA7218_OUT_1_BIQ_5STAGE_FILTER_EN_SHIFT 7
  367. #define DA7218_OUT_1_BIQ_5STAGE_FILTER_EN_MASK (0x1 << 7)
  368. /* DA7218_OUT_1_BIQ_5STAGE_DATA = 0x29 */
  369. #define DA7218_OUT_1_BIQ_5STAGE_DATA_SHIFT 0
  370. #define DA7218_OUT_1_BIQ_5STAGE_DATA_MASK (0xFF << 0)
  371. /* DA7218_OUT_1_BIQ_5STAGE_ADDR = 0x2A */
  372. #define DA7218_OUT_1_BIQ_5STAGE_ADDR_SHIFT 0
  373. #define DA7218_OUT_1_BIQ_5STAGE_ADDR_MASK (0x3F << 0)
  374. #define DA7218_OUT_1_BIQ_5STAGE_CFG_SIZE 50
  375. /* DA7218_MIXIN_1_CTRL = 0x2C */
  376. #define DA7218_MIXIN_1_MIX_SEL_SHIFT 3
  377. #define DA7218_MIXIN_1_MIX_SEL_MASK (0x1 << 3)
  378. #define DA7218_MIXIN_1_AMP_ZC_EN_SHIFT 4
  379. #define DA7218_MIXIN_1_AMP_ZC_EN_MASK (0x1 << 4)
  380. #define DA7218_MIXIN_1_AMP_RAMP_EN_SHIFT 5
  381. #define DA7218_MIXIN_1_AMP_RAMP_EN_MASK (0x1 << 5)
  382. #define DA7218_MIXIN_1_AMP_MUTE_EN_SHIFT 6
  383. #define DA7218_MIXIN_1_AMP_MUTE_EN_MASK (0x1 << 6)
  384. #define DA7218_MIXIN_1_AMP_EN_SHIFT 7
  385. #define DA7218_MIXIN_1_AMP_EN_MASK (0x1 << 7)
  386. /* DA7218_MIXIN_1_GAIN = 0x2D */
  387. #define DA7218_MIXIN_1_AMP_GAIN_SHIFT 0
  388. #define DA7218_MIXIN_1_AMP_GAIN_MASK (0xF << 0)
  389. #define DA7218_MIXIN_AMP_GAIN_MAX 0xF
  390. /* DA7218_MIXIN_2_CTRL = 0x2E */
  391. #define DA7218_MIXIN_2_MIX_SEL_SHIFT 3
  392. #define DA7218_MIXIN_2_MIX_SEL_MASK (0x1 << 3)
  393. #define DA7218_MIXIN_2_AMP_ZC_EN_SHIFT 4
  394. #define DA7218_MIXIN_2_AMP_ZC_EN_MASK (0x1 << 4)
  395. #define DA7218_MIXIN_2_AMP_RAMP_EN_SHIFT 5
  396. #define DA7218_MIXIN_2_AMP_RAMP_EN_MASK (0x1 << 5)
  397. #define DA7218_MIXIN_2_AMP_MUTE_EN_SHIFT 6
  398. #define DA7218_MIXIN_2_AMP_MUTE_EN_MASK (0x1 << 6)
  399. #define DA7218_MIXIN_2_AMP_EN_SHIFT 7
  400. #define DA7218_MIXIN_2_AMP_EN_MASK (0x1 << 7)
  401. /* DA7218_MIXIN_2_GAIN = 0x2F */
  402. #define DA7218_MIXIN_2_AMP_GAIN_SHIFT 0
  403. #define DA7218_MIXIN_2_AMP_GAIN_MASK (0xF << 0)
  404. /* DA7218_ALC_CTRL1 = 0x30 */
  405. #define DA7218_ALC_EN_SHIFT 0
  406. #define DA7218_ALC_EN_MASK (0xF << 0)
  407. #define DA7218_ALC_CHAN1_L_EN_SHIFT 0
  408. #define DA7218_ALC_CHAN1_R_EN_SHIFT 1
  409. #define DA7218_ALC_CHAN2_L_EN_SHIFT 2
  410. #define DA7218_ALC_CHAN2_R_EN_SHIFT 3
  411. #define DA7218_ALC_SYNC_MODE_SHIFT 4
  412. #define DA7218_ALC_SYNC_MODE_MASK (0xF << 4)
  413. #define DA7218_ALC_SYNC_MODE_CH1 (0x1 << 4)
  414. #define DA7218_ALC_SYNC_MODE_CH2 (0x4 << 4)
  415. /* DA7218_ALC_CTRL2 = 0x31 */
  416. #define DA7218_ALC_ATTACK_SHIFT 0
  417. #define DA7218_ALC_ATTACK_MASK (0xF << 0)
  418. #define DA7218_ALC_ATTACK_MAX 13
  419. #define DA7218_ALC_RELEASE_SHIFT 4
  420. #define DA7218_ALC_RELEASE_MASK (0xF << 4)
  421. #define DA7218_ALC_RELEASE_MAX 11
  422. /* DA7218_ALC_CTRL3 = 0x32 */
  423. #define DA7218_ALC_HOLD_SHIFT 0
  424. #define DA7218_ALC_HOLD_MASK (0xF << 0)
  425. #define DA7218_ALC_HOLD_MAX 16
  426. /* DA7218_ALC_NOISE = 0x33 */
  427. #define DA7218_ALC_NOISE_SHIFT 0
  428. #define DA7218_ALC_NOISE_MASK (0x3F << 0)
  429. #define DA7218_ALC_THRESHOLD_MAX 0x3F
  430. /* DA7218_ALC_TARGET_MIN = 0x34 */
  431. #define DA7218_ALC_THRESHOLD_MIN_SHIFT 0
  432. #define DA7218_ALC_THRESHOLD_MIN_MASK (0x3F << 0)
  433. /* DA7218_ALC_TARGET_MAX = 0x35 */
  434. #define DA7218_ALC_THRESHOLD_MAX_SHIFT 0
  435. #define DA7218_ALC_THRESHOLD_MAX_MASK (0x3F << 0)
  436. /* DA7218_ALC_GAIN_LIMITS = 0x36 */
  437. #define DA7218_ALC_ATTEN_MAX_SHIFT 0
  438. #define DA7218_ALC_ATTEN_MAX_MASK (0xF << 0)
  439. #define DA7218_ALC_ATTEN_GAIN_MAX 0xF
  440. #define DA7218_ALC_GAIN_MAX_SHIFT 4
  441. #define DA7218_ALC_GAIN_MAX_MASK (0xF << 4)
  442. /* DA7218_ALC_ANA_GAIN_LIMITS = 0x37 */
  443. #define DA7218_ALC_ANA_GAIN_MIN_SHIFT 0
  444. #define DA7218_ALC_ANA_GAIN_MIN_MASK (0x7 << 0)
  445. #define DA7218_ALC_ANA_GAIN_MIN 0x1
  446. #define DA7218_ALC_ANA_GAIN_MAX 0x7
  447. #define DA7218_ALC_ANA_GAIN_MAX_SHIFT 4
  448. #define DA7218_ALC_ANA_GAIN_MAX_MASK (0x7 << 4)
  449. /* DA7218_ALC_ANTICLIP_CTRL = 0x38 */
  450. #define DA7218_ALC_ANTICLIP_STEP_SHIFT 0
  451. #define DA7218_ALC_ANTICLIP_STEP_MASK (0x3 << 0)
  452. #define DA7218_ALC_ANTICLIP_STEP_MAX 4
  453. #define DA7218_ALC_ANTICLIP_EN_SHIFT 7
  454. #define DA7218_ALC_ANTICLIP_EN_MASK (0x1 << 7)
  455. /* DA7218_AGS_ENABLE = 0x3C */
  456. #define DA7218_AGS_ENABLE_SHIFT 0
  457. #define DA7218_AGS_ENABLE_MASK (0x3 << 0)
  458. #define DA7218_AGS_ENABLE_CHAN1_SHIFT 0
  459. #define DA7218_AGS_ENABLE_CHAN2_SHIFT 1
  460. /* DA7218_AGS_TRIGGER = 0x3D */
  461. #define DA7218_AGS_TRIGGER_SHIFT 0
  462. #define DA7218_AGS_TRIGGER_MASK (0xF << 0)
  463. #define DA7218_AGS_TRIGGER_MAX 0xF
  464. /* DA7218_AGS_ATT_MAX = 0x3E */
  465. #define DA7218_AGS_ATT_MAX_SHIFT 0
  466. #define DA7218_AGS_ATT_MAX_MASK (0x7 << 0)
  467. #define DA7218_AGS_ATT_MAX_MAX 0x7
  468. /* DA7218_AGS_TIMEOUT = 0x3F */
  469. #define DA7218_AGS_TIMEOUT_EN_SHIFT 0
  470. #define DA7218_AGS_TIMEOUT_EN_MASK (0x1 << 0)
  471. /* DA7218_AGS_ANTICLIP_CTRL = 0x40 */
  472. #define DA7218_AGS_ANTICLIP_EN_SHIFT 7
  473. #define DA7218_AGS_ANTICLIP_EN_MASK (0x1 << 7)
  474. /* DA7218_CALIB_CTRL = 0x44 */
  475. #define DA7218_CALIB_OFFSET_EN_SHIFT 0
  476. #define DA7218_CALIB_OFFSET_EN_MASK (0x1 << 0)
  477. #define DA7218_CALIB_AUTO_EN_SHIFT 2
  478. #define DA7218_CALIB_AUTO_EN_MASK (0x1 << 2)
  479. #define DA7218_CALIB_OVERFLOW_SHIFT 3
  480. #define DA7218_CALIB_OVERFLOW_MASK (0x1 << 3)
  481. /* DA7218_CALIB_OFFSET_AUTO_M_1 = 0x45 */
  482. #define DA7218_CALIB_OFFSET_AUTO_M_1_SHIFT 0
  483. #define DA7218_CALIB_OFFSET_AUTO_M_1_MASK (0xFF << 0)
  484. /* DA7218_CALIB_OFFSET_AUTO_U_1 = 0x46 */
  485. #define DA7218_CALIB_OFFSET_AUTO_U_1_SHIFT 0
  486. #define DA7218_CALIB_OFFSET_AUTO_U_1_MASK (0xF << 0)
  487. /* DA7218_CALIB_OFFSET_AUTO_M_2 = 0x47 */
  488. #define DA7218_CALIB_OFFSET_AUTO_M_2_SHIFT 0
  489. #define DA7218_CALIB_OFFSET_AUTO_M_2_MASK (0xFF << 0)
  490. /* DA7218_CALIB_OFFSET_AUTO_U_2 = 0x48 */
  491. #define DA7218_CALIB_OFFSET_AUTO_U_2_SHIFT 0
  492. #define DA7218_CALIB_OFFSET_AUTO_U_2_MASK (0xF << 0)
  493. /* DA7218_ENV_TRACK_CTRL = 0x4C */
  494. #define DA7218_INTEG_ATTACK_SHIFT 0
  495. #define DA7218_INTEG_ATTACK_MASK (0x3 << 0)
  496. #define DA7218_INTEG_RELEASE_SHIFT 4
  497. #define DA7218_INTEG_RELEASE_MASK (0x3 << 4)
  498. #define DA7218_INTEG_MAX 4
  499. /* DA7218_LVL_DET_CTRL = 0x50 */
  500. #define DA7218_LVL_DET_EN_SHIFT 0
  501. #define DA7218_LVL_DET_EN_MASK (0xF << 0)
  502. #define DA7218_LVL_DET_EN_CHAN1L_SHIFT 0
  503. #define DA7218_LVL_DET_EN_CHAN1R_SHIFT 1
  504. #define DA7218_LVL_DET_EN_CHAN2L_SHIFT 2
  505. #define DA7218_LVL_DET_EN_CHAN2R_SHIFT 3
  506. /* DA7218_LVL_DET_LEVEL = 0x51 */
  507. #define DA7218_LVL_DET_LEVEL_SHIFT 0
  508. #define DA7218_LVL_DET_LEVEL_MASK (0x7F << 0)
  509. #define DA7218_LVL_DET_LEVEL_MAX 0x7F
  510. /* DA7218_DGS_TRIGGER = 0x54 */
  511. #define DA7218_DGS_TRIGGER_LVL_SHIFT 0
  512. #define DA7218_DGS_TRIGGER_LVL_MASK (0x3F << 0)
  513. #define DA7218_DGS_TRIGGER_MAX 0x3F
  514. /* DA7218_DGS_ENABLE = 0x55 */
  515. #define DA7218_DGS_ENABLE_SHIFT 0
  516. #define DA7218_DGS_ENABLE_MASK (0x3 << 0)
  517. #define DA7218_DGS_ENABLE_L_SHIFT 0
  518. #define DA7218_DGS_ENABLE_R_SHIFT 1
  519. /* DA7218_DGS_RISE_FALL = 0x56 */
  520. #define DA7218_DGS_RISE_COEFF_SHIFT 0
  521. #define DA7218_DGS_RISE_COEFF_MASK (0x7 << 0)
  522. #define DA7218_DGS_RISE_COEFF_MAX 7
  523. #define DA7218_DGS_FALL_COEFF_SHIFT 4
  524. #define DA7218_DGS_FALL_COEFF_MASK (0x7 << 4)
  525. #define DA7218_DGS_FALL_COEFF_MAX 8
  526. /* DA7218_DGS_SYNC_DELAY = 0x57 */
  527. #define DA7218_DGS_SYNC_DELAY_SHIFT 0
  528. #define DA7218_DGS_SYNC_DELAY_MASK (0xFF << 0)
  529. #define DA7218_DGS_SYNC_DELAY_MAX 0xFF
  530. /* DA7218_DGS_SYNC_DELAY2 = 0x58 */
  531. #define DA7218_DGS_SYNC_DELAY2_SHIFT 0
  532. #define DA7218_DGS_SYNC_DELAY2_MASK (0xFF << 0)
  533. /* DA7218_DGS_SYNC_DELAY3 = 0x59 */
  534. #define DA7218_DGS_SYNC_DELAY3_SHIFT 0
  535. #define DA7218_DGS_SYNC_DELAY3_MASK (0x7F << 0)
  536. #define DA7218_DGS_SYNC_DELAY3_MAX 0x7F
  537. /* DA7218_DGS_LEVELS = 0x5A */
  538. #define DA7218_DGS_ANTICLIP_LVL_SHIFT 0
  539. #define DA7218_DGS_ANTICLIP_LVL_MASK (0x7 << 0)
  540. #define DA7218_DGS_ANTICLIP_LVL_MAX 0x7
  541. #define DA7218_DGS_SIGNAL_LVL_SHIFT 4
  542. #define DA7218_DGS_SIGNAL_LVL_MASK (0xF << 4)
  543. #define DA7218_DGS_SIGNAL_LVL_MAX 0xF
  544. /* DA7218_DGS_GAIN_CTRL = 0x5B */
  545. #define DA7218_DGS_STEPS_SHIFT 0
  546. #define DA7218_DGS_STEPS_MASK (0x1F << 0)
  547. #define DA7218_DGS_STEPS_MAX 0x1F
  548. #define DA7218_DGS_RAMP_EN_SHIFT 5
  549. #define DA7218_DGS_RAMP_EN_MASK (0x1 << 5)
  550. #define DA7218_DGS_SUBR_EN_SHIFT 6
  551. #define DA7218_DGS_SUBR_EN_MASK (0x1 << 6)
  552. /* DA7218_DROUTING_OUTDAI_1L = 0x5C */
  553. #define DA7218_OUTDAI_1L_SRC_SHIFT 0
  554. #define DA7218_OUTDAI_1L_SRC_MASK (0x7F << 0)
  555. #define DA7218_DMIX_SRC_INFILT1L 0
  556. #define DA7218_DMIX_SRC_INFILT1R 1
  557. #define DA7218_DMIX_SRC_INFILT2L 2
  558. #define DA7218_DMIX_SRC_INFILT2R 3
  559. #define DA7218_DMIX_SRC_TONEGEN 4
  560. #define DA7218_DMIX_SRC_DAIL 5
  561. #define DA7218_DMIX_SRC_DAIR 6
  562. /* DA7218_DMIX_OUTDAI_1L_INFILT_1L_GAIN = 0x5D */
  563. #define DA7218_OUTDAI_1L_INFILT_1L_GAIN_SHIFT 0
  564. #define DA7218_OUTDAI_1L_INFILT_1L_GAIN_MASK (0x1F << 0)
  565. #define DA7218_DMIX_GAIN_MAX 0x1F
  566. /* DA7218_DMIX_OUTDAI_1L_INFILT_1R_GAIN = 0x5E */
  567. #define DA7218_OUTDAI_1L_INFILT_1R_GAIN_SHIFT 0
  568. #define DA7218_OUTDAI_1L_INFILT_1R_GAIN_MASK (0x1F << 0)
  569. /* DA7218_DMIX_OUTDAI_1L_INFILT_2L_GAIN = 0x5F */
  570. #define DA7218_OUTDAI_1L_INFILT_2L_GAIN_SHIFT 0
  571. #define DA7218_OUTDAI_1L_INFILT_2L_GAIN_MASK (0x1F << 0)
  572. /* DA7218_DMIX_OUTDAI_1L_INFILT_2R_GAIN = 0x60 */
  573. #define DA7218_OUTDAI_1L_INFILT_2R_GAIN_SHIFT 0
  574. #define DA7218_OUTDAI_1L_INFILT_2R_GAIN_MASK (0x1F << 0)
  575. /* DA7218_DMIX_OUTDAI_1L_TONEGEN_GAIN = 0x61 */
  576. #define DA7218_OUTDAI_1L_TONEGEN_GAIN_SHIFT 0
  577. #define DA7218_OUTDAI_1L_TONEGEN_GAIN_MASK (0x1F << 0)
  578. /* DA7218_DMIX_OUTDAI_1L_INDAI_1L_GAIN = 0x62 */
  579. #define DA7218_OUTDAI_1L_INDAI_1L_GAIN_SHIFT 0
  580. #define DA7218_OUTDAI_1L_INDAI_1L_GAIN_MASK (0x1F << 0)
  581. /* DA7218_DMIX_OUTDAI_1L_INDAI_1R_GAIN = 0x63 */
  582. #define DA7218_OUTDAI_1L_INDAI_1R_GAIN_SHIFT 0
  583. #define DA7218_OUTDAI_1L_INDAI_1R_GAIN_MASK (0x1F << 0)
  584. /* DA7218_DROUTING_OUTDAI_1R = 0x64 */
  585. #define DA7218_OUTDAI_1R_SRC_SHIFT 0
  586. #define DA7218_OUTDAI_1R_SRC_MASK (0x7F << 0)
  587. /* DA7218_DMIX_OUTDAI_1R_INFILT_1L_GAIN = 0x65 */
  588. #define DA7218_OUTDAI_1R_INFILT_1L_GAIN_SHIFT 0
  589. #define DA7218_OUTDAI_1R_INFILT_1L_GAIN_MASK (0x1F << 0)
  590. /* DA7218_DMIX_OUTDAI_1R_INFILT_1R_GAIN = 0x66 */
  591. #define DA7218_OUTDAI_1R_INFILT_1R_GAIN_SHIFT 0
  592. #define DA7218_OUTDAI_1R_INFILT_1R_GAIN_MASK (0x1F << 0)
  593. /* DA7218_DMIX_OUTDAI_1R_INFILT_2L_GAIN = 0x67 */
  594. #define DA7218_OUTDAI_1R_INFILT_2L_GAIN_SHIFT 0
  595. #define DA7218_OUTDAI_1R_INFILT_2L_GAIN_MASK (0x1F << 0)
  596. /* DA7218_DMIX_OUTDAI_1R_INFILT_2R_GAIN = 0x68 */
  597. #define DA7218_OUTDAI_1R_INFILT_2R_GAIN_SHIFT 0
  598. #define DA7218_OUTDAI_1R_INFILT_2R_GAIN_MASK (0x1F << 0)
  599. /* DA7218_DMIX_OUTDAI_1R_TONEGEN_GAIN = 0x69 */
  600. #define DA7218_OUTDAI_1R_TONEGEN_GAIN_SHIFT 0
  601. #define DA7218_OUTDAI_1R_TONEGEN_GAIN_MASK (0x1F << 0)
  602. /* DA7218_DMIX_OUTDAI_1R_INDAI_1L_GAIN = 0x6A */
  603. #define DA7218_OUTDAI_1R_INDAI_1L_GAIN_SHIFT 0
  604. #define DA7218_OUTDAI_1R_INDAI_1L_GAIN_MASK (0x1F << 0)
  605. /* DA7218_DMIX_OUTDAI_1R_INDAI_1R_GAIN = 0x6B */
  606. #define DA7218_OUTDAI_1R_INDAI_1R_GAIN_SHIFT 0
  607. #define DA7218_OUTDAI_1R_INDAI_1R_GAIN_MASK (0x1F << 0)
  608. /* DA7218_DROUTING_OUTFILT_1L = 0x6C */
  609. #define DA7218_OUTFILT_1L_SRC_SHIFT 0
  610. #define DA7218_OUTFILT_1L_SRC_MASK (0x7F << 0)
  611. /* DA7218_DMIX_OUTFILT_1L_INFILT_1L_GAIN = 0x6D */
  612. #define DA7218_OUTFILT_1L_INFILT_1L_GAIN_SHIFT 0
  613. #define DA7218_OUTFILT_1L_INFILT_1L_GAIN_MASK (0x1F << 0)
  614. /* DA7218_DMIX_OUTFILT_1L_INFILT_1R_GAIN = 0x6E */
  615. #define DA7218_OUTFILT_1L_INFILT_1R_GAIN_SHIFT 0
  616. #define DA7218_OUTFILT_1L_INFILT_1R_GAIN_MASK (0x1F << 0)
  617. /* DA7218_DMIX_OUTFILT_1L_INFILT_2L_GAIN = 0x6F */
  618. #define DA7218_OUTFILT_1L_INFILT_2L_GAIN_SHIFT 0
  619. #define DA7218_OUTFILT_1L_INFILT_2L_GAIN_MASK (0x1F << 0)
  620. /* DA7218_DMIX_OUTFILT_1L_INFILT_2R_GAIN = 0x70 */
  621. #define DA7218_OUTFILT_1L_INFILT_2R_GAIN_SHIFT 0
  622. #define DA7218_OUTFILT_1L_INFILT_2R_GAIN_MASK (0x1F << 0)
  623. /* DA7218_DMIX_OUTFILT_1L_TONEGEN_GAIN = 0x71 */
  624. #define DA7218_OUTFILT_1L_TONEGEN_GAIN_SHIFT 0
  625. #define DA7218_OUTFILT_1L_TONEGEN_GAIN_MASK (0x1F << 0)
  626. /* DA7218_DMIX_OUTFILT_1L_INDAI_1L_GAIN = 0x72 */
  627. #define DA7218_OUTFILT_1L_INDAI_1L_GAIN_SHIFT 0
  628. #define DA7218_OUTFILT_1L_INDAI_1L_GAIN_MASK (0x1F << 0)
  629. /* DA7218_DMIX_OUTFILT_1L_INDAI_1R_GAIN = 0x73 */
  630. #define DA7218_OUTFILT_1L_INDAI_1R_GAIN_SHIFT 0
  631. #define DA7218_OUTFILT_1L_INDAI_1R_GAIN_MASK (0x1F << 0)
  632. /* DA7218_DROUTING_OUTFILT_1R = 0x74 */
  633. #define DA7218_OUTFILT_1R_SRC_SHIFT 0
  634. #define DA7218_OUTFILT_1R_SRC_MASK (0x7F << 0)
  635. /* DA7218_DMIX_OUTFILT_1R_INFILT_1L_GAIN = 0x75 */
  636. #define DA7218_OUTFILT_1R_INFILT_1L_GAIN_SHIFT 0
  637. #define DA7218_OUTFILT_1R_INFILT_1L_GAIN_MASK (0x1F << 0)
  638. /* DA7218_DMIX_OUTFILT_1R_INFILT_1R_GAIN = 0x76 */
  639. #define DA7218_OUTFILT_1R_INFILT_1R_GAIN_SHIFT 0
  640. #define DA7218_OUTFILT_1R_INFILT_1R_GAIN_MASK (0x1F << 0)
  641. /* DA7218_DMIX_OUTFILT_1R_INFILT_2L_GAIN = 0x77 */
  642. #define DA7218_OUTFILT_1R_INFILT_2L_GAIN_SHIFT 0
  643. #define DA7218_OUTFILT_1R_INFILT_2L_GAIN_MASK (0x1F << 0)
  644. /* DA7218_DMIX_OUTFILT_1R_INFILT_2R_GAIN = 0x78 */
  645. #define DA7218_OUTFILT_1R_INFILT_2R_GAIN_SHIFT 0
  646. #define DA7218_OUTFILT_1R_INFILT_2R_GAIN_MASK (0x1F << 0)
  647. /* DA7218_DMIX_OUTFILT_1R_TONEGEN_GAIN = 0x79 */
  648. #define DA7218_OUTFILT_1R_TONEGEN_GAIN_SHIFT 0
  649. #define DA7218_OUTFILT_1R_TONEGEN_GAIN_MASK (0x1F << 0)
  650. /* DA7218_DMIX_OUTFILT_1R_INDAI_1L_GAIN = 0x7A */
  651. #define DA7218_OUTFILT_1R_INDAI_1L_GAIN_SHIFT 0
  652. #define DA7218_OUTFILT_1R_INDAI_1L_GAIN_MASK (0x1F << 0)
  653. /* DA7218_DMIX_OUTFILT_1R_INDAI_1R_GAIN = 0x7B */
  654. #define DA7218_OUTFILT_1R_INDAI_1R_GAIN_SHIFT 0
  655. #define DA7218_OUTFILT_1R_INDAI_1R_GAIN_MASK (0x1F << 0)
  656. /* DA7218_DROUTING_OUTDAI_2L = 0x7C */
  657. #define DA7218_OUTDAI_2L_SRC_SHIFT 0
  658. #define DA7218_OUTDAI_2L_SRC_MASK (0x7F << 0)
  659. /* DA7218_DMIX_OUTDAI_2L_INFILT_1L_GAIN = 0x7D */
  660. #define DA7218_OUTDAI_2L_INFILT_1L_GAIN_SHIFT 0
  661. #define DA7218_OUTDAI_2L_INFILT_1L_GAIN_MASK (0x1F << 0)
  662. /* DA7218_DMIX_OUTDAI_2L_INFILT_1R_GAIN = 0x7E */
  663. #define DA7218_OUTDAI_2L_INFILT_1R_GAIN_SHIFT 0
  664. #define DA7218_OUTDAI_2L_INFILT_1R_GAIN_MASK (0x1F << 0)
  665. /* DA7218_DMIX_OUTDAI_2L_INFILT_2L_GAIN = 0x7F */
  666. #define DA7218_OUTDAI_2L_INFILT_2L_GAIN_SHIFT 0
  667. #define DA7218_OUTDAI_2L_INFILT_2L_GAIN_MASK (0x1F << 0)
  668. /* DA7218_DMIX_OUTDAI_2L_INFILT_2R_GAIN = 0x80 */
  669. #define DA7218_OUTDAI_2L_INFILT_2R_GAIN_SHIFT 0
  670. #define DA7218_OUTDAI_2L_INFILT_2R_GAIN_MASK (0x1F << 0)
  671. /* DA7218_DMIX_OUTDAI_2L_TONEGEN_GAIN = 0x81 */
  672. #define DA7218_OUTDAI_2L_TONEGEN_GAIN_SHIFT 0
  673. #define DA7218_OUTDAI_2L_TONEGEN_GAIN_MASK (0x1F << 0)
  674. /* DA7218_DMIX_OUTDAI_2L_INDAI_1L_GAIN = 0x82 */
  675. #define DA7218_OUTDAI_2L_INDAI_1L_GAIN_SHIFT 0
  676. #define DA7218_OUTDAI_2L_INDAI_1L_GAIN_MASK (0x1F << 0)
  677. /* DA7218_DMIX_OUTDAI_2L_INDAI_1R_GAIN = 0x83 */
  678. #define DA7218_OUTDAI_2L_INDAI_1R_GAIN_SHIFT 0
  679. #define DA7218_OUTDAI_2L_INDAI_1R_GAIN_MASK (0x1F << 0)
  680. /* DA7218_DROUTING_OUTDAI_2R = 0x84 */
  681. #define DA7218_OUTDAI_2R_SRC_SHIFT 0
  682. #define DA7218_OUTDAI_2R_SRC_MASK (0x7F << 0)
  683. /* DA7218_DMIX_OUTDAI_2R_INFILT_1L_GAIN = 0x85 */
  684. #define DA7218_OUTDAI_2R_INFILT_1L_GAIN_SHIFT 0
  685. #define DA7218_OUTDAI_2R_INFILT_1L_GAIN_MASK (0x1F << 0)
  686. /* DA7218_DMIX_OUTDAI_2R_INFILT_1R_GAIN = 0x86 */
  687. #define DA7218_OUTDAI_2R_INFILT_1R_GAIN_SHIFT 0
  688. #define DA7218_OUTDAI_2R_INFILT_1R_GAIN_MASK (0x1F << 0)
  689. /* DA7218_DMIX_OUTDAI_2R_INFILT_2L_GAIN = 0x87 */
  690. #define DA7218_OUTDAI_2R_INFILT_2L_GAIN_SHIFT 0
  691. #define DA7218_OUTDAI_2R_INFILT_2L_GAIN_MASK (0x1F << 0)
  692. /* DA7218_DMIX_OUTDAI_2R_INFILT_2R_GAIN = 0x88 */
  693. #define DA7218_OUTDAI_2R_INFILT_2R_GAIN_SHIFT 0
  694. #define DA7218_OUTDAI_2R_INFILT_2R_GAIN_MASK (0x1F << 0)
  695. /* DA7218_DMIX_OUTDAI_2R_TONEGEN_GAIN = 0x89 */
  696. #define DA7218_OUTDAI_2R_TONEGEN_GAIN_SHIFT 0
  697. #define DA7218_OUTDAI_2R_TONEGEN_GAIN_MASK (0x1F << 0)
  698. /* DA7218_DMIX_OUTDAI_2R_INDAI_1L_GAIN = 0x8A */
  699. #define DA7218_OUTDAI_2R_INDAI_1L_GAIN_SHIFT 0
  700. #define DA7218_OUTDAI_2R_INDAI_1L_GAIN_MASK (0x1F << 0)
  701. /* DA7218_DMIX_OUTDAI_2R_INDAI_1R_GAIN = 0x8B */
  702. #define DA7218_OUTDAI_2R_INDAI_1R_GAIN_SHIFT 0
  703. #define DA7218_OUTDAI_2R_INDAI_1R_GAIN_MASK (0x1F << 0)
  704. /* DA7218_DAI_CTRL = 0x8C */
  705. #define DA7218_DAI_FORMAT_SHIFT 0
  706. #define DA7218_DAI_FORMAT_MASK (0x3 << 0)
  707. #define DA7218_DAI_FORMAT_I2S (0x0 << 0)
  708. #define DA7218_DAI_FORMAT_LEFT_J (0x1 << 0)
  709. #define DA7218_DAI_FORMAT_RIGHT_J (0x2 << 0)
  710. #define DA7218_DAI_FORMAT_DSP (0x3 << 0)
  711. #define DA7218_DAI_WORD_LENGTH_SHIFT 2
  712. #define DA7218_DAI_WORD_LENGTH_MASK (0x3 << 2)
  713. #define DA7218_DAI_WORD_LENGTH_S16_LE (0x0 << 2)
  714. #define DA7218_DAI_WORD_LENGTH_S20_LE (0x1 << 2)
  715. #define DA7218_DAI_WORD_LENGTH_S24_LE (0x2 << 2)
  716. #define DA7218_DAI_WORD_LENGTH_S32_LE (0x3 << 2)
  717. #define DA7218_DAI_CH_NUM_SHIFT 4
  718. #define DA7218_DAI_CH_NUM_MASK (0x7 << 4)
  719. #define DA7218_DAI_CH_NUM_MAX 4
  720. #define DA7218_DAI_EN_SHIFT 7
  721. #define DA7218_DAI_EN_MASK (0x1 << 7)
  722. /* DA7218_DAI_TDM_CTRL = 0x8D */
  723. #define DA7218_DAI_TDM_CH_EN_SHIFT 0
  724. #define DA7218_DAI_TDM_CH_EN_MASK (0xF << 0)
  725. #define DA7218_DAI_TDM_MAX_SLOTS 4
  726. #define DA7218_DAI_OE_SHIFT 6
  727. #define DA7218_DAI_OE_MASK (0x1 << 6)
  728. #define DA7218_DAI_TDM_MODE_EN_SHIFT 7
  729. #define DA7218_DAI_TDM_MODE_EN_MASK (0x1 << 7)
  730. /* DA7218_DAI_OFFSET_LOWER = 0x8E */
  731. #define DA7218_DAI_OFFSET_LOWER_SHIFT 0
  732. #define DA7218_DAI_OFFSET_LOWER_MASK (0xFF << 0)
  733. /* DA7218_DAI_OFFSET_UPPER = 0x8F */
  734. #define DA7218_DAI_OFFSET_UPPER_SHIFT 0
  735. #define DA7218_DAI_OFFSET_UPPER_MASK (0x7 << 0)
  736. /* DA7218_DAI_CLK_MODE = 0x90 */
  737. #define DA7218_DAI_BCLKS_PER_WCLK_SHIFT 0
  738. #define DA7218_DAI_BCLKS_PER_WCLK_MASK (0x3 << 0)
  739. #define DA7218_DAI_BCLKS_PER_WCLK_32 (0x0 << 0)
  740. #define DA7218_DAI_BCLKS_PER_WCLK_64 (0x1 << 0)
  741. #define DA7218_DAI_BCLKS_PER_WCLK_128 (0x2 << 0)
  742. #define DA7218_DAI_BCLKS_PER_WCLK_256 (0x3 << 0)
  743. #define DA7218_DAI_CLK_POL_SHIFT 2
  744. #define DA7218_DAI_CLK_POL_MASK (0x1 << 2)
  745. #define DA7218_DAI_CLK_POL_INV (0x1 << 2)
  746. #define DA7218_DAI_WCLK_POL_SHIFT 3
  747. #define DA7218_DAI_WCLK_POL_MASK (0x1 << 3)
  748. #define DA7218_DAI_WCLK_POL_INV (0x1 << 3)
  749. #define DA7218_DAI_WCLK_TRI_STATE_SHIFT 4
  750. #define DA7218_DAI_WCLK_TRI_STATE_MASK (0x1 << 4)
  751. #define DA7218_DAI_CLK_EN_SHIFT 7
  752. #define DA7218_DAI_CLK_EN_MASK (0x1 << 7)
  753. /* DA7218_PLL_CTRL = 0x91 */
  754. #define DA7218_PLL_INDIV_SHIFT 0
  755. #define DA7218_PLL_INDIV_MASK (0x7 << 0)
  756. #define DA7218_PLL_INDIV_2_TO_4_5_MHZ (0x0 << 0)
  757. #define DA7218_PLL_INDIV_4_5_TO_9_MHZ (0x1 << 0)
  758. #define DA7218_PLL_INDIV_9_TO_18_MHZ (0x2 << 0)
  759. #define DA7218_PLL_INDIV_18_TO_36_MHZ (0x3 << 0)
  760. #define DA7218_PLL_INDIV_36_TO_54_MHZ (0x4 << 0)
  761. #define DA7218_PLL_MCLK_SQR_EN_SHIFT 4
  762. #define DA7218_PLL_MCLK_SQR_EN_MASK (0x1 << 4)
  763. #define DA7218_PLL_MODE_SHIFT 6
  764. #define DA7218_PLL_MODE_MASK (0x3 << 6)
  765. #define DA7218_PLL_MODE_BYPASS (0x0 << 6)
  766. #define DA7218_PLL_MODE_NORMAL (0x1 << 6)
  767. #define DA7218_PLL_MODE_SRM (0x2 << 6)
  768. /* DA7218_PLL_FRAC_TOP = 0x92 */
  769. #define DA7218_PLL_FBDIV_FRAC_TOP_SHIFT 0
  770. #define DA7218_PLL_FBDIV_FRAC_TOP_MASK (0x1F << 0)
  771. /* DA7218_PLL_FRAC_BOT = 0x93 */
  772. #define DA7218_PLL_FBDIV_FRAC_BOT_SHIFT 0
  773. #define DA7218_PLL_FBDIV_FRAC_BOT_MASK (0xFF << 0)
  774. /* DA7218_PLL_INTEGER = 0x94 */
  775. #define DA7218_PLL_FBDIV_INTEGER_SHIFT 0
  776. #define DA7218_PLL_FBDIV_INTEGER_MASK (0x7F << 0)
  777. /* DA7218_PLL_STATUS = 0x95 */
  778. #define DA7218_PLL_SRM_STATUS_SHIFT 0
  779. #define DA7218_PLL_SRM_STATUS_MASK (0xFF << 0)
  780. #define DA7218_PLL_SRM_STATUS_SRM_LOCK (0x1 << 7)
  781. /* DA7218_PLL_REFOSC_CAL = 0x98 */
  782. #define DA7218_PLL_REFOSC_CAL_CTRL_SHIFT 0
  783. #define DA7218_PLL_REFOSC_CAL_CTRL_MASK (0x1F << 0)
  784. #define DA7218_PLL_REFOSC_CAL_START_SHIFT 6
  785. #define DA7218_PLL_REFOSC_CAL_START_MASK (0x1 << 6)
  786. #define DA7218_PLL_REFOSC_CAL_EN_SHIFT 7
  787. #define DA7218_PLL_REFOSC_CAL_EN_MASK (0x1 << 7)
  788. /* DA7218_DAC_NG_CTRL = 0x9C */
  789. #define DA7218_DAC_NG_EN_SHIFT 7
  790. #define DA7218_DAC_NG_EN_MASK (0x1 << 7)
  791. /* DA7218_DAC_NG_SETUP_TIME = 0x9D */
  792. #define DA7218_DAC_NG_SETUP_TIME_SHIFT 0
  793. #define DA7218_DAC_NG_SETUP_TIME_MASK (0x3 << 0)
  794. #define DA7218_DAC_NG_SETUP_TIME_MAX 4
  795. #define DA7218_DAC_NG_RAMPUP_RATE_SHIFT 2
  796. #define DA7218_DAC_NG_RAMPUP_RATE_MASK (0x1 << 2)
  797. #define DA7218_DAC_NG_RAMPUP_RATE_MAX 2
  798. #define DA7218_DAC_NG_RAMPDN_RATE_SHIFT 3
  799. #define DA7218_DAC_NG_RAMPDN_RATE_MASK (0x1 << 3)
  800. #define DA7218_DAC_NG_RAMPDN_RATE_MAX 2
  801. /* DA7218_DAC_NG_OFF_THRESH = 0x9E */
  802. #define DA7218_DAC_NG_OFF_THRESHOLD_SHIFT 0
  803. #define DA7218_DAC_NG_OFF_THRESHOLD_MASK (0x7 << 0)
  804. #define DA7218_DAC_NG_THRESHOLD_MAX 0x7
  805. /* DA7218_DAC_NG_ON_THRESH = 0x9F */
  806. #define DA7218_DAC_NG_ON_THRESHOLD_SHIFT 0
  807. #define DA7218_DAC_NG_ON_THRESHOLD_MASK (0x7 << 0)
  808. /* DA7218_TONE_GEN_CFG1 = 0xA0 */
  809. #define DA7218_DTMF_REG_SHIFT 0
  810. #define DA7218_DTMF_REG_MASK (0xF << 0)
  811. #define DA7218_DTMF_REG_MAX 16
  812. #define DA7218_DTMF_EN_SHIFT 4
  813. #define DA7218_DTMF_EN_MASK (0x1 << 4)
  814. #define DA7218_START_STOPN_SHIFT 7
  815. #define DA7218_START_STOPN_MASK (0x1 << 7)
  816. /* DA7218_TONE_GEN_CFG2 = 0xA1 */
  817. #define DA7218_SWG_SEL_SHIFT 0
  818. #define DA7218_SWG_SEL_MASK (0x3 << 0)
  819. #define DA7218_SWG_SEL_MAX 4
  820. /* DA7218_TONE_GEN_FREQ1_L = 0xA2 */
  821. #define DA7218_FREQ1_L_SHIFT 0
  822. #define DA7218_FREQ1_L_MASK (0xFF << 0)
  823. #define DA7218_FREQ_MAX 0xFFFF
  824. /* DA7218_TONE_GEN_FREQ1_U = 0xA3 */
  825. #define DA7218_FREQ1_U_SHIFT 0
  826. #define DA7218_FREQ1_U_MASK (0xFF << 0)
  827. /* DA7218_TONE_GEN_FREQ2_L = 0xA4 */
  828. #define DA7218_FREQ2_L_SHIFT 0
  829. #define DA7218_FREQ2_L_MASK (0xFF << 0)
  830. /* DA7218_TONE_GEN_FREQ2_U = 0xA5 */
  831. #define DA7218_FREQ2_U_SHIFT 0
  832. #define DA7218_FREQ2_U_MASK (0xFF << 0)
  833. /* DA7218_TONE_GEN_CYCLES = 0xA6 */
  834. #define DA7218_BEEP_CYCLES_SHIFT 0
  835. #define DA7218_BEEP_CYCLES_MASK (0x7 << 0)
  836. /* DA7218_TONE_GEN_ON_PER = 0xA7 */
  837. #define DA7218_BEEP_ON_PER_SHIFT 0
  838. #define DA7218_BEEP_ON_PER_MASK (0x3F << 0)
  839. /* DA7218_TONE_GEN_OFF_PER = 0xA8 */
  840. #define DA7218_BEEP_OFF_PER_SHIFT 0
  841. #define DA7218_BEEP_OFF_PER_MASK (0x3F << 0)
  842. #define DA7218_BEEP_ON_OFF_MAX 0x3F
  843. /* DA7218_CP_CTRL = 0xAC */
  844. #define DA7218_CP_MOD_SHIFT 2
  845. #define DA7218_CP_MOD_MASK (0x3 << 2)
  846. #define DA7218_CP_MCHANGE_SHIFT 4
  847. #define DA7218_CP_MCHANGE_MASK (0x3 << 4)
  848. #define DA7218_CP_MCHANGE_REL_MASK 0x3
  849. #define DA7218_CP_MCHANGE_MAX 3
  850. #define DA7218_CP_MCHANGE_LARGEST_VOL 0x1
  851. #define DA7218_CP_MCHANGE_DAC_VOL 0x2
  852. #define DA7218_CP_MCHANGE_SIG_MAG 0x3
  853. #define DA7218_CP_SMALL_SWITCH_FREQ_EN_SHIFT 6
  854. #define DA7218_CP_SMALL_SWITCH_FREQ_EN_MASK (0x1 << 6)
  855. #define DA7218_CP_EN_SHIFT 7
  856. #define DA7218_CP_EN_MASK (0x1 << 7)
  857. /* DA7218_CP_DELAY = 0xAD */
  858. #define DA7218_CP_FCONTROL_SHIFT 0
  859. #define DA7218_CP_FCONTROL_MASK (0x7 << 0)
  860. #define DA7218_CP_FCONTROL_MAX 6
  861. #define DA7218_CP_TAU_DELAY_SHIFT 3
  862. #define DA7218_CP_TAU_DELAY_MASK (0x7 << 3)
  863. #define DA7218_CP_TAU_DELAY_MAX 8
  864. /* DA7218_CP_VOL_THRESHOLD1 = 0xAE */
  865. #define DA7218_CP_THRESH_VDD2_SHIFT 0
  866. #define DA7218_CP_THRESH_VDD2_MASK (0x3F << 0)
  867. #define DA7218_CP_THRESH_VDD2_MAX 0x3F
  868. /* DA7218_MIC_1_CTRL = 0xB4 */
  869. #define DA7218_MIC_1_AMP_MUTE_EN_SHIFT 6
  870. #define DA7218_MIC_1_AMP_MUTE_EN_MASK (0x1 << 6)
  871. #define DA7218_MIC_1_AMP_EN_SHIFT 7
  872. #define DA7218_MIC_1_AMP_EN_MASK (0x1 << 7)
  873. /* DA7218_MIC_1_GAIN = 0xB5 */
  874. #define DA7218_MIC_1_AMP_GAIN_SHIFT 0
  875. #define DA7218_MIC_1_AMP_GAIN_MASK (0x7 << 0)
  876. #define DA7218_MIC_AMP_GAIN_MAX 0x7
  877. /* DA7218_MIC_1_SELECT = 0xB7 */
  878. #define DA7218_MIC_1_AMP_IN_SEL_SHIFT 0
  879. #define DA7218_MIC_1_AMP_IN_SEL_MASK (0x3 << 0)
  880. /* DA7218_MIC_2_CTRL = 0xB8 */
  881. #define DA7218_MIC_2_AMP_MUTE_EN_SHIFT 6
  882. #define DA7218_MIC_2_AMP_MUTE_EN_MASK (0x1 << 6)
  883. #define DA7218_MIC_2_AMP_EN_SHIFT 7
  884. #define DA7218_MIC_2_AMP_EN_MASK (0x1 << 7)
  885. /* DA7218_MIC_2_GAIN = 0xB9 */
  886. #define DA7218_MIC_2_AMP_GAIN_SHIFT 0
  887. #define DA7218_MIC_2_AMP_GAIN_MASK (0x7 << 0)
  888. /* DA7218_MIC_2_SELECT = 0xBB */
  889. #define DA7218_MIC_2_AMP_IN_SEL_SHIFT 0
  890. #define DA7218_MIC_2_AMP_IN_SEL_MASK (0x3 << 0)
  891. /* DA7218_IN_1_HPF_FILTER_CTRL = 0xBC */
  892. #define DA7218_IN_1_VOICE_HPF_CORNER_SHIFT 0
  893. #define DA7218_IN_1_VOICE_HPF_CORNER_MASK (0x7 << 0)
  894. #define DA7218_IN_VOICE_HPF_CORNER_MAX 8
  895. #define DA7218_IN_1_VOICE_EN_SHIFT 3
  896. #define DA7218_IN_1_VOICE_EN_MASK (0x1 << 3)
  897. #define DA7218_IN_1_AUDIO_HPF_CORNER_SHIFT 4
  898. #define DA7218_IN_1_AUDIO_HPF_CORNER_MASK (0x3 << 4)
  899. #define DA7218_IN_1_HPF_EN_SHIFT 7
  900. #define DA7218_IN_1_HPF_EN_MASK (0x1 << 7)
  901. /* DA7218_IN_2_HPF_FILTER_CTRL = 0xBD */
  902. #define DA7218_IN_2_VOICE_HPF_CORNER_SHIFT 0
  903. #define DA7218_IN_2_VOICE_HPF_CORNER_MASK (0x7 << 0)
  904. #define DA7218_IN_2_VOICE_EN_SHIFT 3
  905. #define DA7218_IN_2_VOICE_EN_MASK (0x1 << 3)
  906. #define DA7218_IN_2_AUDIO_HPF_CORNER_SHIFT 4
  907. #define DA7218_IN_2_AUDIO_HPF_CORNER_MASK (0x3 << 4)
  908. #define DA7218_IN_2_HPF_EN_SHIFT 7
  909. #define DA7218_IN_2_HPF_EN_MASK (0x1 << 7)
  910. /* DA7218_ADC_1_CTRL = 0xC0 */
  911. #define DA7218_ADC_1_AAF_EN_SHIFT 2
  912. #define DA7218_ADC_1_AAF_EN_MASK (0x1 << 2)
  913. /* DA7218_ADC_2_CTRL = 0xC1 */
  914. #define DA7218_ADC_2_AAF_EN_SHIFT 2
  915. #define DA7218_ADC_2_AAF_EN_MASK (0x1 << 2)
  916. /* DA7218_ADC_MODE = 0xC2 */
  917. #define DA7218_ADC_LP_MODE_SHIFT 0
  918. #define DA7218_ADC_LP_MODE_MASK (0x1 << 0)
  919. #define DA7218_ADC_LVLDET_MODE_SHIFT 1
  920. #define DA7218_ADC_LVLDET_MODE_MASK (0x1 << 1)
  921. #define DA7218_ADC_LVLDET_AUTO_EXIT_SHIFT 2
  922. #define DA7218_ADC_LVLDET_AUTO_EXIT_MASK (0x1 << 2)
  923. /* DA7218_MIXOUT_L_CTRL = 0xCC */
  924. #define DA7218_MIXOUT_L_AMP_EN_SHIFT 7
  925. #define DA7218_MIXOUT_L_AMP_EN_MASK (0x1 << 7)
  926. /* DA7218_MIXOUT_L_GAIN = 0xCD */
  927. #define DA7218_MIXOUT_L_AMP_GAIN_SHIFT 0
  928. #define DA7218_MIXOUT_L_AMP_GAIN_MASK (0x3 << 0)
  929. #define DA7218_MIXOUT_AMP_GAIN_MIN 0x1
  930. #define DA7218_MIXOUT_AMP_GAIN_MAX 0x3
  931. /* DA7218_MIXOUT_R_CTRL = 0xCE */
  932. #define DA7218_MIXOUT_R_AMP_EN_SHIFT 7
  933. #define DA7218_MIXOUT_R_AMP_EN_MASK (0x1 << 7)
  934. /* DA7218_MIXOUT_R_GAIN = 0xCF */
  935. #define DA7218_MIXOUT_R_AMP_GAIN_SHIFT 0
  936. #define DA7218_MIXOUT_R_AMP_GAIN_MASK (0x3 << 0)
  937. /* DA7218_HP_L_CTRL = 0xD0 */
  938. #define DA7218_HP_L_AMP_MIN_GAIN_EN_SHIFT 2
  939. #define DA7218_HP_L_AMP_MIN_GAIN_EN_MASK (0x1 << 2)
  940. #define DA7218_HP_L_AMP_OE_SHIFT 3
  941. #define DA7218_HP_L_AMP_OE_MASK (0x1 << 3)
  942. #define DA7218_HP_L_AMP_ZC_EN_SHIFT 4
  943. #define DA7218_HP_L_AMP_ZC_EN_MASK (0x1 << 4)
  944. #define DA7218_HP_L_AMP_RAMP_EN_SHIFT 5
  945. #define DA7218_HP_L_AMP_RAMP_EN_MASK (0x1 << 5)
  946. #define DA7218_HP_L_AMP_MUTE_EN_SHIFT 6
  947. #define DA7218_HP_L_AMP_MUTE_EN_MASK (0x1 << 6)
  948. #define DA7218_HP_L_AMP_EN_SHIFT 7
  949. #define DA7218_HP_L_AMP_EN_MASK (0x1 << 7)
  950. #define DA7218_HP_AMP_OE_MASK (0x1 << 3)
  951. /* DA7218_HP_L_GAIN = 0xD1 */
  952. #define DA7218_HP_L_AMP_GAIN_SHIFT 0
  953. #define DA7218_HP_L_AMP_GAIN_MASK (0x3F << 0)
  954. #define DA7218_HP_AMP_GAIN_MIN 0x15
  955. #define DA7218_HP_AMP_GAIN_MAX 0x3F
  956. /* DA7218_HP_R_CTRL = 0xD2 */
  957. #define DA7218_HP_R_AMP_MIN_GAIN_EN_SHIFT 2
  958. #define DA7218_HP_R_AMP_MIN_GAIN_EN_MASK (0x1 << 2)
  959. #define DA7218_HP_R_AMP_OE_SHIFT 3
  960. #define DA7218_HP_R_AMP_OE_MASK (0x1 << 3)
  961. #define DA7218_HP_R_AMP_ZC_EN_SHIFT 4
  962. #define DA7218_HP_R_AMP_ZC_EN_MASK (0x1 << 4)
  963. #define DA7218_HP_R_AMP_RAMP_EN_SHIFT 5
  964. #define DA7218_HP_R_AMP_RAMP_EN_MASK (0x1 << 5)
  965. #define DA7218_HP_R_AMP_MUTE_EN_SHIFT 6
  966. #define DA7218_HP_R_AMP_MUTE_EN_MASK (0x1 << 6)
  967. #define DA7218_HP_R_AMP_EN_SHIFT 7
  968. #define DA7218_HP_R_AMP_EN_MASK (0x1 << 7)
  969. /* DA7218_HP_R_GAIN = 0xD3 */
  970. #define DA7218_HP_R_AMP_GAIN_SHIFT 0
  971. #define DA7218_HP_R_AMP_GAIN_MASK (0x3F << 0)
  972. /* DA7218_HP_SNGL_CTRL = 0xD4 */
  973. #define DA7218_HP_AMP_STEREO_DETECT_STATUS_SHIFT 0
  974. #define DA7218_HP_AMP_STEREO_DETECT_STATUS_MASK (0x1 << 0)
  975. #define DA7218_HPL_AMP_LOAD_DETECT_STATUS_SHIFT 1
  976. #define DA7218_HPL_AMP_LOAD_DETECT_STATUS_MASK (0x1 << 1)
  977. #define DA7218_HPR_AMP_LOAD_DETECT_STATUS_SHIFT 2
  978. #define DA7218_HPR_AMP_LOAD_DETECT_STATUS_MASK (0x1 << 2)
  979. #define DA7218_HP_AMP_LOAD_DETECT_EN_SHIFT 6
  980. #define DA7218_HP_AMP_LOAD_DETECT_EN_MASK (0x1 << 6)
  981. #define DA7218_HP_AMP_STEREO_DETECT_EN_SHIFT 7
  982. #define DA7218_HP_AMP_STEREO_DETECT_EN_MASK (0x1 << 7)
  983. /* DA7218_HP_DIFF_CTRL = 0xD5 */
  984. #define DA7218_HP_AMP_DIFF_MODE_EN_SHIFT 0
  985. #define DA7218_HP_AMP_DIFF_MODE_EN_MASK (0x1 << 0)
  986. #define DA7218_HP_AMP_SINGLE_SUPPLY_EN_SHIFT 4
  987. #define DA7218_HP_AMP_SINGLE_SUPPLY_EN_MASK (0x1 << 4)
  988. /* DA7218_HP_DIFF_UNLOCK = 0xD7 */
  989. #define DA7218_HP_DIFF_UNLOCK_SHIFT 0
  990. #define DA7218_HP_DIFF_UNLOCK_MASK (0x1 << 0)
  991. #define DA7218_HP_DIFF_UNLOCK_VAL 0xC3
  992. /* DA7218_HPLDET_JACK = 0xD8 */
  993. #define DA7218_HPLDET_JACK_RATE_SHIFT 0
  994. #define DA7218_HPLDET_JACK_RATE_MASK (0x7 << 0)
  995. #define DA7218_HPLDET_JACK_DEBOUNCE_SHIFT 3
  996. #define DA7218_HPLDET_JACK_DEBOUNCE_MASK (0x3 << 3)
  997. #define DA7218_HPLDET_JACK_THR_SHIFT 5
  998. #define DA7218_HPLDET_JACK_THR_MASK (0x3 << 5)
  999. #define DA7218_HPLDET_JACK_EN_SHIFT 7
  1000. #define DA7218_HPLDET_JACK_EN_MASK (0x1 << 7)
  1001. /* DA7218_HPLDET_CTRL = 0xD9 */
  1002. #define DA7218_HPLDET_COMP_INV_SHIFT 0
  1003. #define DA7218_HPLDET_COMP_INV_MASK (0x1 << 0)
  1004. #define DA7218_HPLDET_HYST_EN_SHIFT 1
  1005. #define DA7218_HPLDET_HYST_EN_MASK (0x1 << 1)
  1006. #define DA7218_HPLDET_DISCHARGE_EN_SHIFT 7
  1007. #define DA7218_HPLDET_DISCHARGE_EN_MASK (0x1 << 7)
  1008. /* DA7218_HPLDET_TEST = 0xDA */
  1009. #define DA7218_HPLDET_COMP_STS_SHIFT 4
  1010. #define DA7218_HPLDET_COMP_STS_MASK (0x1 << 4)
  1011. /* DA7218_REFERENCES = 0xDC */
  1012. #define DA7218_BIAS_EN_SHIFT 3
  1013. #define DA7218_BIAS_EN_MASK (0x1 << 3)
  1014. /* DA7218_IO_CTRL = 0xE0 */
  1015. #define DA7218_IO_VOLTAGE_LEVEL_SHIFT 0
  1016. #define DA7218_IO_VOLTAGE_LEVEL_MASK (0x1 << 0)
  1017. #define DA7218_IO_VOLTAGE_LEVEL_2_5V_3_6V 0
  1018. #define DA7218_IO_VOLTAGE_LEVEL_1_5V_2_5V 1
  1019. /* DA7218_LDO_CTRL = 0xE1 */
  1020. #define DA7218_LDO_LEVEL_SELECT_SHIFT 4
  1021. #define DA7218_LDO_LEVEL_SELECT_MASK (0x3 << 4)
  1022. #define DA7218_LDO_EN_SHIFT 7
  1023. #define DA7218_LDO_EN_MASK (0x1 << 7)
  1024. /* DA7218_SIDETONE_CTRL = 0xE4 */
  1025. #define DA7218_SIDETONE_MUTE_EN_SHIFT 6
  1026. #define DA7218_SIDETONE_MUTE_EN_MASK (0x1 << 6)
  1027. #define DA7218_SIDETONE_FILTER_EN_SHIFT 7
  1028. #define DA7218_SIDETONE_FILTER_EN_MASK (0x1 << 7)
  1029. /* DA7218_SIDETONE_IN_SELECT = 0xE5 */
  1030. #define DA7218_SIDETONE_IN_SELECT_SHIFT 0
  1031. #define DA7218_SIDETONE_IN_SELECT_MASK (0x3 << 0)
  1032. #define DA7218_SIDETONE_IN_SELECT_MAX 4
  1033. /* DA7218_SIDETONE_GAIN = 0xE6 */
  1034. #define DA7218_SIDETONE_GAIN_SHIFT 0
  1035. #define DA7218_SIDETONE_GAIN_MASK (0x1F << 0)
  1036. /* DA7218_DROUTING_ST_OUTFILT_1L = 0xE8 */
  1037. #define DA7218_OUTFILT_ST_1L_SRC_SHIFT 0
  1038. #define DA7218_OUTFILT_ST_1L_SRC_MASK (0x7 << 0)
  1039. #define DA7218_DMIX_ST_SRC_OUTFILT1L 0
  1040. #define DA7218_DMIX_ST_SRC_OUTFILT1R 1
  1041. #define DA7218_DMIX_ST_SRC_SIDETONE 2
  1042. /* DA7218_DROUTING_ST_OUTFILT_1R = 0xE9 */
  1043. #define DA7218_OUTFILT_ST_1R_SRC_SHIFT 0
  1044. #define DA7218_OUTFILT_ST_1R_SRC_MASK (0x7 << 0)
  1045. /* DA7218_SIDETONE_BIQ_3STAGE_DATA = 0xEA */
  1046. #define DA7218_SIDETONE_BIQ_3STAGE_DATA_SHIFT 0
  1047. #define DA7218_SIDETONE_BIQ_3STAGE_DATA_MASK (0xFF << 0)
  1048. /* DA7218_SIDETONE_BIQ_3STAGE_ADDR = 0xEB */
  1049. #define DA7218_SIDETONE_BIQ_3STAGE_ADDR_SHIFT 0
  1050. #define DA7218_SIDETONE_BIQ_3STAGE_ADDR_MASK (0x1F << 0)
  1051. #define DA7218_SIDETONE_BIQ_3STAGE_CFG_SIZE 30
  1052. /* DA7218_EVENT_STATUS = 0xEC */
  1053. #define DA7218_HPLDET_JACK_STS_SHIFT 7
  1054. #define DA7218_HPLDET_JACK_STS_MASK (0x1 << 7)
  1055. /* DA7218_EVENT = 0xED */
  1056. #define DA7218_LVL_DET_EVENT_SHIFT 0
  1057. #define DA7218_LVL_DET_EVENT_MASK (0x1 << 0)
  1058. #define DA7218_HPLDET_JACK_EVENT_SHIFT 7
  1059. #define DA7218_HPLDET_JACK_EVENT_MASK (0x1 << 7)
  1060. /* DA7218_EVENT_MASK = 0xEE */
  1061. #define DA7218_LVL_DET_EVENT_MSK_SHIFT 0
  1062. #define DA7218_LVL_DET_EVENT_MSK_MASK (0x1 << 0)
  1063. #define DA7218_HPLDET_JACK_EVENT_IRQ_MSK_SHIFT 7
  1064. #define DA7218_HPLDET_JACK_EVENT_IRQ_MSK_MASK (0x1 << 7)
  1065. /* DA7218_DMIC_1_CTRL = 0xF0 */
  1066. #define DA7218_DMIC_1_DATA_SEL_SHIFT 0
  1067. #define DA7218_DMIC_1_DATA_SEL_MASK (0x1 << 0)
  1068. #define DA7218_DMIC_1_SAMPLEPHASE_SHIFT 1
  1069. #define DA7218_DMIC_1_SAMPLEPHASE_MASK (0x1 << 1)
  1070. #define DA7218_DMIC_1_CLK_RATE_SHIFT 2
  1071. #define DA7218_DMIC_1_CLK_RATE_MASK (0x1 << 2)
  1072. #define DA7218_DMIC_1L_EN_SHIFT 6
  1073. #define DA7218_DMIC_1L_EN_MASK (0x1 << 6)
  1074. #define DA7218_DMIC_1R_EN_SHIFT 7
  1075. #define DA7218_DMIC_1R_EN_MASK (0x1 << 7)
  1076. /* DA7218_DMIC_2_CTRL = 0xF1 */
  1077. #define DA7218_DMIC_2_DATA_SEL_SHIFT 0
  1078. #define DA7218_DMIC_2_DATA_SEL_MASK (0x1 << 0)
  1079. #define DA7218_DMIC_2_SAMPLEPHASE_SHIFT 1
  1080. #define DA7218_DMIC_2_SAMPLEPHASE_MASK (0x1 << 1)
  1081. #define DA7218_DMIC_2_CLK_RATE_SHIFT 2
  1082. #define DA7218_DMIC_2_CLK_RATE_MASK (0x1 << 2)
  1083. #define DA7218_DMIC_2L_EN_SHIFT 6
  1084. #define DA7218_DMIC_2L_EN_MASK (0x1 << 6)
  1085. #define DA7218_DMIC_2R_EN_SHIFT 7
  1086. #define DA7218_DMIC_2R_EN_MASK (0x1 << 7)
  1087. /* DA7218_IN_1L_GAIN = 0xF4 */
  1088. #define DA7218_IN_1L_DIGITAL_GAIN_SHIFT 0
  1089. #define DA7218_IN_1L_DIGITAL_GAIN_MASK (0x7F << 0)
  1090. #define DA7218_IN_DIGITAL_GAIN_MAX 0x7F
  1091. /* DA7218_IN_1R_GAIN = 0xF5 */
  1092. #define DA7218_IN_1R_DIGITAL_GAIN_SHIFT 0
  1093. #define DA7218_IN_1R_DIGITAL_GAIN_MASK (0x7F << 0)
  1094. /* DA7218_IN_2L_GAIN = 0xF6 */
  1095. #define DA7218_IN_2L_DIGITAL_GAIN_SHIFT 0
  1096. #define DA7218_IN_2L_DIGITAL_GAIN_MASK (0x7F << 0)
  1097. /* DA7218_IN_2R_GAIN = 0xF7 */
  1098. #define DA7218_IN_2R_DIGITAL_GAIN_SHIFT 0
  1099. #define DA7218_IN_2R_DIGITAL_GAIN_MASK (0x7F << 0)
  1100. /* DA7218_OUT_1L_GAIN = 0xF8 */
  1101. #define DA7218_OUT_1L_DIGITAL_GAIN_SHIFT 0
  1102. #define DA7218_OUT_1L_DIGITAL_GAIN_MASK (0xFF << 0)
  1103. #define DA7218_OUT_DIGITAL_GAIN_MIN 0x0
  1104. #define DA7218_OUT_DIGITAL_GAIN_MAX 0x97
  1105. /* DA7218_OUT_1R_GAIN = 0xF9 */
  1106. #define DA7218_OUT_1R_DIGITAL_GAIN_SHIFT 0
  1107. #define DA7218_OUT_1R_DIGITAL_GAIN_MASK (0xFF << 0)
  1108. /* DA7218_MICBIAS_CTRL = 0xFC */
  1109. #define DA7218_MICBIAS_1_LEVEL_SHIFT 0
  1110. #define DA7218_MICBIAS_1_LEVEL_MASK (0x7 << 0)
  1111. #define DA7218_MICBIAS_1_LP_MODE_SHIFT 3
  1112. #define DA7218_MICBIAS_1_LP_MODE_MASK (0x1 << 3)
  1113. #define DA7218_MICBIAS_2_LEVEL_SHIFT 4
  1114. #define DA7218_MICBIAS_2_LEVEL_MASK (0x7 << 4)
  1115. #define DA7218_MICBIAS_2_LP_MODE_SHIFT 7
  1116. #define DA7218_MICBIAS_2_LP_MODE_MASK (0x1 << 7)
  1117. /* DA7218_MICBIAS_EN = 0xFD */
  1118. #define DA7218_MICBIAS_1_EN_SHIFT 0
  1119. #define DA7218_MICBIAS_1_EN_MASK (0x1 << 0)
  1120. #define DA7218_MICBIAS_2_EN_SHIFT 4
  1121. #define DA7218_MICBIAS_2_EN_MASK (0x1 << 4)
  1122. /*
  1123. * General defines & data
  1124. */
  1125. /* Register inversion */
  1126. #define DA7218_NO_INVERT 0
  1127. #define DA7218_INVERT 1
  1128. /* Byte related defines */
  1129. #define DA7218_BYTE_SHIFT 8
  1130. #define DA7218_BYTE_MASK 0xFF
  1131. #define DA7218_2BYTE_SHIFT 16
  1132. #define DA7218_2BYTE_MASK 0xFFFF
  1133. /* PLL Output Frequencies */
  1134. #define DA7218_PLL_FREQ_OUT_90316 90316800
  1135. #define DA7218_PLL_FREQ_OUT_98304 98304000
  1136. /* PLL Frequency Dividers */
  1137. #define DA7218_PLL_INDIV_2_TO_4_5_MHZ_VAL 1
  1138. #define DA7218_PLL_INDIV_4_5_TO_9_MHZ_VAL 2
  1139. #define DA7218_PLL_INDIV_9_TO_18_MHZ_VAL 4
  1140. #define DA7218_PLL_INDIV_18_TO_36_MHZ_VAL 8
  1141. #define DA7218_PLL_INDIV_36_TO_54_MHZ_VAL 16
  1142. /* ALC Calibration */
  1143. #define DA7218_ALC_CALIB_DELAY_MIN 2500
  1144. #define DA7218_ALC_CALIB_DELAY_MAX 5000
  1145. #define DA7218_ALC_CALIB_MAX_TRIES 5
  1146. /* Ref Oscillator */
  1147. #define DA7218_REF_OSC_CHECK_DELAY_MIN 5000
  1148. #define DA7218_REF_OSC_CHECK_DELAY_MAX 10000
  1149. #define DA7218_REF_OSC_CHECK_TRIES 4
  1150. /* SRM */
  1151. #define DA7218_SRM_CHECK_DELAY 50
  1152. #define DA7218_SRM_CHECK_TRIES 8
  1153. /* Mic Level Detect */
  1154. #define DA7218_MIC_LVL_DET_DELAY 50
  1155. enum da7218_biq_cfg {
  1156. DA7218_BIQ_CFG_DATA = 0,
  1157. DA7218_BIQ_CFG_ADDR,
  1158. DA7218_BIQ_CFG_SIZE,
  1159. };
  1160. enum da7218_clk_src {
  1161. DA7218_CLKSRC_MCLK = 0,
  1162. DA7218_CLKSRC_MCLK_SQR,
  1163. };
  1164. enum da7218_sys_clk {
  1165. DA7218_SYSCLK_MCLK = 0,
  1166. DA7218_SYSCLK_PLL,
  1167. DA7218_SYSCLK_PLL_SRM,
  1168. };
  1169. enum da7218_dev_id {
  1170. DA7217_DEV_ID = 0,
  1171. DA7218_DEV_ID,
  1172. };
  1173. /* Regulators */
  1174. enum da7218_supplies {
  1175. DA7218_SUPPLY_VDD = 0,
  1176. DA7218_SUPPLY_VDDMIC,
  1177. DA7218_SUPPLY_VDDIO,
  1178. DA7218_NUM_SUPPLIES,
  1179. };
  1180. /* Private data */
  1181. struct da7218_priv {
  1182. struct da7218_pdata *pdata;
  1183. struct regulator_bulk_data supplies[DA7218_NUM_SUPPLIES];
  1184. struct regmap *regmap;
  1185. int dev_id;
  1186. struct snd_soc_jack *jack;
  1187. int irq;
  1188. struct clk *mclk;
  1189. unsigned int mclk_rate;
  1190. bool hp_single_supply;
  1191. bool master;
  1192. u8 alc_en;
  1193. u8 in_filt_en;
  1194. u8 mic_lvl_det_en;
  1195. u8 biq_5stage_coeff[DA7218_OUT_1_BIQ_5STAGE_CFG_SIZE];
  1196. u8 stbiq_3stage_coeff[DA7218_SIDETONE_BIQ_3STAGE_CFG_SIZE];
  1197. };
  1198. /* HP detect control */
  1199. int da7218_hpldet(struct snd_soc_codec *codec, struct snd_soc_jack *jack);
  1200. #endif /* _DA7218_H */