max98090.h 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553
  1. /*
  2. * max98090.h -- MAX98090 ALSA SoC Audio driver
  3. *
  4. * Copyright 2011-2012 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 _MAX98090_H
  11. #define _MAX98090_H
  12. /*
  13. * The default operating frequency for a DMIC attached to the codec.
  14. * This can be overridden by a device tree property.
  15. */
  16. #define MAX98090_DEFAULT_DMIC_FREQ 2500000
  17. /*
  18. * MAX98090 Register Definitions
  19. */
  20. #define M98090_REG_SOFTWARE_RESET 0x00
  21. #define M98090_REG_DEVICE_STATUS 0x01
  22. #define M98090_REG_JACK_STATUS 0x02
  23. #define M98090_REG_INTERRUPT_S 0x03
  24. #define M98090_REG_QUICK_SYSTEM_CLOCK 0x04
  25. #define M98090_REG_QUICK_SAMPLE_RATE 0x05
  26. #define M98090_REG_DAI_INTERFACE 0x06
  27. #define M98090_REG_DAC_PATH 0x07
  28. #define M98090_REG_MIC_DIRECT_TO_ADC 0x08
  29. #define M98090_REG_LINE_TO_ADC 0x09
  30. #define M98090_REG_ANALOG_MIC_LOOP 0x0A
  31. #define M98090_REG_ANALOG_LINE_LOOP 0x0B
  32. #define M98090_REG_RESERVED 0x0C
  33. #define M98090_REG_LINE_INPUT_CONFIG 0x0D
  34. #define M98090_REG_LINE_INPUT_LEVEL 0x0E
  35. #define M98090_REG_INPUT_MODE 0x0F
  36. #define M98090_REG_MIC1_INPUT_LEVEL 0x10
  37. #define M98090_REG_MIC2_INPUT_LEVEL 0x11
  38. #define M98090_REG_MIC_BIAS_VOLTAGE 0x12
  39. #define M98090_REG_DIGITAL_MIC_ENABLE 0x13
  40. #define M98090_REG_DIGITAL_MIC_CONFIG 0x14
  41. #define M98090_REG_LEFT_ADC_MIXER 0x15
  42. #define M98090_REG_RIGHT_ADC_MIXER 0x16
  43. #define M98090_REG_LEFT_ADC_LEVEL 0x17
  44. #define M98090_REG_RIGHT_ADC_LEVEL 0x18
  45. #define M98090_REG_ADC_BIQUAD_LEVEL 0x19
  46. #define M98090_REG_ADC_SIDETONE 0x1A
  47. #define M98090_REG_SYSTEM_CLOCK 0x1B
  48. #define M98090_REG_CLOCK_MODE 0x1C
  49. #define M98090_REG_CLOCK_RATIO_NI_MSB 0x1D
  50. #define M98090_REG_CLOCK_RATIO_NI_LSB 0x1E
  51. #define M98090_REG_CLOCK_RATIO_MI_MSB 0x1F
  52. #define M98090_REG_CLOCK_RATIO_MI_LSB 0x20
  53. #define M98090_REG_MASTER_MODE 0x21
  54. #define M98090_REG_INTERFACE_FORMAT 0x22
  55. #define M98090_REG_TDM_CONTROL 0x23
  56. #define M98090_REG_TDM_FORMAT 0x24
  57. #define M98090_REG_IO_CONFIGURATION 0x25
  58. #define M98090_REG_FILTER_CONFIG 0x26
  59. #define M98090_REG_DAI_PLAYBACK_LEVEL 0x27
  60. #define M98090_REG_DAI_PLAYBACK_LEVEL_EQ 0x28
  61. #define M98090_REG_LEFT_HP_MIXER 0x29
  62. #define M98090_REG_RIGHT_HP_MIXER 0x2A
  63. #define M98090_REG_HP_CONTROL 0x2B
  64. #define M98090_REG_LEFT_HP_VOLUME 0x2C
  65. #define M98090_REG_RIGHT_HP_VOLUME 0x2D
  66. #define M98090_REG_LEFT_SPK_MIXER 0x2E
  67. #define M98090_REG_RIGHT_SPK_MIXER 0x2F
  68. #define M98090_REG_SPK_CONTROL 0x30
  69. #define M98090_REG_LEFT_SPK_VOLUME 0x31
  70. #define M98090_REG_RIGHT_SPK_VOLUME 0x32
  71. #define M98090_REG_DRC_TIMING 0x33
  72. #define M98090_REG_DRC_COMPRESSOR 0x34
  73. #define M98090_REG_DRC_EXPANDER 0x35
  74. #define M98090_REG_DRC_GAIN 0x36
  75. #define M98090_REG_RCV_LOUTL_MIXER 0x37
  76. #define M98090_REG_RCV_LOUTL_CONTROL 0x38
  77. #define M98090_REG_RCV_LOUTL_VOLUME 0x39
  78. #define M98090_REG_LOUTR_MIXER 0x3A
  79. #define M98090_REG_LOUTR_CONTROL 0x3B
  80. #define M98090_REG_LOUTR_VOLUME 0x3C
  81. #define M98090_REG_JACK_DETECT 0x3D
  82. #define M98090_REG_INPUT_ENABLE 0x3E
  83. #define M98090_REG_OUTPUT_ENABLE 0x3F
  84. #define M98090_REG_LEVEL_CONTROL 0x40
  85. #define M98090_REG_DSP_FILTER_ENABLE 0x41
  86. #define M98090_REG_BIAS_CONTROL 0x42
  87. #define M98090_REG_DAC_CONTROL 0x43
  88. #define M98090_REG_ADC_CONTROL 0x44
  89. #define M98090_REG_DEVICE_SHUTDOWN 0x45
  90. #define M98090_REG_EQUALIZER_BASE 0x46
  91. #define M98090_REG_RECORD_BIQUAD_BASE 0xAF
  92. #define M98090_REG_DMIC3_VOLUME 0xBE
  93. #define M98090_REG_DMIC4_VOLUME 0xBF
  94. #define M98090_REG_DMIC34_BQ_PREATTEN 0xC0
  95. #define M98090_REG_RECORD_TDM_SLOT 0xC1
  96. #define M98090_REG_SAMPLE_RATE 0xC2
  97. #define M98090_REG_DMIC34_BIQUAD_BASE 0xC3
  98. #define M98090_REG_REVISION_ID 0xFF
  99. #define M98090_REG_CNT (0xFF+1)
  100. #define MAX98090_MAX_REGISTER 0xFF
  101. /* MAX98090 Register Bit Fields */
  102. /*
  103. * M98090_REG_SOFTWARE_RESET
  104. */
  105. #define M98090_SWRESET_MASK (1<<7)
  106. #define M98090_SWRESET_SHIFT 7
  107. #define M98090_SWRESET_WIDTH 1
  108. /*
  109. * M98090_REG_DEVICE_STATUS
  110. */
  111. #define M98090_CLD_MASK (1<<7)
  112. #define M98090_CLD_SHIFT 7
  113. #define M98090_CLD_WIDTH 1
  114. #define M98090_SLD_MASK (1<<6)
  115. #define M98090_SLD_SHIFT 6
  116. #define M98090_SLD_WIDTH 1
  117. #define M98090_ULK_MASK (1<<5)
  118. #define M98090_ULK_SHIFT 5
  119. #define M98090_ULK_WIDTH 1
  120. #define M98090_JDET_MASK (1<<2)
  121. #define M98090_JDET_SHIFT 2
  122. #define M98090_JDET_WIDTH 1
  123. #define M98090_DRCACT_MASK (1<<1)
  124. #define M98090_DRCACT_SHIFT 1
  125. #define M98090_DRCACT_WIDTH 1
  126. #define M98090_DRCCLP_MASK (1<<0)
  127. #define M98090_DRCCLP_SHIFT 0
  128. #define M98090_DRCCLP_WIDTH 1
  129. /*
  130. * M98090_REG_JACK_STATUS
  131. */
  132. #define M98090_LSNS_MASK (1<<2)
  133. #define M98090_LSNS_SHIFT 2
  134. #define M98090_LSNS_WIDTH 1
  135. #define M98090_JKSNS_MASK (1<<1)
  136. #define M98090_JKSNS_SHIFT 1
  137. #define M98090_JKSNS_WIDTH 1
  138. /*
  139. * M98090_REG_INTERRUPT_S
  140. */
  141. #define M98090_ICLD_MASK (1<<7)
  142. #define M98090_ICLD_SHIFT 7
  143. #define M98090_ICLD_WIDTH 1
  144. #define M98090_ISLD_MASK (1<<6)
  145. #define M98090_ISLD_SHIFT 6
  146. #define M98090_ISLD_WIDTH 1
  147. #define M98090_IULK_MASK (1<<5)
  148. #define M98090_IULK_SHIFT 5
  149. #define M98090_IULK_WIDTH 1
  150. #define M98090_IJDET_MASK (1<<2)
  151. #define M98090_IJDET_SHIFT 2
  152. #define M98090_IJDET_WIDTH 1
  153. #define M98090_IDRCACT_MASK (1<<1)
  154. #define M98090_IDRCACT_SHIFT 1
  155. #define M98090_IDRCACT_WIDTH 1
  156. #define M98090_IDRCCLP_MASK (1<<0)
  157. #define M98090_IDRCCLP_SHIFT 0
  158. #define M98090_IDRCCLP_WIDTH 1
  159. /*
  160. * M98090_REG_QUICK_SYSTEM_CLOCK
  161. */
  162. #define M98090_26M_MASK (1<<7)
  163. #define M98090_26M_SHIFT 7
  164. #define M98090_26M_WIDTH 1
  165. #define M98090_19P2M_MASK (1<<6)
  166. #define M98090_19P2M_SHIFT 6
  167. #define M98090_19P2M_WIDTH 1
  168. #define M98090_13M_MASK (1<<5)
  169. #define M98090_13M_SHIFT 5
  170. #define M98090_13M_WIDTH 1
  171. #define M98090_12P288M_MASK (1<<4)
  172. #define M98090_12P288M_SHIFT 4
  173. #define M98090_12P288M_WIDTH 1
  174. #define M98090_12M_MASK (1<<3)
  175. #define M98090_12M_SHIFT 3
  176. #define M98090_12M_WIDTH 1
  177. #define M98090_11P2896M_MASK (1<<2)
  178. #define M98090_11P2896M_SHIFT 2
  179. #define M98090_11P2896M_WIDTH 1
  180. #define M98090_256FS_MASK (1<<0)
  181. #define M98090_256FS_SHIFT 0
  182. #define M98090_256FS_WIDTH 1
  183. #define M98090_CLK_ALL_SHIFT 0
  184. #define M98090_CLK_ALL_WIDTH 8
  185. #define M98090_CLK_ALL_NUM (1<<M98090_CLK_ALL_WIDTH)
  186. /*
  187. * M98090_REG_QUICK_SAMPLE_RATE
  188. */
  189. #define M98090_SR_96K_MASK (1<<5)
  190. #define M98090_SR_96K_SHIFT 5
  191. #define M98090_SR_96K_WIDTH 1
  192. #define M98090_SR_32K_MASK (1<<4)
  193. #define M98090_SR_32K_SHIFT 4
  194. #define M98090_SR_32K_WIDTH 1
  195. #define M98090_SR_48K_MASK (1<<3)
  196. #define M98090_SR_48K_SHIFT 3
  197. #define M98090_SR_48K_WIDTH 1
  198. #define M98090_SR_44K1_MASK (1<<2)
  199. #define M98090_SR_44K1_SHIFT 2
  200. #define M98090_SR_44K1_WIDTH 1
  201. #define M98090_SR_16K_MASK (1<<1)
  202. #define M98090_SR_16K_SHIFT 1
  203. #define M98090_SR_16K_WIDTH 1
  204. #define M98090_SR_8K_MASK (1<<0)
  205. #define M98090_SR_8K_SHIFT 0
  206. #define M98090_SR_8K_WIDTH 1
  207. #define M98090_SR_MASK 0x3F
  208. #define M98090_SR_ALL_SHIFT 0
  209. #define M98090_SR_ALL_WIDTH 8
  210. #define M98090_SR_ALL_NUM (1<<M98090_SR_ALL_WIDTH)
  211. /*
  212. * M98090_REG_DAI_INTERFACE
  213. */
  214. #define M98090_RJ_M_MASK (1<<5)
  215. #define M98090_RJ_M_SHIFT 5
  216. #define M98090_RJ_M_WIDTH 1
  217. #define M98090_RJ_S_MASK (1<<4)
  218. #define M98090_RJ_S_SHIFT 4
  219. #define M98090_RJ_S_WIDTH 1
  220. #define M98090_LJ_M_MASK (1<<3)
  221. #define M98090_LJ_M_SHIFT 3
  222. #define M98090_LJ_M_WIDTH 1
  223. #define M98090_LJ_S_MASK (1<<2)
  224. #define M98090_LJ_S_SHIFT 2
  225. #define M98090_LJ_S_WIDTH 1
  226. #define M98090_I2S_M_MASK (1<<1)
  227. #define M98090_I2S_M_SHIFT 1
  228. #define M98090_I2S_M_WIDTH 1
  229. #define M98090_I2S_S_MASK (1<<0)
  230. #define M98090_I2S_S_SHIFT 0
  231. #define M98090_I2S_S_WIDTH 1
  232. #define M98090_DAI_ALL_SHIFT 0
  233. #define M98090_DAI_ALL_WIDTH 8
  234. #define M98090_DAI_ALL_NUM (1<<M98090_DAI_ALL_WIDTH)
  235. /*
  236. * M98090_REG_DAC_PATH
  237. */
  238. #define M98090_DIG2_HP_MASK (1<<7)
  239. #define M98090_DIG2_HP_SHIFT 7
  240. #define M98090_DIG2_HP_WIDTH 1
  241. #define M98090_DIG2_EAR_MASK (1<<6)
  242. #define M98090_DIG2_EAR_SHIFT 6
  243. #define M98090_DIG2_EAR_WIDTH 1
  244. #define M98090_DIG2_SPK_MASK (1<<5)
  245. #define M98090_DIG2_SPK_SHIFT 5
  246. #define M98090_DIG2_SPK_WIDTH 1
  247. #define M98090_DIG2_LOUT_MASK (1<<4)
  248. #define M98090_DIG2_LOUT_SHIFT 4
  249. #define M98090_DIG2_LOUT_WIDTH 1
  250. #define M98090_DIG2_ALL_SHIFT 0
  251. #define M98090_DIG2_ALL_WIDTH 8
  252. #define M98090_DIG2_ALL_NUM (1<<M98090_DIG2_ALL_WIDTH)
  253. /*
  254. * M98090_REG_MIC_DIRECT_TO_ADC
  255. */
  256. #define M98090_IN12_MIC1_MASK (1<<7)
  257. #define M98090_IN12_MIC1_SHIFT 7
  258. #define M98090_IN12_MIC1_WIDTH 1
  259. #define M98090_IN34_MIC2_MASK (1<<6)
  260. #define M98090_IN34_MIC2_SHIFT 6
  261. #define M98090_IN34_MIC2_WIDTH 1
  262. #define M98090_IN56_MIC1_MASK (1<<5)
  263. #define M98090_IN56_MIC1_SHIFT 5
  264. #define M98090_IN56_MIC1_WIDTH 1
  265. #define M98090_IN56_MIC2_MASK (1<<4)
  266. #define M98090_IN56_MIC2_SHIFT 4
  267. #define M98090_IN56_MIC2_WIDTH 1
  268. #define M98090_IN12_DADC_MASK (1<<3)
  269. #define M98090_IN12_DADC_SHIFT 3
  270. #define M98090_IN12_DADC_WIDTH 1
  271. #define M98090_IN34_DADC_MASK (1<<2)
  272. #define M98090_IN34_DADC_SHIFT 2
  273. #define M98090_IN34_DADC_WIDTH 1
  274. #define M98090_IN56_DADC_MASK (1<<1)
  275. #define M98090_IN56_DADC_SHIFT 1
  276. #define M98090_IN56_DADC_WIDTH 1
  277. #define M98090_MIC_ALL_SHIFT 0
  278. #define M98090_MIC_ALL_WIDTH 8
  279. #define M98090_MIC_ALL_NUM (1<<M98090_MIC_ALL_WIDTH)
  280. /*
  281. * M98090_REG_LINE_TO_ADC
  282. */
  283. #define M98090_IN12S_AB_MASK (1<<7)
  284. #define M98090_IN12S_AB_SHIFT 7
  285. #define M98090_IN12S_AB_WIDTH 1
  286. #define M98090_IN34S_AB_MASK (1<<6)
  287. #define M98090_IN34S_AB_SHIFT 6
  288. #define M98090_IN34S_AB_WIDTH 1
  289. #define M98090_IN56S_AB_MASK (1<<5)
  290. #define M98090_IN56S_AB_SHIFT 5
  291. #define M98090_IN56S_AB_WIDTH 1
  292. #define M98090_IN34D_A_MASK (1<<4)
  293. #define M98090_IN34D_A_SHIFT 4
  294. #define M98090_IN34D_A_WIDTH 1
  295. #define M98090_IN56D_B_MASK (1<<3)
  296. #define M98090_IN56D_B_SHIFT 3
  297. #define M98090_IN56D_B_WIDTH 1
  298. #define M98090_LINE_ALL_SHIFT 0
  299. #define M98090_LINE_ALL_WIDTH 8
  300. #define M98090_LINE_ALL_NUM (1<<M98090_LINE_ALL_WIDTH)
  301. /*
  302. * M98090_REG_ANALOG_MIC_LOOP
  303. */
  304. #define M98090_IN12_M1HPL_MASK (1<<7)
  305. #define M98090_IN12_M1HPL_SHIFT 7
  306. #define M98090_IN12_M1HPL_WIDTH 1
  307. #define M98090_IN12_M1SPKL_MASK (1<<6)
  308. #define M98090_IN12_M1SPKL_SHIFT 6
  309. #define M98090_IN12_M1SPKL_WIDTH 1
  310. #define M98090_IN12_M1EAR_MASK (1<<5)
  311. #define M98090_IN12_M1EAR_SHIFT 5
  312. #define M98090_IN12_M1EAR_WIDTH 1
  313. #define M98090_IN12_M1LOUTL_MASK (1<<4)
  314. #define M98090_IN12_M1LOUTL_SHIFT 4
  315. #define M98090_IN12_M1LOUTL_WIDTH 1
  316. #define M98090_IN34_M2HPR_MASK (1<<3)
  317. #define M98090_IN34_M2HPR_SHIFT 3
  318. #define M98090_IN34_M2HPR_WIDTH 1
  319. #define M98090_IN34_M2SPKR_MASK (1<<2)
  320. #define M98090_IN34_M2SPKR_SHIFT 2
  321. #define M98090_IN34_M2SPKR_WIDTH 1
  322. #define M98090_IN34_M2EAR_MASK (1<<1)
  323. #define M98090_IN34_M2EAR_SHIFT 1
  324. #define M98090_IN34_M2EAR_WIDTH 1
  325. #define M98090_IN34_M2LOUTR_MASK (1<<0)
  326. #define M98090_IN34_M2LOUTR_SHIFT 0
  327. #define M98090_IN34_M2LOUTR_WIDTH 1
  328. #define M98090_AMIC_ALL_SHIFT 0
  329. #define M98090_AMIC_ALL_WIDTH 8
  330. #define M98090_AMIC_ALL_NUM (1<<M98090_AMIC_ALL_WIDTH)
  331. /*
  332. * M98090_REG_ANALOG_LINE_LOOP
  333. */
  334. #define M98090_IN12S_ABHP_MASK (1<<7)
  335. #define M98090_IN12S_ABHP_SHIFT 7
  336. #define M98090_IN12S_ABHP_WIDTH 1
  337. #define M98090_IN34D_ASPKL_MASK (1<<6)
  338. #define M98090_IN34D_ASPKL_SHIFT 6
  339. #define M98090_IN34D_ASPKL_WIDTH 1
  340. #define M98090_IN34D_AEAR_MASK (1<<5)
  341. #define M98090_IN34D_AEAR_SHIFT 5
  342. #define M98090_IN34D_AEAR_WIDTH 1
  343. #define M98090_IN12S_ABLOUT_MASK (1<<4)
  344. #define M98090_IN12S_ABLOUT_SHIFT 4
  345. #define M98090_IN12S_ABLOUT_WIDTH 1
  346. #define M98090_IN34S_ABHP_MASK (1<<3)
  347. #define M98090_IN34S_ABHP_SHIFT 3
  348. #define M98090_IN34S_ABHP_WIDTH 1
  349. #define M98090_IN56D_BSPKR_MASK (1<<2)
  350. #define M98090_IN56D_BSPKR_SHIFT 2
  351. #define M98090_IN56D_BSPKR_WIDTH 1
  352. #define M98090_IN56D_BEAR_MASK (1<<1)
  353. #define M98090_IN56D_BEAR_SHIFT 1
  354. #define M98090_IN56D_BEAR_WIDTH 1
  355. #define M98090_IN34S_ABLOUT_MASK (1<<0)
  356. #define M98090_IN34S_ABLOUT_SHIFT 0
  357. #define M98090_IN34S_ABLOUT_WIDTH 1
  358. #define M98090_ALIN_ALL_SHIFT 0
  359. #define M98090_ALIN_ALL_WIDTH 8
  360. #define M98090_ALIN_ALL_NUM (1<<M98090_ALIN_ALL_WIDTH)
  361. /*
  362. * M98090_REG_RESERVED
  363. */
  364. /*
  365. * M98090_REG_LINE_INPUT_CONFIG
  366. */
  367. #define M98090_IN34DIFF_MASK (1<<7)
  368. #define M98090_IN34DIFF_SHIFT 7
  369. #define M98090_IN34DIFF_WIDTH 1
  370. #define M98090_IN56DIFF_MASK (1<<6)
  371. #define M98090_IN56DIFF_SHIFT 6
  372. #define M98090_IN56DIFF_WIDTH 1
  373. #define M98090_IN1SEEN_MASK (1<<5)
  374. #define M98090_IN1SEEN_SHIFT 5
  375. #define M98090_IN1SEEN_WIDTH 1
  376. #define M98090_IN2SEEN_MASK (1<<4)
  377. #define M98090_IN2SEEN_SHIFT 4
  378. #define M98090_IN2SEEN_WIDTH 1
  379. #define M98090_IN3SEEN_MASK (1<<3)
  380. #define M98090_IN3SEEN_SHIFT 3
  381. #define M98090_IN3SEEN_WIDTH 1
  382. #define M98090_IN4SEEN_MASK (1<<2)
  383. #define M98090_IN4SEEN_SHIFT 2
  384. #define M98090_IN4SEEN_WIDTH 1
  385. #define M98090_IN5SEEN_MASK (1<<1)
  386. #define M98090_IN5SEEN_SHIFT 1
  387. #define M98090_IN5SEEN_WIDTH 1
  388. #define M98090_IN6SEEN_MASK (1<<0)
  389. #define M98090_IN6SEEN_SHIFT 0
  390. #define M98090_IN6SEEN_WIDTH 1
  391. /*
  392. * M98090_REG_LINE_INPUT_LEVEL
  393. */
  394. #define M98090_MIXG135_MASK (1<<7)
  395. #define M98090_MIXG135_SHIFT 7
  396. #define M98090_MIXG135_WIDTH 1
  397. #define M98090_MIXG135_NUM (1<<M98090_MIXG135_WIDTH)
  398. #define M98090_MIXG246_MASK (1<<6)
  399. #define M98090_MIXG246_SHIFT 6
  400. #define M98090_MIXG246_WIDTH 1
  401. #define M98090_MIXG246_NUM (1<<M98090_MIXG246_WIDTH)
  402. #define M98090_LINAPGA_MASK (7<<3)
  403. #define M98090_LINAPGA_SHIFT 3
  404. #define M98090_LINAPGA_WIDTH 3
  405. #define M98090_LINAPGA_NUM 6
  406. #define M98090_LINBPGA_MASK (7<<0)
  407. #define M98090_LINBPGA_SHIFT 0
  408. #define M98090_LINBPGA_WIDTH 3
  409. #define M98090_LINBPGA_NUM 6
  410. /*
  411. * M98090_REG_INPUT_MODE
  412. */
  413. #define M98090_EXTBUFA_MASK (1<<7)
  414. #define M98090_EXTBUFA_SHIFT 7
  415. #define M98090_EXTBUFA_WIDTH 1
  416. #define M98090_EXTBUFA_NUM (1<<M98090_EXTBUFA_WIDTH)
  417. #define M98090_EXTBUFB_MASK (1<<6)
  418. #define M98090_EXTBUFB_SHIFT 6
  419. #define M98090_EXTBUFB_WIDTH 1
  420. #define M98090_EXTBUFB_NUM (1<<M98090_EXTBUFB_WIDTH)
  421. #define M98090_EXTMIC_MASK (3<<0)
  422. #define M98090_EXTMIC_SHIFT 0
  423. #define M98090_EXTMIC1_SHIFT 0
  424. #define M98090_EXTMIC2_SHIFT 1
  425. #define M98090_EXTMIC_WIDTH 2
  426. #define M98090_EXTMIC_NONE (0<<0)
  427. #define M98090_EXTMIC_MIC1 (1<<0)
  428. #define M98090_EXTMIC_MIC2 (2<<0)
  429. /*
  430. * M98090_REG_MIC1_INPUT_LEVEL
  431. */
  432. #define M98090_MIC_PA1EN_MASK (3<<5)
  433. #define M98090_MIC_PA1EN_SHIFT 5
  434. #define M98090_MIC_PA1EN_WIDTH 2
  435. #define M98090_MIC_PA1EN_NUM 3
  436. #define M98090_MIC_PGAM1_MASK (31<<0)
  437. #define M98090_MIC_PGAM1_SHIFT 0
  438. #define M98090_MIC_PGAM1_WIDTH 5
  439. #define M98090_MIC_PGAM1_NUM 21
  440. /*
  441. * M98090_REG_MIC2_INPUT_LEVEL
  442. */
  443. #define M98090_MIC_PA2EN_MASK (3<<5)
  444. #define M98090_MIC_PA2EN_SHIFT 5
  445. #define M98090_MIC_PA2EN_WIDTH 2
  446. #define M98090_MIC_PA2EN_NUM 3
  447. #define M98090_MIC_PGAM2_MASK (31<<0)
  448. #define M98090_MIC_PGAM2_SHIFT 0
  449. #define M98090_MIC_PGAM2_WIDTH 5
  450. #define M98090_MIC_PGAM2_NUM 21
  451. /*
  452. * M98090_REG_MIC_BIAS_VOLTAGE
  453. */
  454. #define M98090_MBVSEL_MASK (3<<0)
  455. #define M98090_MBVSEL_SHIFT 0
  456. #define M98090_MBVSEL_WIDTH 2
  457. #define M98090_MBVSEL_2V8 (3<<0)
  458. #define M98090_MBVSEL_2V55 (2<<0)
  459. #define M98090_MBVSEL_2V4 (1<<0)
  460. #define M98090_MBVSEL_2V2 (0<<0)
  461. /*
  462. * M98090_REG_DIGITAL_MIC_ENABLE
  463. */
  464. #define M98090_MICCLK_MASK (7<<4)
  465. #define M98090_MICCLK_SHIFT 4
  466. #define M98090_MICCLK_WIDTH 3
  467. #define M98090_DIGMIC4_MASK (1<<3)
  468. #define M98090_DIGMIC4_SHIFT 3
  469. #define M98090_DIGMIC4_WIDTH 1
  470. #define M98090_DIGMIC4_NUM (1<<M98090_DIGMIC4_WIDTH)
  471. #define M98090_DIGMIC3_MASK (1<<2)
  472. #define M98090_DIGMIC3_SHIFT 2
  473. #define M98090_DIGMIC3_WIDTH 1
  474. #define M98090_DIGMIC3_NUM (1<<M98090_DIGMIC3_WIDTH)
  475. #define M98090_DIGMICR_MASK (1<<1)
  476. #define M98090_DIGMICR_SHIFT 1
  477. #define M98090_DIGMICR_WIDTH 1
  478. #define M98090_DIGMICR_NUM (1<<M98090_DIGMICR_WIDTH)
  479. #define M98090_DIGMICL_MASK (1<<0)
  480. #define M98090_DIGMICL_SHIFT 0
  481. #define M98090_DIGMICL_WIDTH 1
  482. #define M98090_DIGMICL_NUM (1<<M98090_DIGMICL_WIDTH)
  483. /*
  484. * M98090_REG_DIGITAL_MIC_CONFIG
  485. */
  486. #define M98090_DMIC_COMP_MASK (15<<4)
  487. #define M98090_DMIC_COMP_SHIFT 4
  488. #define M98090_DMIC_COMP_WIDTH 4
  489. #define M98090_DMIC_COMP_NUM (1<<M98090_DMIC_COMP_WIDTH)
  490. #define M98090_DMIC_FREQ_MASK (3<<0)
  491. #define M98090_DMIC_FREQ_SHIFT 0
  492. #define M98090_DMIC_FREQ_WIDTH 2
  493. /*
  494. * M98090_REG_LEFT_ADC_MIXER
  495. */
  496. #define M98090_MIXADL_MIC2_MASK (1<<6)
  497. #define M98090_MIXADL_MIC2_SHIFT 6
  498. #define M98090_MIXADL_MIC2_WIDTH 1
  499. #define M98090_MIXADL_MIC1_MASK (1<<5)
  500. #define M98090_MIXADL_MIC1_SHIFT 5
  501. #define M98090_MIXADL_MIC1_WIDTH 1
  502. #define M98090_MIXADL_LINEB_MASK (1<<4)
  503. #define M98090_MIXADL_LINEB_SHIFT 4
  504. #define M98090_MIXADL_LINEB_WIDTH 1
  505. #define M98090_MIXADL_LINEA_MASK (1<<3)
  506. #define M98090_MIXADL_LINEA_SHIFT 3
  507. #define M98090_MIXADL_LINEA_WIDTH 1
  508. #define M98090_MIXADL_IN65DIFF_MASK (1<<2)
  509. #define M98090_MIXADL_IN65DIFF_SHIFT 2
  510. #define M98090_MIXADL_IN65DIFF_WIDTH 1
  511. #define M98090_MIXADL_IN34DIFF_MASK (1<<1)
  512. #define M98090_MIXADL_IN34DIFF_SHIFT 1
  513. #define M98090_MIXADL_IN34DIFF_WIDTH 1
  514. #define M98090_MIXADL_IN12DIFF_MASK (1<<0)
  515. #define M98090_MIXADL_IN12DIFF_SHIFT 0
  516. #define M98090_MIXADL_IN12DIFF_WIDTH 1
  517. #define M98090_MIXADL_MASK (255<<0)
  518. #define M98090_MIXADL_SHIFT 0
  519. #define M98090_MIXADL_WIDTH 8
  520. /*
  521. * M98090_REG_RIGHT_ADC_MIXER
  522. */
  523. #define M98090_MIXADR_MIC2_MASK (1<<6)
  524. #define M98090_MIXADR_MIC2_SHIFT 6
  525. #define M98090_MIXADR_MIC2_WIDTH 1
  526. #define M98090_MIXADR_MIC1_MASK (1<<5)
  527. #define M98090_MIXADR_MIC1_SHIFT 5
  528. #define M98090_MIXADR_MIC1_WIDTH 1
  529. #define M98090_MIXADR_LINEB_MASK (1<<4)
  530. #define M98090_MIXADR_LINEB_SHIFT 4
  531. #define M98090_MIXADR_LINEB_WIDTH 1
  532. #define M98090_MIXADR_LINEA_MASK (1<<3)
  533. #define M98090_MIXADR_LINEA_SHIFT 3
  534. #define M98090_MIXADR_LINEA_WIDTH 1
  535. #define M98090_MIXADR_IN65DIFF_MASK (1<<2)
  536. #define M98090_MIXADR_IN65DIFF_SHIFT 2
  537. #define M98090_MIXADR_IN65DIFF_WIDTH 1
  538. #define M98090_MIXADR_IN34DIFF_MASK (1<<1)
  539. #define M98090_MIXADR_IN34DIFF_SHIFT 1
  540. #define M98090_MIXADR_IN34DIFF_WIDTH 1
  541. #define M98090_MIXADR_IN12DIFF_MASK (1<<0)
  542. #define M98090_MIXADR_IN12DIFF_SHIFT 0
  543. #define M98090_MIXADR_IN12DIFF_WIDTH 1
  544. #define M98090_MIXADR_MASK (255<<0)
  545. #define M98090_MIXADR_SHIFT 0
  546. #define M98090_MIXADR_WIDTH 8
  547. /*
  548. * M98090_REG_LEFT_ADC_LEVEL
  549. */
  550. #define M98090_AVLG_MASK (7<<4)
  551. #define M98090_AVLG_SHIFT 4
  552. #define M98090_AVLG_WIDTH 3
  553. #define M98090_AVLG_NUM (1<<M98090_AVLG_WIDTH)
  554. #define M98090_AVL_MASK (15<<0)
  555. #define M98090_AVL_SHIFT 0
  556. #define M98090_AVL_WIDTH 4
  557. #define M98090_AVL_NUM (1<<M98090_AVL_WIDTH)
  558. /*
  559. * M98090_REG_RIGHT_ADC_LEVEL
  560. */
  561. #define M98090_AVRG_MASK (7<<4)
  562. #define M98090_AVRG_SHIFT 4
  563. #define M98090_AVRG_WIDTH 3
  564. #define M98090_AVRG_NUM (1<<M98090_AVRG_WIDTH)
  565. #define M98090_AVR_MASK (15<<0)
  566. #define M98090_AVR_SHIFT 0
  567. #define M98090_AVR_WIDTH 4
  568. #define M98090_AVR_NUM (1<<M98090_AVR_WIDTH)
  569. /*
  570. * M98090_REG_ADC_BIQUAD_LEVEL
  571. */
  572. #define M98090_AVBQ_MASK (15<<0)
  573. #define M98090_AVBQ_SHIFT 0
  574. #define M98090_AVBQ_WIDTH 4
  575. #define M98090_AVBQ_NUM (1<<M98090_AVBQ_WIDTH)
  576. /*
  577. * M98090_REG_ADC_SIDETONE
  578. */
  579. #define M98090_DSTSR_MASK (1<<7)
  580. #define M98090_DSTSR_SHIFT 7
  581. #define M98090_DSTSR_WIDTH 1
  582. #define M98090_DSTSL_MASK (1<<6)
  583. #define M98090_DSTSL_SHIFT 6
  584. #define M98090_DSTSL_WIDTH 1
  585. #define M98090_DVST_MASK (31<<0)
  586. #define M98090_DVST_SHIFT 0
  587. #define M98090_DVST_WIDTH 5
  588. #define M98090_DVST_NUM 31
  589. /*
  590. * M98090_REG_SYSTEM_CLOCK
  591. */
  592. #define M98090_PSCLK_MASK (3<<4)
  593. #define M98090_PSCLK_SHIFT 4
  594. #define M98090_PSCLK_WIDTH 2
  595. #define M98090_PSCLK_DISABLED (0<<4)
  596. #define M98090_PSCLK_DIV1 (1<<4)
  597. #define M98090_PSCLK_DIV2 (2<<4)
  598. #define M98090_PSCLK_DIV4 (3<<4)
  599. /*
  600. * M98090_REG_CLOCK_MODE
  601. */
  602. #define M98090_FREQ_MASK (15<<4)
  603. #define M98090_FREQ_SHIFT 4
  604. #define M98090_FREQ_WIDTH 4
  605. #define M98090_USE_M1_MASK (1<<0)
  606. #define M98090_USE_M1_SHIFT 0
  607. #define M98090_USE_M1_WIDTH 1
  608. #define M98090_USE_M1_NUM (1<<M98090_USE_M1_WIDTH)
  609. /*
  610. * M98090_REG_CLOCK_RATIO_NI_MSB
  611. */
  612. #define M98090_NI_HI_MASK (127<<0)
  613. #define M98090_NI_HI_SHIFT 0
  614. #define M98090_NI_HI_WIDTH 7
  615. #define M98090_NI_HI_NUM (1<<M98090_NI_HI_WIDTH)
  616. /*
  617. * M98090_REG_CLOCK_RATIO_NI_LSB
  618. */
  619. #define M98090_NI_LO_MASK (255<<0)
  620. #define M98090_NI_LO_SHIFT 0
  621. #define M98090_NI_LO_WIDTH 8
  622. #define M98090_NI_LO_NUM (1<<M98090_NI_LO_WIDTH)
  623. /*
  624. * M98090_REG_CLOCK_RATIO_MI_MSB
  625. */
  626. #define M98090_MI_HI_MASK (255<<0)
  627. #define M98090_MI_HI_SHIFT 0
  628. #define M98090_MI_HI_WIDTH 8
  629. #define M98090_MI_HI_NUM (1<<M98090_MI_HI_WIDTH)
  630. /*
  631. * M98090_REG_CLOCK_RATIO_MI_LSB
  632. */
  633. #define M98090_MI_LO_MASK (255<<0)
  634. #define M98090_MI_LO_SHIFT 0
  635. #define M98090_MI_LO_WIDTH 8
  636. #define M98090_MI_LO_NUM (1<<M98090_MI_LO_WIDTH)
  637. /*
  638. * M98090_REG_MASTER_MODE
  639. */
  640. #define M98090_MAS_MASK (1<<7)
  641. #define M98090_MAS_SHIFT 7
  642. #define M98090_MAS_WIDTH 1
  643. #define M98090_BSEL_MASK (1<<0)
  644. #define M98090_BSEL_SHIFT 0
  645. #define M98090_BSEL_WIDTH 1
  646. #define M98090_BSEL_32 (1<<0)
  647. #define M98090_BSEL_48 (2<<0)
  648. #define M98090_BSEL_64 (3<<0)
  649. /*
  650. * M98090_REG_INTERFACE_FORMAT
  651. */
  652. #define M98090_RJ_MASK (1<<5)
  653. #define M98090_RJ_SHIFT 5
  654. #define M98090_RJ_WIDTH 1
  655. #define M98090_WCI_MASK (1<<4)
  656. #define M98090_WCI_SHIFT 4
  657. #define M98090_WCI_WIDTH 1
  658. #define M98090_BCI_MASK (1<<3)
  659. #define M98090_BCI_SHIFT 3
  660. #define M98090_BCI_WIDTH 1
  661. #define M98090_DLY_MASK (1<<2)
  662. #define M98090_DLY_SHIFT 2
  663. #define M98090_DLY_WIDTH 1
  664. #define M98090_WS_MASK (3<<0)
  665. #define M98090_WS_SHIFT 0
  666. #define M98090_WS_WIDTH 2
  667. #define M98090_WS_NUM (1<<M98090_WS_WIDTH)
  668. /*
  669. * M98090_REG_TDM_CONTROL
  670. */
  671. #define M98090_FSW_MASK (1<<1)
  672. #define M98090_FSW_SHIFT 1
  673. #define M98090_FSW_WIDTH 1
  674. #define M98090_TDM_MASK (1<<0)
  675. #define M98090_TDM_SHIFT 0
  676. #define M98090_TDM_WIDTH 1
  677. #define M98090_TDM_NUM (1<<M98090_TDM_WIDTH)
  678. /*
  679. * M98090_REG_TDM_FORMAT
  680. */
  681. #define M98090_TDM_SLOTL_MASK (3<<6)
  682. #define M98090_TDM_SLOTL_SHIFT 6
  683. #define M98090_TDM_SLOTL_WIDTH 2
  684. #define M98090_TDM_SLOTL_NUM (1<<M98090_TDM_SLOTL_WIDTH)
  685. #define M98090_TDM_SLOTR_MASK (3<<4)
  686. #define M98090_TDM_SLOTR_SHIFT 4
  687. #define M98090_TDM_SLOTR_WIDTH 2
  688. #define M98090_TDM_SLOTR_NUM (1<<M98090_TDM_SLOTR_WIDTH)
  689. #define M98090_TDM_SLOTDLY_MASK (15<<0)
  690. #define M98090_TDM_SLOTDLY_SHIFT 0
  691. #define M98090_TDM_SLOTDLY_WIDTH 4
  692. #define M98090_TDM_SLOTDLY_NUM (1<<M98090_TDM_SLOTDLY_WIDTH)
  693. /*
  694. * M98090_REG_IO_CONFIGURATION
  695. */
  696. #define M98090_LTEN_MASK (1<<5)
  697. #define M98090_LTEN_SHIFT 5
  698. #define M98090_LTEN_WIDTH 1
  699. #define M98090_LTEN_NUM (1<<M98090_LTEN_WIDTH)
  700. #define M98090_LBEN_MASK (1<<4)
  701. #define M98090_LBEN_SHIFT 4
  702. #define M98090_LBEN_WIDTH 1
  703. #define M98090_LBEN_NUM (1<<M98090_LBEN_WIDTH)
  704. #define M98090_DMONO_MASK (1<<3)
  705. #define M98090_DMONO_SHIFT 3
  706. #define M98090_DMONO_WIDTH 1
  707. #define M98090_DMONO_NUM (1<<M98090_DMONO_WIDTH)
  708. #define M98090_HIZOFF_MASK (1<<2)
  709. #define M98090_HIZOFF_SHIFT 2
  710. #define M98090_HIZOFF_WIDTH 1
  711. #define M98090_HIZOFF_NUM (1<<M98090_HIZOFF_WIDTH)
  712. #define M98090_SDOEN_MASK (1<<1)
  713. #define M98090_SDOEN_SHIFT 1
  714. #define M98090_SDOEN_WIDTH 1
  715. #define M98090_SDOEN_NUM (1<<M98090_SDOEN_WIDTH)
  716. #define M98090_SDIEN_MASK (1<<0)
  717. #define M98090_SDIEN_SHIFT 0
  718. #define M98090_SDIEN_WIDTH 1
  719. #define M98090_SDIEN_NUM (1<<M98090_SDIEN_WIDTH)
  720. /*
  721. * M98090_REG_FILTER_CONFIG
  722. */
  723. #define M98090_MODE_MASK (1<<7)
  724. #define M98090_MODE_SHIFT 7
  725. #define M98090_MODE_WIDTH 1
  726. #define M98090_AHPF_MASK (1<<6)
  727. #define M98090_AHPF_SHIFT 6
  728. #define M98090_AHPF_WIDTH 1
  729. #define M98090_AHPF_NUM (1<<M98090_AHPF_WIDTH)
  730. #define M98090_DHPF_MASK (1<<5)
  731. #define M98090_DHPF_SHIFT 5
  732. #define M98090_DHPF_WIDTH 1
  733. #define M98090_DHPF_NUM (1<<M98090_DHPF_WIDTH)
  734. #define M98090_DHF_MASK (1<<4)
  735. #define M98090_DHF_SHIFT 4
  736. #define M98090_DHF_WIDTH 1
  737. #define M98090_FLT_DMIC34MODE_MASK (1<<3)
  738. #define M98090_FLT_DMIC34MODE_SHIFT 3
  739. #define M98090_FLT_DMIC34MODE_WIDTH 1
  740. #define M98090_FLT_DMIC34HPF_MASK (1<<2)
  741. #define M98090_FLT_DMIC34HPF_SHIFT 2
  742. #define M98090_FLT_DMIC34HPF_WIDTH 1
  743. #define M98090_FLT_DMIC34HPF_NUM (1<<M98090_FLT_DMIC34HPF_WIDTH)
  744. /*
  745. * M98090_REG_DAI_PLAYBACK_LEVEL
  746. */
  747. #define M98090_DVM_MASK (1<<7)
  748. #define M98090_DVM_SHIFT 7
  749. #define M98090_DVM_WIDTH 1
  750. #define M98090_DVG_MASK (3<<4)
  751. #define M98090_DVG_SHIFT 4
  752. #define M98090_DVG_WIDTH 2
  753. #define M98090_DVG_NUM (1<<M98090_DVG_WIDTH)
  754. #define M98090_DV_MASK (15<<0)
  755. #define M98090_DV_SHIFT 0
  756. #define M98090_DV_WIDTH 4
  757. #define M98090_DV_NUM (1<<M98090_DV_WIDTH)
  758. /*
  759. * M98090_REG_DAI_PLAYBACK_LEVEL_EQ
  760. */
  761. #define M98090_EQCLPN_MASK (1<<4)
  762. #define M98090_EQCLPN_SHIFT 4
  763. #define M98090_EQCLPN_WIDTH 1
  764. #define M98090_EQCLPN_NUM (1<<M98090_EQCLPN_WIDTH)
  765. #define M98090_DVEQ_MASK (15<<0)
  766. #define M98090_DVEQ_SHIFT 0
  767. #define M98090_DVEQ_WIDTH 4
  768. #define M98090_DVEQ_NUM (1<<M98090_DVEQ_WIDTH)
  769. /*
  770. * M98090_REG_LEFT_HP_MIXER
  771. */
  772. #define M98090_MIXHPL_MIC2_MASK (1<<5)
  773. #define M98090_MIXHPL_MIC2_SHIFT 5
  774. #define M98090_MIXHPL_MIC2_WIDTH 1
  775. #define M98090_MIXHPL_MIC1_MASK (1<<4)
  776. #define M98090_MIXHPL_MIC1_SHIFT 4
  777. #define M98090_MIXHPL_MIC1_WIDTH 1
  778. #define M98090_MIXHPL_LINEB_MASK (1<<3)
  779. #define M98090_MIXHPL_LINEB_SHIFT 3
  780. #define M98090_MIXHPL_LINEB_WIDTH 1
  781. #define M98090_MIXHPL_LINEA_MASK (1<<2)
  782. #define M98090_MIXHPL_LINEA_SHIFT 2
  783. #define M98090_MIXHPL_LINEA_WIDTH 1
  784. #define M98090_MIXHPL_DACR_MASK (1<<1)
  785. #define M98090_MIXHPL_DACR_SHIFT 1
  786. #define M98090_MIXHPL_DACR_WIDTH 1
  787. #define M98090_MIXHPL_DACL_MASK (1<<0)
  788. #define M98090_MIXHPL_DACL_SHIFT 0
  789. #define M98090_MIXHPL_DACL_WIDTH 1
  790. #define M98090_MIXHPL_MASK (63<<0)
  791. #define M98090_MIXHPL_SHIFT 0
  792. #define M98090_MIXHPL_WIDTH 6
  793. /*
  794. * M98090_REG_RIGHT_HP_MIXER
  795. */
  796. #define M98090_MIXHPR_MIC2_MASK (1<<5)
  797. #define M98090_MIXHPR_MIC2_SHIFT 5
  798. #define M98090_MIXHPR_MIC2_WIDTH 1
  799. #define M98090_MIXHPR_MIC1_MASK (1<<4)
  800. #define M98090_MIXHPR_MIC1_SHIFT 4
  801. #define M98090_MIXHPR_MIC1_WIDTH 1
  802. #define M98090_MIXHPR_LINEB_MASK (1<<3)
  803. #define M98090_MIXHPR_LINEB_SHIFT 3
  804. #define M98090_MIXHPR_LINEB_WIDTH 1
  805. #define M98090_MIXHPR_LINEA_MASK (1<<2)
  806. #define M98090_MIXHPR_LINEA_SHIFT 2
  807. #define M98090_MIXHPR_LINEA_WIDTH 1
  808. #define M98090_MIXHPR_DACR_MASK (1<<1)
  809. #define M98090_MIXHPR_DACR_SHIFT 1
  810. #define M98090_MIXHPR_DACR_WIDTH 1
  811. #define M98090_MIXHPR_DACL_MASK (1<<0)
  812. #define M98090_MIXHPR_DACL_SHIFT 0
  813. #define M98090_MIXHPR_DACL_WIDTH 1
  814. #define M98090_MIXHPR_MASK (63<<0)
  815. #define M98090_MIXHPR_SHIFT 0
  816. #define M98090_MIXHPR_WIDTH 6
  817. /*
  818. * M98090_REG_HP_CONTROL
  819. */
  820. #define M98090_MIXHPRSEL_MASK (1<<5)
  821. #define M98090_MIXHPRSEL_SHIFT 5
  822. #define M98090_MIXHPRSEL_WIDTH 1
  823. #define M98090_MIXHPLSEL_MASK (1<<4)
  824. #define M98090_MIXHPLSEL_SHIFT 4
  825. #define M98090_MIXHPLSEL_WIDTH 1
  826. #define M98090_MIXHPRG_MASK (3<<2)
  827. #define M98090_MIXHPRG_SHIFT 2
  828. #define M98090_MIXHPRG_WIDTH 2
  829. #define M98090_MIXHPRG_NUM (1<<M98090_MIXHPRG_WIDTH)
  830. #define M98090_MIXHPLG_MASK (3<<0)
  831. #define M98090_MIXHPLG_SHIFT 0
  832. #define M98090_MIXHPLG_WIDTH 2
  833. #define M98090_MIXHPLG_NUM (1<<M98090_MIXHPLG_WIDTH)
  834. /*
  835. * M98090_REG_LEFT_HP_VOLUME
  836. */
  837. #define M98090_HPLM_MASK (1<<7)
  838. #define M98090_HPLM_SHIFT 7
  839. #define M98090_HPLM_WIDTH 1
  840. #define M98090_HPVOLL_MASK (31<<0)
  841. #define M98090_HPVOLL_SHIFT 0
  842. #define M98090_HPVOLL_WIDTH 5
  843. #define M98090_HPVOLL_NUM (1<<M98090_HPVOLL_WIDTH)
  844. /*
  845. * M98090_REG_RIGHT_HP_VOLUME
  846. */
  847. #define M98090_HPRM_MASK (1<<7)
  848. #define M98090_HPRM_SHIFT 7
  849. #define M98090_HPRM_WIDTH 1
  850. #define M98090_HPVOLR_MASK (31<<0)
  851. #define M98090_HPVOLR_SHIFT 0
  852. #define M98090_HPVOLR_WIDTH 5
  853. #define M98090_HPVOLR_NUM (1<<M98090_HPVOLR_WIDTH)
  854. /*
  855. * M98090_REG_LEFT_SPK_MIXER
  856. */
  857. #define M98090_MIXSPL_MIC2_MASK (1<<5)
  858. #define M98090_MIXSPL_MIC2_SHIFT 5
  859. #define M98090_MIXSPL_MIC2_WIDTH 1
  860. #define M98090_MIXSPL_MIC1_MASK (1<<4)
  861. #define M98090_MIXSPL_MIC1_SHIFT 4
  862. #define M98090_MIXSPL_MIC1_WIDTH 1
  863. #define M98090_MIXSPL_LINEB_MASK (1<<3)
  864. #define M98090_MIXSPL_LINEB_SHIFT 3
  865. #define M98090_MIXSPL_LINEB_WIDTH 1
  866. #define M98090_MIXSPL_LINEA_MASK (1<<2)
  867. #define M98090_MIXSPL_LINEA_SHIFT 2
  868. #define M98090_MIXSPL_LINEA_WIDTH 1
  869. #define M98090_MIXSPL_DACR_MASK (1<<1)
  870. #define M98090_MIXSPL_DACR_SHIFT 1
  871. #define M98090_MIXSPL_DACR_WIDTH 1
  872. #define M98090_MIXSPL_DACL_MASK (1<<0)
  873. #define M98090_MIXSPL_DACL_SHIFT 0
  874. #define M98090_MIXSPL_DACL_WIDTH 1
  875. #define M98090_MIXSPL_MASK (63<<0)
  876. #define M98090_MIXSPL_SHIFT 0
  877. #define M98090_MIXSPL_WIDTH 6
  878. #define M98090_MIXSPR_DACR_MASK (1<<1)
  879. #define M98090_MIXSPR_DACR_SHIFT 1
  880. #define M98090_MIXSPR_DACR_WIDTH 1
  881. /*
  882. * M98090_REG_RIGHT_SPK_MIXER
  883. */
  884. #define M98090_SPK_SLAVE_MASK (1<<6)
  885. #define M98090_SPK_SLAVE_SHIFT 6
  886. #define M98090_SPK_SLAVE_WIDTH 1
  887. #define M98090_MIXSPR_MIC2_MASK (1<<5)
  888. #define M98090_MIXSPR_MIC2_SHIFT 5
  889. #define M98090_MIXSPR_MIC2_WIDTH 1
  890. #define M98090_MIXSPR_MIC1_MASK (1<<4)
  891. #define M98090_MIXSPR_MIC1_SHIFT 4
  892. #define M98090_MIXSPR_MIC1_WIDTH 1
  893. #define M98090_MIXSPR_LINEB_MASK (1<<3)
  894. #define M98090_MIXSPR_LINEB_SHIFT 3
  895. #define M98090_MIXSPR_LINEB_WIDTH 1
  896. #define M98090_MIXSPR_LINEA_MASK (1<<2)
  897. #define M98090_MIXSPR_LINEA_SHIFT 2
  898. #define M98090_MIXSPR_LINEA_WIDTH 1
  899. #define M98090_MIXSPR_DACR_MASK (1<<1)
  900. #define M98090_MIXSPR_DACR_SHIFT 1
  901. #define M98090_MIXSPR_DACR_WIDTH 1
  902. #define M98090_MIXSPR_DACL_MASK (1<<0)
  903. #define M98090_MIXSPR_DACL_SHIFT 0
  904. #define M98090_MIXSPR_DACL_WIDTH 1
  905. #define M98090_MIXSPR_MASK (63<<0)
  906. #define M98090_MIXSPR_SHIFT 0
  907. #define M98090_MIXSPR_WIDTH 6
  908. /*
  909. * M98090_REG_SPK_CONTROL
  910. */
  911. #define M98090_MIXSPRG_MASK (3<<2)
  912. #define M98090_MIXSPRG_SHIFT 2
  913. #define M98090_MIXSPRG_WIDTH 2
  914. #define M98090_MIXSPRG_NUM (1<<M98090_MIXSPRG_WIDTH)
  915. #define M98090_MIXSPLG_MASK (3<<0)
  916. #define M98090_MIXSPLG_SHIFT 0
  917. #define M98090_MIXSPLG_WIDTH 2
  918. #define M98090_MIXSPLG_NUM (1<<M98090_MIXSPLG_WIDTH)
  919. /*
  920. * M98090_REG_LEFT_SPK_VOLUME
  921. */
  922. #define M98090_SPLM_MASK (1<<7)
  923. #define M98090_SPLM_SHIFT 7
  924. #define M98090_SPLM_WIDTH 1
  925. #define M98090_SPVOLL_MASK (63<<0)
  926. #define M98090_SPVOLL_SHIFT 0
  927. #define M98090_SPVOLL_WIDTH 6
  928. #define M98090_SPVOLL_NUM 40
  929. /*
  930. * M98090_REG_RIGHT_SPK_VOLUME
  931. */
  932. #define M98090_SPRM_MASK (1<<7)
  933. #define M98090_SPRM_SHIFT 7
  934. #define M98090_SPRM_WIDTH 1
  935. #define M98090_SPVOLR_MASK (63<<0)
  936. #define M98090_SPVOLR_SHIFT 0
  937. #define M98090_SPVOLR_WIDTH 6
  938. #define M98090_SPVOLR_NUM 40
  939. /*
  940. * M98090_REG_DRC_TIMING
  941. */
  942. #define M98090_DRCEN_MASK (1<<7)
  943. #define M98090_DRCEN_SHIFT 7
  944. #define M98090_DRCEN_WIDTH 1
  945. #define M98090_DRCEN_NUM (1<<M98090_DRCEN_WIDTH)
  946. #define M98090_DRCRLS_MASK (7<<4)
  947. #define M98090_DRCRLS_SHIFT 4
  948. #define M98090_DRCRLS_WIDTH 3
  949. #define M98090_DRCATK_MASK (7<<0)
  950. #define M98090_DRCATK_SHIFT 0
  951. #define M98090_DRCATK_WIDTH 3
  952. /*
  953. * M98090_REG_DRC_COMPRESSOR
  954. */
  955. #define M98090_DRCCMP_MASK (7<<5)
  956. #define M98090_DRCCMP_SHIFT 5
  957. #define M98090_DRCCMP_WIDTH 3
  958. #define M98090_DRCTHC_MASK (31<<0)
  959. #define M98090_DRCTHC_SHIFT 0
  960. #define M98090_DRCTHC_WIDTH 5
  961. #define M98090_DRCTHC_NUM (1<<M98090_DRCTHC_WIDTH)
  962. /*
  963. * M98090_REG_DRC_EXPANDER
  964. */
  965. #define M98090_DRCEXP_MASK (7<<5)
  966. #define M98090_DRCEXP_SHIFT 5
  967. #define M98090_DRCEXP_WIDTH 3
  968. #define M98090_DRCTHE_MASK (31<<0)
  969. #define M98090_DRCTHE_SHIFT 0
  970. #define M98090_DRCTHE_WIDTH 5
  971. #define M98090_DRCTHE_NUM (1<<M98090_DRCTHE_WIDTH)
  972. /*
  973. * M98090_REG_DRC_GAIN
  974. */
  975. #define M98090_DRCG_MASK (31<<0)
  976. #define M98090_DRCG_SHIFT 0
  977. #define M98090_DRCG_WIDTH 5
  978. #define M98090_DRCG_NUM 13
  979. /*
  980. * M98090_REG_RCV_LOUTL_MIXER
  981. */
  982. #define M98090_MIXRCVL_MIC2_MASK (1<<5)
  983. #define M98090_MIXRCVL_MIC2_SHIFT 5
  984. #define M98090_MIXRCVL_MIC2_WIDTH 1
  985. #define M98090_MIXRCVL_MIC1_MASK (1<<4)
  986. #define M98090_MIXRCVL_MIC1_SHIFT 4
  987. #define M98090_MIXRCVL_MIC1_WIDTH 1
  988. #define M98090_MIXRCVL_LINEB_MASK (1<<3)
  989. #define M98090_MIXRCVL_LINEB_SHIFT 3
  990. #define M98090_MIXRCVL_LINEB_WIDTH 1
  991. #define M98090_MIXRCVL_LINEA_MASK (1<<2)
  992. #define M98090_MIXRCVL_LINEA_SHIFT 2
  993. #define M98090_MIXRCVL_LINEA_WIDTH 1
  994. #define M98090_MIXRCVL_DACR_MASK (1<<1)
  995. #define M98090_MIXRCVL_DACR_SHIFT 1
  996. #define M98090_MIXRCVL_DACR_WIDTH 1
  997. #define M98090_MIXRCVL_DACL_MASK (1<<0)
  998. #define M98090_MIXRCVL_DACL_SHIFT 0
  999. #define M98090_MIXRCVL_DACL_WIDTH 1
  1000. #define M98090_MIXRCVL_MASK (63<<0)
  1001. #define M98090_MIXRCVL_SHIFT 0
  1002. #define M98090_MIXRCVL_WIDTH 6
  1003. /*
  1004. * M98090_REG_RCV_LOUTL_CONTROL
  1005. */
  1006. #define M98090_MIXRCVLG_MASK (3<<0)
  1007. #define M98090_MIXRCVLG_SHIFT 0
  1008. #define M98090_MIXRCVLG_WIDTH 2
  1009. #define M98090_MIXRCVLG_NUM (1<<M98090_MIXRCVLG_WIDTH)
  1010. /*
  1011. * M98090_REG_RCV_LOUTL_VOLUME
  1012. */
  1013. #define M98090_RCVLM_MASK (1<<7)
  1014. #define M98090_RCVLM_SHIFT 7
  1015. #define M98090_RCVLM_WIDTH 1
  1016. #define M98090_RCVLVOL_MASK (31<<0)
  1017. #define M98090_RCVLVOL_SHIFT 0
  1018. #define M98090_RCVLVOL_WIDTH 5
  1019. #define M98090_RCVLVOL_NUM (1<<M98090_RCVLVOL_WIDTH)
  1020. /*
  1021. * M98090_REG_LOUTR_MIXER
  1022. */
  1023. #define M98090_LINMOD_MASK (1<<7)
  1024. #define M98090_LINMOD_SHIFT 7
  1025. #define M98090_LINMOD_WIDTH 1
  1026. #define M98090_MIXRCVR_MIC2_MASK (1<<5)
  1027. #define M98090_MIXRCVR_MIC2_SHIFT 5
  1028. #define M98090_MIXRCVR_MIC2_WIDTH 1
  1029. #define M98090_MIXRCVR_MIC1_MASK (1<<4)
  1030. #define M98090_MIXRCVR_MIC1_SHIFT 4
  1031. #define M98090_MIXRCVR_MIC1_WIDTH 1
  1032. #define M98090_MIXRCVR_LINEB_MASK (1<<3)
  1033. #define M98090_MIXRCVR_LINEB_SHIFT 3
  1034. #define M98090_MIXRCVR_LINEB_WIDTH 1
  1035. #define M98090_MIXRCVR_LINEA_MASK (1<<2)
  1036. #define M98090_MIXRCVR_LINEA_SHIFT 2
  1037. #define M98090_MIXRCVR_LINEA_WIDTH 1
  1038. #define M98090_MIXRCVR_DACR_MASK (1<<1)
  1039. #define M98090_MIXRCVR_DACR_SHIFT 1
  1040. #define M98090_MIXRCVR_DACR_WIDTH 1
  1041. #define M98090_MIXRCVR_DACL_MASK (1<<0)
  1042. #define M98090_MIXRCVR_DACL_SHIFT 0
  1043. #define M98090_MIXRCVR_DACL_WIDTH 1
  1044. #define M98090_MIXRCVR_MASK (63<<0)
  1045. #define M98090_MIXRCVR_SHIFT 0
  1046. #define M98090_MIXRCVR_WIDTH 6
  1047. /*
  1048. * M98090_REG_LOUTR_CONTROL
  1049. */
  1050. #define M98090_MIXRCVRG_MASK (3<<0)
  1051. #define M98090_MIXRCVRG_SHIFT 0
  1052. #define M98090_MIXRCVRG_WIDTH 2
  1053. #define M98090_MIXRCVRG_NUM (1<<M98090_MIXRCVRG_WIDTH)
  1054. /*
  1055. * M98090_REG_LOUTR_VOLUME
  1056. */
  1057. #define M98090_RCVRM_MASK (1<<7)
  1058. #define M98090_RCVRM_SHIFT 7
  1059. #define M98090_RCVRM_WIDTH 1
  1060. #define M98090_RCVRVOL_MASK (31<<0)
  1061. #define M98090_RCVRVOL_SHIFT 0
  1062. #define M98090_RCVRVOL_WIDTH 5
  1063. #define M98090_RCVRVOL_NUM (1<<M98090_RCVRVOL_WIDTH)
  1064. /*
  1065. * M98090_REG_JACK_DETECT
  1066. */
  1067. #define M98090_JDETEN_MASK (1<<7)
  1068. #define M98090_JDETEN_SHIFT 7
  1069. #define M98090_JDETEN_WIDTH 1
  1070. #define M98090_JDWK_MASK (1<<6)
  1071. #define M98090_JDWK_SHIFT 6
  1072. #define M98090_JDWK_WIDTH 1
  1073. #define M98090_JDEB_MASK (3<<0)
  1074. #define M98090_JDEB_SHIFT 0
  1075. #define M98090_JDEB_WIDTH 2
  1076. #define M98090_JDEB_25MS (0<<0)
  1077. #define M98090_JDEB_50MS (1<<0)
  1078. #define M98090_JDEB_100MS (2<<0)
  1079. #define M98090_JDEB_200MS (3<<0)
  1080. /*
  1081. * M98090_REG_INPUT_ENABLE
  1082. */
  1083. #define M98090_MBEN_MASK (1<<4)
  1084. #define M98090_MBEN_SHIFT 4
  1085. #define M98090_MBEN_WIDTH 1
  1086. #define M98090_LINEAEN_MASK (1<<3)
  1087. #define M98090_LINEAEN_SHIFT 3
  1088. #define M98090_LINEAEN_WIDTH 1
  1089. #define M98090_LINEBEN_MASK (1<<2)
  1090. #define M98090_LINEBEN_SHIFT 2
  1091. #define M98090_LINEBEN_WIDTH 1
  1092. #define M98090_ADREN_MASK (1<<1)
  1093. #define M98090_ADREN_SHIFT 1
  1094. #define M98090_ADREN_WIDTH 1
  1095. #define M98090_ADLEN_MASK (1<<0)
  1096. #define M98090_ADLEN_SHIFT 0
  1097. #define M98090_ADLEN_WIDTH 1
  1098. /*
  1099. * M98090_REG_OUTPUT_ENABLE
  1100. */
  1101. #define M98090_HPREN_MASK (1<<7)
  1102. #define M98090_HPREN_SHIFT 7
  1103. #define M98090_HPREN_WIDTH 1
  1104. #define M98090_HPLEN_MASK (1<<6)
  1105. #define M98090_HPLEN_SHIFT 6
  1106. #define M98090_HPLEN_WIDTH 1
  1107. #define M98090_SPREN_MASK (1<<5)
  1108. #define M98090_SPREN_SHIFT 5
  1109. #define M98090_SPREN_WIDTH 1
  1110. #define M98090_SPLEN_MASK (1<<4)
  1111. #define M98090_SPLEN_SHIFT 4
  1112. #define M98090_SPLEN_WIDTH 1
  1113. #define M98090_RCVLEN_MASK (1<<3)
  1114. #define M98090_RCVLEN_SHIFT 3
  1115. #define M98090_RCVLEN_WIDTH 1
  1116. #define M98090_RCVREN_MASK (1<<2)
  1117. #define M98090_RCVREN_SHIFT 2
  1118. #define M98090_RCVREN_WIDTH 1
  1119. #define M98090_DAREN_MASK (1<<1)
  1120. #define M98090_DAREN_SHIFT 1
  1121. #define M98090_DAREN_WIDTH 1
  1122. #define M98090_DALEN_MASK (1<<0)
  1123. #define M98090_DALEN_SHIFT 0
  1124. #define M98090_DALEN_WIDTH 1
  1125. /*
  1126. * M98090_REG_LEVEL_CONTROL
  1127. */
  1128. #define M98090_ZDENN_MASK (1<<2)
  1129. #define M98090_ZDENN_SHIFT 2
  1130. #define M98090_ZDENN_WIDTH 1
  1131. #define M98090_ZDENN_NUM (1<<M98090_ZDENN_WIDTH)
  1132. #define M98090_VS2ENN_MASK (1<<1)
  1133. #define M98090_VS2ENN_SHIFT 1
  1134. #define M98090_VS2ENN_WIDTH 1
  1135. #define M98090_VS2ENN_NUM (1<<M98090_VS2ENN_WIDTH)
  1136. #define M98090_VSENN_MASK (1<<0)
  1137. #define M98090_VSENN_SHIFT 0
  1138. #define M98090_VSENN_WIDTH 1
  1139. #define M98090_VSENN_NUM (1<<M98090_VSENN_WIDTH)
  1140. /*
  1141. * M98090_REG_DSP_FILTER_ENABLE
  1142. */
  1143. #define M98090_DMIC34BQEN_MASK (1<<4)
  1144. #define M98090_DMIC34BQEN_SHIFT 4
  1145. #define M98090_DMIC34BQEN_WIDTH 1
  1146. #define M98090_DMIC34BQEN_NUM (1<<M98090_DMIC34BQEN_WIDTH)
  1147. #define M98090_ADCBQEN_MASK (1<<3)
  1148. #define M98090_ADCBQEN_SHIFT 3
  1149. #define M98090_ADCBQEN_WIDTH 1
  1150. #define M98090_ADCBQEN_NUM (1<<M98090_ADCBQEN_WIDTH)
  1151. #define M98090_EQ3BANDEN_MASK (1<<2)
  1152. #define M98090_EQ3BANDEN_SHIFT 2
  1153. #define M98090_EQ3BANDEN_WIDTH 1
  1154. #define M98090_EQ3BANDEN_NUM (1<<M98090_EQ3BANDEN_WIDTH)
  1155. #define M98090_EQ5BANDEN_MASK (1<<1)
  1156. #define M98090_EQ5BANDEN_SHIFT 1
  1157. #define M98090_EQ5BANDEN_WIDTH 1
  1158. #define M98090_EQ5BANDEN_NUM (1<<M98090_EQ5BANDEN_WIDTH)
  1159. #define M98090_EQ7BANDEN_MASK (1<<0)
  1160. #define M98090_EQ7BANDEN_SHIFT 0
  1161. #define M98090_EQ7BANDEN_WIDTH 1
  1162. #define M98090_EQ7BANDEN_NUM (1<<M98090_EQ7BANDEN_WIDTH)
  1163. /*
  1164. * M98090_REG_BIAS_CONTROL
  1165. */
  1166. #define M98090_VCM_MODE_MASK (1<<0)
  1167. #define M98090_VCM_MODE_SHIFT 0
  1168. #define M98090_VCM_MODE_WIDTH 1
  1169. #define M98090_VCM_MODE_NUM (1<<M98090_VCM_MODE_WIDTH)
  1170. /*
  1171. * M98090_REG_DAC_CONTROL
  1172. */
  1173. #define M98090_PERFMODE_MASK (1<<1)
  1174. #define M98090_PERFMODE_SHIFT 1
  1175. #define M98090_PERFMODE_WIDTH 1
  1176. #define M98090_PERFMODE_NUM (1<<M98090_PERFMODE_WIDTH)
  1177. #define M98090_DACHP_MASK (1<<0)
  1178. #define M98090_DACHP_SHIFT 0
  1179. #define M98090_DACHP_WIDTH 1
  1180. #define M98090_DACHP_NUM (1<<M98090_DACHP_WIDTH)
  1181. /*
  1182. * M98090_REG_ADC_CONTROL
  1183. */
  1184. #define M98090_OSR128_MASK (1<<2)
  1185. #define M98090_OSR128_SHIFT 2
  1186. #define M98090_OSR128_WIDTH 1
  1187. #define M98090_ADCDITHER_MASK (1<<1)
  1188. #define M98090_ADCDITHER_SHIFT 1
  1189. #define M98090_ADCDITHER_WIDTH 1
  1190. #define M98090_ADCDITHER_NUM (1<<M98090_ADCDITHER_WIDTH)
  1191. #define M98090_ADCHP_MASK (1<<0)
  1192. #define M98090_ADCHP_SHIFT 0
  1193. #define M98090_ADCHP_WIDTH 1
  1194. #define M98090_ADCHP_NUM (1<<M98090_ADCHP_WIDTH)
  1195. /*
  1196. * M98090_REG_DEVICE_SHUTDOWN
  1197. */
  1198. #define M98090_SHDNN_MASK (1<<7)
  1199. #define M98090_SHDNN_SHIFT 7
  1200. #define M98090_SHDNN_WIDTH 1
  1201. /*
  1202. * M98090_REG_EQUALIZER_BASE
  1203. */
  1204. #define M98090_B0_1_HI_MASK (255<<0)
  1205. #define M98090_B0_1_HI_SHIFT 0
  1206. #define M98090_B0_1_HI_WIDTH 8
  1207. #define M98090_B0_1_MID_MASK (255<<0)
  1208. #define M98090_B0_1_MID_SHIFT 0
  1209. #define M98090_B0_1_MID_WIDTH 8
  1210. #define M98090_B0_1_LO_MASK (255<<0)
  1211. #define M98090_B0_1_LO_SHIFT 0
  1212. #define M98090_B0_1_LO_WIDTH 8
  1213. #define M98090_B1_1_HI_MASK (255<<0)
  1214. #define M98090_B1_1_HI_SHIFT 0
  1215. #define M98090_B1_1_HI_WIDTH 8
  1216. #define M98090_B1_1_MID_MASK (255<<0)
  1217. #define M98090_B1_1_MID_SHIFT 0
  1218. #define M98090_B1_1_MID_WIDTH 8
  1219. #define M98090_B1_1_LO_MASK (255<<0)
  1220. #define M98090_B1_1_LO_SHIFT 0
  1221. #define M98090_B1_1_LO_WIDTH 8
  1222. #define M98090_B2_1_HI_MASK (255<<0)
  1223. #define M98090_B2_1_HI_SHIFT 0
  1224. #define M98090_B2_1_HI_WIDTH 8
  1225. #define M98090_B2_1_MID_MASK (255<<0)
  1226. #define M98090_B2_1_MID_SHIFT 0
  1227. #define M98090_B2_1_MID_WIDTH 8
  1228. #define M98090_B2_1_LO_MASK (255<<0)
  1229. #define M98090_B2_1_LO_SHIFT 0
  1230. #define M98090_B2_1_LO_WIDTH 8
  1231. #define M98090_A1_1_HI_MASK (255<<0)
  1232. #define M98090_A1_1_HI_SHIFT 0
  1233. #define M98090_A1_1_HI_WIDTH 8
  1234. #define M98090_A1_1_MID_MASK (255<<0)
  1235. #define M98090_A1_1_MID_SHIFT 0
  1236. #define M98090_A1_1_MID_WIDTH 8
  1237. #define M98090_A1_1_LO_MASK (255<<0)
  1238. #define M98090_A1_1_LO_SHIFT 0
  1239. #define M98090_A1_1_LO_WIDTH 8
  1240. #define M98090_A2_1_HI_MASK (255<<0)
  1241. #define M98090_A2_1_HI_SHIFT 0
  1242. #define M98090_A2_1_HI_WIDTH 8
  1243. #define M98090_A2_1_MID_MASK (255<<0)
  1244. #define M98090_A2_1_MID_SHIFT 0
  1245. #define M98090_A2_1_MID_WIDTH 8
  1246. #define M98090_A2_1_LO_MASK (255<<0)
  1247. #define M98090_A2_1_LO_SHIFT 0
  1248. #define M98090_A2_1_LO_WIDTH 8
  1249. #define M98090_COEFS_PER_BAND 5
  1250. #define M98090_COEFS_BLK_SZ (M98090_COEFS_PER_BAND * 3)
  1251. #define M98090_COEFS_MAX_SZ (M98090_COEFS_BLK_SZ * 7)
  1252. /*
  1253. * M98090_REG_RECORD_BIQUAD_BASE
  1254. */
  1255. #define M98090_REC_B0_HI_MASK (255<<0)
  1256. #define M98090_REC_B0_HI_SHIFT 0
  1257. #define M98090_REC_B0_HI_WIDTH 8
  1258. #define M98090_REC_B0_MID_MASK (255<<0)
  1259. #define M98090_REC_B0_MID_SHIFT 0
  1260. #define M98090_REC_B0_MID_WIDTH 8
  1261. #define M98090_REC_B0_LO_MASK (255<<0)
  1262. #define M98090_REC_B0_LO_SHIFT 0
  1263. #define M98090_REC_B0_LO_WIDTH 8
  1264. #define M98090_REC_B1_HI_MASK (255<<0)
  1265. #define M98090_REC_B1_HI_SHIFT 0
  1266. #define M98090_REC_B1_HI_WIDTH 8
  1267. #define M98090_REC_B1_MID_MASK (255<<0)
  1268. #define M98090_REC_B1_MID_SHIFT 0
  1269. #define M98090_REC_B1_MID_WIDTH 8
  1270. #define M98090_REC_B1_LO_MASK (255<<0)
  1271. #define M98090_REC_B1_LO_SHIFT 0
  1272. #define M98090_REC_B1_LO_WIDTH 8
  1273. #define M98090_REC_B2_HI_MASK (255<<0)
  1274. #define M98090_REC_B2_HI_SHIFT 0
  1275. #define M98090_REC_B2_HI_WIDTH 8
  1276. #define M98090_REC_B2_MID_MASK (255<<0)
  1277. #define M98090_REC_B2_MID_SHIFT 0
  1278. #define M98090_REC_B2_MID_WIDTH 8
  1279. #define M98090_REC_B2_LO_MASK (255<<0)
  1280. #define M98090_REC_B2_LO_SHIFT 0
  1281. #define M98090_REC_B2_LO_WIDTH 8
  1282. #define M98090_REC_A1_HI_MASK (255<<0)
  1283. #define M98090_REC_A1_HI_SHIFT 0
  1284. #define M98090_REC_A1_HI_WIDTH 8
  1285. #define M98090_REC_A1_MID_MASK (255<<0)
  1286. #define M98090_REC_A1_MID_SHIFT 0
  1287. #define M98090_REC_A1_MID_WIDTH 8
  1288. #define M98090_REC_A1_LO_MASK (255<<0)
  1289. #define M98090_REC_A1_LO_SHIFT 0
  1290. #define M98090_REC_A1_LO_WIDTH 8
  1291. #define M98090_REC_A2_HI_MASK (255<<0)
  1292. #define M98090_REC_A2_HI_SHIFT 0
  1293. #define M98090_REC_A2_HI_WIDTH 8
  1294. #define M98090_REC_A2_MID_MASK (255<<0)
  1295. #define M98090_REC_A2_MID_SHIFT 0
  1296. #define M98090_REC_A2_MID_WIDTH 8
  1297. #define M98090_REC_A2_LO_MASK (255<<0)
  1298. #define M98090_REC_A2_LO_SHIFT 0
  1299. #define M98090_REC_A2_LO_WIDTH 8
  1300. /*
  1301. * M98090_REG_DMIC3_VOLUME
  1302. */
  1303. #define M98090_DMIC_AV3G_MASK (7<<4)
  1304. #define M98090_DMIC_AV3G_SHIFT 4
  1305. #define M98090_DMIC_AV3G_WIDTH 3
  1306. #define M98090_DMIC_AV3G_NUM (1<<M98090_DMIC_AV3G_WIDTH)
  1307. #define M98090_DMIC_AV3_MASK (15<<0)
  1308. #define M98090_DMIC_AV3_SHIFT 0
  1309. #define M98090_DMIC_AV3_WIDTH 4
  1310. #define M98090_DMIC_AV3_NUM (1<<M98090_DMIC_AV3_WIDTH)
  1311. /*
  1312. * M98090_REG_DMIC4_VOLUME
  1313. */
  1314. #define M98090_DMIC_AV4G_MASK (7<<4)
  1315. #define M98090_DMIC_AV4G_SHIFT 4
  1316. #define M98090_DMIC_AV4G_WIDTH 3
  1317. #define M98090_DMIC_AV4G_NUM (1<<M98090_DMIC_AV4G_WIDTH)
  1318. #define M98090_DMIC_AV4_MASK (15<<0)
  1319. #define M98090_DMIC_AV4_SHIFT 0
  1320. #define M98090_DMIC_AV4_WIDTH 4
  1321. #define M98090_DMIC_AV4_NUM (1<<M98090_DMIC_AV4_WIDTH)
  1322. /*
  1323. * M98090_REG_DMIC34_BQ_PREATTEN
  1324. */
  1325. #define M98090_AV34BQ_MASK (15<<0)
  1326. #define M98090_AV34BQ_SHIFT 0
  1327. #define M98090_AV34BQ_WIDTH 4
  1328. #define M98090_AV34BQ_NUM (1<<M98090_AV34BQ_WIDTH)
  1329. /*
  1330. * M98090_REG_RECORD_TDM_SLOT
  1331. */
  1332. #define M98090_TDM_SLOTADCL_MASK (3<<6)
  1333. #define M98090_TDM_SLOTADCL_SHIFT 6
  1334. #define M98090_TDM_SLOTADCL_WIDTH 2
  1335. #define M98090_TDM_SLOTADCL_NUM (1<<M98090_TDM_SLOTADCL_WIDTH)
  1336. #define M98090_TDM_SLOTADCR_MASK (3<<4)
  1337. #define M98090_TDM_SLOTADCR_SHIFT 4
  1338. #define M98090_TDM_SLOTADCR_WIDTH 2
  1339. #define M98090_TDM_SLOTADCR_NUM (1<<M98090_TDM_SLOTADCR_WIDTH)
  1340. #define M98090_TDM_SLOTDMIC3_MASK (3<<2)
  1341. #define M98090_TDM_SLOTDMIC3_SHIFT 2
  1342. #define M98090_TDM_SLOTDMIC3_WIDTH 2
  1343. #define M98090_TDM_SLOTDMIC3_NUM (1<<M98090_TDM_SLOTDMIC3_WIDTH)
  1344. #define M98090_TDM_SLOTDMIC4_MASK (3<<0)
  1345. #define M98090_TDM_SLOTDMIC4_SHIFT 0
  1346. #define M98090_TDM_SLOTDMIC4_WIDTH 2
  1347. #define M98090_TDM_SLOTDMIC4_NUM (1<<M98090_TDM_SLOTDMIC4_WIDTH)
  1348. /*
  1349. * M98090_REG_SAMPLE_RATE
  1350. */
  1351. #define M98090_DMIC34_ZEROPAD_MASK (1<<4)
  1352. #define M98090_DMIC34_ZEROPAD_SHIFT 4
  1353. #define M98090_DMIC34_ZEROPAD_WIDTH 1
  1354. #define M98090_DMIC34_ZEROPAD_NUM (1<<M98090_DIGMIC4_WIDTH)
  1355. #define M98090_DMIC34_SRDIV_MASK (7<<0)
  1356. #define M98090_DMIC34_SRDIV_SHIFT 0
  1357. #define M98090_DMIC34_SRDIV_WIDTH 3
  1358. /*
  1359. * M98090_REG_DMIC34_BIQUAD_BASE
  1360. */
  1361. #define M98090_DMIC34_B0_HI_MASK (255<<0)
  1362. #define M98090_DMIC34_B0_HI_SHIFT 0
  1363. #define M98090_DMIC34_B0_HI_WIDTH 8
  1364. #define M98090_DMIC34_B0_MID_MASK (255<<0)
  1365. #define M98090_DMIC34_B0_MID_SHIFT 0
  1366. #define M98090_DMIC34_B0_MID_WIDTH 8
  1367. #define M98090_DMIC34_B0_LO_MASK (255<<0)
  1368. #define M98090_DMIC34_B0_LO_SHIFT 0
  1369. #define M98090_DMIC34_B0_LO_WIDTH 8
  1370. #define M98090_DMIC34_B1_HI_MASK (255<<0)
  1371. #define M98090_DMIC34_B1_HI_SHIFT 0
  1372. #define M98090_DMIC34_B1_HI_WIDTH 8
  1373. #define M98090_DMIC34_B1_MID_MASK (255<<0)
  1374. #define M98090_DMIC34_B1_MID_SHIFT 0
  1375. #define M98090_DMIC34_B1_MID_WIDTH 8
  1376. #define M98090_DMIC34_B1_LO_MASK (255<<0)
  1377. #define M98090_DMIC34_B1_LO_SHIFT 0
  1378. #define M98090_DMIC34_B1_LO_WIDTH 8
  1379. #define M98090_DMIC34_B2_HI_MASK (255<<0)
  1380. #define M98090_DMIC34_B2_HI_SHIFT 0
  1381. #define M98090_DMIC34_B2_HI_WIDTH 8
  1382. #define M98090_DMIC34_B2_MID_MASK (255<<0)
  1383. #define M98090_DMIC34_B2_MID_SHIFT 0
  1384. #define M98090_DMIC34_B2_MID_WIDTH 8
  1385. #define M98090_DMIC34_B2_LO_MASK (255<<0)
  1386. #define M98090_DMIC34_B2_LO_SHIFT 0
  1387. #define M98090_DMIC34_B2_LO_WIDTH 8
  1388. #define M98090_DMIC34_A1_HI_MASK (255<<0)
  1389. #define M98090_DMIC34_A1_HI_SHIFT 0
  1390. #define M98090_DMIC34_A1_HI_WIDTH 8
  1391. #define M98090_DMIC34_A1_MID_MASK (255<<0)
  1392. #define M98090_DMIC34_A1_MID_SHIFT 0
  1393. #define M98090_DMIC34_A1_MID_WIDTH 8
  1394. #define M98090_DMIC34_A1_LO_MASK (255<<0)
  1395. #define M98090_DMIC34_A1_LO_SHIFT 0
  1396. #define M98090_DMIC34_A1_LO_WIDTH 8
  1397. #define M98090_DMIC34_A2_HI_MASK (255<<0)
  1398. #define M98090_DMIC34_A2_HI_SHIFT 0
  1399. #define M98090_DMIC34_A2_HI_WIDTH 8
  1400. #define M98090_DMIC34_A2_MID_MASK (255<<0)
  1401. #define M98090_DMIC34_A2_MID_SHIFT 0
  1402. #define M98090_DMIC34_A2_MID_WIDTH 8
  1403. #define M98090_DMIC34_A2_LO_MASK (255<<0)
  1404. #define M98090_DMIC34_A2_LO_SHIFT 0
  1405. #define M98090_DMIC34_A2_LO_WIDTH 8
  1406. #define M98090_JACK_STATE_NO_HEADSET 0
  1407. #define M98090_JACK_STATE_NO_HEADSET_2 1
  1408. #define M98090_JACK_STATE_HEADPHONE 2
  1409. #define M98090_JACK_STATE_HEADSET 3
  1410. /*
  1411. * M98090_REG_REVISION_ID
  1412. */
  1413. #define M98090_REVID_MASK (255<<0)
  1414. #define M98090_REVID_SHIFT 0
  1415. #define M98090_REVID_WIDTH 8
  1416. #define M98090_REVID_NUM (1<<M98090_REVID_WIDTH)
  1417. /* Silicon revision number */
  1418. #define M98090_REVA 0x40
  1419. #define M98091_REVA 0x50
  1420. enum max98090_type {
  1421. MAX98090,
  1422. MAX98091,
  1423. };
  1424. struct max98090_cdata {
  1425. unsigned int rate;
  1426. unsigned int fmt;
  1427. };
  1428. struct max98090_priv {
  1429. struct regmap *regmap;
  1430. struct snd_soc_codec *codec;
  1431. enum max98090_type devtype;
  1432. struct max98090_pdata *pdata;
  1433. struct clk *mclk;
  1434. unsigned int sysclk;
  1435. unsigned int pclk;
  1436. unsigned int bclk;
  1437. unsigned int lrclk;
  1438. u32 dmic_freq;
  1439. struct max98090_cdata dai[1];
  1440. int jack_state;
  1441. struct delayed_work jack_work;
  1442. struct delayed_work pll_det_enable_work;
  1443. struct work_struct pll_det_disable_work;
  1444. struct work_struct pll_work;
  1445. struct snd_soc_jack *jack;
  1446. unsigned int dai_fmt;
  1447. int tdm_slots;
  1448. int tdm_width;
  1449. u8 lin_state;
  1450. unsigned int pa1en;
  1451. unsigned int pa2en;
  1452. unsigned int sidetone;
  1453. bool master;
  1454. bool shdn_pending;
  1455. };
  1456. int max98090_mic_detect(struct snd_soc_codec *codec,
  1457. struct snd_soc_jack *jack);
  1458. #endif