max98926.h 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849
  1. /*
  2. * max98926.h -- MAX98926 ALSA SoC Audio driver
  3. * Copyright 2013-2015 Maxim Integrated Products
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #ifndef _MAX98926_H
  9. #define _MAX98926_H
  10. #define MAX98926_CHIP_VERSION 0x40
  11. #define MAX98926_CHIP_VERSION1 0x50
  12. #define MAX98926_VBAT_DATA 0x00
  13. #define MAX98926_VBST_DATA 0x01
  14. #define MAX98926_LIVE_STATUS0 0x02
  15. #define MAX98926_LIVE_STATUS1 0x03
  16. #define MAX98926_LIVE_STATUS2 0x04
  17. #define MAX98926_STATE0 0x05
  18. #define MAX98926_STATE1 0x06
  19. #define MAX98926_STATE2 0x07
  20. #define MAX98926_FLAG0 0x08
  21. #define MAX98926_FLAG1 0x09
  22. #define MAX98926_FLAG2 0x0A
  23. #define MAX98926_IRQ_ENABLE0 0x0B
  24. #define MAX98926_IRQ_ENABLE1 0x0C
  25. #define MAX98926_IRQ_ENABLE2 0x0D
  26. #define MAX98926_IRQ_CLEAR0 0x0E
  27. #define MAX98926_IRQ_CLEAR1 0x0F
  28. #define MAX98926_IRQ_CLEAR2 0x10
  29. #define MAX98926_MAP0 0x11
  30. #define MAX98926_MAP1 0x12
  31. #define MAX98926_MAP2 0x13
  32. #define MAX98926_MAP3 0x14
  33. #define MAX98926_MAP4 0x15
  34. #define MAX98926_MAP5 0x16
  35. #define MAX98926_MAP6 0x17
  36. #define MAX98926_MAP7 0x18
  37. #define MAX98926_MAP8 0x19
  38. #define MAX98926_DAI_CLK_MODE1 0x1A
  39. #define MAX98926_DAI_CLK_MODE2 0x1B
  40. #define MAX98926_DAI_CLK_DIV_M_MSBS 0x1C
  41. #define MAX98926_DAI_CLK_DIV_M_LSBS 0x1D
  42. #define MAX98926_DAI_CLK_DIV_N_MSBS 0x1E
  43. #define MAX98926_DAI_CLK_DIV_N_LSBS 0x1F
  44. #define MAX98926_FORMAT 0x20
  45. #define MAX98926_TDM_SLOT_SELECT 0x21
  46. #define MAX98926_DOUT_CFG_VMON 0x22
  47. #define MAX98926_DOUT_CFG_IMON 0x23
  48. #define MAX98926_DOUT_CFG_VBAT 0x24
  49. #define MAX98926_DOUT_CFG_VBST 0x25
  50. #define MAX98926_DOUT_CFG_FLAG 0x26
  51. #define MAX98926_DOUT_HIZ_CFG1 0x27
  52. #define MAX98926_DOUT_HIZ_CFG2 0x28
  53. #define MAX98926_DOUT_HIZ_CFG3 0x29
  54. #define MAX98926_DOUT_HIZ_CFG4 0x2A
  55. #define MAX98926_DOUT_DRV_STRENGTH 0x2B
  56. #define MAX98926_FILTERS 0x2C
  57. #define MAX98926_GAIN 0x2D
  58. #define MAX98926_GAIN_RAMPING 0x2E
  59. #define MAX98926_SPK_AMP 0x2F
  60. #define MAX98926_THRESHOLD 0x30
  61. #define MAX98926_ALC_ATTACK 0x31
  62. #define MAX98926_ALC_ATTEN_RLS 0x32
  63. #define MAX98926_ALC_HOLD_RLS 0x33
  64. #define MAX98926_ALC_CONFIGURATION 0x34
  65. #define MAX98926_BOOST_CONVERTER 0x35
  66. #define MAX98926_BLOCK_ENABLE 0x36
  67. #define MAX98926_CONFIGURATION 0x37
  68. #define MAX98926_GLOBAL_ENABLE 0x38
  69. #define MAX98926_BOOST_LIMITER 0x3A
  70. #define MAX98926_VERSION 0xFF
  71. #define MAX98926_REG_CNT (MAX98926_R03A_BOOST_LIMITER+1)
  72. #define MAX98926_PDM_CURRENT_MASK (1<<7)
  73. #define MAX98926_PDM_CURRENT_SHIFT 7
  74. #define MAX98926_PDM_VOLTAGE_MASK (1<<3)
  75. #define MAX98926_PDM_VOLTAGE_SHIFT 3
  76. #define MAX98926_PDM_CHANNEL_0_MASK (1<<2)
  77. #define MAX98926_PDM_CHANNEL_0_SHIFT 2
  78. #define MAX98926_PDM_CHANNEL_1_MASK (1<<6)
  79. #define MAX98926_PDM_CHANNEL_1_SHIFT 6
  80. #define MAX98926_PDM_CHANNEL_1_HIZ 5
  81. #define MAX98926_PDM_CHANNEL_0_HIZ 1
  82. #define MAX98926_PDM_SOURCE_0_SHIFT 0
  83. #define MAX98926_PDM_SOURCE_0_MASK (1<<0)
  84. #define MAX98926_PDM_SOURCE_1_MASK (1<<4)
  85. #define MAX98926_PDM_SOURCE_1_SHIFT 4
  86. /* MAX98926 Register Bit Fields */
  87. /* MAX98926_R002_LIVE_STATUS0 */
  88. #define MAX98926_THERMWARN_STATUS_MASK (1<<3)
  89. #define MAX98926_THERMWARN_STATUS_SHIFT 3
  90. #define MAX98926_THERMWARN_STATUS_WIDTH 1
  91. #define MAX98926_THERMSHDN_STATUS_MASK (1<<1)
  92. #define MAX98926_THERMSHDN_STATUS_SHIFT 1
  93. #define MAX98926_THERMSHDN_STATUS_WIDTH 1
  94. /* MAX98926_R003_LIVE_STATUS1 */
  95. #define MAX98926_SPKCURNT_STATUS_MASK (1<<5)
  96. #define MAX98926_SPKCURNT_STATUS_SHIFT 5
  97. #define MAX98926_SPKCURNT_STATUS_WIDTH 1
  98. #define MAX98926_WATCHFAIL_STATUS_MASK (1<<4)
  99. #define MAX98926_WATCHFAIL_STATUS_SHIFT 4
  100. #define MAX98926_WATCHFAIL_STATUS_WIDTH 1
  101. #define MAX98926_ALCINFH_STATUS_MASK (1<<3)
  102. #define MAX98926_ALCINFH_STATUS_SHIFT 3
  103. #define MAX98926_ALCINFH_STATUS_WIDTH 1
  104. #define MAX98926_ALCACT_STATUS_MASK (1<<2)
  105. #define MAX98926_ALCACT_STATUS_SHIFT 2
  106. #define MAX98926_ALCACT_STATUS_WIDTH 1
  107. #define MAX98926_ALCMUT_STATUS_MASK (1<<1)
  108. #define MAX98926_ALCMUT_STATUS_SHIFT 1
  109. #define MAX98926_ALCMUT_STATUS_WIDTH 1
  110. #define MAX98926_ACLP_STATUS_MASK (1<<0)
  111. #define MAX98926_ACLP_STATUS_SHIFT 0
  112. #define MAX98926_ACLP_STATUS_WIDTH 1
  113. /* MAX98926_R004_LIVE_STATUS2 */
  114. #define MAX98926_SLOTOVRN_STATUS_MASK (1<<6)
  115. #define MAX98926_SLOTOVRN_STATUS_SHIFT 6
  116. #define MAX98926_SLOTOVRN_STATUS_WIDTH 1
  117. #define MAX98926_INVALSLOT_STATUS_MASK (1<<5)
  118. #define MAX98926_INVALSLOT_STATUS_SHIFT 5
  119. #define MAX98926_INVALSLOT_STATUS_WIDTH 1
  120. #define MAX98926_SLOTCNFLT_STATUS_MASK (1<<4)
  121. #define MAX98926_SLOTCNFLT_STATUS_SHIFT 4
  122. #define MAX98926_SLOTCNFLT_STATUS_WIDTH 1
  123. #define MAX98926_VBSTOVFL_STATUS_MASK (1<<3)
  124. #define MAX98926_VBSTOVFL_STATUS_SHIFT 3
  125. #define MAX98926_VBSTOVFL_STATUS_WIDTH 1
  126. #define MAX98926_VBATOVFL_STATUS_MASK (1<<2)
  127. #define MAX98926_VBATOVFL_STATUS_SHIFT 2
  128. #define MAX98926_VBATOVFL_STATUS_WIDTH 1
  129. #define MAX98926_IMONOVFL_STATUS_MASK (1<<1)
  130. #define MAX98926_IMONOVFL_STATUS_SHIFT 1
  131. #define MAX98926_IMONOVFL_STATUS_WIDTH 1
  132. #define MAX98926_VMONOVFL_STATUS_MASK (1<<0)
  133. #define MAX98926_VMONOVFL_STATUS_SHIFT 0
  134. #define MAX98926_VMONOVFL_STATUS_WIDTH 1
  135. /* MAX98926_R005_STATE0 */
  136. #define MAX98926_THERMWARN_END_STATE_MASK (1<<3)
  137. #define MAX98926_THERMWARN_END_STATE_SHIFT 3
  138. #define MAX98926_THERMWARN_END_STATE_WIDTH 1
  139. #define MAX98926_THERMWARN_BGN_STATE_MASK (1<<2)
  140. #define MAX98926_THERMWARN_BGN_STATE_SHIFT 1
  141. #define MAX98926_THERMWARN_BGN_STATE_WIDTH 1
  142. #define MAX98926_THERMSHDN_END_STATE_MASK (1<<1)
  143. #define MAX98926_THERMSHDN_END_STATE_SHIFT 1
  144. #define MAX98926_THERMSHDN_END_STATE_WIDTH 1
  145. #define MAX98926_THERMSHDN_BGN_STATE_MASK (1<<0)
  146. #define MAX98926_THERMSHDN_BGN_STATE_SHIFT 0
  147. #define MAX98926_THERMSHDN_BGN_STATE_WIDTH 1
  148. /* MAX98926_R006_STATE1 */
  149. #define MAX98926_SPRCURNT_STATE_MASK (1<<5)
  150. #define MAX98926_SPRCURNT_STATE_SHIFT 5
  151. #define MAX98926_SPRCURNT_STATE_WIDTH 1
  152. #define MAX98926_WATCHFAIL_STATE_MASK (1<<4)
  153. #define MAX98926_WATCHFAIL_STATE_SHIFT 4
  154. #define MAX98926_WATCHFAIL_STATE_WIDTH 1
  155. #define MAX98926_ALCINFH_STATE_MASK (1<<3)
  156. #define MAX98926_ALCINFH_STATE_SHIFT 3
  157. #define MAX98926_ALCINFH_STATE_WIDTH 1
  158. #define MAX98926_ALCACT_STATE_MASK (1<<2)
  159. #define MAX98926_ALCACT_STATE_SHIFT 2
  160. #define MAX98926_ALCACT_STATE_WIDTH 1
  161. #define MAX98926_ALCMUT_STATE_MASK (1<<1)
  162. #define MAX98926_ALCMUT_STATE_SHIFT 1
  163. #define MAX98926_ALCMUT_STATE_WIDTH 1
  164. #define MAX98926_ALCP_STATE_MASK (1<<0)
  165. #define MAX98926_ALCP_STATE_SHIFT 0
  166. #define MAX98926_ALCP_STATE_WIDTH 1
  167. /* MAX98926_R007_STATE2 */
  168. #define MAX98926_SLOTOVRN_STATE_MASK (1<<6)
  169. #define MAX98926_SLOTOVRN_STATE_SHIFT 6
  170. #define MAX98926_SLOTOVRN_STATE_WIDTH 1
  171. #define MAX98926_INVALSLOT_STATE_MASK (1<<5)
  172. #define MAX98926_INVALSLOT_STATE_SHIFT 5
  173. #define MAX98926_INVALSLOT_STATE_WIDTH 1
  174. #define MAX98926_SLOTCNFLT_STATE_MASK (1<<4)
  175. #define MAX98926_SLOTCNFLT_STATE_SHIFT 4
  176. #define MAX98926_SLOTCNFLT_STATE_WIDTH 1
  177. #define MAX98926_VBSTOVFL_STATE_MASK (1<<3)
  178. #define MAX98926_VBSTOVFL_STATE_SHIFT 3
  179. #define MAX98926_VBSTOVFL_STATE_WIDTH 1
  180. #define MAX98926_VBATOVFL_STATE_MASK (1<<2)
  181. #define MAX98926_VBATOVFL_STATE_SHIFT 2
  182. #define MAX98926_VBATOVFL_STATE_WIDTH 1
  183. #define MAX98926_IMONOVFL_STATE_MASK (1<<1)
  184. #define MAX98926_IMONOVFL_STATE_SHIFT 1
  185. #define MAX98926_IMONOVFL_STATE_WIDTH 1
  186. #define MAX98926_VMONOVFL_STATE_MASK (1<<0)
  187. #define MAX98926_VMONOVFL_STATE_SHIFT 0
  188. #define MAX98926_VMONOVFL_STATE_WIDTH 1
  189. /* MAX98926_R008_FLAG0 */
  190. #define MAX98926_THERMWARN_END_FLAG_MASK (1<<3)
  191. #define MAX98926_THERMWARN_END_FLAG_SHIFT 3
  192. #define MAX98926_THERMWARN_END_FLAG_WIDTH 1
  193. #define MAX98926_THERMWARN_BGN_FLAG_MASK (1<<2)
  194. #define MAX98926_THERMWARN_BGN_FLAG_SHIFT 2
  195. #define MAX98926_THERMWARN_BGN_FLAG_WIDTH 1
  196. #define MAX98926_THERMSHDN_END_FLAG_MASK (1<<1)
  197. #define MAX98926_THERMSHDN_END_FLAG_SHIFT 1
  198. #define MAX98926_THERMSHDN_END_FLAG_WIDTH 1
  199. #define MAX98926_THERMSHDN_BGN_FLAG_MASK (1<<0)
  200. #define MAX98926_THERMSHDN_BGN_FLAG_SHIFT 0
  201. #define MAX98926_THERMSHDN_BGN_FLAG_WIDTH 1
  202. /* MAX98926_R009_FLAG1 */
  203. #define MAX98926_SPKCURNT_FLAG_MASK (1<<5)
  204. #define MAX98926_SPKCURNT_FLAG_SHIFT 5
  205. #define MAX98926_SPKCURNT_FLAG_WIDTH 1
  206. #define MAX98926_WATCHFAIL_FLAG_MASK (1<<4)
  207. #define MAX98926_WATCHFAIL_FLAG_SHIFT 4
  208. #define MAX98926_WATCHFAIL_FLAG_WIDTH 1
  209. #define MAX98926_ALCINFH_FLAG_MASK (1<<3)
  210. #define MAX98926_ALCINFH_FLAG_SHIFT 3
  211. #define MAX98926_ALCINFH_FLAG_WIDTH 1
  212. #define MAX98926_ALCACT_FLAG_MASK (1<<2)
  213. #define MAX98926_ALCACT_FLAG_SHIFT 2
  214. #define MAX98926_ALCACT_FLAG_WIDTH 1
  215. #define MAX98926_ALCMUT_FLAG_MASK (1<<1)
  216. #define MAX98926_ALCMUT_FLAG_SHIFT 1
  217. #define MAX98926_ALCMUT_FLAG_WIDTH 1
  218. #define MAX98926_ALCP_FLAG_MASK (1<<0)
  219. #define MAX98926_ALCP_FLAG_SHIFT 0
  220. #define MAX98926_ALCP_FLAG_WIDTH 1
  221. /* MAX98926_R00A_FLAG2 */
  222. #define MAX98926_SLOTOVRN_FLAG_MASK (1<<6)
  223. #define MAX98926_SLOTOVRN_FLAG_SHIFT 6
  224. #define MAX98926_SLOTOVRN_FLAG_WIDTH 1
  225. #define MAX98926_INVALSLOT_FLAG_MASK (1<<5)
  226. #define MAX98926_INVALSLOT_FLAG_SHIFT 5
  227. #define MAX98926_INVALSLOT_FLAG_WIDTH 1
  228. #define MAX98926_SLOTCNFLT_FLAG_MASK (1<<4)
  229. #define MAX98926_SLOTCNFLT_FLAG_SHIFT 4
  230. #define MAX98926_SLOTCNFLT_FLAG_WIDTH 1
  231. #define MAX98926_VBSTOVFL_FLAG_MASK (1<<3)
  232. #define MAX98926_VBSTOVFL_FLAG_SHIFT 3
  233. #define MAX98926_VBSTOVFL_FLAG_WIDTH 1
  234. #define MAX98926_VBATOVFL_FLAG_MASK (1<<2)
  235. #define MAX98926_VBATOVFL_FLAG_SHIFT 2
  236. #define MAX98926_VBATOVFL_FLAG_WIDTH 1
  237. #define MAX98926_IMONOVFL_FLAG_MASK (1<<1)
  238. #define MAX98926_IMONOVFL_FLAG_SHIFT 1
  239. #define MAX98926_IMONOVFL_FLAG_WIDTH 1
  240. #define MAX98926_VMONOVFL_FLAG_MASK (1<<0)
  241. #define MAX98926_VMONOVFL_FLAG_SHIFT 0
  242. #define MAX98926_VMONOVFL_FLAG_WIDTH 1
  243. /* MAX98926_R00B_IRQ_ENABLE0 */
  244. #define MAX98926_THERMWARN_END_EN_MASK (1<<3)
  245. #define MAX98926_THERMWARN_END_EN_SHIFT 3
  246. #define MAX98926_THERMWARN_END_EN_WIDTH 1
  247. #define MAX98926_THERMWARN_BGN_EN_MASK (1<<2)
  248. #define MAX98926_THERMWARN_BGN_EN_SHIFT 2
  249. #define MAX98926_THERMWARN_BGN_EN_WIDTH 1
  250. #define MAX98926_THERMSHDN_END_EN_MASK (1<<1)
  251. #define MAX98926_THERMSHDN_END_EN_SHIFT 1
  252. #define MAX98926_THERMSHDN_END_EN_WIDTH 1
  253. #define MAX98926_THERMSHDN_BGN_EN_MASK (1<<0)
  254. #define MAX98926_THERMSHDN_BGN_EN_SHIFT 0
  255. #define MAX98926_THERMSHDN_BGN_EN_WIDTH 1
  256. /* MAX98926_R00C_IRQ_ENABLE1 */
  257. #define MAX98926_SPKCURNT_EN_MASK (1<<5)
  258. #define MAX98926_SPKCURNT_EN_SHIFT 5
  259. #define MAX98926_SPKCURNT_EN_WIDTH 1
  260. #define MAX98926_WATCHFAIL_EN_MASK (1<<4)
  261. #define MAX98926_WATCHFAIL_EN_SHIFT 4
  262. #define MAX98926_WATCHFAIL_EN_WIDTH 1
  263. #define MAX98926_ALCINFH_EN_MASK (1<<3)
  264. #define MAX98926_ALCINFH_EN_SHIFT 3
  265. #define MAX98926_ALCINFH_EN_WIDTH 1
  266. #define MAX98926_ALCACT_EN_MASK (1<<2)
  267. #define MAX98926_ALCACT_EN_SHIFT 2
  268. #define MAX98926_ALCACT_EN_WIDTH 1
  269. #define MAX98926_ALCMUT_EN_MASK (1<<1)
  270. #define MAX98926_ALCMUT_EN_SHIFT 1
  271. #define MAX98926_ALCMUT_EN_WIDTH 1
  272. #define MAX98926_ALCP_EN_MASK (1<<0)
  273. #define MAX98926_ALCP_EN_SHIFT 0
  274. #define MAX98926_ALCP_EN_WIDTH 1
  275. /* MAX98926_R00D_IRQ_ENABLE2 */
  276. #define MAX98926_SLOTOVRN_EN_MASK (1<<6)
  277. #define MAX98926_SLOTOVRN_EN_SHIFT 6
  278. #define MAX98926_SLOTOVRN_EN_WIDTH 1
  279. #define MAX98926_INVALSLOT_EN_MASK (1<<5)
  280. #define MAX98926_INVALSLOT_EN_SHIFT 5
  281. #define MAX98926_INVALSLOT_EN_WIDTH 1
  282. #define MAX98926_SLOTCNFLT_EN_MASK (1<<4)
  283. #define MAX98926_SLOTCNFLT_EN_SHIFT 4
  284. #define MAX98926_SLOTCNFLT_EN_WIDTH 1
  285. #define MAX98926_VBSTOVFL_EN_MASK (1<<3)
  286. #define MAX98926_VBSTOVFL_EN_SHIFT 3
  287. #define MAX98926_VBSTOVFL_EN_WIDTH 1
  288. #define MAX98926_VBATOVFL_EN_MASK (1<<2)
  289. #define MAX98926_VBATOVFL_EN_SHIFT 2
  290. #define MAX98926_VBATOVFL_EN_WIDTH 1
  291. #define MAX98926_IMONOVFL_EN_MASK (1<<1)
  292. #define MAX98926_IMONOVFL_EN_SHIFT 1
  293. #define MAX98926_IMONOVFL_EN_WIDTH 1
  294. #define MAX98926_VMONOVFL_EN_MASK (1<<0)
  295. #define MAX98926_VMONOVFL_EN_SHIFT 0
  296. #define MAX98926_VMONOVFL_EN_WIDTH 1
  297. /* MAX98926_R00E_IRQ_CLEAR0 */
  298. #define MAX98926_THERMWARN_END_CLR_MASK (1<<3)
  299. #define MAX98926_THERMWARN_END_CLR_SHIFT 3
  300. #define MAX98926_THERMWARN_END_CLR_WIDTH 1
  301. #define MAX98926_THERMWARN_BGN_CLR_MASK (1<<2)
  302. #define MAX98926_THERMWARN_BGN_CLR_SHIFT 2
  303. #define MAX98926_THERMWARN_BGN_CLR_WIDTH 1
  304. #define MAX98926_THERMSHDN_END_CLR_MASK (1<<1)
  305. #define MAX98926_THERMSHDN_END_CLR_SHIFT 1
  306. #define MAX98926_THERMSHDN_END_CLR_WIDTH 1
  307. #define MAX98926_THERMSHDN_BGN_CLR_MASK (1<<0)
  308. #define MAX98926_THERMSHDN_BGN_CLR_SHIFT 0
  309. #define MAX98926_THERMSHDN_BGN_CLR_WIDTH 1
  310. /* MAX98926_R00F_IRQ_CLEAR1 */
  311. #define MAX98926_SPKCURNT_CLR_MASK (1<<5)
  312. #define MAX98926_SPKCURNT_CLR_SHIFT 5
  313. #define MAX98926_SPKCURNT_CLR_WIDTH 1
  314. #define MAX98926_WATCHFAIL_CLR_MASK (1<<4)
  315. #define MAX98926_WATCHFAIL_CLR_SHIFT 4
  316. #define MAX98926_WATCHFAIL_CLR_WIDTH 1
  317. #define MAX98926_ALCINFH_CLR_MASK (1<<3)
  318. #define MAX98926_ALCINFH_CLR_SHIFT 3
  319. #define MAX98926_ALCINFH_CLR_WIDTH 1
  320. #define MAX98926_ALCACT_CLR_MASK (1<<2)
  321. #define MAX98926_ALCACT_CLR_SHIFT 2
  322. #define MAX98926_ALCACT_CLR_WIDTH 1
  323. #define MAX98926_ALCMUT_CLR_MASK (1<<1)
  324. #define MAX98926_ALCMUT_CLR_SHIFT 1
  325. #define MAX98926_ALCMUT_CLR_WIDTH 1
  326. #define MAX98926_ALCP_CLR_MASK (1<<0)
  327. #define MAX98926_ALCP_CLR_SHIFT 0
  328. #define MAX98926_ALCP_CLR_WIDTH 1
  329. /* MAX98926_R010_IRQ_CLEAR2 */
  330. #define MAX98926_SLOTOVRN_CLR_MASK (1<<6)
  331. #define MAX98926_SLOTOVRN_CLR_SHIFT 6
  332. #define MAX98926_SLOTOVRN_CLR_WIDTH 1
  333. #define MAX98926_INVALSLOT_CLR_MASK (1<<5)
  334. #define MAX98926_INVALSLOT_CLR_SHIFT 5
  335. #define MAX98926_INVALSLOT_CLR_WIDTH 1
  336. #define MAX98926_SLOTCNFLT_CLR_MASK (1<<4)
  337. #define MAX98926_SLOTCNFLT_CLR_SHIFT 4
  338. #define MAX98926_SLOTCNFLT_CLR_WIDTH 1
  339. #define MAX98926_VBSTOVFL_CLR_MASK (1<<3)
  340. #define MAX98926_VBSTOVFL_CLR_SHIFT 3
  341. #define MAX98926_VBSTOVFL_CLR_WIDTH 1
  342. #define MAX98926_VBATOVFL_CLR_MASK (1<<2)
  343. #define MAX98926_VBATOVFL_CLR_SHIFT 2
  344. #define MAX98926_VBATOVFL_CLR_WIDTH 1
  345. #define MAX98926_IMONOVFL_CLR_MASK (1<<1)
  346. #define MAX98926_IMONOVFL_CLR_SHIFT 1
  347. #define MAX98926_IMONOVFL_CLR_WIDTH 1
  348. #define MAX98926_VMONOVFL_CLR_MASK (1<<0)
  349. #define MAX98926_VMONOVFL_CLR_SHIFT 0
  350. #define MAX98926_VMONOVFL_CLR_WIDTH 1
  351. /* MAX98926_R011_MAP0 */
  352. #define MAX98926_ER_THERMWARN_EN_MASK (1<<7)
  353. #define MAX98926_ER_THERMWARN_EN_SHIFT 7
  354. #define MAX98926_ER_THERMWARN_EN_WIDTH 1
  355. #define MAX98926_ER_THERMWARN_MAP_MASK (0x07<<4)
  356. #define MAX98926_ER_THERMWARN_MAP_SHIFT 4
  357. #define MAX98926_ER_THERMWARN_MAP_WIDTH 3
  358. /* MAX98926_R012_MAP1 */
  359. #define MAX98926_ER_ALCMUT_EN_MASK (1<<7)
  360. #define MAX98926_ER_ALCMUT_EN_SHIFT 7
  361. #define MAX98926_ER_ALCMUT_EN_WIDTH 1
  362. #define MAX98926_ER_ALCMUT_MAP_MASK (0x07<<4)
  363. #define MAX98926_ER_ALCMUT_MAP_SHIFT 4
  364. #define MAX98926_ER_ALCMUT_MAP_WIDTH 3
  365. #define MAX98926_ER_ALCP_EN_MASK (1<<3)
  366. #define MAX98926_ER_ALCP_EN_SHIFT 3
  367. #define MAX98926_ER_ALCP_EN_WIDTH 1
  368. #define MAX98926_ER_ALCP_MAP_MASK (0x07<<0)
  369. #define MAX98926_ER_ALCP_MAP_SHIFT 0
  370. #define MAX98926_ER_ALCP_MAP_WIDTH 3
  371. /* MAX98926_R013_MAP2 */
  372. #define MAX98926_ER_ALCINFH_EN_MASK (1<<7)
  373. #define MAX98926_ER_ALCINFH_EN_SHIFT 7
  374. #define MAX98926_ER_ALCINFH_EN_WIDTH 1
  375. #define MAX98926_ER_ALCINFH_MAP_MASK (0x07<<4)
  376. #define MAX98926_ER_ALCINFH_MAP_SHIFT 4
  377. #define MAX98926_ER_ALCINFH_MAP_WIDTH 3
  378. #define MAX98926_ER_ALCACT_EN_MASK (1<<3)
  379. #define MAX98926_ER_ALCACT_EN_SHIFT 3
  380. #define MAX98926_ER_ALCACT_EN_WIDTH 1
  381. #define MAX98926_ER_ALCACT_MAP_MASK (0x07<<0)
  382. #define MAX98926_ER_ALCACT_MAP_SHIFT 0
  383. #define MAX98926_ER_ALCACT_MAP_WIDTH 3
  384. /* MAX98926_R014_MAP3 */
  385. #define MAX98926_ER_SPKCURNT_EN_MASK (1<<7)
  386. #define MAX98926_ER_SPKCURNT_EN_SHIFT 7
  387. #define MAX98926_ER_SPKCURNT_EN_WIDTH 1
  388. #define MAX98926_ER_SPKCURNT_MAP_MASK (0x07<<4)
  389. #define MAX98926_ER_SPKCURNT_MAP_SHIFT 4
  390. #define MAX98926_ER_SPKCURNT_MAP_WIDTH 3
  391. /* MAX98926_R015_MAP4 */
  392. /* RESERVED */
  393. /* MAX98926_R016_MAP5 */
  394. #define MAX98926_ER_IMONOVFL_EN_MASK (1<<7)
  395. #define MAX98926_ER_IMONOVFL_EN_SHIFT 7
  396. #define MAX98926_ER_IMONOVFL_EN_WIDTH 1
  397. #define MAX98926_ER_IMONOVFL_MAP_MASK (0x07<<4)
  398. #define MAX98926_ER_IMONOVFL_MAP_SHIFT 4
  399. #define MAX98926_ER_IMONOVFL_MAP_WIDTH 3
  400. #define MAX98926_ER_VMONOVFL_EN_MASK (1<<3)
  401. #define MAX98926_ER_VMONOVFL_EN_SHIFT 3
  402. #define MAX98926_ER_VMONOVFL_EN_WIDTH 1
  403. #define MAX98926_ER_VMONOVFL_MAP_MASK (0x07<<0)
  404. #define MAX98926_ER_VMONOVFL_MAP_SHIFT 0
  405. #define MAX98926_ER_VMONOVFL_MAP_WIDTH 3
  406. /* MAX98926_R017_MAP6 */
  407. #define MAX98926_ER_VBSTOVFL_EN_MASK (1<<7)
  408. #define MAX98926_ER_VBSTOVFL_EN_SHIFT 7
  409. #define MAX98926_ER_VBSTOVFL_EN_WIDTH 1
  410. #define MAX98926_ER_VBSTOVFL_MAP_MASK (0x07<<4)
  411. #define MAX98926_ER_VBSTOVFL_MAP_SHIFT 4
  412. #define MAX98926_ER_VBSTOVFL_MAP_WIDTH 3
  413. #define MAX98926_ER_VBATOVFL_EN_MASK (1<<3)
  414. #define MAX98926_ER_VBATOVFL_EN_SHIFT 3
  415. #define MAX98926_ER_VBATOVFL_EN_WIDTH 1
  416. #define MAX98926_ER_VBATOVFL_MAP_MASK (0x07<<0)
  417. #define MAX98926_ER_VBATOVFL_MAP_SHIFT 0
  418. #define MAX98926_ER_VBATOVFL_MAP_WIDTH 3
  419. /* MAX98926_R018_MAP7 */
  420. #define MAX98926_ER_INVALSLOT_EN_MASK (1<<7)
  421. #define MAX98926_ER_INVALSLOT_EN_SHIFT 7
  422. #define MAX98926_ER_INVALSLOT_EN_WIDTH 1
  423. #define MAX98926_ER_INVALSLOT_MAP_MASK (0x07<<4)
  424. #define MAX98926_ER_INVALSLOT_MAP_SHIFT 4
  425. #define MAX98926_ER_INVALSLOT_MAP_WIDTH 3
  426. #define MAX98926_ER_SLOTCNFLT_EN_MASK (1<<3)
  427. #define MAX98926_ER_SLOTCNFLT_EN_SHIFT 3
  428. #define MAX98926_ER_SLOTCNFLT_EN_WIDTH 1
  429. #define MAX98926_ER_SLOTCNFLT_MAP_MASK (0x07<<0)
  430. #define MAX98926_ER_SLOTCNFLT_MAP_SHIFT 0
  431. #define MAX98926_ER_SLOTCNFLT_MAP_WIDTH 3
  432. /* MAX98926_R019_MAP8 */
  433. #define MAX98926_ER_SLOTOVRN_EN_MASK (1<<3)
  434. #define MAX98926_ER_SLOTOVRN_EN_SHIFT 3
  435. #define MAX98926_ER_SLOTOVRN_EN_WIDTH 1
  436. #define MAX98926_ER_SLOTOVRN_MAP_MASK (0x07<<0)
  437. #define MAX98926_ER_SLOTOVRN_MAP_SHIFT 0
  438. #define MAX98926_ER_SLOTOVRN_MAP_WIDTH 3
  439. /* MAX98926_R01A_DAI_CLK_MODE1 */
  440. #define MAX98926_DAI_CLK_SOURCE_MASK (1<<6)
  441. #define MAX98926_DAI_CLK_SOURCE_SHIFT 6
  442. #define MAX98926_DAI_CLK_SOURCE_WIDTH 1
  443. #define MAX98926_MDLL_MULT_MASK (0x0F<<0)
  444. #define MAX98926_MDLL_MULT_SHIFT 0
  445. #define MAX98926_MDLL_MULT_WIDTH 4
  446. #define MAX98926_MDLL_MULT_MCLKx8 6
  447. #define MAX98926_MDLL_MULT_MCLKx16 8
  448. /* MAX98926_R01B_DAI_CLK_MODE2 */
  449. #define MAX98926_DAI_SR_MASK (0x0F<<4)
  450. #define MAX98926_DAI_SR_SHIFT 4
  451. #define MAX98926_DAI_SR_WIDTH 4
  452. #define MAX98926_DAI_MAS_MASK (1<<3)
  453. #define MAX98926_DAI_MAS_SHIFT 3
  454. #define MAX98926_DAI_MAS_WIDTH 1
  455. #define MAX98926_DAI_BSEL_MASK (0x07<<0)
  456. #define MAX98926_DAI_BSEL_SHIFT 0
  457. #define MAX98926_DAI_BSEL_WIDTH 3
  458. #define MAX98926_DAI_BSEL_32 (0 << MAX98926_DAI_BSEL_SHIFT)
  459. #define MAX98926_DAI_BSEL_48 (1 << MAX98926_DAI_BSEL_SHIFT)
  460. #define MAX98926_DAI_BSEL_64 (2 << MAX98926_DAI_BSEL_SHIFT)
  461. #define MAX98926_DAI_BSEL_256 (6 << MAX98926_DAI_BSEL_SHIFT)
  462. /* MAX98926_R01C_DAI_CLK_DIV_M_MSBS */
  463. #define MAX98926_DAI_M_MSBS_MASK (0xFF<<0)
  464. #define MAX98926_DAI_M_MSBS_SHIFT 0
  465. #define MAX98926_DAI_M_MSBS_WIDTH 8
  466. /* MAX98926_R01D_DAI_CLK_DIV_M_LSBS */
  467. #define MAX98926_DAI_M_LSBS_MASK (0xFF<<0)
  468. #define MAX98926_DAI_M_LSBS_SHIFT 0
  469. #define MAX98926_DAI_M_LSBS_WIDTH 8
  470. /* MAX98926_R01E_DAI_CLK_DIV_N_MSBS */
  471. #define MAX98926_DAI_N_MSBS_MASK (0x7F<<0)
  472. #define MAX98926_DAI_N_MSBS_SHIFT 0
  473. #define MAX98926_DAI_N_MSBS_WIDTH 7
  474. /* MAX98926_R01F_DAI_CLK_DIV_N_LSBS */
  475. #define MAX98926_DAI_N_LSBS_MASK (0xFF<<0)
  476. #define MAX98926_DAI_N_LSBS_SHIFT 0
  477. #define MAX98926_DAI_N_LSBS_WIDTH 8
  478. /* MAX98926_R020_FORMAT */
  479. #define MAX98926_DAI_CHANSZ_MASK (0x03<<6)
  480. #define MAX98926_DAI_CHANSZ_SHIFT 6
  481. #define MAX98926_DAI_CHANSZ_WIDTH 2
  482. #define MAX98926_DAI_INTERLEAVE_MASK (1<<5)
  483. #define MAX98926_DAI_INTERLEAVE_SHIFT 5
  484. #define MAX98926_DAI_INTERLEAVE_WIDTH 1
  485. #define MAX98926_DAI_EXTBCLK_HIZ_MASK (1<<4)
  486. #define MAX98926_DAI_EXTBCLK_HIZ_SHIFT 4
  487. #define MAX98926_DAI_EXTBCLK_HIZ_WIDTH 1
  488. #define MAX98926_DAI_WCI_MASK (1<<3)
  489. #define MAX98926_DAI_WCI_SHIFT 3
  490. #define MAX98926_DAI_WCI_WIDTH 1
  491. #define MAX98926_DAI_BCI_MASK (1<<2)
  492. #define MAX98926_DAI_BCI_SHIFT 2
  493. #define MAX98926_DAI_BCI_WIDTH 1
  494. #define MAX98926_DAI_DLY_MASK (1<<1)
  495. #define MAX98926_DAI_DLY_SHIFT 1
  496. #define MAX98926_DAI_DLY_WIDTH 1
  497. #define MAX98926_DAI_TDM_MASK (1<<0)
  498. #define MAX98926_DAI_TDM_SHIFT 0
  499. #define MAX98926_DAI_TDM_WIDTH 1
  500. #define MAX98926_DAI_CHANSZ_16 (1 << MAX98926_DAI_CHANSZ_SHIFT)
  501. #define MAX98926_DAI_CHANSZ_24 (2 << MAX98926_DAI_CHANSZ_SHIFT)
  502. #define MAX98926_DAI_CHANSZ_32 (3 << MAX98926_DAI_CHANSZ_SHIFT)
  503. /* MAX98926_R021_TDM_SLOT_SELECT */
  504. #define MAX98926_DAI_DO_EN_MASK (1<<7)
  505. #define MAX98926_DAI_DO_EN_SHIFT 7
  506. #define MAX98926_DAI_DO_EN_WIDTH 1
  507. #define MAX98926_DAI_DIN_EN_MASK (1<<6)
  508. #define MAX98926_DAI_DIN_EN_SHIFT 6
  509. #define MAX98926_DAI_DIN_EN_WIDTH 1
  510. #define MAX98926_DAI_INR_SOURCE_MASK (0x07<<3)
  511. #define MAX98926_DAI_INR_SOURCE_SHIFT 3
  512. #define MAX98926_DAI_INR_SOURCE_WIDTH 3
  513. #define MAX98926_DAI_INL_SOURCE_MASK (0x07<<0)
  514. #define MAX98926_DAI_INL_SOURCE_SHIFT 0
  515. #define MAX98926_DAI_INL_SOURCE_WIDTH 3
  516. /* MAX98926_R022_DOUT_CFG_VMON */
  517. #define MAX98926_DAI_VMON_EN_MASK (1<<5)
  518. #define MAX98926_DAI_VMON_EN_SHIFT 5
  519. #define MAX98926_DAI_VMON_EN_WIDTH 1
  520. #define MAX98926_DAI_VMON_SLOT_MASK (0x1F<<0)
  521. #define MAX98926_DAI_VMON_SLOT_SHIFT 0
  522. #define MAX98926_DAI_VMON_SLOT_WIDTH 5
  523. #define MAX98926_DAI_VMON_SLOT_00_01 (0 << MAX98926_DAI_VMON_SLOT_SHIFT)
  524. #define MAX98926_DAI_VMON_SLOT_01_02 (1 << MAX98926_DAI_VMON_SLOT_SHIFT)
  525. #define MAX98926_DAI_VMON_SLOT_02_03 (2 << MAX98926_DAI_VMON_SLOT_SHIFT)
  526. #define MAX98926_DAI_VMON_SLOT_03_04 (3 << MAX98926_DAI_VMON_SLOT_SHIFT)
  527. #define MAX98926_DAI_VMON_SLOT_04_05 (4 << MAX98926_DAI_VMON_SLOT_SHIFT)
  528. #define MAX98926_DAI_VMON_SLOT_05_06 (5 << MAX98926_DAI_VMON_SLOT_SHIFT)
  529. #define MAX98926_DAI_VMON_SLOT_06_07 (6 << MAX98926_DAI_VMON_SLOT_SHIFT)
  530. #define MAX98926_DAI_VMON_SLOT_07_08 (7 << MAX98926_DAI_VMON_SLOT_SHIFT)
  531. #define MAX98926_DAI_VMON_SLOT_08_09 (8 << MAX98926_DAI_VMON_SLOT_SHIFT)
  532. #define MAX98926_DAI_VMON_SLOT_09_0A (9 << MAX98926_DAI_VMON_SLOT_SHIFT)
  533. #define MAX98926_DAI_VMON_SLOT_0A_0B (10 << MAX98926_DAI_VMON_SLOT_SHIFT)
  534. #define MAX98926_DAI_VMON_SLOT_0B_0C (11 << MAX98926_DAI_VMON_SLOT_SHIFT)
  535. #define MAX98926_DAI_VMON_SLOT_0C_0D (12 << MAX98926_DAI_VMON_SLOT_SHIFT)
  536. #define MAX98926_DAI_VMON_SLOT_0D_0E (13 << MAX98926_DAI_VMON_SLOT_SHIFT)
  537. #define MAX98926_DAI_VMON_SLOT_0E_0F (14 << MAX98926_DAI_VMON_SLOT_SHIFT)
  538. #define MAX98926_DAI_VMON_SLOT_0F_10 (15 << MAX98926_DAI_VMON_SLOT_SHIFT)
  539. #define MAX98926_DAI_VMON_SLOT_10_11 (16 << MAX98926_DAI_VMON_SLOT_SHIFT)
  540. #define MAX98926_DAI_VMON_SLOT_11_12 (17 << MAX98926_DAI_VMON_SLOT_SHIFT)
  541. #define MAX98926_DAI_VMON_SLOT_12_13 (18 << MAX98926_DAI_VMON_SLOT_SHIFT)
  542. #define MAX98926_DAI_VMON_SLOT_13_14 (19 << MAX98926_DAI_VMON_SLOT_SHIFT)
  543. #define MAX98926_DAI_VMON_SLOT_14_15 (20 << MAX98926_DAI_VMON_SLOT_SHIFT)
  544. #define MAX98926_DAI_VMON_SLOT_15_16 (21 << MAX98926_DAI_VMON_SLOT_SHIFT)
  545. #define MAX98926_DAI_VMON_SLOT_16_17 (22 << MAX98926_DAI_VMON_SLOT_SHIFT)
  546. #define MAX98926_DAI_VMON_SLOT_17_18 (23 << MAX98926_DAI_VMON_SLOT_SHIFT)
  547. #define MAX98926_DAI_VMON_SLOT_18_19 (24 << MAX98926_DAI_VMON_SLOT_SHIFT)
  548. #define MAX98926_DAI_VMON_SLOT_19_1A (25 << MAX98926_DAI_VMON_SLOT_SHIFT)
  549. #define MAX98926_DAI_VMON_SLOT_1A_1B (26 << MAX98926_DAI_VMON_SLOT_SHIFT)
  550. #define MAX98926_DAI_VMON_SLOT_1B_1C (27 << MAX98926_DAI_VMON_SLOT_SHIFT)
  551. #define MAX98926_DAI_VMON_SLOT_1C_1D (28 << MAX98926_DAI_VMON_SLOT_SHIFT)
  552. #define MAX98926_DAI_VMON_SLOT_1D_1E (29 << MAX98926_DAI_VMON_SLOT_SHIFT)
  553. #define MAX98926_DAI_VMON_SLOT_1E_1F (30 << MAX98926_DAI_VMON_SLOT_SHIFT)
  554. /* MAX98926_R023_DOUT_CFG_IMON */
  555. #define MAX98926_DAI_IMON_EN_MASK (1<<5)
  556. #define MAX98926_DAI_IMON_EN_SHIFT 5
  557. #define MAX98926_DAI_IMON_EN_WIDTH 1
  558. #define MAX98926_DAI_IMON_SLOT_MASK (0x1F<<0)
  559. #define MAX98926_DAI_IMON_SLOT_SHIFT 0
  560. #define MAX98926_DAI_IMON_SLOT_WIDTH 5
  561. #define MAX98926_DAI_IMON_SLOT_00_01 (0 << MAX98926_DAI_IMON_SLOT_SHIFT)
  562. #define MAX98926_DAI_IMON_SLOT_01_02 (1 << MAX98926_DAI_IMON_SLOT_SHIFT)
  563. #define MAX98926_DAI_IMON_SLOT_02_03 (2 << MAX98926_DAI_IMON_SLOT_SHIFT)
  564. #define MAX98926_DAI_IMON_SLOT_03_04 (3 << MAX98926_DAI_IMON_SLOT_SHIFT)
  565. #define MAX98926_DAI_IMON_SLOT_04_05 (4 << MAX98926_DAI_IMON_SLOT_SHIFT)
  566. #define MAX98926_DAI_IMON_SLOT_05_06 (5 << MAX98926_DAI_IMON_SLOT_SHIFT)
  567. #define MAX98926_DAI_IMON_SLOT_06_07 (6 << MAX98926_DAI_IMON_SLOT_SHIFT)
  568. #define MAX98926_DAI_IMON_SLOT_07_08 (7 << MAX98926_DAI_IMON_SLOT_SHIFT)
  569. #define MAX98926_DAI_IMON_SLOT_08_09 (8 << MAX98926_DAI_IMON_SLOT_SHIFT)
  570. #define MAX98926_DAI_IMON_SLOT_09_0A (9 << MAX98926_DAI_IMON_SLOT_SHIFT)
  571. #define MAX98926_DAI_IMON_SLOT_0A_0B (10 << MAX98926_DAI_IMON_SLOT_SHIFT)
  572. #define MAX98926_DAI_IMON_SLOT_0B_0C (11 << MAX98926_DAI_IMON_SLOT_SHIFT)
  573. #define MAX98926_DAI_IMON_SLOT_0C_0D (12 << MAX98926_DAI_IMON_SLOT_SHIFT)
  574. #define MAX98926_DAI_IMON_SLOT_0D_0E (13 << MAX98926_DAI_IMON_SLOT_SHIFT)
  575. #define MAX98926_DAI_IMON_SLOT_0E_0F (14 << MAX98926_DAI_IMON_SLOT_SHIFT)
  576. #define MAX98926_DAI_IMON_SLOT_0F_10 (15 << MAX98926_DAI_IMON_SLOT_SHIFT)
  577. #define MAX98926_DAI_IMON_SLOT_10_11 (16 << MAX98926_DAI_IMON_SLOT_SHIFT)
  578. #define MAX98926_DAI_IMON_SLOT_11_12 (17 << MAX98926_DAI_IMON_SLOT_SHIFT)
  579. #define MAX98926_DAI_IMON_SLOT_12_13 (18 << MAX98926_DAI_IMON_SLOT_SHIFT)
  580. #define MAX98926_DAI_IMON_SLOT_13_14 (19 << MAX98926_DAI_IMON_SLOT_SHIFT)
  581. #define MAX98926_DAI_IMON_SLOT_14_15 (20 << MAX98926_DAI_IMON_SLOT_SHIFT)
  582. #define MAX98926_DAI_IMON_SLOT_15_16 (21 << MAX98926_DAI_IMON_SLOT_SHIFT)
  583. #define MAX98926_DAI_IMON_SLOT_16_17 (22 << MAX98926_DAI_IMON_SLOT_SHIFT)
  584. #define MAX98926_DAI_IMON_SLOT_17_18 (23 << MAX98926_DAI_IMON_SLOT_SHIFT)
  585. #define MAX98926_DAI_IMON_SLOT_18_19 (24 << MAX98926_DAI_IMON_SLOT_SHIFT)
  586. #define MAX98926_DAI_IMON_SLOT_19_1A (25 << MAX98926_DAI_IMON_SLOT_SHIFT)
  587. #define MAX98926_DAI_IMON_SLOT_1A_1B (26 << MAX98926_DAI_IMON_SLOT_SHIFT)
  588. #define MAX98926_DAI_IMON_SLOT_1B_1C (27 << MAX98926_DAI_IMON_SLOT_SHIFT)
  589. #define MAX98926_DAI_IMON_SLOT_1C_1D (28 << MAX98926_DAI_IMON_SLOT_SHIFT)
  590. #define MAX98926_DAI_IMON_SLOT_1D_1E (29 << MAX98926_DAI_IMON_SLOT_SHIFT)
  591. #define MAX98926_DAI_IMON_SLOT_1E_1F (30 << MAX98926_DAI_IMON_SLOT_SHIFT)
  592. /* MAX98926_R024_DOUT_CFG_VBAT */
  593. #define MAX98926_DAI_INTERLEAVE_SLOT_MASK (0x1F<<0)
  594. #define MAX98926_DAI_INTERLEAVE_SLOT_SHIFT 0
  595. #define MAX98926_DAI_INTERLEAVE_SLOT_WIDTH 5
  596. /* MAX98926_R025_DOUT_CFG_VBST */
  597. #define MAX98926_DAI_VBST_EN_MASK (1<<5)
  598. #define MAX98926_DAI_VBST_EN_SHIFT 5
  599. #define MAX98926_DAI_VBST_EN_WIDTH 1
  600. #define MAX98926_DAI_VBST_SLOT_MASK (0x1F<<0)
  601. #define MAX98926_DAI_VBST_SLOT_SHIFT 0
  602. #define MAX98926_DAI_VBST_SLOT_WIDTH 5
  603. /* MAX98926_R026_DOUT_CFG_FLAG */
  604. #define MAX98926_DAI_FLAG_EN_MASK (1<<5)
  605. #define MAX98926_DAI_FLAG_EN_SHIFT 5
  606. #define MAX98926_DAI_FLAG_EN_WIDTH 1
  607. #define MAX98926_DAI_FLAG_SLOT_MASK (0x1F<<0)
  608. #define MAX98926_DAI_FLAG_SLOT_SHIFT 0
  609. #define MAX98926_DAI_FLAG_SLOT_WIDTH 5
  610. /* MAX98926_R027_DOUT_HIZ_CFG1 */
  611. #define MAX98926_DAI_SLOT_HIZ_CFG1_MASK (0xFF<<0)
  612. #define MAX98926_DAI_SLOT_HIZ_CFG1_SHIFT 0
  613. #define MAX98926_DAI_SLOT_HIZ_CFG1_WIDTH 8
  614. /* MAX98926_R028_DOUT_HIZ_CFG2 */
  615. #define MAX98926_DAI_SLOT_HIZ_CFG2_MASK (0xFF<<0)
  616. #define MAX98926_DAI_SLOT_HIZ_CFG2_SHIFT 0
  617. #define MAX98926_DAI_SLOT_HIZ_CFG2_WIDTH 8
  618. /* MAX98926_R029_DOUT_HIZ_CFG3 */
  619. #define MAX98926_DAI_SLOT_HIZ_CFG3_MASK (0xFF<<0)
  620. #define MAX98926_DAI_SLOT_HIZ_CFG3_SHIFT 0
  621. #define MAX98926_DAI_SLOT_HIZ_CFG3_WIDTH 8
  622. /* MAX98926_R02A_DOUT_HIZ_CFG4 */
  623. #define MAX98926_DAI_SLOT_HIZ_CFG4_MASK (0xFF<<0)
  624. #define MAX98926_DAI_SLOT_HIZ_CFG4_SHIFT 0
  625. #define MAX98926_DAI_SLOT_HIZ_CFG4_WIDTH 8
  626. /* MAX98926_R02B_DOUT_DRV_STRENGTH */
  627. #define MAX98926_DAI_OUT_DRIVE_MASK (0x03<<0)
  628. #define MAX98926_DAI_OUT_DRIVE_SHIFT 0
  629. #define MAX98926_DAI_OUT_DRIVE_WIDTH 2
  630. /* MAX98926_R02C_FILTERS */
  631. #define MAX98926_ADC_DITHER_EN_MASK (1<<7)
  632. #define MAX98926_ADC_DITHER_EN_SHIFT 7
  633. #define MAX98926_ADC_DITHER_EN_WIDTH 1
  634. #define MAX98926_IV_DCB_EN_MASK (1<<6)
  635. #define MAX98926_IV_DCB_EN_SHIFT 6
  636. #define MAX98926_IV_DCB_EN_WIDTH 1
  637. #define MAX98926_DAC_DITHER_EN_MASK (1<<4)
  638. #define MAX98926_DAC_DITHER_EN_SHIFT 4
  639. #define MAX98926_DAC_DITHER_EN_WIDTH 1
  640. #define MAX98926_DAC_FILTER_MODE_MASK (1<<3)
  641. #define MAX98926_DAC_FILTER_MODE_SHIFT 3
  642. #define MAX98926_DAC_FILTER_MODE_WIDTH 1
  643. #define MAX98926_DAC_HPF_MASK (0x07<<0)
  644. #define MAX98926_DAC_HPF_SHIFT 0
  645. #define MAX98926_DAC_HPF_WIDTH 3
  646. #define MAX98926_DAC_HPF_DISABLE (0 << MAX98926_DAC_HPF_SHIFT)
  647. #define MAX98926_DAC_HPF_DC_BLOCK (1 << MAX98926_DAC_HPF_SHIFT)
  648. #define MAX98926_DAC_HPF_EN_100 (2 << MAX98926_DAC_HPF_SHIFT)
  649. #define MAX98926_DAC_HPF_EN_200 (3 << MAX98926_DAC_HPF_SHIFT)
  650. #define MAX98926_DAC_HPF_EN_400 (4 << MAX98926_DAC_HPF_SHIFT)
  651. #define MAX98926_DAC_HPF_EN_800 (5 << MAX98926_DAC_HPF_SHIFT)
  652. /* MAX98926_R02D_GAIN */
  653. #define MAX98926_DAC_IN_SEL_MASK (0x03<<5)
  654. #define MAX98926_DAC_IN_SEL_SHIFT 5
  655. #define MAX98926_DAC_IN_SEL_WIDTH 2
  656. #define MAX98926_SPK_GAIN_MASK (0x1F<<0)
  657. #define MAX98926_SPK_GAIN_SHIFT 0
  658. #define MAX98926_SPK_GAIN_WIDTH 5
  659. #define MAX98926_DAC_IN_SEL_LEFT_DAI (0 << MAX98926_DAC_IN_SEL_SHIFT)
  660. #define MAX98926_DAC_IN_SEL_RIGHT_DAI (1 << MAX98926_DAC_IN_SEL_SHIFT)
  661. #define MAX98926_DAC_IN_SEL_SUMMED_DAI (2 << MAX98926_DAC_IN_SEL_SHIFT)
  662. #define MAX98926_DAC_IN_SEL_DIV2_SUMMED_DAI (3 << MAX98926_DAC_IN_SEL_SHIFT)
  663. /* MAX98926_R02E_GAIN_RAMPING */
  664. #define MAX98926_SPK_RMP_EN_MASK (1<<1)
  665. #define MAX98926_SPK_RMP_EN_SHIFT 1
  666. #define MAX98926_SPK_RMP_EN_WIDTH 1
  667. #define MAX98926_SPK_ZCD_EN_MASK (1<<0)
  668. #define MAX98926_SPK_ZCD_EN_SHIFT 0
  669. #define MAX98926_SPK_ZCD_EN_WIDTH 1
  670. /* MAX98926_R02F_SPK_AMP */
  671. #define MAX98926_SPK_MODE_MASK (1<<0)
  672. #define MAX98926_SPK_MODE_SHIFT 0
  673. #define MAX98926_SPK_MODE_WIDTH 1
  674. #define MAX98926_INSELECT_MODE_MASK (1<<1)
  675. #define MAX98926_INSELECT_MODE_SHIFT 1
  676. #define MAX98926_INSELECT_MODE_WIDTH 1
  677. /* MAX98926_R030_THRESHOLD */
  678. #define MAX98926_ALC_EN_MASK (1<<5)
  679. #define MAX98926_ALC_EN_SHIFT 5
  680. #define MAX98926_ALC_EN_WIDTH 1
  681. #define MAX98926_ALC_TH_MASK (0x1F<<0)
  682. #define MAX98926_ALC_TH_SHIFT 0
  683. #define MAX98926_ALC_TH_WIDTH 5
  684. /* MAX98926_R031_ALC_ATTACK */
  685. #define MAX98926_ALC_ATK_STEP_MASK (0x0F<<4)
  686. #define MAX98926_ALC_ATK_STEP_SHIFT 4
  687. #define MAX98926_ALC_ATK_STEP_WIDTH 4
  688. #define MAX98926_ALC_ATK_RATE_MASK (0x7<<0)
  689. #define MAX98926_ALC_ATK_RATE_SHIFT 0
  690. #define MAX98926_ALC_ATK_RATE_WIDTH 3
  691. /* MAX98926_R032_ALC_ATTEN_RLS */
  692. #define MAX98926_ALC_MAX_ATTEN_MASK (0x0F<<4)
  693. #define MAX98926_ALC_MAX_ATTEN_SHIFT 4
  694. #define MAX98926_ALC_MAX_ATTEN_WIDTH 4
  695. #define MAX98926_ALC_RLS_RATE_MASK (0x7<<0)
  696. #define MAX98926_ALC_RLS_RATE_SHIFT 0
  697. #define MAX98926_ALC_RLS_RATE_WIDTH 3
  698. /* MAX98926_R033_ALC_HOLD_RLS */
  699. #define MAX98926_ALC_RLS_TGR_MASK (1<<0)
  700. #define MAX98926_ALC_RLS_TGR_SHIFT 0
  701. #define MAX98926_ALC_RLS_TGR_WIDTH 1
  702. /* MAX98926_R034_ALC_CONFIGURATION */
  703. #define MAX98926_ALC_MUTE_EN_MASK (1<<7)
  704. #define MAX98926_ALC_MUTE_EN_SHIFT 7
  705. #define MAX98926_ALC_MUTE_EN_WIDTH 1
  706. #define MAX98926_ALC_MUTE_DLY_MASK (0x07<<4)
  707. #define MAX98926_ALC_MUTE_DLY_SHIFT 4
  708. #define MAX98926_ALC_MUTE_DLY_WIDTH 3
  709. #define MAX98926_ALC_RLS_DBT_MASK (0x07<<0)
  710. #define MAX98926_ALC_RLS_DBT_SHIFT 0
  711. #define MAX98926_ALC_RLS_DBT_WIDTH 3
  712. /* MAX98926_R035_BOOST_CONVERTER */
  713. #define MAX98926_BST_SYNC_MASK (1<<7)
  714. #define MAX98926_BST_SYNC_SHIFT 7
  715. #define MAX98926_BST_SYNC_WIDTH 1
  716. #define MAX98926_BST_PHASE_MASK (0x03<<4)
  717. #define MAX98926_BST_PHASE_SHIFT 4
  718. #define MAX98926_BST_PHASE_WIDTH 2
  719. #define MAX98926_BST_SKIP_MODE_MASK (0x03<<0)
  720. #define MAX98926_BST_SKIP_MODE_SHIFT 0
  721. #define MAX98926_BST_SKIP_MODE_WIDTH 2
  722. /* MAX98926_R036_BLOCK_ENABLE */
  723. #define MAX98926_BST_EN_MASK (1<<7)
  724. #define MAX98926_BST_EN_SHIFT 7
  725. #define MAX98926_BST_EN_WIDTH 1
  726. #define MAX98926_WATCH_EN_MASK (1<<6)
  727. #define MAX98926_WATCH_EN_SHIFT 6
  728. #define MAX98926_WATCH_EN_WIDTH 1
  729. #define MAX98926_CLKMON_EN_MASK (1<<5)
  730. #define MAX98926_CLKMON_EN_SHIFT 5
  731. #define MAX98926_CLKMON_EN_WIDTH 1
  732. #define MAX98926_SPK_EN_MASK (1<<4)
  733. #define MAX98926_SPK_EN_SHIFT 4
  734. #define MAX98926_SPK_EN_WIDTH 1
  735. #define MAX98926_ADC_VBST_EN_MASK (1<<3)
  736. #define MAX98926_ADC_VBST_EN_SHIFT 3
  737. #define MAX98926_ADC_VBST_EN_WIDTH 1
  738. #define MAX98926_ADC_VBAT_EN_MASK (1<<2)
  739. #define MAX98926_ADC_VBAT_EN_SHIFT 2
  740. #define MAX98926_ADC_VBAT_EN_WIDTH 1
  741. #define MAX98926_ADC_IMON_EN_MASK (1<<1)
  742. #define MAX98926_ADC_IMON_EN_SHIFT 1
  743. #define MAX98926_ADC_IMON_EN_WIDTH 1
  744. #define MAX98926_ADC_VMON_EN_MASK (1<<0)
  745. #define MAX98926_ADC_VMON_EN_SHIFT 0
  746. #define MAX98926_ADC_VMON_EN_WIDTH 1
  747. /* MAX98926_R037_CONFIGURATION */
  748. #define MAX98926_BST_VOUT_MASK (0x0F<<4)
  749. #define MAX98926_BST_VOUT_SHIFT 4
  750. #define MAX98926_BST_VOUT_WIDTH 4
  751. #define MAX98926_THERMWARN_LEVEL_MASK (0x03<<2)
  752. #define MAX98926_THERMWARN_LEVEL_SHIFT 2
  753. #define MAX98926_THERMWARN_LEVEL_WIDTH 2
  754. #define MAX98926_WATCH_TIME_MASK (0x03<<0)
  755. #define MAX98926_WATCH_TIME_SHIFT 0
  756. #define MAX98926_WATCH_TIME_WIDTH 2
  757. /* MAX98926_R038_GLOBAL_ENABLE */
  758. #define MAX98926_EN_MASK (1<<7)
  759. #define MAX98926_EN_SHIFT 7
  760. #define MAX98926_EN_WIDTH 1
  761. /* MAX98926_R03A_BOOST_LIMITER */
  762. #define MAX98926_BST_ILIM_MASK (0xF<<4)
  763. #define MAX98926_BST_ILIM_SHIFT 4
  764. #define MAX98926_BST_ILIM_WIDTH 4
  765. /* MAX98926_R0FF_VERSION */
  766. #define MAX98926_REV_ID_MASK (0xFF<<0)
  767. #define MAX98926_REV_ID_SHIFT 0
  768. #define MAX98926_REV_ID_WIDTH 8
  769. struct max98926_priv {
  770. struct regmap *regmap;
  771. struct snd_soc_codec *codec;
  772. unsigned int sysclk;
  773. unsigned int v_slot;
  774. unsigned int i_slot;
  775. unsigned int ch_size;
  776. unsigned int interleave_mode;
  777. };
  778. #endif