max98506.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. /*
  2. * max98506.h -- MAX98506 ALSA SoC Audio driver
  3. *
  4. * Copyright 2013-2015 Maxim Integrated Products
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef _MAX98506_H
  11. #define _MAX98506_H
  12. #ifdef CONFIG_SND_SOC_MAXIM_DSM
  13. #include <sound/maxim_dsm.h>
  14. #endif /* CONFIG_SND_SOC_MAXIM_DSM */
  15. /*
  16. * The version of max98506
  17. */
  18. #define MAX98506_VERSION 0x51
  19. #define MAX98506_VERSION1 0x80
  20. #define MAX98506_VERSION2 0x8A
  21. #define MAX98506_VERSION3 0x8B
  22. #define MAX98506_VERSION4 0x40
  23. #define MAX98506_VERSION5 0x50
  24. /*
  25. * Driver revision
  26. */
  27. #define MAX98506_REVISION "0.00.0010"
  28. /*
  29. * MAX98506 Register Definitions
  30. */
  31. #define MAX98506_R002_LIVE_STATUS0 0x02
  32. #define MAX98506_R003_LIVE_STATUS1 0x03
  33. #define MAX98506_R004_LIVE_STATUS2 0x04
  34. #define MAX98506_R005_STATE0 0x05
  35. #define MAX98506_R006_STATE1 0x06
  36. #define MAX98506_R007_STATE2 0x07
  37. #define MAX98506_R008_FLAG0 0x08
  38. #define MAX98506_R009_FLAG1 0x09
  39. #define MAX98506_R00A_FLAG2 0x0A
  40. #define MAX98506_R00B_IRQ_ENABLE0 0x0B
  41. #define MAX98506_R00C_IRQ_ENABLE1 0x0C
  42. #define MAX98506_R00D_IRQ_ENABLE2 0x0D
  43. #define MAX98506_R00E_IRQ_CLEAR0 0x0E
  44. #define MAX98506_R00F_IRQ_CLEAR1 0x0F
  45. #define MAX98506_R010_IRQ_CLEAR2 0x10
  46. #define MAX98506_R01A_DAI_CLK_MODE1 0x1A
  47. #define MAX98506_R01B_DAI_CLK_MODE2 0x1B
  48. #define MAX98506_R01F_DAI_CLK_DIV_N_LSBS 0x1F
  49. #define MAX98506_R020_FORMAT 0x20
  50. #define MAX98506_R021_TDM_SLOT_SELECT 0x21
  51. #define MAX98506_R022_DOUT_CFG_VMON 0x22
  52. #define MAX98506_R023_DOUT_CFG_IMON 0x23
  53. #define MAX98506_R024_DAI_INT_CFG 0x24
  54. #define MAX98506_R026_DOUT_CFG_FLAG 0x26
  55. #define MAX98506_R027_DOUT_HIZ_CFG1 0x27
  56. #define MAX98506_R028_DOUT_HIZ_CFG2 0x28
  57. #define MAX98506_R029_DOUT_HIZ_CFG3 0x29
  58. #define MAX98506_R02A_DOUT_HIZ_CFG4 0x2A
  59. #define MAX98506_R02B_DOUT_DRV_STRENGTH 0x2B
  60. #define MAX98506_R02C_FILTERS 0x2C
  61. #define MAX98506_R02D_GAIN 0x2D
  62. #define MAX98506_R02E_GAIN_RAMPING 0x2E
  63. #define MAX98506_R02F_SPK_AMP 0x2F
  64. #define MAX98506_R030_THRESHOLD 0x30
  65. #define MAX98506_R031_ALC_ATTACK 0x31
  66. #define MAX98506_R032_ALC_ATTEN_RLS 0x32
  67. #define MAX98506_R033_ALC_HOLD_RLS 0x33
  68. #define MAX98506_R034_ALC_CONFIGURATION 0x34
  69. #define MAX98506_R035_BOOST_CONVERTER 0x35
  70. #define MAX98506_R036_BLOCK_ENABLE 0x36
  71. #define MAX98506_R037_CONFIGURATION 0x37
  72. #define MAX98506_R038_GLOBAL_ENABLE 0x38
  73. #define MAX98506_R03A_BOOST_LIMITER 0x3A
  74. #define MAX98506_R0FF_VERSION 0xFF
  75. #define MAX98506_REG_CNT (MAX98506_R03A_BOOST_LIMITER+1)
  76. /* MAX98506 Register Bit Fields */
  77. /* MAX98506_R002_LIVE_STATUS0 */
  78. #define MAX98506_THERMWARN_STATUS_MASK (1<<3)
  79. #define MAX98506_THERMWARN_STATUS_SHIFT 3
  80. #define MAX98506_THERMWARN_STATUS_WIDTH 1
  81. #define MAX98506_THERMSHDN_STATUS_MASK (1<<1)
  82. #define MAX98506_THERMSHDN_STATUS_SHIFT 1
  83. #define MAX98506_THERMSHDN_STATUS_WIDTH 1
  84. /* MAX98506_R003_LIVE_STATUS1 */
  85. #define MAX98506_SPKCURNT_STATUS_MASK (1<<5)
  86. #define MAX98506_SPKCURNT_STATUS_SHIFT 5
  87. #define MAX98506_SPKCURNT_STATUS_WIDTH 1
  88. #define MAX98506_WATCHFAIL_STATUS_MASK (1<<4)
  89. #define MAX98506_WATCHFAIL_STATUS_SHIFT 4
  90. #define MAX98506_WATCHFAIL_STATUS_WIDTH 1
  91. #define MAX98506_ALCINFH_STATUS_MASK (1<<3)
  92. #define MAX98506_ALCINFH_STATUS_SHIFT 3
  93. #define MAX98506_ALCINFH_STATUS_WIDTH 1
  94. #define MAX98506_ALCACT_STATUS_MASK (1<<2)
  95. #define MAX98506_ALCACT_STATUS_SHIFT 2
  96. #define MAX98506_ALCACT_STATUS_WIDTH 1
  97. #define MAX98506_ALCMUT_STATUS_MASK (1<<1)
  98. #define MAX98506_ALCMUT_STATUS_SHIFT 1
  99. #define MAX98506_ALCMUT_STATUS_WIDTH 1
  100. #define MAX98506_ACLP_STATUS_MASK (1<<0)
  101. #define MAX98506_ACLP_STATUS_SHIFT 0
  102. #define MAX98506_ACLP_STATUS_WIDTH 1
  103. /* MAX98506_R004_LIVE_STATUS2 */
  104. #define MAX98506_SLOTOVRN_STATUS_MASK (1<<6)
  105. #define MAX98506_SLOTOVRN_STATUS_SHIFT 6
  106. #define MAX98506_SLOTOVRN_STATUS_WIDTH 1
  107. #define MAX98506_INVALSLOT_STATUS_MASK (1<<5)
  108. #define MAX98506_INVALSLOT_STATUS_SHIFT 5
  109. #define MAX98506_INVALSLOT_STATUS_WIDTH 1
  110. #define MAX98506_SLOTCNFLT_STATUS_MASK (1<<4)
  111. #define MAX98506_SLOTCNFLT_STATUS_SHIFT 4
  112. #define MAX98506_SLOTCNFLT_STATUS_WIDTH 1
  113. #define MAX98506_VBSTOVFL_STATUS_MASK (1<<3)
  114. #define MAX98506_VBSTOVFL_STATUS_SHIFT 3
  115. #define MAX98506_VBSTOVFL_STATUS_WIDTH 1
  116. #define MAX98506_VBATOVFL_STATUS_MASK (1<<2)
  117. #define MAX98506_VBATOVFL_STATUS_SHIFT 2
  118. #define MAX98506_VBATOVFL_STATUS_WIDTH 1
  119. #define MAX98506_IMONOVFL_STATUS_MASK (1<<1)
  120. #define MAX98506_IMONOVFL_STATUS_SHIFT 1
  121. #define MAX98506_IMONOVFL_STATUS_WIDTH 1
  122. #define MAX98506_VMONOVFL_STATUS_MASK (1<<0)
  123. #define MAX98506_VMONOVFL_STATUS_SHIFT 0
  124. #define MAX98506_VMONOVFL_STATUS_WIDTH 1
  125. /* MAX98506_R005_STATE0 */
  126. #define MAX98506_THERMWARN_END_STATE_MASK (1<<3)
  127. #define MAX98506_THERMWARN_END_STATE_SHIFT 3
  128. #define MAX98506_THERMWARN_END_STATE_WIDTH 1
  129. #define MAX98506_THERMWARN_BGN_STATE_MASK (1<<2)
  130. #define MAX98506_THERMWARN_BGN_STATE_SHIFT 1
  131. #define MAX98506_THERMWARN_BGN_STATE_WIDTH 1
  132. #define MAX98506_THERMSHDN_END_STATE_MASK (1<<1)
  133. #define MAX98506_THERMSHDN_END_STATE_SHIFT 1
  134. #define MAX98506_THERMSHDN_END_STATE_WIDTH 1
  135. #define MAX98506_THERMSHDN_BGN_STATE_MASK (1<<0)
  136. #define MAX98506_THERMSHDN_BGN_STATE_SHIFT 0
  137. #define MAX98506_THERMSHDN_BGN_STATE_WIDTH 1
  138. /* MAX98506_R006_STATE1 */
  139. #define MAX98506_SPRCURNT_STATE_MASK (1<<5)
  140. #define MAX98506_SPRCURNT_STATE_SHIFT 5
  141. #define MAX98506_SPRCURNT_STATE_WIDTH 1
  142. #define MAX98506_WATCHFAIL_STATE_MASK (1<<4)
  143. #define MAX98506_WATCHFAIL_STATE_SHIFT 4
  144. #define MAX98506_WATCHFAIL_STATE_WIDTH 1
  145. #define MAX98506_ALCINFH_STATE_MASK (1<<3)
  146. #define MAX98506_ALCINFH_STATE_SHIFT 3
  147. #define MAX98506_ALCINFH_STATE_WIDTH 1
  148. #define MAX98506_ALCACT_STATE_MASK (1<<2)
  149. #define MAX98506_ALCACT_STATE_SHIFT 2
  150. #define MAX98506_ALCACT_STATE_WIDTH 1
  151. #define MAX98506_ALCMUT_STATE_MASK (1<<1)
  152. #define MAX98506_ALCMUT_STATE_SHIFT 1
  153. #define MAX98506_ALCMUT_STATE_WIDTH 1
  154. #define MAX98506_ALCP_STATE_MASK (1<<0)
  155. #define MAX98506_ALCP_STATE_SHIFT 0
  156. #define MAX98506_ALCP_STATE_WIDTH 1
  157. /* MAX98506_R007_STATE2 */
  158. #define MAX98506_SLOTOVRN_STATE_MASK (1<<6)
  159. #define MAX98506_SLOTOVRN_STATE_SHIFT 6
  160. #define MAX98506_SLOTOVRN_STATE_WIDTH 1
  161. #define MAX98506_INVALSLOT_STATE_MASK (1<<5)
  162. #define MAX98506_INVALSLOT_STATE_SHIFT 5
  163. #define MAX98506_INVALSLOT_STATE_WIDTH 1
  164. #define MAX98506_SLOTCNFLT_STATE_MASK (1<<4)
  165. #define MAX98506_SLOTCNFLT_STATE_SHIFT 4
  166. #define MAX98506_SLOTCNFLT_STATE_WIDTH 1
  167. #define MAX98506_VBSTOVFL_STATE_MASK (1<<3)
  168. #define MAX98506_VBSTOVFL_STATE_SHIFT 3
  169. #define MAX98506_VBSTOVFL_STATE_WIDTH 1
  170. #define MAX98506_VBATOVFL_STATE_MASK (1<<2)
  171. #define MAX98506_VBATOVFL_STATE_SHIFT 2
  172. #define MAX98506_VBATOVFL_STATE_WIDTH 1
  173. #define MAX98506_IMONOVFL_STATE_MASK (1<<1)
  174. #define MAX98506_IMONOVFL_STATE_SHIFT 1
  175. #define MAX98506_IMONOVFL_STATE_WIDTH 1
  176. #define MAX98506_VMONOVFL_STATE_MASK (1<<0)
  177. #define MAX98506_VMONOVFL_STATE_SHIFT 0
  178. #define MAX98506_VMONOVFL_STATE_WIDTH 1
  179. /* MAX98506_R008_FLAG0 */
  180. #define MAX98506_THERMWARN_END_FLAG_MASK (1<<3)
  181. #define MAX98506_THERMWARN_END_FLAG_SHIFT 3
  182. #define MAX98506_THERMWARN_END_FLAG_WIDTH 1
  183. #define MAX98506_THERMWARN_BGN_FLAG_MASK (1<<2)
  184. #define MAX98506_THERMWARN_BGN_FLAG_SHIFT 2
  185. #define MAX98506_THERMWARN_BGN_FLAG_WIDTH 1
  186. #define MAX98506_THERMSHDN_END_FLAG_MASK (1<<1)
  187. #define MAX98506_THERMSHDN_END_FLAG_SHIFT 1
  188. #define MAX98506_THERMSHDN_END_FLAG_WIDTH 1
  189. #define MAX98506_THERMSHDN_BGN_FLAG_MASK (1<<0)
  190. #define MAX98506_THERMSHDN_BGN_FLAG_SHIFT 0
  191. #define MAX98506_THERMSHDN_BGN_FLAG_WIDTH 1
  192. /* MAX98506_R009_FLAG1 */
  193. #define MAX98506_SPKCURNT_FLAG_MASK (1<<5)
  194. #define MAX98506_SPKCURNT_FLAG_SHIFT 5
  195. #define MAX98506_SPKCURNT_FLAG_WIDTH 1
  196. #define MAX98506_WATCHFAIL_FLAG_MASK (1<<4)
  197. #define MAX98506_WATCHFAIL_FLAG_SHIFT 4
  198. #define MAX98506_WATCHFAIL_FLAG_WIDTH 1
  199. #define MAX98506_ALCINFH_FLAG_MASK (1<<3)
  200. #define MAX98506_ALCINFH_FLAG_SHIFT 3
  201. #define MAX98506_ALCINFH_FLAG_WIDTH 1
  202. #define MAX98506_ALCACT_FLAG_MASK (1<<2)
  203. #define MAX98506_ALCACT_FLAG_SHIFT 2
  204. #define MAX98506_ALCACT_FLAG_WIDTH 1
  205. #define MAX98506_ALCMUT_FLAG_MASK (1<<1)
  206. #define MAX98506_ALCMUT_FLAG_SHIFT 1
  207. #define MAX98506_ALCMUT_FLAG_WIDTH 1
  208. #define MAX98506_ALCP_FLAG_MASK (1<<0)
  209. #define MAX98506_ALCP_FLAG_SHIFT 0
  210. #define MAX98506_ALCP_FLAG_WIDTH 1
  211. /* MAX98506_R00A_FLAG2 */
  212. #define MAX98506_SLOTOVRN_FLAG_MASK (1<<6)
  213. #define MAX98506_SLOTOVRN_FLAG_SHIFT 6
  214. #define MAX98506_SLOTOVRN_FLAG_WIDTH 1
  215. #define MAX98506_INVALSLOT_FLAG_MASK (1<<5)
  216. #define MAX98506_INVALSLOT_FLAG_SHIFT 5
  217. #define MAX98506_INVALSLOT_FLAG_WIDTH 1
  218. #define MAX98506_SLOTCNFLT_FLAG_MASK (1<<4)
  219. #define MAX98506_SLOTCNFLT_FLAG_SHIFT 4
  220. #define MAX98506_SLOTCNFLT_FLAG_WIDTH 1
  221. #define MAX98506_VBSTOVFL_FLAG_MASK (1<<3)
  222. #define MAX98506_VBSTOVFL_FLAG_SHIFT 3
  223. #define MAX98506_VBSTOVFL_FLAG_WIDTH 1
  224. #define MAX98506_VBATOVFL_FLAG_MASK (1<<2)
  225. #define MAX98506_VBATOVFL_FLAG_SHIFT 2
  226. #define MAX98506_VBATOVFL_FLAG_WIDTH 1
  227. #define MAX98506_IMONOVFL_FLAG_MASK (1<<1)
  228. #define MAX98506_IMONOVFL_FLAG_SHIFT 1
  229. #define MAX98506_IMONOVFL_FLAG_WIDTH 1
  230. #define MAX98506_VMONOVFL_FLAG_MASK (1<<0)
  231. #define MAX98506_VMONOVFL_FLAG_SHIFT 0
  232. #define MAX98506_VMONOVFL_FLAG_WIDTH 1
  233. /* MAX98506_R00B_IRQ_ENABLE0 */
  234. #define MAX98506_THERMWARN_END_EN_MASK (1<<3)
  235. #define MAX98506_THERMWARN_END_EN_SHIFT 3
  236. #define MAX98506_THERMWARN_END_EN_WIDTH 1
  237. #define MAX98506_THERMWARN_BGN_EN_MASK (1<<2)
  238. #define MAX98506_THERMWARN_BGN_EN_SHIFT 2
  239. #define MAX98506_THERMWARN_BGN_EN_WIDTH 1
  240. #define MAX98506_THERMSHDN_END_EN_MASK (1<<1)
  241. #define MAX98506_THERMSHDN_END_EN_SHIFT 1
  242. #define MAX98506_THERMSHDN_END_EN_WIDTH 1
  243. #define MAX98506_THERMSHDN_BGN_EN_MASK (1<<0)
  244. #define MAX98506_THERMSHDN_BGN_EN_SHIFT 0
  245. #define MAX98506_THERMSHDN_BGN_EN_WIDTH 1
  246. /* MAX98506_R00C_IRQ_ENABLE1 */
  247. #define MAX98506_SPKCURNT_EN_MASK (1<<5)
  248. #define MAX98506_SPKCURNT_EN_SHIFT 5
  249. #define MAX98506_SPKCURNT_EN_WIDTH 1
  250. #define MAX98506_WATCHFAIL_EN_MASK (1<<4)
  251. #define MAX98506_WATCHFAIL_EN_SHIFT 4
  252. #define MAX98506_WATCHFAIL_EN_WIDTH 1
  253. #define MAX98506_ALCINFH_EN_MASK (1<<3)
  254. #define MAX98506_ALCINFH_EN_SHIFT 3
  255. #define MAX98506_ALCINFH_EN_WIDTH 1
  256. #define MAX98506_ALCACT_EN_MASK (1<<2)
  257. #define MAX98506_ALCACT_EN_SHIFT 2
  258. #define MAX98506_ALCACT_EN_WIDTH 1
  259. #define MAX98506_ALCMUT_EN_MASK (1<<1)
  260. #define MAX98506_ALCMUT_EN_SHIFT 1
  261. #define MAX98506_ALCMUT_EN_WIDTH 1
  262. #define MAX98506_ALCP_EN_MASK (1<<0)
  263. #define MAX98506_ALCP_EN_SHIFT 0
  264. #define MAX98506_ALCP_EN_WIDTH 1
  265. /* MAX98506_R00D_IRQ_ENABLE2 */
  266. #define MAX98506_SLOTOVRN_EN_MASK (1<<6)
  267. #define MAX98506_SLOTOVRN_EN_SHIFT 6
  268. #define MAX98506_SLOTOVRN_EN_WIDTH 1
  269. #define MAX98506_INVALSLOT_EN_MASK (1<<5)
  270. #define MAX98506_INVALSLOT_EN_SHIFT 5
  271. #define MAX98506_INVALSLOT_EN_WIDTH 1
  272. #define MAX98506_SLOTCNFLT_EN_MASK (1<<4)
  273. #define MAX98506_SLOTCNFLT_EN_SHIFT 4
  274. #define MAX98506_SLOTCNFLT_EN_WIDTH 1
  275. #define MAX98506_VBSTOVFL_EN_MASK (1<<3)
  276. #define MAX98506_VBSTOVFL_EN_SHIFT 3
  277. #define MAX98506_VBSTOVFL_EN_WIDTH 1
  278. #define MAX98506_VBATOVFL_EN_MASK (1<<2)
  279. #define MAX98506_VBATOVFL_EN_SHIFT 2
  280. #define MAX98506_VBATOVFL_EN_WIDTH 1
  281. #define MAX98506_IMONOVFL_EN_MASK (1<<1)
  282. #define MAX98506_IMONOVFL_EN_SHIFT 1
  283. #define MAX98506_IMONOVFL_EN_WIDTH 1
  284. #define MAX98506_VMONOVFL_EN_MASK (1<<0)
  285. #define MAX98506_VMONOVFL_EN_SHIFT 0
  286. #define MAX98506_VMONOVFL_EN_WIDTH 1
  287. /* MAX98506_R00E_IRQ_CLEAR0 */
  288. #define MAX98506_THERMWARN_END_CLR_MASK (1<<3)
  289. #define MAX98506_THERMWARN_END_CLR_SHIFT 3
  290. #define MAX98506_THERMWARN_END_CLR_WIDTH 1
  291. #define MAX98506_THERMWARN_BGN_CLR_MASK (1<<2)
  292. #define MAX98506_THERMWARN_BGN_CLR_SHIFT 2
  293. #define MAX98506_THERMWARN_BGN_CLR_WIDTH 1
  294. #define MAX98506_THERMSHDN_END_CLR_MASK (1<<1)
  295. #define MAX98506_THERMSHDN_END_CLR_SHIFT 1
  296. #define MAX98506_THERMSHDN_END_CLR_WIDTH 1
  297. #define MAX98506_THERMSHDN_BGN_CLR_MASK (1<<0)
  298. #define MAX98506_THERMSHDN_BGN_CLR_SHIFT 0
  299. #define MAX98506_THERMSHDN_BGN_CLR_WIDTH 1
  300. /* MAX98506_R00F_IRQ_CLEAR1 */
  301. #define MAX98506_SPKCURNT_CLR_MASK (1<<5)
  302. #define MAX98506_SPKCURNT_CLR_SHIFT 5
  303. #define MAX98506_SPKCURNT_CLR_WIDTH 1
  304. #define MAX98506_WATCHFAIL_CLR_MASK (1<<4)
  305. #define MAX98506_WATCHFAIL_CLR_SHIFT 4
  306. #define MAX98506_WATCHFAIL_CLR_WIDTH 1
  307. #define MAX98506_ALCINFH_CLR_MASK (1<<3)
  308. #define MAX98506_ALCINFH_CLR_SHIFT 3
  309. #define MAX98506_ALCINFH_CLR_WIDTH 1
  310. #define MAX98506_ALCACT_CLR_MASK (1<<2)
  311. #define MAX98506_ALCACT_CLR_SHIFT 2
  312. #define MAX98506_ALCACT_CLR_WIDTH 1
  313. #define MAX98506_ALCMUT_CLR_MASK (1<<1)
  314. #define MAX98506_ALCMUT_CLR_SHIFT 1
  315. #define MAX98506_ALCMUT_CLR_WIDTH 1
  316. #define MAX98506_ALCP_CLR_MASK (1<<0)
  317. #define MAX98506_ALCP_CLR_SHIFT 0
  318. #define MAX98506_ALCP_CLR_WIDTH 1
  319. /* MAX98506_R010_IRQ_CLEAR2 */
  320. #define MAX98506_SLOTOVRN_CLR_MASK (1<<6)
  321. #define MAX98506_SLOTOVRN_CLR_SHIFT 6
  322. #define MAX98506_SLOTOVRN_CLR_WIDTH 1
  323. #define MAX98506_INVALSLOT_CLR_MASK (1<<5)
  324. #define MAX98506_INVALSLOT_CLR_SHIFT 5
  325. #define MAX98506_INVALSLOT_CLR_WIDTH 1
  326. #define MAX98506_SLOTCNFLT_CLR_MASK (1<<4)
  327. #define MAX98506_SLOTCNFLT_CLR_SHIFT 4
  328. #define MAX98506_SLOTCNFLT_CLR_WIDTH 1
  329. #define MAX98506_VBSTOVFL_CLR_MASK (1<<3)
  330. #define MAX98506_VBSTOVFL_CLR_SHIFT 3
  331. #define MAX98506_VBSTOVFL_CLR_WIDTH 1
  332. #define MAX98506_VBATOVFL_CLR_MASK (1<<2)
  333. #define MAX98506_VBATOVFL_CLR_SHIFT 2
  334. #define MAX98506_VBATOVFL_CLR_WIDTH 1
  335. #define MAX98506_IMONOVFL_CLR_MASK (1<<1)
  336. #define MAX98506_IMONOVFL_CLR_SHIFT 1
  337. #define MAX98506_IMONOVFL_CLR_WIDTH 1
  338. #define MAX98506_VMONOVFL_CLR_MASK (1<<0)
  339. #define MAX98506_VMONOVFL_CLR_SHIFT 0
  340. #define MAX98506_VMONOVFL_CLR_WIDTH 1
  341. /* MAX98506_R01A_DAI_CLK_MODE1 */
  342. #define MAX98506_DAI_CLK_SOURCE_MASK (1<<6)
  343. #define MAX98506_DAI_CLK_SOURCE_SHIFT 6
  344. #define MAX98506_DAI_CLK_SOURCE_WIDTH 1
  345. #define MAX98506_MDLL_MULT_MASK (0x0F<<0)
  346. #define MAX98506_MDLL_MULT_SHIFT 0
  347. #define MAX98506_MDLL_MULT_WIDTH 4
  348. #define MAX98506_MDLL_MULT_MCLKx8 6
  349. #define MAX98506_MDLL_MULT_MCLKx16 8
  350. /* MAX98506_R01B_DAI_CLK_MODE2 */
  351. #define MAX98506_DAI_SR_MASK (0x0F<<4)
  352. #define MAX98506_DAI_SR_SHIFT 4
  353. #define MAX98506_DAI_SR_WIDTH 4
  354. #define MAX98506_DAI_MAS_MASK (1<<3)
  355. #define MAX98506_DAI_MAS_SHIFT 3
  356. #define MAX98506_DAI_MAS_WIDTH 1
  357. #define MAX98506_DAI_BSEL_MASK (0x07<<0)
  358. #define MAX98506_DAI_BSEL_SHIFT 0
  359. #define MAX98506_DAI_BSEL_WIDTH 3
  360. #define MAX98506_DAI_BSEL_32 (0 << MAX98506_DAI_BSEL_SHIFT)
  361. #define MAX98506_DAI_BSEL_48 (1 << MAX98506_DAI_BSEL_SHIFT)
  362. #define MAX98506_DAI_BSEL_64 (2 << MAX98506_DAI_BSEL_SHIFT)
  363. #define MAX98506_DAI_BSEL_256 (6 << MAX98506_DAI_BSEL_SHIFT)
  364. /* MAX98506_R01F_DAI_CLK_DIV_N_LSBS */
  365. #define MAX98506_DAI_N_LSBS_MASK (0xFF<<0)
  366. #define MAX98506_DAI_N_LSBS_SHIFT 0
  367. #define MAX98506_DAI_N_LSBS_WIDTH 8
  368. /* MAX98506_R020_FORMAT */
  369. #define MAX98506_DAI_CHANSZ_MASK (0x03<<6)
  370. #define MAX98506_DAI_CHANSZ_SHIFT 6
  371. #define MAX98506_DAI_CHANSZ_WIDTH 2
  372. #define MAX98506_DAI_INTERLEAVE_MASK (1<<5)
  373. #define MAX98506_DAI_INTERLEAVE_SHIFT 5
  374. #define MAX98506_DAI_INTERLEAVE_WIDTH 1
  375. #define MAX98506_DAI_EXTBCLK_HIZ_MASK (1<<4)
  376. #define MAX98506_DAI_EXTBCLK_HIZ_SHIFT 4
  377. #define MAX98506_DAI_EXTBCLK_HIZ_WIDTH 1
  378. #define MAX98506_DAI_WCI_MASK (1<<3)
  379. #define MAX98506_DAI_WCI_SHIFT 3
  380. #define MAX98506_DAI_WCI_WIDTH 1
  381. #define MAX98506_DAI_BCI_MASK (1<<2)
  382. #define MAX98506_DAI_BCI_SHIFT 2
  383. #define MAX98506_DAI_BCI_WIDTH 1
  384. #define MAX98506_DAI_DLY_MASK (1<<1)
  385. #define MAX98506_DAI_DLY_SHIFT 1
  386. #define MAX98506_DAI_DLY_WIDTH 1
  387. #define MAX98506_DAI_TDM_MASK (1<<0)
  388. #define MAX98506_DAI_TDM_SHIFT 0
  389. #define MAX98506_DAI_TDM_WIDTH 1
  390. #define MAX98506_DAI_CHANSZ_16 (1 << MAX98506_DAI_CHANSZ_SHIFT)
  391. #define MAX98506_DAI_CHANSZ_24 (2 << MAX98506_DAI_CHANSZ_SHIFT)
  392. #define MAX98506_DAI_CHANSZ_32 (3 << MAX98506_DAI_CHANSZ_SHIFT)
  393. /* MAX98506_R021_TDM_SLOT_SELECT */
  394. #define MAX98506_DAI_DO_EN_MASK (1<<7)
  395. #define MAX98506_DAI_DO_EN_SHIFT 7
  396. #define MAX98506_DAI_DO_EN_WIDTH 1
  397. #define MAX98506_DAI_DIN_EN_MASK (1<<6)
  398. #define MAX98506_DAI_DIN_EN_SHIFT 6
  399. #define MAX98506_DAI_DIN_EN_WIDTH 1
  400. #define MAX98506_DAI_INR_SOURCE_MASK (0x07<<3)
  401. #define MAX98506_DAI_INR_SOURCE_SHIFT 3
  402. #define MAX98506_DAI_INR_SOURCE_WIDTH 3
  403. #define MAX98506_DAI_INL_SOURCE_MASK (0x07<<0)
  404. #define MAX98506_DAI_INL_SOURCE_SHIFT 0
  405. #define MAX98506_DAI_INL_SOURCE_WIDTH 3
  406. /* MAX98506_R022_DOUT_CFG_VMON */
  407. #define MAX98506_DAI_VMON_EN_MASK (1<<5)
  408. #define MAX98506_DAI_VMON_EN_SHIFT 5
  409. #define MAX98506_DAI_VMON_EN_WIDTH 1
  410. #define MAX98506_DAI_VMON_SLOT_MASK (0x1F<<0)
  411. #define MAX98506_DAI_VMON_SLOT_SHIFT 0
  412. #define MAX98506_DAI_VMON_SLOT_WIDTH 5
  413. #define MAX98506_DAI_VMON_SLOT_00_01 (0 << MAX98506_DAI_VMON_SLOT_SHIFT)
  414. #define MAX98506_DAI_VMON_SLOT_01_02 (1 << MAX98506_DAI_VMON_SLOT_SHIFT)
  415. #define MAX98506_DAI_VMON_SLOT_02_03 (2 << MAX98506_DAI_VMON_SLOT_SHIFT)
  416. #define MAX98506_DAI_VMON_SLOT_03_04 (3 << MAX98506_DAI_VMON_SLOT_SHIFT)
  417. #define MAX98506_DAI_VMON_SLOT_04_05 (4 << MAX98506_DAI_VMON_SLOT_SHIFT)
  418. #define MAX98506_DAI_VMON_SLOT_05_06 (5 << MAX98506_DAI_VMON_SLOT_SHIFT)
  419. #define MAX98506_DAI_VMON_SLOT_06_07 (6 << MAX98506_DAI_VMON_SLOT_SHIFT)
  420. #define MAX98506_DAI_VMON_SLOT_07_08 (7 << MAX98506_DAI_VMON_SLOT_SHIFT)
  421. #define MAX98506_DAI_VMON_SLOT_08_09 (8 << MAX98506_DAI_VMON_SLOT_SHIFT)
  422. #define MAX98506_DAI_VMON_SLOT_09_0A (9 << MAX98506_DAI_VMON_SLOT_SHIFT)
  423. #define MAX98506_DAI_VMON_SLOT_0A_0B (10 << MAX98506_DAI_VMON_SLOT_SHIFT)
  424. #define MAX98506_DAI_VMON_SLOT_0B_0C (11 << MAX98506_DAI_VMON_SLOT_SHIFT)
  425. #define MAX98506_DAI_VMON_SLOT_0C_0D (12 << MAX98506_DAI_VMON_SLOT_SHIFT)
  426. #define MAX98506_DAI_VMON_SLOT_0D_0E (13 << MAX98506_DAI_VMON_SLOT_SHIFT)
  427. #define MAX98506_DAI_VMON_SLOT_0E_0F (14 << MAX98506_DAI_VMON_SLOT_SHIFT)
  428. #define MAX98506_DAI_VMON_SLOT_0F_10 (15 << MAX98506_DAI_VMON_SLOT_SHIFT)
  429. #define MAX98506_DAI_VMON_SLOT_10_11 (16 << MAX98506_DAI_VMON_SLOT_SHIFT)
  430. #define MAX98506_DAI_VMON_SLOT_11_12 (17 << MAX98506_DAI_VMON_SLOT_SHIFT)
  431. #define MAX98506_DAI_VMON_SLOT_12_13 (18 << MAX98506_DAI_VMON_SLOT_SHIFT)
  432. #define MAX98506_DAI_VMON_SLOT_13_14 (19 << MAX98506_DAI_VMON_SLOT_SHIFT)
  433. #define MAX98506_DAI_VMON_SLOT_14_15 (20 << MAX98506_DAI_VMON_SLOT_SHIFT)
  434. #define MAX98506_DAI_VMON_SLOT_15_16 (21 << MAX98506_DAI_VMON_SLOT_SHIFT)
  435. #define MAX98506_DAI_VMON_SLOT_16_17 (22 << MAX98506_DAI_VMON_SLOT_SHIFT)
  436. #define MAX98506_DAI_VMON_SLOT_17_18 (23 << MAX98506_DAI_VMON_SLOT_SHIFT)
  437. #define MAX98506_DAI_VMON_SLOT_18_19 (24 << MAX98506_DAI_VMON_SLOT_SHIFT)
  438. #define MAX98506_DAI_VMON_SLOT_19_1A (25 << MAX98506_DAI_VMON_SLOT_SHIFT)
  439. #define MAX98506_DAI_VMON_SLOT_1A_1B (26 << MAX98506_DAI_VMON_SLOT_SHIFT)
  440. #define MAX98506_DAI_VMON_SLOT_1B_1C (27 << MAX98506_DAI_VMON_SLOT_SHIFT)
  441. #define MAX98506_DAI_VMON_SLOT_1C_1D (28 << MAX98506_DAI_VMON_SLOT_SHIFT)
  442. #define MAX98506_DAI_VMON_SLOT_1D_1E (29 << MAX98506_DAI_VMON_SLOT_SHIFT)
  443. #define MAX98506_DAI_VMON_SLOT_1E_1F (30 << MAX98506_DAI_VMON_SLOT_SHIFT)
  444. /* MAX98506_R023_DOUT_CFG_IMON */
  445. #define MAX98506_DAI_IMON_EN_MASK (1<<5)
  446. #define MAX98506_DAI_IMON_EN_SHIFT 5
  447. #define MAX98506_DAI_IMON_EN_WIDTH 1
  448. #define MAX98506_DAI_IMON_SLOT_MASK (0x1F<<0)
  449. #define MAX98506_DAI_IMON_SLOT_SHIFT 0
  450. #define MAX98506_DAI_IMON_SLOT_WIDTH 5
  451. #define MAX98506_DAI_IMON_SLOT_00_01 (0 << MAX98506_DAI_IMON_SLOT_SHIFT)
  452. #define MAX98506_DAI_IMON_SLOT_01_02 (1 << MAX98506_DAI_IMON_SLOT_SHIFT)
  453. #define MAX98506_DAI_IMON_SLOT_02_03 (2 << MAX98506_DAI_IMON_SLOT_SHIFT)
  454. #define MAX98506_DAI_IMON_SLOT_03_04 (3 << MAX98506_DAI_IMON_SLOT_SHIFT)
  455. #define MAX98506_DAI_IMON_SLOT_04_05 (4 << MAX98506_DAI_IMON_SLOT_SHIFT)
  456. #define MAX98506_DAI_IMON_SLOT_05_06 (5 << MAX98506_DAI_IMON_SLOT_SHIFT)
  457. #define MAX98506_DAI_IMON_SLOT_06_07 (6 << MAX98506_DAI_IMON_SLOT_SHIFT)
  458. #define MAX98506_DAI_IMON_SLOT_07_08 (7 << MAX98506_DAI_IMON_SLOT_SHIFT)
  459. #define MAX98506_DAI_IMON_SLOT_08_09 (8 << MAX98506_DAI_IMON_SLOT_SHIFT)
  460. #define MAX98506_DAI_IMON_SLOT_09_0A (9 << MAX98506_DAI_IMON_SLOT_SHIFT)
  461. #define MAX98506_DAI_IMON_SLOT_0A_0B (10 << MAX98506_DAI_IMON_SLOT_SHIFT)
  462. #define MAX98506_DAI_IMON_SLOT_0B_0C (11 << MAX98506_DAI_IMON_SLOT_SHIFT)
  463. #define MAX98506_DAI_IMON_SLOT_0C_0D (12 << MAX98506_DAI_IMON_SLOT_SHIFT)
  464. #define MAX98506_DAI_IMON_SLOT_0D_0E (13 << MAX98506_DAI_IMON_SLOT_SHIFT)
  465. #define MAX98506_DAI_IMON_SLOT_0E_0F (14 << MAX98506_DAI_IMON_SLOT_SHIFT)
  466. #define MAX98506_DAI_IMON_SLOT_0F_10 (15 << MAX98506_DAI_IMON_SLOT_SHIFT)
  467. #define MAX98506_DAI_IMON_SLOT_10_11 (16 << MAX98506_DAI_IMON_SLOT_SHIFT)
  468. #define MAX98506_DAI_IMON_SLOT_11_12 (17 << MAX98506_DAI_IMON_SLOT_SHIFT)
  469. #define MAX98506_DAI_IMON_SLOT_12_13 (18 << MAX98506_DAI_IMON_SLOT_SHIFT)
  470. #define MAX98506_DAI_IMON_SLOT_13_14 (19 << MAX98506_DAI_IMON_SLOT_SHIFT)
  471. #define MAX98506_DAI_IMON_SLOT_14_15 (20 << MAX98506_DAI_IMON_SLOT_SHIFT)
  472. #define MAX98506_DAI_IMON_SLOT_15_16 (21 << MAX98506_DAI_IMON_SLOT_SHIFT)
  473. #define MAX98506_DAI_IMON_SLOT_16_17 (22 << MAX98506_DAI_IMON_SLOT_SHIFT)
  474. #define MAX98506_DAI_IMON_SLOT_17_18 (23 << MAX98506_DAI_IMON_SLOT_SHIFT)
  475. #define MAX98506_DAI_IMON_SLOT_18_19 (24 << MAX98506_DAI_IMON_SLOT_SHIFT)
  476. #define MAX98506_DAI_IMON_SLOT_19_1A (25 << MAX98506_DAI_IMON_SLOT_SHIFT)
  477. #define MAX98506_DAI_IMON_SLOT_1A_1B (26 << MAX98506_DAI_IMON_SLOT_SHIFT)
  478. #define MAX98506_DAI_IMON_SLOT_1B_1C (27 << MAX98506_DAI_IMON_SLOT_SHIFT)
  479. #define MAX98506_DAI_IMON_SLOT_1C_1D (28 << MAX98506_DAI_IMON_SLOT_SHIFT)
  480. #define MAX98506_DAI_IMON_SLOT_1D_1E (29 << MAX98506_DAI_IMON_SLOT_SHIFT)
  481. #define MAX98506_DAI_IMON_SLOT_1E_1F (30 << MAX98506_DAI_IMON_SLOT_SHIFT)
  482. /* MAX98506_R024_DOUT_CFG_VBAT */
  483. #define MAX98506_DAI_VBAT_EN_MASK (1<<5)
  484. #define MAX98506_DAI_VBAT_EN_SHIFT 5
  485. #define MAX98506_DAI_VBAT_EN_WIDTH 1
  486. #define MAX98506_DAI_VBAT_SLOT_MASK (0x1F<<0)
  487. #define MAX98506_DAI_VBAT_SLOT_SHIFT 0
  488. #define MAX98506_DAI_VBAT_SLOT_WIDTH 5
  489. /* MAX98506_R025_DOUT_CFG_VBST */
  490. #define MAX98506_DAI_VBST_EN_MASK (1<<5)
  491. #define MAX98506_DAI_VBST_EN_SHIFT 5
  492. #define MAX98506_DAI_VBST_EN_WIDTH 1
  493. #define MAX98506_DAI_VBST_SLOT_MASK (0x1F<<0)
  494. #define MAX98506_DAI_VBST_SLOT_SHIFT 0
  495. #define MAX98506_DAI_VBST_SLOT_WIDTH 5
  496. /* MAX98506_R026_DOUT_CFG_FLAG */
  497. #define MAX98506_DAI_FLAG_EN_MASK (1<<5)
  498. #define MAX98506_DAI_FLAG_EN_SHIFT 5
  499. #define MAX98506_DAI_FLAG_EN_WIDTH 1
  500. #define MAX98506_DAI_FLAG_SLOT_MASK (0x1F<<0)
  501. #define MAX98506_DAI_FLAG_SLOT_SHIFT 0
  502. #define MAX98506_DAI_FLAG_SLOT_WIDTH 5
  503. /* MAX98506_R027_DOUT_HIZ_CFG1 */
  504. #define MAX98506_DAI_SLOT_HIZ_CFG1_MASK (0xFF<<0)
  505. #define MAX98506_DAI_SLOT_HIZ_CFG1_SHIFT 0
  506. #define MAX98506_DAI_SLOT_HIZ_CFG1_WIDTH 8
  507. /* MAX98506_R028_DOUT_HIZ_CFG2 */
  508. #define MAX98506_DAI_SLOT_HIZ_CFG2_MASK (0xFF<<0)
  509. #define MAX98506_DAI_SLOT_HIZ_CFG2_SHIFT 0
  510. #define MAX98506_DAI_SLOT_HIZ_CFG2_WIDTH 8
  511. /* MAX98506_R029_DOUT_HIZ_CFG3 */
  512. #define MAX98506_DAI_SLOT_HIZ_CFG3_MASK (0xFF<<0)
  513. #define MAX98506_DAI_SLOT_HIZ_CFG3_SHIFT 0
  514. #define MAX98506_DAI_SLOT_HIZ_CFG3_WIDTH 8
  515. /* MAX98506_R02A_DOUT_HIZ_CFG4 */
  516. #define MAX98506_DAI_SLOT_HIZ_CFG4_MASK (0xFF<<0)
  517. #define MAX98506_DAI_SLOT_HIZ_CFG4_SHIFT 0
  518. #define MAX98506_DAI_SLOT_HIZ_CFG4_WIDTH 8
  519. /* MAX98506_R02B_DOUT_DRV_STRENGTH */
  520. #define MAX98506_DAI_OUT_DRIVE_MASK (0x03<<0)
  521. #define MAX98506_DAI_OUT_DRIVE_SHIFT 0
  522. #define MAX98506_DAI_OUT_DRIVE_WIDTH 2
  523. /* MAX98506_R02C_FILTERS */
  524. #define MAX98506_ADC_DITHER_EN_MASK (1<<7)
  525. #define MAX98506_ADC_DITHER_EN_SHIFT 7
  526. #define MAX98506_ADC_DITHER_EN_WIDTH 1
  527. #define MAX98506_IV_DCB_EN_MASK (1<<6)
  528. #define MAX98506_IV_DCB_EN_SHIFT 6
  529. #define MAX98506_IV_DCB_EN_WIDTH 1
  530. #define MAX98506_DAC_DITHER_EN_MASK (1<<4)
  531. #define MAX98506_DAC_DITHER_EN_SHIFT 4
  532. #define MAX98506_DAC_DITHER_EN_WIDTH 1
  533. #define MAX98506_DAC_FILTER_MODE_MASK (1<<3)
  534. #define MAX98506_DAC_FILTER_MODE_SHIFT 3
  535. #define MAX98506_DAC_FILTER_MODE_WIDTH 1
  536. #define MAX98506_DAC_HPF_MASK (0x07<<0)
  537. #define MAX98506_DAC_HPF_SHIFT 0
  538. #define MAX98506_DAC_HPF_WIDTH 3
  539. /* MAX98506_R02D_GAIN */
  540. #define MAX98506_DAC_IN_SEL_MASK (0x03<<5)
  541. #define MAX98506_DAC_IN_SEL_SHIFT 5
  542. #define MAX98506_DAC_IN_SEL_WIDTH 2
  543. #define MAX98506_SPK_GAIN_MASK (0x1F<<0)
  544. #define MAX98506_SPK_GAIN_SHIFT 0
  545. #define MAX98506_SPK_GAIN_WIDTH 5
  546. #define MAX98506_DAC_IN_SEL_LEFT_DAI (0 << MAX98506_DAC_IN_SEL_SHIFT)
  547. #define MAX98506_DAC_IN_SEL_RIGHT_DAI (1 << MAX98506_DAC_IN_SEL_SHIFT)
  548. #define MAX98506_DAC_IN_SEL_SUMMED_DAI (2 << MAX98506_DAC_IN_SEL_SHIFT)
  549. #define MAX98506_DAC_IN_SEL_DIV2_SUMMED_DAI (3 << MAX98506_DAC_IN_SEL_SHIFT)
  550. /* MAX98506_R02E_GAIN_RAMPING */
  551. #define MAX98506_SPK_RMP_EN_MASK (1<<1)
  552. #define MAX98506_SPK_RMP_EN_SHIFT 1
  553. #define MAX98506_SPK_RMP_EN_WIDTH 1
  554. #define MAX98506_SPK_ZCD_EN_MASK (1<<0)
  555. #define MAX98506_SPK_ZCD_EN_SHIFT 0
  556. #define MAX98506_SPK_ZCD_EN_WIDTH 1
  557. /* MAX98506_R02F_SPK_AMP */
  558. #define MAX98506_SPK_MODE_MASK (1<<0)
  559. #define MAX98506_SPK_MODE_SHIFT 0
  560. #define MAX98506_SPK_MODE_WIDTH 1
  561. /* MAX98506_R030_THRESHOLD */
  562. #define MAX98506_ALC_EN_MASK (1<<5)
  563. #define MAX98506_ALC_EN_SHIFT 5
  564. #define MAX98506_ALC_EN_WIDTH 1
  565. #define MAX98506_ALC_TH_MASK (0x1F<<0)
  566. #define MAX98506_ALC_TH_SHIFT 0
  567. #define MAX98506_ALC_TH_WIDTH 5
  568. /* MAX98506_R031_ALC_ATTACK */
  569. #define MAX98506_ALC_ATK_STEP_MASK (0x0F<<4)
  570. #define MAX98506_ALC_ATK_STEP_SHIFT 4
  571. #define MAX98506_ALC_ATK_STEP_WIDTH 4
  572. #define MAX98506_ALC_ATK_RATE_MASK (0x7<<0)
  573. #define MAX98506_ALC_ATK_RATE_SHIFT 0
  574. #define MAX98506_ALC_ATK_RATE_WIDTH 3
  575. /* MAX98506_R032_ALC_ATTEN_RLS */
  576. #define MAX98506_ALC_MAX_ATTEN_MASK (0x0F<<4)
  577. #define MAX98506_ALC_MAX_ATTEN_SHIFT 4
  578. #define MAX98506_ALC_MAX_ATTEN_WIDTH 4
  579. #define MAX98506_ALC_RLS_RATE_MASK (0x7<<0)
  580. #define MAX98506_ALC_RLS_RATE_SHIFT 0
  581. #define MAX98506_ALC_RLS_RATE_WIDTH 3
  582. /* MAX98506_R033_ALC_HOLD_RLS */
  583. #define MAX98506_ALC_RLS_TGR_MASK (1<<0)
  584. #define MAX98506_ALC_RLS_TGR_SHIFT 0
  585. #define MAX98506_ALC_RLS_TGR_WIDTH 1
  586. /* MAX98506_R034_ALC_CONFIGURATION */
  587. #define MAX98506_ALC_MUTE_EN_MASK (1<<7)
  588. #define MAX98506_ALC_MUTE_EN_SHIFT 7
  589. #define MAX98506_ALC_MUTE_EN_WIDTH 1
  590. #define MAX98506_ALC_MUTE_DLY_MASK (0x07<<4)
  591. #define MAX98506_ALC_MUTE_DLY_SHIFT 4
  592. #define MAX98506_ALC_MUTE_DLY_WIDTH 3
  593. #define MAX98506_ALC_RLS_DBT_MASK (0x07<<0)
  594. #define MAX98506_ALC_RLS_DBT_SHIFT 0
  595. #define MAX98506_ALC_RLS_DBT_WIDTH 3
  596. /* MAX98506_R035_BOOST_CONVERTER */
  597. #define MAX98506_BST_SYNC_MASK (1<<7)
  598. #define MAX98506_BST_SYNC_SHIFT 7
  599. #define MAX98506_BST_SYNC_WIDTH 1
  600. #define MAX98506_BST_PHASE_MASK (0x03<<4)
  601. #define MAX98506_BST_PHASE_SHIFT 4
  602. #define MAX98506_BST_PHASE_WIDTH 2
  603. #define MAX98506_BST_SKIP_MODE_MASK (0x03<<0)
  604. #define MAX98506_BST_SKIP_MODE_SHIFT 0
  605. #define MAX98506_BST_SKIP_MODE_WIDTH 2
  606. /* MAX98506_R036_BLOCK_ENABLE */
  607. #define MAX98506_BST_EN_MASK (1<<7)
  608. #define MAX98506_BST_EN_SHIFT 7
  609. #define MAX98506_BST_EN_WIDTH 1
  610. #define MAX98506_WATCH_EN_MASK (1<<6)
  611. #define MAX98506_WATCH_EN_SHIFT 6
  612. #define MAX98506_WATCH_EN_WIDTH 1
  613. #define MAX98506_CLKMON_EN_MASK (1<<5)
  614. #define MAX98506_CLKMON_EN_SHIFT 5
  615. #define MAX98506_CLKMON_EN_WIDTH 1
  616. #define MAX98506_SPK_EN_MASK (1<<4)
  617. #define MAX98506_SPK_EN_SHIFT 4
  618. #define MAX98506_SPK_EN_WIDTH 1
  619. #define MAX98506_ADC_VBST_EN_MASK (1<<3)
  620. #define MAX98506_ADC_VBST_EN_SHIFT 3
  621. #define MAX98506_ADC_VBST_EN_WIDTH 1
  622. #define MAX98506_ADC_VBAT_EN_MASK (1<<2)
  623. #define MAX98506_ADC_VBAT_EN_SHIFT 2
  624. #define MAX98506_ADC_VBAT_EN_WIDTH 1
  625. #define MAX98506_ADC_IMON_EN_MASK (1<<1)
  626. #define MAX98506_ADC_IMON_EN_SHIFT 1
  627. #define MAX98506_ADC_IMON_EN_WIDTH 1
  628. #define MAX98506_ADC_VMON_EN_MASK (1<<0)
  629. #define MAX98506_ADC_VMON_EN_SHIFT 0
  630. #define MAX98506_ADC_VMON_EN_WIDTH 1
  631. #define MAX98506_ADC_VIMON_EN_MASK (3<<0)
  632. #define MAX98506_ADC_VIMON_EN_SHIFT 0
  633. #define MAX98506_ADC_VIMON_EN_WIDTH 2
  634. /* MAX98506_R037_CONFIGURATION */
  635. #define MAX98506_BST_VOUT_MASK (0x0F<<4)
  636. #define MAX98506_BST_VOUT_SHIFT 4
  637. #define MAX98506_BST_VOUT_WIDTH 4
  638. #define MAX98506_THERMWARN_LEVEL_MASK (0x03<<2)
  639. #define MAX98506_THERMWARN_LEVEL_SHIFT 2
  640. #define MAX98506_THERMWARN_LEVEL_WIDTH 2
  641. #define MAX98506_WATCH_TIME_MASK (0x03<<0)
  642. #define MAX98506_WATCH_TIME_SHIFT 0
  643. #define MAX98506_WATCH_TIME_WIDTH 2
  644. /* MAX98506_R038_GLOBAL_ENABLE */
  645. #define MAX98506_EN_MASK (1<<7)
  646. #define MAX98506_EN_SHIFT 7
  647. #define MAX98506_EN_WIDTH 1
  648. /* MAX98506_R03A_BOOST_LIMITER */
  649. #define MAX98506_BST_ILIM_MASK (0x1F<<3)
  650. #define MAX98506_BST_ILIM_SHIFT 3
  651. #define MAX98506_BST_ILIM_WIDTH 5
  652. /* MAX98506_R0FF_VERSION */
  653. #define MAX98506_REV_ID_MASK (0xFF<<0)
  654. #define MAX98506_REV_ID_SHIFT 0
  655. #define MAX98506_REV_ID_WIDTH 8
  656. enum max98506_type {
  657. MAX98506,
  658. };
  659. struct max98506_priv {
  660. struct regmap *regmap;
  661. struct snd_soc_codec *codec;
  662. struct max98506_pdata *pdata;
  663. struct max98506_pc_active pca;
  664. struct max98506_volume_step_info vstep;
  665. #ifdef USE_DSM_LOG
  666. struct class *dev_log_class;
  667. struct device *dev_log;
  668. #endif /* USE_DSM_LOG */
  669. struct i2c_client *sub_i2c;
  670. struct regmap *sub_regmap;
  671. };
  672. #endif /* _MAX98506_H */