wm8994.c 135 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055
  1. /*
  2. * wm8994.c -- WM8994 ALSA SoC Audio driver
  3. *
  4. * Copyright 2009 Wolfson Microelectronics plc
  5. *
  6. * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
  7. *
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #include <linux/module.h>
  14. #include <linux/moduleparam.h>
  15. #include <linux/init.h>
  16. #include <linux/delay.h>
  17. #include <linux/pm.h>
  18. #include <linux/i2c.h>
  19. #include <linux/platform_device.h>
  20. #include <linux/regulator/consumer.h>
  21. #include <sound/core.h>
  22. #include <sound/pcm.h>
  23. #include <sound/pcm_params.h>
  24. #include <sound/soc.h>
  25. #include <sound/soc-dapm.h>
  26. #include <sound/initval.h>
  27. #include <sound/tlv.h>
  28. #include <linux/mfd/wm8994/core.h>
  29. #include <linux/mfd/wm8994/registers.h>
  30. #include <linux/mfd/wm8994/pdata.h>
  31. #include <linux/mfd/wm8994/gpio.h>
  32. #include "wm8994.h"
  33. #include "wm_hubs.h"
  34. static struct snd_soc_codec *wm8994_codec;
  35. struct snd_soc_codec_device soc_codec_dev_wm8994;
  36. struct fll_config {
  37. int src;
  38. int in;
  39. int out;
  40. };
  41. #define WM8994_NUM_DRC 3
  42. #define WM8994_NUM_EQ 3
  43. static int wm8994_drc_base[] = {
  44. WM8994_AIF1_DRC1_1,
  45. WM8994_AIF1_DRC2_1,
  46. WM8994_AIF2_DRC_1,
  47. };
  48. static int wm8994_retune_mobile_base[] = {
  49. WM8994_AIF1_DAC1_EQ_GAINS_1,
  50. WM8994_AIF1_DAC2_EQ_GAINS_1,
  51. WM8994_AIF2_EQ_GAINS_1,
  52. };
  53. #define WM8994_REG_CACHE_SIZE 0x621
  54. struct wm8994_micdet {
  55. struct snd_soc_jack *jack;
  56. int det;
  57. int shrt;
  58. };
  59. /* codec private data */
  60. struct wm8994_priv {
  61. struct wm_hubs_data hubs;
  62. struct snd_soc_codec codec;
  63. u16 reg_cache[WM8994_REG_CACHE_SIZE + 1];
  64. int sysclk[2];
  65. int sysclk_rate[2];
  66. int mclk[2];
  67. int aifclk[2];
  68. struct fll_config fll[2], fll_suspend[2];
  69. int dac_rates[2];
  70. int lrclk_shared[2];
  71. /* Platform dependant DRC configuration */
  72. const char **drc_texts;
  73. int drc_cfg[WM8994_NUM_DRC];
  74. struct soc_enum drc_enum;
  75. /* Platform dependant ReTune mobile configuration */
  76. int num_retune_mobile_texts;
  77. const char **retune_mobile_texts;
  78. int retune_mobile_cfg[WM8994_NUM_EQ];
  79. struct soc_enum retune_mobile_enum;
  80. struct wm8994_micdet micdet[2];
  81. struct wm8994_pdata *pdata;
  82. };
  83. static struct {
  84. unsigned short readable; /* Mask of readable bits */
  85. unsigned short writable; /* Mask of writable bits */
  86. unsigned short vol; /* Mask of volatile bits */
  87. } access_masks[] = {
  88. { 0xFFFF, 0xFFFF, 0x0000 }, /* R0 - Software Reset */
  89. { 0x3B37, 0x3B37, 0x0000 }, /* R1 - Power Management (1) */
  90. { 0x6BF0, 0x6BF0, 0x0000 }, /* R2 - Power Management (2) */
  91. { 0x3FF0, 0x3FF0, 0x0000 }, /* R3 - Power Management (3) */
  92. { 0x3F3F, 0x3F3F, 0x0000 }, /* R4 - Power Management (4) */
  93. { 0x3F0F, 0x3F0F, 0x0000 }, /* R5 - Power Management (5) */
  94. { 0x003F, 0x003F, 0x0000 }, /* R6 - Power Management (6) */
  95. { 0x0000, 0x0000, 0x0000 }, /* R7 */
  96. { 0x0000, 0x0000, 0x0000 }, /* R8 */
  97. { 0x0000, 0x0000, 0x0000 }, /* R9 */
  98. { 0x0000, 0x0000, 0x0000 }, /* R10 */
  99. { 0x0000, 0x0000, 0x0000 }, /* R11 */
  100. { 0x0000, 0x0000, 0x0000 }, /* R12 */
  101. { 0x0000, 0x0000, 0x0000 }, /* R13 */
  102. { 0x0000, 0x0000, 0x0000 }, /* R14 */
  103. { 0x0000, 0x0000, 0x0000 }, /* R15 */
  104. { 0x0000, 0x0000, 0x0000 }, /* R16 */
  105. { 0x0000, 0x0000, 0x0000 }, /* R17 */
  106. { 0x0000, 0x0000, 0x0000 }, /* R18 */
  107. { 0x0000, 0x0000, 0x0000 }, /* R19 */
  108. { 0x0000, 0x0000, 0x0000 }, /* R20 */
  109. { 0x01C0, 0x01C0, 0x0000 }, /* R21 - Input Mixer (1) */
  110. { 0x0000, 0x0000, 0x0000 }, /* R22 */
  111. { 0x0000, 0x0000, 0x0000 }, /* R23 */
  112. { 0x00DF, 0x01DF, 0x0000 }, /* R24 - Left Line Input 1&2 Volume */
  113. { 0x00DF, 0x01DF, 0x0000 }, /* R25 - Left Line Input 3&4 Volume */
  114. { 0x00DF, 0x01DF, 0x0000 }, /* R26 - Right Line Input 1&2 Volume */
  115. { 0x00DF, 0x01DF, 0x0000 }, /* R27 - Right Line Input 3&4 Volume */
  116. { 0x00FF, 0x01FF, 0x0000 }, /* R28 - Left Output Volume */
  117. { 0x00FF, 0x01FF, 0x0000 }, /* R29 - Right Output Volume */
  118. { 0x0077, 0x0077, 0x0000 }, /* R30 - Line Outputs Volume */
  119. { 0x0030, 0x0030, 0x0000 }, /* R31 - HPOUT2 Volume */
  120. { 0x00FF, 0x01FF, 0x0000 }, /* R32 - Left OPGA Volume */
  121. { 0x00FF, 0x01FF, 0x0000 }, /* R33 - Right OPGA Volume */
  122. { 0x007F, 0x007F, 0x0000 }, /* R34 - SPKMIXL Attenuation */
  123. { 0x017F, 0x017F, 0x0000 }, /* R35 - SPKMIXR Attenuation */
  124. { 0x003F, 0x003F, 0x0000 }, /* R36 - SPKOUT Mixers */
  125. { 0x003F, 0x003F, 0x0000 }, /* R37 - ClassD */
  126. { 0x00FF, 0x01FF, 0x0000 }, /* R38 - Speaker Volume Left */
  127. { 0x00FF, 0x01FF, 0x0000 }, /* R39 - Speaker Volume Right */
  128. { 0x00FF, 0x00FF, 0x0000 }, /* R40 - Input Mixer (2) */
  129. { 0x01B7, 0x01B7, 0x0000 }, /* R41 - Input Mixer (3) */
  130. { 0x01B7, 0x01B7, 0x0000 }, /* R42 - Input Mixer (4) */
  131. { 0x01C7, 0x01C7, 0x0000 }, /* R43 - Input Mixer (5) */
  132. { 0x01C7, 0x01C7, 0x0000 }, /* R44 - Input Mixer (6) */
  133. { 0x01FF, 0x01FF, 0x0000 }, /* R45 - Output Mixer (1) */
  134. { 0x01FF, 0x01FF, 0x0000 }, /* R46 - Output Mixer (2) */
  135. { 0x0FFF, 0x0FFF, 0x0000 }, /* R47 - Output Mixer (3) */
  136. { 0x0FFF, 0x0FFF, 0x0000 }, /* R48 - Output Mixer (4) */
  137. { 0x0FFF, 0x0FFF, 0x0000 }, /* R49 - Output Mixer (5) */
  138. { 0x0FFF, 0x0FFF, 0x0000 }, /* R50 - Output Mixer (6) */
  139. { 0x0038, 0x0038, 0x0000 }, /* R51 - HPOUT2 Mixer */
  140. { 0x0077, 0x0077, 0x0000 }, /* R52 - Line Mixer (1) */
  141. { 0x0077, 0x0077, 0x0000 }, /* R53 - Line Mixer (2) */
  142. { 0x03FF, 0x03FF, 0x0000 }, /* R54 - Speaker Mixer */
  143. { 0x00C1, 0x00C1, 0x0000 }, /* R55 - Additional Control */
  144. { 0x00F0, 0x00F0, 0x0000 }, /* R56 - AntiPOP (1) */
  145. { 0x01EF, 0x01EF, 0x0000 }, /* R57 - AntiPOP (2) */
  146. { 0x00FF, 0x00FF, 0x0000 }, /* R58 - MICBIAS */
  147. { 0x000F, 0x000F, 0x0000 }, /* R59 - LDO 1 */
  148. { 0x0007, 0x0007, 0x0000 }, /* R60 - LDO 2 */
  149. { 0x0000, 0x0000, 0x0000 }, /* R61 */
  150. { 0x0000, 0x0000, 0x0000 }, /* R62 */
  151. { 0x0000, 0x0000, 0x0000 }, /* R63 */
  152. { 0x0000, 0x0000, 0x0000 }, /* R64 */
  153. { 0x0000, 0x0000, 0x0000 }, /* R65 */
  154. { 0x0000, 0x0000, 0x0000 }, /* R66 */
  155. { 0x0000, 0x0000, 0x0000 }, /* R67 */
  156. { 0x0000, 0x0000, 0x0000 }, /* R68 */
  157. { 0x0000, 0x0000, 0x0000 }, /* R69 */
  158. { 0x0000, 0x0000, 0x0000 }, /* R70 */
  159. { 0x0000, 0x0000, 0x0000 }, /* R71 */
  160. { 0x0000, 0x0000, 0x0000 }, /* R72 */
  161. { 0x0000, 0x0000, 0x0000 }, /* R73 */
  162. { 0x0000, 0x0000, 0x0000 }, /* R74 */
  163. { 0x0000, 0x0000, 0x0000 }, /* R75 */
  164. { 0x8000, 0x8000, 0x0000 }, /* R76 - Charge Pump (1) */
  165. { 0x0000, 0x0000, 0x0000 }, /* R77 */
  166. { 0x0000, 0x0000, 0x0000 }, /* R78 */
  167. { 0x0000, 0x0000, 0x0000 }, /* R79 */
  168. { 0x0000, 0x0000, 0x0000 }, /* R80 */
  169. { 0x0301, 0x0301, 0x0000 }, /* R81 - Class W (1) */
  170. { 0x0000, 0x0000, 0x0000 }, /* R82 */
  171. { 0x0000, 0x0000, 0x0000 }, /* R83 */
  172. { 0x333F, 0x333F, 0x0000 }, /* R84 - DC Servo (1) */
  173. { 0x0FEF, 0x0FEF, 0x0000 }, /* R85 - DC Servo (2) */
  174. { 0x0000, 0x0000, 0x0000 }, /* R86 */
  175. { 0xFFFF, 0xFFFF, 0x0000 }, /* R87 - DC Servo (4) */
  176. { 0x0333, 0x0000, 0x0000 }, /* R88 - DC Servo Readback */
  177. { 0x0000, 0x0000, 0x0000 }, /* R89 */
  178. { 0x0000, 0x0000, 0x0000 }, /* R90 */
  179. { 0x0000, 0x0000, 0x0000 }, /* R91 */
  180. { 0x0000, 0x0000, 0x0000 }, /* R92 */
  181. { 0x0000, 0x0000, 0x0000 }, /* R93 */
  182. { 0x0000, 0x0000, 0x0000 }, /* R94 */
  183. { 0x0000, 0x0000, 0x0000 }, /* R95 */
  184. { 0x00EE, 0x00EE, 0x0000 }, /* R96 - Analogue HP (1) */
  185. { 0x0000, 0x0000, 0x0000 }, /* R97 */
  186. { 0x0000, 0x0000, 0x0000 }, /* R98 */
  187. { 0x0000, 0x0000, 0x0000 }, /* R99 */
  188. { 0x0000, 0x0000, 0x0000 }, /* R100 */
  189. { 0x0000, 0x0000, 0x0000 }, /* R101 */
  190. { 0x0000, 0x0000, 0x0000 }, /* R102 */
  191. { 0x0000, 0x0000, 0x0000 }, /* R103 */
  192. { 0x0000, 0x0000, 0x0000 }, /* R104 */
  193. { 0x0000, 0x0000, 0x0000 }, /* R105 */
  194. { 0x0000, 0x0000, 0x0000 }, /* R106 */
  195. { 0x0000, 0x0000, 0x0000 }, /* R107 */
  196. { 0x0000, 0x0000, 0x0000 }, /* R108 */
  197. { 0x0000, 0x0000, 0x0000 }, /* R109 */
  198. { 0x0000, 0x0000, 0x0000 }, /* R110 */
  199. { 0x0000, 0x0000, 0x0000 }, /* R111 */
  200. { 0x0000, 0x0000, 0x0000 }, /* R112 */
  201. { 0x0000, 0x0000, 0x0000 }, /* R113 */
  202. { 0x0000, 0x0000, 0x0000 }, /* R114 */
  203. { 0x0000, 0x0000, 0x0000 }, /* R115 */
  204. { 0x0000, 0x0000, 0x0000 }, /* R116 */
  205. { 0x0000, 0x0000, 0x0000 }, /* R117 */
  206. { 0x0000, 0x0000, 0x0000 }, /* R118 */
  207. { 0x0000, 0x0000, 0x0000 }, /* R119 */
  208. { 0x0000, 0x0000, 0x0000 }, /* R120 */
  209. { 0x0000, 0x0000, 0x0000 }, /* R121 */
  210. { 0x0000, 0x0000, 0x0000 }, /* R122 */
  211. { 0x0000, 0x0000, 0x0000 }, /* R123 */
  212. { 0x0000, 0x0000, 0x0000 }, /* R124 */
  213. { 0x0000, 0x0000, 0x0000 }, /* R125 */
  214. { 0x0000, 0x0000, 0x0000 }, /* R126 */
  215. { 0x0000, 0x0000, 0x0000 }, /* R127 */
  216. { 0x0000, 0x0000, 0x0000 }, /* R128 */
  217. { 0x0000, 0x0000, 0x0000 }, /* R129 */
  218. { 0x0000, 0x0000, 0x0000 }, /* R130 */
  219. { 0x0000, 0x0000, 0x0000 }, /* R131 */
  220. { 0x0000, 0x0000, 0x0000 }, /* R132 */
  221. { 0x0000, 0x0000, 0x0000 }, /* R133 */
  222. { 0x0000, 0x0000, 0x0000 }, /* R134 */
  223. { 0x0000, 0x0000, 0x0000 }, /* R135 */
  224. { 0x0000, 0x0000, 0x0000 }, /* R136 */
  225. { 0x0000, 0x0000, 0x0000 }, /* R137 */
  226. { 0x0000, 0x0000, 0x0000 }, /* R138 */
  227. { 0x0000, 0x0000, 0x0000 }, /* R139 */
  228. { 0x0000, 0x0000, 0x0000 }, /* R140 */
  229. { 0x0000, 0x0000, 0x0000 }, /* R141 */
  230. { 0x0000, 0x0000, 0x0000 }, /* R142 */
  231. { 0x0000, 0x0000, 0x0000 }, /* R143 */
  232. { 0x0000, 0x0000, 0x0000 }, /* R144 */
  233. { 0x0000, 0x0000, 0x0000 }, /* R145 */
  234. { 0x0000, 0x0000, 0x0000 }, /* R146 */
  235. { 0x0000, 0x0000, 0x0000 }, /* R147 */
  236. { 0x0000, 0x0000, 0x0000 }, /* R148 */
  237. { 0x0000, 0x0000, 0x0000 }, /* R149 */
  238. { 0x0000, 0x0000, 0x0000 }, /* R150 */
  239. { 0x0000, 0x0000, 0x0000 }, /* R151 */
  240. { 0x0000, 0x0000, 0x0000 }, /* R152 */
  241. { 0x0000, 0x0000, 0x0000 }, /* R153 */
  242. { 0x0000, 0x0000, 0x0000 }, /* R154 */
  243. { 0x0000, 0x0000, 0x0000 }, /* R155 */
  244. { 0x0000, 0x0000, 0x0000 }, /* R156 */
  245. { 0x0000, 0x0000, 0x0000 }, /* R157 */
  246. { 0x0000, 0x0000, 0x0000 }, /* R158 */
  247. { 0x0000, 0x0000, 0x0000 }, /* R159 */
  248. { 0x0000, 0x0000, 0x0000 }, /* R160 */
  249. { 0x0000, 0x0000, 0x0000 }, /* R161 */
  250. { 0x0000, 0x0000, 0x0000 }, /* R162 */
  251. { 0x0000, 0x0000, 0x0000 }, /* R163 */
  252. { 0x0000, 0x0000, 0x0000 }, /* R164 */
  253. { 0x0000, 0x0000, 0x0000 }, /* R165 */
  254. { 0x0000, 0x0000, 0x0000 }, /* R166 */
  255. { 0x0000, 0x0000, 0x0000 }, /* R167 */
  256. { 0x0000, 0x0000, 0x0000 }, /* R168 */
  257. { 0x0000, 0x0000, 0x0000 }, /* R169 */
  258. { 0x0000, 0x0000, 0x0000 }, /* R170 */
  259. { 0x0000, 0x0000, 0x0000 }, /* R171 */
  260. { 0x0000, 0x0000, 0x0000 }, /* R172 */
  261. { 0x0000, 0x0000, 0x0000 }, /* R173 */
  262. { 0x0000, 0x0000, 0x0000 }, /* R174 */
  263. { 0x0000, 0x0000, 0x0000 }, /* R175 */
  264. { 0x0000, 0x0000, 0x0000 }, /* R176 */
  265. { 0x0000, 0x0000, 0x0000 }, /* R177 */
  266. { 0x0000, 0x0000, 0x0000 }, /* R178 */
  267. { 0x0000, 0x0000, 0x0000 }, /* R179 */
  268. { 0x0000, 0x0000, 0x0000 }, /* R180 */
  269. { 0x0000, 0x0000, 0x0000 }, /* R181 */
  270. { 0x0000, 0x0000, 0x0000 }, /* R182 */
  271. { 0x0000, 0x0000, 0x0000 }, /* R183 */
  272. { 0x0000, 0x0000, 0x0000 }, /* R184 */
  273. { 0x0000, 0x0000, 0x0000 }, /* R185 */
  274. { 0x0000, 0x0000, 0x0000 }, /* R186 */
  275. { 0x0000, 0x0000, 0x0000 }, /* R187 */
  276. { 0x0000, 0x0000, 0x0000 }, /* R188 */
  277. { 0x0000, 0x0000, 0x0000 }, /* R189 */
  278. { 0x0000, 0x0000, 0x0000 }, /* R190 */
  279. { 0x0000, 0x0000, 0x0000 }, /* R191 */
  280. { 0x0000, 0x0000, 0x0000 }, /* R192 */
  281. { 0x0000, 0x0000, 0x0000 }, /* R193 */
  282. { 0x0000, 0x0000, 0x0000 }, /* R194 */
  283. { 0x0000, 0x0000, 0x0000 }, /* R195 */
  284. { 0x0000, 0x0000, 0x0000 }, /* R196 */
  285. { 0x0000, 0x0000, 0x0000 }, /* R197 */
  286. { 0x0000, 0x0000, 0x0000 }, /* R198 */
  287. { 0x0000, 0x0000, 0x0000 }, /* R199 */
  288. { 0x0000, 0x0000, 0x0000 }, /* R200 */
  289. { 0x0000, 0x0000, 0x0000 }, /* R201 */
  290. { 0x0000, 0x0000, 0x0000 }, /* R202 */
  291. { 0x0000, 0x0000, 0x0000 }, /* R203 */
  292. { 0x0000, 0x0000, 0x0000 }, /* R204 */
  293. { 0x0000, 0x0000, 0x0000 }, /* R205 */
  294. { 0x0000, 0x0000, 0x0000 }, /* R206 */
  295. { 0x0000, 0x0000, 0x0000 }, /* R207 */
  296. { 0x0000, 0x0000, 0x0000 }, /* R208 */
  297. { 0x0000, 0x0000, 0x0000 }, /* R209 */
  298. { 0x0000, 0x0000, 0x0000 }, /* R210 */
  299. { 0x0000, 0x0000, 0x0000 }, /* R211 */
  300. { 0x0000, 0x0000, 0x0000 }, /* R212 */
  301. { 0x0000, 0x0000, 0x0000 }, /* R213 */
  302. { 0x0000, 0x0000, 0x0000 }, /* R214 */
  303. { 0x0000, 0x0000, 0x0000 }, /* R215 */
  304. { 0x0000, 0x0000, 0x0000 }, /* R216 */
  305. { 0x0000, 0x0000, 0x0000 }, /* R217 */
  306. { 0x0000, 0x0000, 0x0000 }, /* R218 */
  307. { 0x0000, 0x0000, 0x0000 }, /* R219 */
  308. { 0x0000, 0x0000, 0x0000 }, /* R220 */
  309. { 0x0000, 0x0000, 0x0000 }, /* R221 */
  310. { 0x0000, 0x0000, 0x0000 }, /* R222 */
  311. { 0x0000, 0x0000, 0x0000 }, /* R223 */
  312. { 0x0000, 0x0000, 0x0000 }, /* R224 */
  313. { 0x0000, 0x0000, 0x0000 }, /* R225 */
  314. { 0x0000, 0x0000, 0x0000 }, /* R226 */
  315. { 0x0000, 0x0000, 0x0000 }, /* R227 */
  316. { 0x0000, 0x0000, 0x0000 }, /* R228 */
  317. { 0x0000, 0x0000, 0x0000 }, /* R229 */
  318. { 0x0000, 0x0000, 0x0000 }, /* R230 */
  319. { 0x0000, 0x0000, 0x0000 }, /* R231 */
  320. { 0x0000, 0x0000, 0x0000 }, /* R232 */
  321. { 0x0000, 0x0000, 0x0000 }, /* R233 */
  322. { 0x0000, 0x0000, 0x0000 }, /* R234 */
  323. { 0x0000, 0x0000, 0x0000 }, /* R235 */
  324. { 0x0000, 0x0000, 0x0000 }, /* R236 */
  325. { 0x0000, 0x0000, 0x0000 }, /* R237 */
  326. { 0x0000, 0x0000, 0x0000 }, /* R238 */
  327. { 0x0000, 0x0000, 0x0000 }, /* R239 */
  328. { 0x0000, 0x0000, 0x0000 }, /* R240 */
  329. { 0x0000, 0x0000, 0x0000 }, /* R241 */
  330. { 0x0000, 0x0000, 0x0000 }, /* R242 */
  331. { 0x0000, 0x0000, 0x0000 }, /* R243 */
  332. { 0x0000, 0x0000, 0x0000 }, /* R244 */
  333. { 0x0000, 0x0000, 0x0000 }, /* R245 */
  334. { 0x0000, 0x0000, 0x0000 }, /* R246 */
  335. { 0x0000, 0x0000, 0x0000 }, /* R247 */
  336. { 0x0000, 0x0000, 0x0000 }, /* R248 */
  337. { 0x0000, 0x0000, 0x0000 }, /* R249 */
  338. { 0x0000, 0x0000, 0x0000 }, /* R250 */
  339. { 0x0000, 0x0000, 0x0000 }, /* R251 */
  340. { 0x0000, 0x0000, 0x0000 }, /* R252 */
  341. { 0x0000, 0x0000, 0x0000 }, /* R253 */
  342. { 0x0000, 0x0000, 0x0000 }, /* R254 */
  343. { 0x0000, 0x0000, 0x0000 }, /* R255 */
  344. { 0x000F, 0x0000, 0x0000 }, /* R256 - Chip Revision */
  345. { 0x0074, 0x0074, 0x0000 }, /* R257 - Control Interface */
  346. { 0x0000, 0x0000, 0x0000 }, /* R258 */
  347. { 0x0000, 0x0000, 0x0000 }, /* R259 */
  348. { 0x0000, 0x0000, 0x0000 }, /* R260 */
  349. { 0x0000, 0x0000, 0x0000 }, /* R261 */
  350. { 0x0000, 0x0000, 0x0000 }, /* R262 */
  351. { 0x0000, 0x0000, 0x0000 }, /* R263 */
  352. { 0x0000, 0x0000, 0x0000 }, /* R264 */
  353. { 0x0000, 0x0000, 0x0000 }, /* R265 */
  354. { 0x0000, 0x0000, 0x0000 }, /* R266 */
  355. { 0x0000, 0x0000, 0x0000 }, /* R267 */
  356. { 0x0000, 0x0000, 0x0000 }, /* R268 */
  357. { 0x0000, 0x0000, 0x0000 }, /* R269 */
  358. { 0x0000, 0x0000, 0x0000 }, /* R270 */
  359. { 0x0000, 0x0000, 0x0000 }, /* R271 */
  360. { 0x807F, 0x837F, 0x0000 }, /* R272 - Write Sequencer Ctrl (1) */
  361. { 0x017F, 0x0000, 0x0000 }, /* R273 - Write Sequencer Ctrl (2) */
  362. { 0x0000, 0x0000, 0x0000 }, /* R274 */
  363. { 0x0000, 0x0000, 0x0000 }, /* R275 */
  364. { 0x0000, 0x0000, 0x0000 }, /* R276 */
  365. { 0x0000, 0x0000, 0x0000 }, /* R277 */
  366. { 0x0000, 0x0000, 0x0000 }, /* R278 */
  367. { 0x0000, 0x0000, 0x0000 }, /* R279 */
  368. { 0x0000, 0x0000, 0x0000 }, /* R280 */
  369. { 0x0000, 0x0000, 0x0000 }, /* R281 */
  370. { 0x0000, 0x0000, 0x0000 }, /* R282 */
  371. { 0x0000, 0x0000, 0x0000 }, /* R283 */
  372. { 0x0000, 0x0000, 0x0000 }, /* R284 */
  373. { 0x0000, 0x0000, 0x0000 }, /* R285 */
  374. { 0x0000, 0x0000, 0x0000 }, /* R286 */
  375. { 0x0000, 0x0000, 0x0000 }, /* R287 */
  376. { 0x0000, 0x0000, 0x0000 }, /* R288 */
  377. { 0x0000, 0x0000, 0x0000 }, /* R289 */
  378. { 0x0000, 0x0000, 0x0000 }, /* R290 */
  379. { 0x0000, 0x0000, 0x0000 }, /* R291 */
  380. { 0x0000, 0x0000, 0x0000 }, /* R292 */
  381. { 0x0000, 0x0000, 0x0000 }, /* R293 */
  382. { 0x0000, 0x0000, 0x0000 }, /* R294 */
  383. { 0x0000, 0x0000, 0x0000 }, /* R295 */
  384. { 0x0000, 0x0000, 0x0000 }, /* R296 */
  385. { 0x0000, 0x0000, 0x0000 }, /* R297 */
  386. { 0x0000, 0x0000, 0x0000 }, /* R298 */
  387. { 0x0000, 0x0000, 0x0000 }, /* R299 */
  388. { 0x0000, 0x0000, 0x0000 }, /* R300 */
  389. { 0x0000, 0x0000, 0x0000 }, /* R301 */
  390. { 0x0000, 0x0000, 0x0000 }, /* R302 */
  391. { 0x0000, 0x0000, 0x0000 }, /* R303 */
  392. { 0x0000, 0x0000, 0x0000 }, /* R304 */
  393. { 0x0000, 0x0000, 0x0000 }, /* R305 */
  394. { 0x0000, 0x0000, 0x0000 }, /* R306 */
  395. { 0x0000, 0x0000, 0x0000 }, /* R307 */
  396. { 0x0000, 0x0000, 0x0000 }, /* R308 */
  397. { 0x0000, 0x0000, 0x0000 }, /* R309 */
  398. { 0x0000, 0x0000, 0x0000 }, /* R310 */
  399. { 0x0000, 0x0000, 0x0000 }, /* R311 */
  400. { 0x0000, 0x0000, 0x0000 }, /* R312 */
  401. { 0x0000, 0x0000, 0x0000 }, /* R313 */
  402. { 0x0000, 0x0000, 0x0000 }, /* R314 */
  403. { 0x0000, 0x0000, 0x0000 }, /* R315 */
  404. { 0x0000, 0x0000, 0x0000 }, /* R316 */
  405. { 0x0000, 0x0000, 0x0000 }, /* R317 */
  406. { 0x0000, 0x0000, 0x0000 }, /* R318 */
  407. { 0x0000, 0x0000, 0x0000 }, /* R319 */
  408. { 0x0000, 0x0000, 0x0000 }, /* R320 */
  409. { 0x0000, 0x0000, 0x0000 }, /* R321 */
  410. { 0x0000, 0x0000, 0x0000 }, /* R322 */
  411. { 0x0000, 0x0000, 0x0000 }, /* R323 */
  412. { 0x0000, 0x0000, 0x0000 }, /* R324 */
  413. { 0x0000, 0x0000, 0x0000 }, /* R325 */
  414. { 0x0000, 0x0000, 0x0000 }, /* R326 */
  415. { 0x0000, 0x0000, 0x0000 }, /* R327 */
  416. { 0x0000, 0x0000, 0x0000 }, /* R328 */
  417. { 0x0000, 0x0000, 0x0000 }, /* R329 */
  418. { 0x0000, 0x0000, 0x0000 }, /* R330 */
  419. { 0x0000, 0x0000, 0x0000 }, /* R331 */
  420. { 0x0000, 0x0000, 0x0000 }, /* R332 */
  421. { 0x0000, 0x0000, 0x0000 }, /* R333 */
  422. { 0x0000, 0x0000, 0x0000 }, /* R334 */
  423. { 0x0000, 0x0000, 0x0000 }, /* R335 */
  424. { 0x0000, 0x0000, 0x0000 }, /* R336 */
  425. { 0x0000, 0x0000, 0x0000 }, /* R337 */
  426. { 0x0000, 0x0000, 0x0000 }, /* R338 */
  427. { 0x0000, 0x0000, 0x0000 }, /* R339 */
  428. { 0x0000, 0x0000, 0x0000 }, /* R340 */
  429. { 0x0000, 0x0000, 0x0000 }, /* R341 */
  430. { 0x0000, 0x0000, 0x0000 }, /* R342 */
  431. { 0x0000, 0x0000, 0x0000 }, /* R343 */
  432. { 0x0000, 0x0000, 0x0000 }, /* R344 */
  433. { 0x0000, 0x0000, 0x0000 }, /* R345 */
  434. { 0x0000, 0x0000, 0x0000 }, /* R346 */
  435. { 0x0000, 0x0000, 0x0000 }, /* R347 */
  436. { 0x0000, 0x0000, 0x0000 }, /* R348 */
  437. { 0x0000, 0x0000, 0x0000 }, /* R349 */
  438. { 0x0000, 0x0000, 0x0000 }, /* R350 */
  439. { 0x0000, 0x0000, 0x0000 }, /* R351 */
  440. { 0x0000, 0x0000, 0x0000 }, /* R352 */
  441. { 0x0000, 0x0000, 0x0000 }, /* R353 */
  442. { 0x0000, 0x0000, 0x0000 }, /* R354 */
  443. { 0x0000, 0x0000, 0x0000 }, /* R355 */
  444. { 0x0000, 0x0000, 0x0000 }, /* R356 */
  445. { 0x0000, 0x0000, 0x0000 }, /* R357 */
  446. { 0x0000, 0x0000, 0x0000 }, /* R358 */
  447. { 0x0000, 0x0000, 0x0000 }, /* R359 */
  448. { 0x0000, 0x0000, 0x0000 }, /* R360 */
  449. { 0x0000, 0x0000, 0x0000 }, /* R361 */
  450. { 0x0000, 0x0000, 0x0000 }, /* R362 */
  451. { 0x0000, 0x0000, 0x0000 }, /* R363 */
  452. { 0x0000, 0x0000, 0x0000 }, /* R364 */
  453. { 0x0000, 0x0000, 0x0000 }, /* R365 */
  454. { 0x0000, 0x0000, 0x0000 }, /* R366 */
  455. { 0x0000, 0x0000, 0x0000 }, /* R367 */
  456. { 0x0000, 0x0000, 0x0000 }, /* R368 */
  457. { 0x0000, 0x0000, 0x0000 }, /* R369 */
  458. { 0x0000, 0x0000, 0x0000 }, /* R370 */
  459. { 0x0000, 0x0000, 0x0000 }, /* R371 */
  460. { 0x0000, 0x0000, 0x0000 }, /* R372 */
  461. { 0x0000, 0x0000, 0x0000 }, /* R373 */
  462. { 0x0000, 0x0000, 0x0000 }, /* R374 */
  463. { 0x0000, 0x0000, 0x0000 }, /* R375 */
  464. { 0x0000, 0x0000, 0x0000 }, /* R376 */
  465. { 0x0000, 0x0000, 0x0000 }, /* R377 */
  466. { 0x0000, 0x0000, 0x0000 }, /* R378 */
  467. { 0x0000, 0x0000, 0x0000 }, /* R379 */
  468. { 0x0000, 0x0000, 0x0000 }, /* R380 */
  469. { 0x0000, 0x0000, 0x0000 }, /* R381 */
  470. { 0x0000, 0x0000, 0x0000 }, /* R382 */
  471. { 0x0000, 0x0000, 0x0000 }, /* R383 */
  472. { 0x0000, 0x0000, 0x0000 }, /* R384 */
  473. { 0x0000, 0x0000, 0x0000 }, /* R385 */
  474. { 0x0000, 0x0000, 0x0000 }, /* R386 */
  475. { 0x0000, 0x0000, 0x0000 }, /* R387 */
  476. { 0x0000, 0x0000, 0x0000 }, /* R388 */
  477. { 0x0000, 0x0000, 0x0000 }, /* R389 */
  478. { 0x0000, 0x0000, 0x0000 }, /* R390 */
  479. { 0x0000, 0x0000, 0x0000 }, /* R391 */
  480. { 0x0000, 0x0000, 0x0000 }, /* R392 */
  481. { 0x0000, 0x0000, 0x0000 }, /* R393 */
  482. { 0x0000, 0x0000, 0x0000 }, /* R394 */
  483. { 0x0000, 0x0000, 0x0000 }, /* R395 */
  484. { 0x0000, 0x0000, 0x0000 }, /* R396 */
  485. { 0x0000, 0x0000, 0x0000 }, /* R397 */
  486. { 0x0000, 0x0000, 0x0000 }, /* R398 */
  487. { 0x0000, 0x0000, 0x0000 }, /* R399 */
  488. { 0x0000, 0x0000, 0x0000 }, /* R400 */
  489. { 0x0000, 0x0000, 0x0000 }, /* R401 */
  490. { 0x0000, 0x0000, 0x0000 }, /* R402 */
  491. { 0x0000, 0x0000, 0x0000 }, /* R403 */
  492. { 0x0000, 0x0000, 0x0000 }, /* R404 */
  493. { 0x0000, 0x0000, 0x0000 }, /* R405 */
  494. { 0x0000, 0x0000, 0x0000 }, /* R406 */
  495. { 0x0000, 0x0000, 0x0000 }, /* R407 */
  496. { 0x0000, 0x0000, 0x0000 }, /* R408 */
  497. { 0x0000, 0x0000, 0x0000 }, /* R409 */
  498. { 0x0000, 0x0000, 0x0000 }, /* R410 */
  499. { 0x0000, 0x0000, 0x0000 }, /* R411 */
  500. { 0x0000, 0x0000, 0x0000 }, /* R412 */
  501. { 0x0000, 0x0000, 0x0000 }, /* R413 */
  502. { 0x0000, 0x0000, 0x0000 }, /* R414 */
  503. { 0x0000, 0x0000, 0x0000 }, /* R415 */
  504. { 0x0000, 0x0000, 0x0000 }, /* R416 */
  505. { 0x0000, 0x0000, 0x0000 }, /* R417 */
  506. { 0x0000, 0x0000, 0x0000 }, /* R418 */
  507. { 0x0000, 0x0000, 0x0000 }, /* R419 */
  508. { 0x0000, 0x0000, 0x0000 }, /* R420 */
  509. { 0x0000, 0x0000, 0x0000 }, /* R421 */
  510. { 0x0000, 0x0000, 0x0000 }, /* R422 */
  511. { 0x0000, 0x0000, 0x0000 }, /* R423 */
  512. { 0x0000, 0x0000, 0x0000 }, /* R424 */
  513. { 0x0000, 0x0000, 0x0000 }, /* R425 */
  514. { 0x0000, 0x0000, 0x0000 }, /* R426 */
  515. { 0x0000, 0x0000, 0x0000 }, /* R427 */
  516. { 0x0000, 0x0000, 0x0000 }, /* R428 */
  517. { 0x0000, 0x0000, 0x0000 }, /* R429 */
  518. { 0x0000, 0x0000, 0x0000 }, /* R430 */
  519. { 0x0000, 0x0000, 0x0000 }, /* R431 */
  520. { 0x0000, 0x0000, 0x0000 }, /* R432 */
  521. { 0x0000, 0x0000, 0x0000 }, /* R433 */
  522. { 0x0000, 0x0000, 0x0000 }, /* R434 */
  523. { 0x0000, 0x0000, 0x0000 }, /* R435 */
  524. { 0x0000, 0x0000, 0x0000 }, /* R436 */
  525. { 0x0000, 0x0000, 0x0000 }, /* R437 */
  526. { 0x0000, 0x0000, 0x0000 }, /* R438 */
  527. { 0x0000, 0x0000, 0x0000 }, /* R439 */
  528. { 0x0000, 0x0000, 0x0000 }, /* R440 */
  529. { 0x0000, 0x0000, 0x0000 }, /* R441 */
  530. { 0x0000, 0x0000, 0x0000 }, /* R442 */
  531. { 0x0000, 0x0000, 0x0000 }, /* R443 */
  532. { 0x0000, 0x0000, 0x0000 }, /* R444 */
  533. { 0x0000, 0x0000, 0x0000 }, /* R445 */
  534. { 0x0000, 0x0000, 0x0000 }, /* R446 */
  535. { 0x0000, 0x0000, 0x0000 }, /* R447 */
  536. { 0x0000, 0x0000, 0x0000 }, /* R448 */
  537. { 0x0000, 0x0000, 0x0000 }, /* R449 */
  538. { 0x0000, 0x0000, 0x0000 }, /* R450 */
  539. { 0x0000, 0x0000, 0x0000 }, /* R451 */
  540. { 0x0000, 0x0000, 0x0000 }, /* R452 */
  541. { 0x0000, 0x0000, 0x0000 }, /* R453 */
  542. { 0x0000, 0x0000, 0x0000 }, /* R454 */
  543. { 0x0000, 0x0000, 0x0000 }, /* R455 */
  544. { 0x0000, 0x0000, 0x0000 }, /* R456 */
  545. { 0x0000, 0x0000, 0x0000 }, /* R457 */
  546. { 0x0000, 0x0000, 0x0000 }, /* R458 */
  547. { 0x0000, 0x0000, 0x0000 }, /* R459 */
  548. { 0x0000, 0x0000, 0x0000 }, /* R460 */
  549. { 0x0000, 0x0000, 0x0000 }, /* R461 */
  550. { 0x0000, 0x0000, 0x0000 }, /* R462 */
  551. { 0x0000, 0x0000, 0x0000 }, /* R463 */
  552. { 0x0000, 0x0000, 0x0000 }, /* R464 */
  553. { 0x0000, 0x0000, 0x0000 }, /* R465 */
  554. { 0x0000, 0x0000, 0x0000 }, /* R466 */
  555. { 0x0000, 0x0000, 0x0000 }, /* R467 */
  556. { 0x0000, 0x0000, 0x0000 }, /* R468 */
  557. { 0x0000, 0x0000, 0x0000 }, /* R469 */
  558. { 0x0000, 0x0000, 0x0000 }, /* R470 */
  559. { 0x0000, 0x0000, 0x0000 }, /* R471 */
  560. { 0x0000, 0x0000, 0x0000 }, /* R472 */
  561. { 0x0000, 0x0000, 0x0000 }, /* R473 */
  562. { 0x0000, 0x0000, 0x0000 }, /* R474 */
  563. { 0x0000, 0x0000, 0x0000 }, /* R475 */
  564. { 0x0000, 0x0000, 0x0000 }, /* R476 */
  565. { 0x0000, 0x0000, 0x0000 }, /* R477 */
  566. { 0x0000, 0x0000, 0x0000 }, /* R478 */
  567. { 0x0000, 0x0000, 0x0000 }, /* R479 */
  568. { 0x0000, 0x0000, 0x0000 }, /* R480 */
  569. { 0x0000, 0x0000, 0x0000 }, /* R481 */
  570. { 0x0000, 0x0000, 0x0000 }, /* R482 */
  571. { 0x0000, 0x0000, 0x0000 }, /* R483 */
  572. { 0x0000, 0x0000, 0x0000 }, /* R484 */
  573. { 0x0000, 0x0000, 0x0000 }, /* R485 */
  574. { 0x0000, 0x0000, 0x0000 }, /* R486 */
  575. { 0x0000, 0x0000, 0x0000 }, /* R487 */
  576. { 0x0000, 0x0000, 0x0000 }, /* R488 */
  577. { 0x0000, 0x0000, 0x0000 }, /* R489 */
  578. { 0x0000, 0x0000, 0x0000 }, /* R490 */
  579. { 0x0000, 0x0000, 0x0000 }, /* R491 */
  580. { 0x0000, 0x0000, 0x0000 }, /* R492 */
  581. { 0x0000, 0x0000, 0x0000 }, /* R493 */
  582. { 0x0000, 0x0000, 0x0000 }, /* R494 */
  583. { 0x0000, 0x0000, 0x0000 }, /* R495 */
  584. { 0x0000, 0x0000, 0x0000 }, /* R496 */
  585. { 0x0000, 0x0000, 0x0000 }, /* R497 */
  586. { 0x0000, 0x0000, 0x0000 }, /* R498 */
  587. { 0x0000, 0x0000, 0x0000 }, /* R499 */
  588. { 0x0000, 0x0000, 0x0000 }, /* R500 */
  589. { 0x0000, 0x0000, 0x0000 }, /* R501 */
  590. { 0x0000, 0x0000, 0x0000 }, /* R502 */
  591. { 0x0000, 0x0000, 0x0000 }, /* R503 */
  592. { 0x0000, 0x0000, 0x0000 }, /* R504 */
  593. { 0x0000, 0x0000, 0x0000 }, /* R505 */
  594. { 0x0000, 0x0000, 0x0000 }, /* R506 */
  595. { 0x0000, 0x0000, 0x0000 }, /* R507 */
  596. { 0x0000, 0x0000, 0x0000 }, /* R508 */
  597. { 0x0000, 0x0000, 0x0000 }, /* R509 */
  598. { 0x0000, 0x0000, 0x0000 }, /* R510 */
  599. { 0x0000, 0x0000, 0x0000 }, /* R511 */
  600. { 0x001F, 0x001F, 0x0000 }, /* R512 - AIF1 Clocking (1) */
  601. { 0x003F, 0x003F, 0x0000 }, /* R513 - AIF1 Clocking (2) */
  602. { 0x0000, 0x0000, 0x0000 }, /* R514 */
  603. { 0x0000, 0x0000, 0x0000 }, /* R515 */
  604. { 0x001F, 0x001F, 0x0000 }, /* R516 - AIF2 Clocking (1) */
  605. { 0x003F, 0x003F, 0x0000 }, /* R517 - AIF2 Clocking (2) */
  606. { 0x0000, 0x0000, 0x0000 }, /* R518 */
  607. { 0x0000, 0x0000, 0x0000 }, /* R519 */
  608. { 0x001F, 0x001F, 0x0000 }, /* R520 - Clocking (1) */
  609. { 0x0777, 0x0777, 0x0000 }, /* R521 - Clocking (2) */
  610. { 0x0000, 0x0000, 0x0000 }, /* R522 */
  611. { 0x0000, 0x0000, 0x0000 }, /* R523 */
  612. { 0x0000, 0x0000, 0x0000 }, /* R524 */
  613. { 0x0000, 0x0000, 0x0000 }, /* R525 */
  614. { 0x0000, 0x0000, 0x0000 }, /* R526 */
  615. { 0x0000, 0x0000, 0x0000 }, /* R527 */
  616. { 0x00FF, 0x00FF, 0x0000 }, /* R528 - AIF1 Rate */
  617. { 0x00FF, 0x00FF, 0x0000 }, /* R529 - AIF2 Rate */
  618. { 0x000F, 0x0000, 0x0000 }, /* R530 - Rate Status */
  619. { 0x0000, 0x0000, 0x0000 }, /* R531 */
  620. { 0x0000, 0x0000, 0x0000 }, /* R532 */
  621. { 0x0000, 0x0000, 0x0000 }, /* R533 */
  622. { 0x0000, 0x0000, 0x0000 }, /* R534 */
  623. { 0x0000, 0x0000, 0x0000 }, /* R535 */
  624. { 0x0000, 0x0000, 0x0000 }, /* R536 */
  625. { 0x0000, 0x0000, 0x0000 }, /* R537 */
  626. { 0x0000, 0x0000, 0x0000 }, /* R538 */
  627. { 0x0000, 0x0000, 0x0000 }, /* R539 */
  628. { 0x0000, 0x0000, 0x0000 }, /* R540 */
  629. { 0x0000, 0x0000, 0x0000 }, /* R541 */
  630. { 0x0000, 0x0000, 0x0000 }, /* R542 */
  631. { 0x0000, 0x0000, 0x0000 }, /* R543 */
  632. { 0x0007, 0x0007, 0x0000 }, /* R544 - FLL1 Control (1) */
  633. { 0x3F77, 0x3F77, 0x0000 }, /* R545 - FLL1 Control (2) */
  634. { 0xFFFF, 0xFFFF, 0x0000 }, /* R546 - FLL1 Control (3) */
  635. { 0x7FEF, 0x7FEF, 0x0000 }, /* R547 - FLL1 Control (4) */
  636. { 0x1FDB, 0x1FDB, 0x0000 }, /* R548 - FLL1 Control (5) */
  637. { 0x0000, 0x0000, 0x0000 }, /* R549 */
  638. { 0x0000, 0x0000, 0x0000 }, /* R550 */
  639. { 0x0000, 0x0000, 0x0000 }, /* R551 */
  640. { 0x0000, 0x0000, 0x0000 }, /* R552 */
  641. { 0x0000, 0x0000, 0x0000 }, /* R553 */
  642. { 0x0000, 0x0000, 0x0000 }, /* R554 */
  643. { 0x0000, 0x0000, 0x0000 }, /* R555 */
  644. { 0x0000, 0x0000, 0x0000 }, /* R556 */
  645. { 0x0000, 0x0000, 0x0000 }, /* R557 */
  646. { 0x0000, 0x0000, 0x0000 }, /* R558 */
  647. { 0x0000, 0x0000, 0x0000 }, /* R559 */
  648. { 0x0000, 0x0000, 0x0000 }, /* R560 */
  649. { 0x0000, 0x0000, 0x0000 }, /* R561 */
  650. { 0x0000, 0x0000, 0x0000 }, /* R562 */
  651. { 0x0000, 0x0000, 0x0000 }, /* R563 */
  652. { 0x0000, 0x0000, 0x0000 }, /* R564 */
  653. { 0x0000, 0x0000, 0x0000 }, /* R565 */
  654. { 0x0000, 0x0000, 0x0000 }, /* R566 */
  655. { 0x0000, 0x0000, 0x0000 }, /* R567 */
  656. { 0x0000, 0x0000, 0x0000 }, /* R568 */
  657. { 0x0000, 0x0000, 0x0000 }, /* R569 */
  658. { 0x0000, 0x0000, 0x0000 }, /* R570 */
  659. { 0x0000, 0x0000, 0x0000 }, /* R571 */
  660. { 0x0000, 0x0000, 0x0000 }, /* R572 */
  661. { 0x0000, 0x0000, 0x0000 }, /* R573 */
  662. { 0x0000, 0x0000, 0x0000 }, /* R574 */
  663. { 0x0000, 0x0000, 0x0000 }, /* R575 */
  664. { 0x0007, 0x0007, 0x0000 }, /* R576 - FLL2 Control (1) */
  665. { 0x3F77, 0x3F77, 0x0000 }, /* R577 - FLL2 Control (2) */
  666. { 0xFFFF, 0xFFFF, 0x0000 }, /* R578 - FLL2 Control (3) */
  667. { 0x7FEF, 0x7FEF, 0x0000 }, /* R579 - FLL2 Control (4) */
  668. { 0x1FDB, 0x1FDB, 0x0000 }, /* R580 - FLL2 Control (5) */
  669. { 0x0000, 0x0000, 0x0000 }, /* R581 */
  670. { 0x0000, 0x0000, 0x0000 }, /* R582 */
  671. { 0x0000, 0x0000, 0x0000 }, /* R583 */
  672. { 0x0000, 0x0000, 0x0000 }, /* R584 */
  673. { 0x0000, 0x0000, 0x0000 }, /* R585 */
  674. { 0x0000, 0x0000, 0x0000 }, /* R586 */
  675. { 0x0000, 0x0000, 0x0000 }, /* R587 */
  676. { 0x0000, 0x0000, 0x0000 }, /* R588 */
  677. { 0x0000, 0x0000, 0x0000 }, /* R589 */
  678. { 0x0000, 0x0000, 0x0000 }, /* R590 */
  679. { 0x0000, 0x0000, 0x0000 }, /* R591 */
  680. { 0x0000, 0x0000, 0x0000 }, /* R592 */
  681. { 0x0000, 0x0000, 0x0000 }, /* R593 */
  682. { 0x0000, 0x0000, 0x0000 }, /* R594 */
  683. { 0x0000, 0x0000, 0x0000 }, /* R595 */
  684. { 0x0000, 0x0000, 0x0000 }, /* R596 */
  685. { 0x0000, 0x0000, 0x0000 }, /* R597 */
  686. { 0x0000, 0x0000, 0x0000 }, /* R598 */
  687. { 0x0000, 0x0000, 0x0000 }, /* R599 */
  688. { 0x0000, 0x0000, 0x0000 }, /* R600 */
  689. { 0x0000, 0x0000, 0x0000 }, /* R601 */
  690. { 0x0000, 0x0000, 0x0000 }, /* R602 */
  691. { 0x0000, 0x0000, 0x0000 }, /* R603 */
  692. { 0x0000, 0x0000, 0x0000 }, /* R604 */
  693. { 0x0000, 0x0000, 0x0000 }, /* R605 */
  694. { 0x0000, 0x0000, 0x0000 }, /* R606 */
  695. { 0x0000, 0x0000, 0x0000 }, /* R607 */
  696. { 0x0000, 0x0000, 0x0000 }, /* R608 */
  697. { 0x0000, 0x0000, 0x0000 }, /* R609 */
  698. { 0x0000, 0x0000, 0x0000 }, /* R610 */
  699. { 0x0000, 0x0000, 0x0000 }, /* R611 */
  700. { 0x0000, 0x0000, 0x0000 }, /* R612 */
  701. { 0x0000, 0x0000, 0x0000 }, /* R613 */
  702. { 0x0000, 0x0000, 0x0000 }, /* R614 */
  703. { 0x0000, 0x0000, 0x0000 }, /* R615 */
  704. { 0x0000, 0x0000, 0x0000 }, /* R616 */
  705. { 0x0000, 0x0000, 0x0000 }, /* R617 */
  706. { 0x0000, 0x0000, 0x0000 }, /* R618 */
  707. { 0x0000, 0x0000, 0x0000 }, /* R619 */
  708. { 0x0000, 0x0000, 0x0000 }, /* R620 */
  709. { 0x0000, 0x0000, 0x0000 }, /* R621 */
  710. { 0x0000, 0x0000, 0x0000 }, /* R622 */
  711. { 0x0000, 0x0000, 0x0000 }, /* R623 */
  712. { 0x0000, 0x0000, 0x0000 }, /* R624 */
  713. { 0x0000, 0x0000, 0x0000 }, /* R625 */
  714. { 0x0000, 0x0000, 0x0000 }, /* R626 */
  715. { 0x0000, 0x0000, 0x0000 }, /* R627 */
  716. { 0x0000, 0x0000, 0x0000 }, /* R628 */
  717. { 0x0000, 0x0000, 0x0000 }, /* R629 */
  718. { 0x0000, 0x0000, 0x0000 }, /* R630 */
  719. { 0x0000, 0x0000, 0x0000 }, /* R631 */
  720. { 0x0000, 0x0000, 0x0000 }, /* R632 */
  721. { 0x0000, 0x0000, 0x0000 }, /* R633 */
  722. { 0x0000, 0x0000, 0x0000 }, /* R634 */
  723. { 0x0000, 0x0000, 0x0000 }, /* R635 */
  724. { 0x0000, 0x0000, 0x0000 }, /* R636 */
  725. { 0x0000, 0x0000, 0x0000 }, /* R637 */
  726. { 0x0000, 0x0000, 0x0000 }, /* R638 */
  727. { 0x0000, 0x0000, 0x0000 }, /* R639 */
  728. { 0x0000, 0x0000, 0x0000 }, /* R640 */
  729. { 0x0000, 0x0000, 0x0000 }, /* R641 */
  730. { 0x0000, 0x0000, 0x0000 }, /* R642 */
  731. { 0x0000, 0x0000, 0x0000 }, /* R643 */
  732. { 0x0000, 0x0000, 0x0000 }, /* R644 */
  733. { 0x0000, 0x0000, 0x0000 }, /* R645 */
  734. { 0x0000, 0x0000, 0x0000 }, /* R646 */
  735. { 0x0000, 0x0000, 0x0000 }, /* R647 */
  736. { 0x0000, 0x0000, 0x0000 }, /* R648 */
  737. { 0x0000, 0x0000, 0x0000 }, /* R649 */
  738. { 0x0000, 0x0000, 0x0000 }, /* R650 */
  739. { 0x0000, 0x0000, 0x0000 }, /* R651 */
  740. { 0x0000, 0x0000, 0x0000 }, /* R652 */
  741. { 0x0000, 0x0000, 0x0000 }, /* R653 */
  742. { 0x0000, 0x0000, 0x0000 }, /* R654 */
  743. { 0x0000, 0x0000, 0x0000 }, /* R655 */
  744. { 0x0000, 0x0000, 0x0000 }, /* R656 */
  745. { 0x0000, 0x0000, 0x0000 }, /* R657 */
  746. { 0x0000, 0x0000, 0x0000 }, /* R658 */
  747. { 0x0000, 0x0000, 0x0000 }, /* R659 */
  748. { 0x0000, 0x0000, 0x0000 }, /* R660 */
  749. { 0x0000, 0x0000, 0x0000 }, /* R661 */
  750. { 0x0000, 0x0000, 0x0000 }, /* R662 */
  751. { 0x0000, 0x0000, 0x0000 }, /* R663 */
  752. { 0x0000, 0x0000, 0x0000 }, /* R664 */
  753. { 0x0000, 0x0000, 0x0000 }, /* R665 */
  754. { 0x0000, 0x0000, 0x0000 }, /* R666 */
  755. { 0x0000, 0x0000, 0x0000 }, /* R667 */
  756. { 0x0000, 0x0000, 0x0000 }, /* R668 */
  757. { 0x0000, 0x0000, 0x0000 }, /* R669 */
  758. { 0x0000, 0x0000, 0x0000 }, /* R670 */
  759. { 0x0000, 0x0000, 0x0000 }, /* R671 */
  760. { 0x0000, 0x0000, 0x0000 }, /* R672 */
  761. { 0x0000, 0x0000, 0x0000 }, /* R673 */
  762. { 0x0000, 0x0000, 0x0000 }, /* R674 */
  763. { 0x0000, 0x0000, 0x0000 }, /* R675 */
  764. { 0x0000, 0x0000, 0x0000 }, /* R676 */
  765. { 0x0000, 0x0000, 0x0000 }, /* R677 */
  766. { 0x0000, 0x0000, 0x0000 }, /* R678 */
  767. { 0x0000, 0x0000, 0x0000 }, /* R679 */
  768. { 0x0000, 0x0000, 0x0000 }, /* R680 */
  769. { 0x0000, 0x0000, 0x0000 }, /* R681 */
  770. { 0x0000, 0x0000, 0x0000 }, /* R682 */
  771. { 0x0000, 0x0000, 0x0000 }, /* R683 */
  772. { 0x0000, 0x0000, 0x0000 }, /* R684 */
  773. { 0x0000, 0x0000, 0x0000 }, /* R685 */
  774. { 0x0000, 0x0000, 0x0000 }, /* R686 */
  775. { 0x0000, 0x0000, 0x0000 }, /* R687 */
  776. { 0x0000, 0x0000, 0x0000 }, /* R688 */
  777. { 0x0000, 0x0000, 0x0000 }, /* R689 */
  778. { 0x0000, 0x0000, 0x0000 }, /* R690 */
  779. { 0x0000, 0x0000, 0x0000 }, /* R691 */
  780. { 0x0000, 0x0000, 0x0000 }, /* R692 */
  781. { 0x0000, 0x0000, 0x0000 }, /* R693 */
  782. { 0x0000, 0x0000, 0x0000 }, /* R694 */
  783. { 0x0000, 0x0000, 0x0000 }, /* R695 */
  784. { 0x0000, 0x0000, 0x0000 }, /* R696 */
  785. { 0x0000, 0x0000, 0x0000 }, /* R697 */
  786. { 0x0000, 0x0000, 0x0000 }, /* R698 */
  787. { 0x0000, 0x0000, 0x0000 }, /* R699 */
  788. { 0x0000, 0x0000, 0x0000 }, /* R700 */
  789. { 0x0000, 0x0000, 0x0000 }, /* R701 */
  790. { 0x0000, 0x0000, 0x0000 }, /* R702 */
  791. { 0x0000, 0x0000, 0x0000 }, /* R703 */
  792. { 0x0000, 0x0000, 0x0000 }, /* R704 */
  793. { 0x0000, 0x0000, 0x0000 }, /* R705 */
  794. { 0x0000, 0x0000, 0x0000 }, /* R706 */
  795. { 0x0000, 0x0000, 0x0000 }, /* R707 */
  796. { 0x0000, 0x0000, 0x0000 }, /* R708 */
  797. { 0x0000, 0x0000, 0x0000 }, /* R709 */
  798. { 0x0000, 0x0000, 0x0000 }, /* R710 */
  799. { 0x0000, 0x0000, 0x0000 }, /* R711 */
  800. { 0x0000, 0x0000, 0x0000 }, /* R712 */
  801. { 0x0000, 0x0000, 0x0000 }, /* R713 */
  802. { 0x0000, 0x0000, 0x0000 }, /* R714 */
  803. { 0x0000, 0x0000, 0x0000 }, /* R715 */
  804. { 0x0000, 0x0000, 0x0000 }, /* R716 */
  805. { 0x0000, 0x0000, 0x0000 }, /* R717 */
  806. { 0x0000, 0x0000, 0x0000 }, /* R718 */
  807. { 0x0000, 0x0000, 0x0000 }, /* R719 */
  808. { 0x0000, 0x0000, 0x0000 }, /* R720 */
  809. { 0x0000, 0x0000, 0x0000 }, /* R721 */
  810. { 0x0000, 0x0000, 0x0000 }, /* R722 */
  811. { 0x0000, 0x0000, 0x0000 }, /* R723 */
  812. { 0x0000, 0x0000, 0x0000 }, /* R724 */
  813. { 0x0000, 0x0000, 0x0000 }, /* R725 */
  814. { 0x0000, 0x0000, 0x0000 }, /* R726 */
  815. { 0x0000, 0x0000, 0x0000 }, /* R727 */
  816. { 0x0000, 0x0000, 0x0000 }, /* R728 */
  817. { 0x0000, 0x0000, 0x0000 }, /* R729 */
  818. { 0x0000, 0x0000, 0x0000 }, /* R730 */
  819. { 0x0000, 0x0000, 0x0000 }, /* R731 */
  820. { 0x0000, 0x0000, 0x0000 }, /* R732 */
  821. { 0x0000, 0x0000, 0x0000 }, /* R733 */
  822. { 0x0000, 0x0000, 0x0000 }, /* R734 */
  823. { 0x0000, 0x0000, 0x0000 }, /* R735 */
  824. { 0x0000, 0x0000, 0x0000 }, /* R736 */
  825. { 0x0000, 0x0000, 0x0000 }, /* R737 */
  826. { 0x0000, 0x0000, 0x0000 }, /* R738 */
  827. { 0x0000, 0x0000, 0x0000 }, /* R739 */
  828. { 0x0000, 0x0000, 0x0000 }, /* R740 */
  829. { 0x0000, 0x0000, 0x0000 }, /* R741 */
  830. { 0x0000, 0x0000, 0x0000 }, /* R742 */
  831. { 0x0000, 0x0000, 0x0000 }, /* R743 */
  832. { 0x0000, 0x0000, 0x0000 }, /* R744 */
  833. { 0x0000, 0x0000, 0x0000 }, /* R745 */
  834. { 0x0000, 0x0000, 0x0000 }, /* R746 */
  835. { 0x0000, 0x0000, 0x0000 }, /* R747 */
  836. { 0x0000, 0x0000, 0x0000 }, /* R748 */
  837. { 0x0000, 0x0000, 0x0000 }, /* R749 */
  838. { 0x0000, 0x0000, 0x0000 }, /* R750 */
  839. { 0x0000, 0x0000, 0x0000 }, /* R751 */
  840. { 0x0000, 0x0000, 0x0000 }, /* R752 */
  841. { 0x0000, 0x0000, 0x0000 }, /* R753 */
  842. { 0x0000, 0x0000, 0x0000 }, /* R754 */
  843. { 0x0000, 0x0000, 0x0000 }, /* R755 */
  844. { 0x0000, 0x0000, 0x0000 }, /* R756 */
  845. { 0x0000, 0x0000, 0x0000 }, /* R757 */
  846. { 0x0000, 0x0000, 0x0000 }, /* R758 */
  847. { 0x0000, 0x0000, 0x0000 }, /* R759 */
  848. { 0x0000, 0x0000, 0x0000 }, /* R760 */
  849. { 0x0000, 0x0000, 0x0000 }, /* R761 */
  850. { 0x0000, 0x0000, 0x0000 }, /* R762 */
  851. { 0x0000, 0x0000, 0x0000 }, /* R763 */
  852. { 0x0000, 0x0000, 0x0000 }, /* R764 */
  853. { 0x0000, 0x0000, 0x0000 }, /* R765 */
  854. { 0x0000, 0x0000, 0x0000 }, /* R766 */
  855. { 0x0000, 0x0000, 0x0000 }, /* R767 */
  856. { 0xE1F8, 0xE1F8, 0x0000 }, /* R768 - AIF1 Control (1) */
  857. { 0xCD1F, 0xCD1F, 0x0000 }, /* R769 - AIF1 Control (2) */
  858. { 0xF000, 0xF000, 0x0000 }, /* R770 - AIF1 Master/Slave */
  859. { 0x01F0, 0x01F0, 0x0000 }, /* R771 - AIF1 BCLK */
  860. { 0x0FFF, 0x0FFF, 0x0000 }, /* R772 - AIF1ADC LRCLK */
  861. { 0x0FFF, 0x0FFF, 0x0000 }, /* R773 - AIF1DAC LRCLK */
  862. { 0x0003, 0x0003, 0x0000 }, /* R774 - AIF1DAC Data */
  863. { 0x0003, 0x0003, 0x0000 }, /* R775 - AIF1ADC Data */
  864. { 0x0000, 0x0000, 0x0000 }, /* R776 */
  865. { 0x0000, 0x0000, 0x0000 }, /* R777 */
  866. { 0x0000, 0x0000, 0x0000 }, /* R778 */
  867. { 0x0000, 0x0000, 0x0000 }, /* R779 */
  868. { 0x0000, 0x0000, 0x0000 }, /* R780 */
  869. { 0x0000, 0x0000, 0x0000 }, /* R781 */
  870. { 0x0000, 0x0000, 0x0000 }, /* R782 */
  871. { 0x0000, 0x0000, 0x0000 }, /* R783 */
  872. { 0xF1F8, 0xF1F8, 0x0000 }, /* R784 - AIF2 Control (1) */
  873. { 0xFD1F, 0xFD1F, 0x0000 }, /* R785 - AIF2 Control (2) */
  874. { 0xF000, 0xF000, 0x0000 }, /* R786 - AIF2 Master/Slave */
  875. { 0x01F0, 0x01F0, 0x0000 }, /* R787 - AIF2 BCLK */
  876. { 0x0FFF, 0x0FFF, 0x0000 }, /* R788 - AIF2ADC LRCLK */
  877. { 0x0FFF, 0x0FFF, 0x0000 }, /* R789 - AIF2DAC LRCLK */
  878. { 0x0003, 0x0003, 0x0000 }, /* R790 - AIF2DAC Data */
  879. { 0x0003, 0x0003, 0x0000 }, /* R791 - AIF2ADC Data */
  880. { 0x0000, 0x0000, 0x0000 }, /* R792 */
  881. { 0x0000, 0x0000, 0x0000 }, /* R793 */
  882. { 0x0000, 0x0000, 0x0000 }, /* R794 */
  883. { 0x0000, 0x0000, 0x0000 }, /* R795 */
  884. { 0x0000, 0x0000, 0x0000 }, /* R796 */
  885. { 0x0000, 0x0000, 0x0000 }, /* R797 */
  886. { 0x0000, 0x0000, 0x0000 }, /* R798 */
  887. { 0x0000, 0x0000, 0x0000 }, /* R799 */
  888. { 0x0000, 0x0000, 0x0000 }, /* R800 */
  889. { 0x0000, 0x0000, 0x0000 }, /* R801 */
  890. { 0x0000, 0x0000, 0x0000 }, /* R802 */
  891. { 0x0000, 0x0000, 0x0000 }, /* R803 */
  892. { 0x0000, 0x0000, 0x0000 }, /* R804 */
  893. { 0x0000, 0x0000, 0x0000 }, /* R805 */
  894. { 0x0000, 0x0000, 0x0000 }, /* R806 */
  895. { 0x0000, 0x0000, 0x0000 }, /* R807 */
  896. { 0x0000, 0x0000, 0x0000 }, /* R808 */
  897. { 0x0000, 0x0000, 0x0000 }, /* R809 */
  898. { 0x0000, 0x0000, 0x0000 }, /* R810 */
  899. { 0x0000, 0x0000, 0x0000 }, /* R811 */
  900. { 0x0000, 0x0000, 0x0000 }, /* R812 */
  901. { 0x0000, 0x0000, 0x0000 }, /* R813 */
  902. { 0x0000, 0x0000, 0x0000 }, /* R814 */
  903. { 0x0000, 0x0000, 0x0000 }, /* R815 */
  904. { 0x0000, 0x0000, 0x0000 }, /* R816 */
  905. { 0x0000, 0x0000, 0x0000 }, /* R817 */
  906. { 0x0000, 0x0000, 0x0000 }, /* R818 */
  907. { 0x0000, 0x0000, 0x0000 }, /* R819 */
  908. { 0x0000, 0x0000, 0x0000 }, /* R820 */
  909. { 0x0000, 0x0000, 0x0000 }, /* R821 */
  910. { 0x0000, 0x0000, 0x0000 }, /* R822 */
  911. { 0x0000, 0x0000, 0x0000 }, /* R823 */
  912. { 0x0000, 0x0000, 0x0000 }, /* R824 */
  913. { 0x0000, 0x0000, 0x0000 }, /* R825 */
  914. { 0x0000, 0x0000, 0x0000 }, /* R826 */
  915. { 0x0000, 0x0000, 0x0000 }, /* R827 */
  916. { 0x0000, 0x0000, 0x0000 }, /* R828 */
  917. { 0x0000, 0x0000, 0x0000 }, /* R829 */
  918. { 0x0000, 0x0000, 0x0000 }, /* R830 */
  919. { 0x0000, 0x0000, 0x0000 }, /* R831 */
  920. { 0x0000, 0x0000, 0x0000 }, /* R832 */
  921. { 0x0000, 0x0000, 0x0000 }, /* R833 */
  922. { 0x0000, 0x0000, 0x0000 }, /* R834 */
  923. { 0x0000, 0x0000, 0x0000 }, /* R835 */
  924. { 0x0000, 0x0000, 0x0000 }, /* R836 */
  925. { 0x0000, 0x0000, 0x0000 }, /* R837 */
  926. { 0x0000, 0x0000, 0x0000 }, /* R838 */
  927. { 0x0000, 0x0000, 0x0000 }, /* R839 */
  928. { 0x0000, 0x0000, 0x0000 }, /* R840 */
  929. { 0x0000, 0x0000, 0x0000 }, /* R841 */
  930. { 0x0000, 0x0000, 0x0000 }, /* R842 */
  931. { 0x0000, 0x0000, 0x0000 }, /* R843 */
  932. { 0x0000, 0x0000, 0x0000 }, /* R844 */
  933. { 0x0000, 0x0000, 0x0000 }, /* R845 */
  934. { 0x0000, 0x0000, 0x0000 }, /* R846 */
  935. { 0x0000, 0x0000, 0x0000 }, /* R847 */
  936. { 0x0000, 0x0000, 0x0000 }, /* R848 */
  937. { 0x0000, 0x0000, 0x0000 }, /* R849 */
  938. { 0x0000, 0x0000, 0x0000 }, /* R850 */
  939. { 0x0000, 0x0000, 0x0000 }, /* R851 */
  940. { 0x0000, 0x0000, 0x0000 }, /* R852 */
  941. { 0x0000, 0x0000, 0x0000 }, /* R853 */
  942. { 0x0000, 0x0000, 0x0000 }, /* R854 */
  943. { 0x0000, 0x0000, 0x0000 }, /* R855 */
  944. { 0x0000, 0x0000, 0x0000 }, /* R856 */
  945. { 0x0000, 0x0000, 0x0000 }, /* R857 */
  946. { 0x0000, 0x0000, 0x0000 }, /* R858 */
  947. { 0x0000, 0x0000, 0x0000 }, /* R859 */
  948. { 0x0000, 0x0000, 0x0000 }, /* R860 */
  949. { 0x0000, 0x0000, 0x0000 }, /* R861 */
  950. { 0x0000, 0x0000, 0x0000 }, /* R862 */
  951. { 0x0000, 0x0000, 0x0000 }, /* R863 */
  952. { 0x0000, 0x0000, 0x0000 }, /* R864 */
  953. { 0x0000, 0x0000, 0x0000 }, /* R865 */
  954. { 0x0000, 0x0000, 0x0000 }, /* R866 */
  955. { 0x0000, 0x0000, 0x0000 }, /* R867 */
  956. { 0x0000, 0x0000, 0x0000 }, /* R868 */
  957. { 0x0000, 0x0000, 0x0000 }, /* R869 */
  958. { 0x0000, 0x0000, 0x0000 }, /* R870 */
  959. { 0x0000, 0x0000, 0x0000 }, /* R871 */
  960. { 0x0000, 0x0000, 0x0000 }, /* R872 */
  961. { 0x0000, 0x0000, 0x0000 }, /* R873 */
  962. { 0x0000, 0x0000, 0x0000 }, /* R874 */
  963. { 0x0000, 0x0000, 0x0000 }, /* R875 */
  964. { 0x0000, 0x0000, 0x0000 }, /* R876 */
  965. { 0x0000, 0x0000, 0x0000 }, /* R877 */
  966. { 0x0000, 0x0000, 0x0000 }, /* R878 */
  967. { 0x0000, 0x0000, 0x0000 }, /* R879 */
  968. { 0x0000, 0x0000, 0x0000 }, /* R880 */
  969. { 0x0000, 0x0000, 0x0000 }, /* R881 */
  970. { 0x0000, 0x0000, 0x0000 }, /* R882 */
  971. { 0x0000, 0x0000, 0x0000 }, /* R883 */
  972. { 0x0000, 0x0000, 0x0000 }, /* R884 */
  973. { 0x0000, 0x0000, 0x0000 }, /* R885 */
  974. { 0x0000, 0x0000, 0x0000 }, /* R886 */
  975. { 0x0000, 0x0000, 0x0000 }, /* R887 */
  976. { 0x0000, 0x0000, 0x0000 }, /* R888 */
  977. { 0x0000, 0x0000, 0x0000 }, /* R889 */
  978. { 0x0000, 0x0000, 0x0000 }, /* R890 */
  979. { 0x0000, 0x0000, 0x0000 }, /* R891 */
  980. { 0x0000, 0x0000, 0x0000 }, /* R892 */
  981. { 0x0000, 0x0000, 0x0000 }, /* R893 */
  982. { 0x0000, 0x0000, 0x0000 }, /* R894 */
  983. { 0x0000, 0x0000, 0x0000 }, /* R895 */
  984. { 0x0000, 0x0000, 0x0000 }, /* R896 */
  985. { 0x0000, 0x0000, 0x0000 }, /* R897 */
  986. { 0x0000, 0x0000, 0x0000 }, /* R898 */
  987. { 0x0000, 0x0000, 0x0000 }, /* R899 */
  988. { 0x0000, 0x0000, 0x0000 }, /* R900 */
  989. { 0x0000, 0x0000, 0x0000 }, /* R901 */
  990. { 0x0000, 0x0000, 0x0000 }, /* R902 */
  991. { 0x0000, 0x0000, 0x0000 }, /* R903 */
  992. { 0x0000, 0x0000, 0x0000 }, /* R904 */
  993. { 0x0000, 0x0000, 0x0000 }, /* R905 */
  994. { 0x0000, 0x0000, 0x0000 }, /* R906 */
  995. { 0x0000, 0x0000, 0x0000 }, /* R907 */
  996. { 0x0000, 0x0000, 0x0000 }, /* R908 */
  997. { 0x0000, 0x0000, 0x0000 }, /* R909 */
  998. { 0x0000, 0x0000, 0x0000 }, /* R910 */
  999. { 0x0000, 0x0000, 0x0000 }, /* R911 */
  1000. { 0x0000, 0x0000, 0x0000 }, /* R912 */
  1001. { 0x0000, 0x0000, 0x0000 }, /* R913 */
  1002. { 0x0000, 0x0000, 0x0000 }, /* R914 */
  1003. { 0x0000, 0x0000, 0x0000 }, /* R915 */
  1004. { 0x0000, 0x0000, 0x0000 }, /* R916 */
  1005. { 0x0000, 0x0000, 0x0000 }, /* R917 */
  1006. { 0x0000, 0x0000, 0x0000 }, /* R918 */
  1007. { 0x0000, 0x0000, 0x0000 }, /* R919 */
  1008. { 0x0000, 0x0000, 0x0000 }, /* R920 */
  1009. { 0x0000, 0x0000, 0x0000 }, /* R921 */
  1010. { 0x0000, 0x0000, 0x0000 }, /* R922 */
  1011. { 0x0000, 0x0000, 0x0000 }, /* R923 */
  1012. { 0x0000, 0x0000, 0x0000 }, /* R924 */
  1013. { 0x0000, 0x0000, 0x0000 }, /* R925 */
  1014. { 0x0000, 0x0000, 0x0000 }, /* R926 */
  1015. { 0x0000, 0x0000, 0x0000 }, /* R927 */
  1016. { 0x0000, 0x0000, 0x0000 }, /* R928 */
  1017. { 0x0000, 0x0000, 0x0000 }, /* R929 */
  1018. { 0x0000, 0x0000, 0x0000 }, /* R930 */
  1019. { 0x0000, 0x0000, 0x0000 }, /* R931 */
  1020. { 0x0000, 0x0000, 0x0000 }, /* R932 */
  1021. { 0x0000, 0x0000, 0x0000 }, /* R933 */
  1022. { 0x0000, 0x0000, 0x0000 }, /* R934 */
  1023. { 0x0000, 0x0000, 0x0000 }, /* R935 */
  1024. { 0x0000, 0x0000, 0x0000 }, /* R936 */
  1025. { 0x0000, 0x0000, 0x0000 }, /* R937 */
  1026. { 0x0000, 0x0000, 0x0000 }, /* R938 */
  1027. { 0x0000, 0x0000, 0x0000 }, /* R939 */
  1028. { 0x0000, 0x0000, 0x0000 }, /* R940 */
  1029. { 0x0000, 0x0000, 0x0000 }, /* R941 */
  1030. { 0x0000, 0x0000, 0x0000 }, /* R942 */
  1031. { 0x0000, 0x0000, 0x0000 }, /* R943 */
  1032. { 0x0000, 0x0000, 0x0000 }, /* R944 */
  1033. { 0x0000, 0x0000, 0x0000 }, /* R945 */
  1034. { 0x0000, 0x0000, 0x0000 }, /* R946 */
  1035. { 0x0000, 0x0000, 0x0000 }, /* R947 */
  1036. { 0x0000, 0x0000, 0x0000 }, /* R948 */
  1037. { 0x0000, 0x0000, 0x0000 }, /* R949 */
  1038. { 0x0000, 0x0000, 0x0000 }, /* R950 */
  1039. { 0x0000, 0x0000, 0x0000 }, /* R951 */
  1040. { 0x0000, 0x0000, 0x0000 }, /* R952 */
  1041. { 0x0000, 0x0000, 0x0000 }, /* R953 */
  1042. { 0x0000, 0x0000, 0x0000 }, /* R954 */
  1043. { 0x0000, 0x0000, 0x0000 }, /* R955 */
  1044. { 0x0000, 0x0000, 0x0000 }, /* R956 */
  1045. { 0x0000, 0x0000, 0x0000 }, /* R957 */
  1046. { 0x0000, 0x0000, 0x0000 }, /* R958 */
  1047. { 0x0000, 0x0000, 0x0000 }, /* R959 */
  1048. { 0x0000, 0x0000, 0x0000 }, /* R960 */
  1049. { 0x0000, 0x0000, 0x0000 }, /* R961 */
  1050. { 0x0000, 0x0000, 0x0000 }, /* R962 */
  1051. { 0x0000, 0x0000, 0x0000 }, /* R963 */
  1052. { 0x0000, 0x0000, 0x0000 }, /* R964 */
  1053. { 0x0000, 0x0000, 0x0000 }, /* R965 */
  1054. { 0x0000, 0x0000, 0x0000 }, /* R966 */
  1055. { 0x0000, 0x0000, 0x0000 }, /* R967 */
  1056. { 0x0000, 0x0000, 0x0000 }, /* R968 */
  1057. { 0x0000, 0x0000, 0x0000 }, /* R969 */
  1058. { 0x0000, 0x0000, 0x0000 }, /* R970 */
  1059. { 0x0000, 0x0000, 0x0000 }, /* R971 */
  1060. { 0x0000, 0x0000, 0x0000 }, /* R972 */
  1061. { 0x0000, 0x0000, 0x0000 }, /* R973 */
  1062. { 0x0000, 0x0000, 0x0000 }, /* R974 */
  1063. { 0x0000, 0x0000, 0x0000 }, /* R975 */
  1064. { 0x0000, 0x0000, 0x0000 }, /* R976 */
  1065. { 0x0000, 0x0000, 0x0000 }, /* R977 */
  1066. { 0x0000, 0x0000, 0x0000 }, /* R978 */
  1067. { 0x0000, 0x0000, 0x0000 }, /* R979 */
  1068. { 0x0000, 0x0000, 0x0000 }, /* R980 */
  1069. { 0x0000, 0x0000, 0x0000 }, /* R981 */
  1070. { 0x0000, 0x0000, 0x0000 }, /* R982 */
  1071. { 0x0000, 0x0000, 0x0000 }, /* R983 */
  1072. { 0x0000, 0x0000, 0x0000 }, /* R984 */
  1073. { 0x0000, 0x0000, 0x0000 }, /* R985 */
  1074. { 0x0000, 0x0000, 0x0000 }, /* R986 */
  1075. { 0x0000, 0x0000, 0x0000 }, /* R987 */
  1076. { 0x0000, 0x0000, 0x0000 }, /* R988 */
  1077. { 0x0000, 0x0000, 0x0000 }, /* R989 */
  1078. { 0x0000, 0x0000, 0x0000 }, /* R990 */
  1079. { 0x0000, 0x0000, 0x0000 }, /* R991 */
  1080. { 0x0000, 0x0000, 0x0000 }, /* R992 */
  1081. { 0x0000, 0x0000, 0x0000 }, /* R993 */
  1082. { 0x0000, 0x0000, 0x0000 }, /* R994 */
  1083. { 0x0000, 0x0000, 0x0000 }, /* R995 */
  1084. { 0x0000, 0x0000, 0x0000 }, /* R996 */
  1085. { 0x0000, 0x0000, 0x0000 }, /* R997 */
  1086. { 0x0000, 0x0000, 0x0000 }, /* R998 */
  1087. { 0x0000, 0x0000, 0x0000 }, /* R999 */
  1088. { 0x0000, 0x0000, 0x0000 }, /* R1000 */
  1089. { 0x0000, 0x0000, 0x0000 }, /* R1001 */
  1090. { 0x0000, 0x0000, 0x0000 }, /* R1002 */
  1091. { 0x0000, 0x0000, 0x0000 }, /* R1003 */
  1092. { 0x0000, 0x0000, 0x0000 }, /* R1004 */
  1093. { 0x0000, 0x0000, 0x0000 }, /* R1005 */
  1094. { 0x0000, 0x0000, 0x0000 }, /* R1006 */
  1095. { 0x0000, 0x0000, 0x0000 }, /* R1007 */
  1096. { 0x0000, 0x0000, 0x0000 }, /* R1008 */
  1097. { 0x0000, 0x0000, 0x0000 }, /* R1009 */
  1098. { 0x0000, 0x0000, 0x0000 }, /* R1010 */
  1099. { 0x0000, 0x0000, 0x0000 }, /* R1011 */
  1100. { 0x0000, 0x0000, 0x0000 }, /* R1012 */
  1101. { 0x0000, 0x0000, 0x0000 }, /* R1013 */
  1102. { 0x0000, 0x0000, 0x0000 }, /* R1014 */
  1103. { 0x0000, 0x0000, 0x0000 }, /* R1015 */
  1104. { 0x0000, 0x0000, 0x0000 }, /* R1016 */
  1105. { 0x0000, 0x0000, 0x0000 }, /* R1017 */
  1106. { 0x0000, 0x0000, 0x0000 }, /* R1018 */
  1107. { 0x0000, 0x0000, 0x0000 }, /* R1019 */
  1108. { 0x0000, 0x0000, 0x0000 }, /* R1020 */
  1109. { 0x0000, 0x0000, 0x0000 }, /* R1021 */
  1110. { 0x0000, 0x0000, 0x0000 }, /* R1022 */
  1111. { 0x0000, 0x0000, 0x0000 }, /* R1023 */
  1112. { 0x00FF, 0x01FF, 0x0000 }, /* R1024 - AIF1 ADC1 Left Volume */
  1113. { 0x00FF, 0x01FF, 0x0000 }, /* R1025 - AIF1 ADC1 Right Volume */
  1114. { 0x00FF, 0x01FF, 0x0000 }, /* R1026 - AIF1 DAC1 Left Volume */
  1115. { 0x00FF, 0x01FF, 0x0000 }, /* R1027 - AIF1 DAC1 Right Volume */
  1116. { 0x00FF, 0x01FF, 0x0000 }, /* R1028 - AIF1 ADC2 Left Volume */
  1117. { 0x00FF, 0x01FF, 0x0000 }, /* R1029 - AIF1 ADC2 Right Volume */
  1118. { 0x00FF, 0x01FF, 0x0000 }, /* R1030 - AIF1 DAC2 Left Volume */
  1119. { 0x00FF, 0x01FF, 0x0000 }, /* R1031 - AIF1 DAC2 Right Volume */
  1120. { 0x0000, 0x0000, 0x0000 }, /* R1032 */
  1121. { 0x0000, 0x0000, 0x0000 }, /* R1033 */
  1122. { 0x0000, 0x0000, 0x0000 }, /* R1034 */
  1123. { 0x0000, 0x0000, 0x0000 }, /* R1035 */
  1124. { 0x0000, 0x0000, 0x0000 }, /* R1036 */
  1125. { 0x0000, 0x0000, 0x0000 }, /* R1037 */
  1126. { 0x0000, 0x0000, 0x0000 }, /* R1038 */
  1127. { 0x0000, 0x0000, 0x0000 }, /* R1039 */
  1128. { 0xF800, 0xF800, 0x0000 }, /* R1040 - AIF1 ADC1 Filters */
  1129. { 0x7800, 0x7800, 0x0000 }, /* R1041 - AIF1 ADC2 Filters */
  1130. { 0x0000, 0x0000, 0x0000 }, /* R1042 */
  1131. { 0x0000, 0x0000, 0x0000 }, /* R1043 */
  1132. { 0x0000, 0x0000, 0x0000 }, /* R1044 */
  1133. { 0x0000, 0x0000, 0x0000 }, /* R1045 */
  1134. { 0x0000, 0x0000, 0x0000 }, /* R1046 */
  1135. { 0x0000, 0x0000, 0x0000 }, /* R1047 */
  1136. { 0x0000, 0x0000, 0x0000 }, /* R1048 */
  1137. { 0x0000, 0x0000, 0x0000 }, /* R1049 */
  1138. { 0x0000, 0x0000, 0x0000 }, /* R1050 */
  1139. { 0x0000, 0x0000, 0x0000 }, /* R1051 */
  1140. { 0x0000, 0x0000, 0x0000 }, /* R1052 */
  1141. { 0x0000, 0x0000, 0x0000 }, /* R1053 */
  1142. { 0x0000, 0x0000, 0x0000 }, /* R1054 */
  1143. { 0x0000, 0x0000, 0x0000 }, /* R1055 */
  1144. { 0x02B6, 0x02B6, 0x0000 }, /* R1056 - AIF1 DAC1 Filters (1) */
  1145. { 0x3F00, 0x3F00, 0x0000 }, /* R1057 - AIF1 DAC1 Filters (2) */
  1146. { 0x02B6, 0x02B6, 0x0000 }, /* R1058 - AIF1 DAC2 Filters (1) */
  1147. { 0x3F00, 0x3F00, 0x0000 }, /* R1059 - AIF1 DAC2 Filters (2) */
  1148. { 0x0000, 0x0000, 0x0000 }, /* R1060 */
  1149. { 0x0000, 0x0000, 0x0000 }, /* R1061 */
  1150. { 0x0000, 0x0000, 0x0000 }, /* R1062 */
  1151. { 0x0000, 0x0000, 0x0000 }, /* R1063 */
  1152. { 0x0000, 0x0000, 0x0000 }, /* R1064 */
  1153. { 0x0000, 0x0000, 0x0000 }, /* R1065 */
  1154. { 0x0000, 0x0000, 0x0000 }, /* R1066 */
  1155. { 0x0000, 0x0000, 0x0000 }, /* R1067 */
  1156. { 0x0000, 0x0000, 0x0000 }, /* R1068 */
  1157. { 0x0000, 0x0000, 0x0000 }, /* R1069 */
  1158. { 0x0000, 0x0000, 0x0000 }, /* R1070 */
  1159. { 0x0000, 0x0000, 0x0000 }, /* R1071 */
  1160. { 0x0000, 0x0000, 0x0000 }, /* R1072 */
  1161. { 0x0000, 0x0000, 0x0000 }, /* R1073 */
  1162. { 0x0000, 0x0000, 0x0000 }, /* R1074 */
  1163. { 0x0000, 0x0000, 0x0000 }, /* R1075 */
  1164. { 0x0000, 0x0000, 0x0000 }, /* R1076 */
  1165. { 0x0000, 0x0000, 0x0000 }, /* R1077 */
  1166. { 0x0000, 0x0000, 0x0000 }, /* R1078 */
  1167. { 0x0000, 0x0000, 0x0000 }, /* R1079 */
  1168. { 0x0000, 0x0000, 0x0000 }, /* R1080 */
  1169. { 0x0000, 0x0000, 0x0000 }, /* R1081 */
  1170. { 0x0000, 0x0000, 0x0000 }, /* R1082 */
  1171. { 0x0000, 0x0000, 0x0000 }, /* R1083 */
  1172. { 0x0000, 0x0000, 0x0000 }, /* R1084 */
  1173. { 0x0000, 0x0000, 0x0000 }, /* R1085 */
  1174. { 0x0000, 0x0000, 0x0000 }, /* R1086 */
  1175. { 0x0000, 0x0000, 0x0000 }, /* R1087 */
  1176. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1088 - AIF1 DRC1 (1) */
  1177. { 0x1FFF, 0x1FFF, 0x0000 }, /* R1089 - AIF1 DRC1 (2) */
  1178. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1090 - AIF1 DRC1 (3) */
  1179. { 0x07FF, 0x07FF, 0x0000 }, /* R1091 - AIF1 DRC1 (4) */
  1180. { 0x03FF, 0x03FF, 0x0000 }, /* R1092 - AIF1 DRC1 (5) */
  1181. { 0x0000, 0x0000, 0x0000 }, /* R1093 */
  1182. { 0x0000, 0x0000, 0x0000 }, /* R1094 */
  1183. { 0x0000, 0x0000, 0x0000 }, /* R1095 */
  1184. { 0x0000, 0x0000, 0x0000 }, /* R1096 */
  1185. { 0x0000, 0x0000, 0x0000 }, /* R1097 */
  1186. { 0x0000, 0x0000, 0x0000 }, /* R1098 */
  1187. { 0x0000, 0x0000, 0x0000 }, /* R1099 */
  1188. { 0x0000, 0x0000, 0x0000 }, /* R1100 */
  1189. { 0x0000, 0x0000, 0x0000 }, /* R1101 */
  1190. { 0x0000, 0x0000, 0x0000 }, /* R1102 */
  1191. { 0x0000, 0x0000, 0x0000 }, /* R1103 */
  1192. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1104 - AIF1 DRC2 (1) */
  1193. { 0x1FFF, 0x1FFF, 0x0000 }, /* R1105 - AIF1 DRC2 (2) */
  1194. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1106 - AIF1 DRC2 (3) */
  1195. { 0x07FF, 0x07FF, 0x0000 }, /* R1107 - AIF1 DRC2 (4) */
  1196. { 0x03FF, 0x03FF, 0x0000 }, /* R1108 - AIF1 DRC2 (5) */
  1197. { 0x0000, 0x0000, 0x0000 }, /* R1109 */
  1198. { 0x0000, 0x0000, 0x0000 }, /* R1110 */
  1199. { 0x0000, 0x0000, 0x0000 }, /* R1111 */
  1200. { 0x0000, 0x0000, 0x0000 }, /* R1112 */
  1201. { 0x0000, 0x0000, 0x0000 }, /* R1113 */
  1202. { 0x0000, 0x0000, 0x0000 }, /* R1114 */
  1203. { 0x0000, 0x0000, 0x0000 }, /* R1115 */
  1204. { 0x0000, 0x0000, 0x0000 }, /* R1116 */
  1205. { 0x0000, 0x0000, 0x0000 }, /* R1117 */
  1206. { 0x0000, 0x0000, 0x0000 }, /* R1118 */
  1207. { 0x0000, 0x0000, 0x0000 }, /* R1119 */
  1208. { 0x0000, 0x0000, 0x0000 }, /* R1120 */
  1209. { 0x0000, 0x0000, 0x0000 }, /* R1121 */
  1210. { 0x0000, 0x0000, 0x0000 }, /* R1122 */
  1211. { 0x0000, 0x0000, 0x0000 }, /* R1123 */
  1212. { 0x0000, 0x0000, 0x0000 }, /* R1124 */
  1213. { 0x0000, 0x0000, 0x0000 }, /* R1125 */
  1214. { 0x0000, 0x0000, 0x0000 }, /* R1126 */
  1215. { 0x0000, 0x0000, 0x0000 }, /* R1127 */
  1216. { 0x0000, 0x0000, 0x0000 }, /* R1128 */
  1217. { 0x0000, 0x0000, 0x0000 }, /* R1129 */
  1218. { 0x0000, 0x0000, 0x0000 }, /* R1130 */
  1219. { 0x0000, 0x0000, 0x0000 }, /* R1131 */
  1220. { 0x0000, 0x0000, 0x0000 }, /* R1132 */
  1221. { 0x0000, 0x0000, 0x0000 }, /* R1133 */
  1222. { 0x0000, 0x0000, 0x0000 }, /* R1134 */
  1223. { 0x0000, 0x0000, 0x0000 }, /* R1135 */
  1224. { 0x0000, 0x0000, 0x0000 }, /* R1136 */
  1225. { 0x0000, 0x0000, 0x0000 }, /* R1137 */
  1226. { 0x0000, 0x0000, 0x0000 }, /* R1138 */
  1227. { 0x0000, 0x0000, 0x0000 }, /* R1139 */
  1228. { 0x0000, 0x0000, 0x0000 }, /* R1140 */
  1229. { 0x0000, 0x0000, 0x0000 }, /* R1141 */
  1230. { 0x0000, 0x0000, 0x0000 }, /* R1142 */
  1231. { 0x0000, 0x0000, 0x0000 }, /* R1143 */
  1232. { 0x0000, 0x0000, 0x0000 }, /* R1144 */
  1233. { 0x0000, 0x0000, 0x0000 }, /* R1145 */
  1234. { 0x0000, 0x0000, 0x0000 }, /* R1146 */
  1235. { 0x0000, 0x0000, 0x0000 }, /* R1147 */
  1236. { 0x0000, 0x0000, 0x0000 }, /* R1148 */
  1237. { 0x0000, 0x0000, 0x0000 }, /* R1149 */
  1238. { 0x0000, 0x0000, 0x0000 }, /* R1150 */
  1239. { 0x0000, 0x0000, 0x0000 }, /* R1151 */
  1240. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1152 - AIF1 DAC1 EQ Gains (1) */
  1241. { 0xFFC0, 0xFFC0, 0x0000 }, /* R1153 - AIF1 DAC1 EQ Gains (2) */
  1242. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1154 - AIF1 DAC1 EQ Band 1 A */
  1243. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1155 - AIF1 DAC1 EQ Band 1 B */
  1244. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1156 - AIF1 DAC1 EQ Band 1 PG */
  1245. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1157 - AIF1 DAC1 EQ Band 2 A */
  1246. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1158 - AIF1 DAC1 EQ Band 2 B */
  1247. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1159 - AIF1 DAC1 EQ Band 2 C */
  1248. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1160 - AIF1 DAC1 EQ Band 2 PG */
  1249. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1161 - AIF1 DAC1 EQ Band 3 A */
  1250. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1162 - AIF1 DAC1 EQ Band 3 B */
  1251. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1163 - AIF1 DAC1 EQ Band 3 C */
  1252. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1164 - AIF1 DAC1 EQ Band 3 PG */
  1253. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1165 - AIF1 DAC1 EQ Band 4 A */
  1254. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1166 - AIF1 DAC1 EQ Band 4 B */
  1255. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1167 - AIF1 DAC1 EQ Band 4 C */
  1256. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1168 - AIF1 DAC1 EQ Band 4 PG */
  1257. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1169 - AIF1 DAC1 EQ Band 5 A */
  1258. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1170 - AIF1 DAC1 EQ Band 5 B */
  1259. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1171 - AIF1 DAC1 EQ Band 5 PG */
  1260. { 0x0000, 0x0000, 0x0000 }, /* R1172 */
  1261. { 0x0000, 0x0000, 0x0000 }, /* R1173 */
  1262. { 0x0000, 0x0000, 0x0000 }, /* R1174 */
  1263. { 0x0000, 0x0000, 0x0000 }, /* R1175 */
  1264. { 0x0000, 0x0000, 0x0000 }, /* R1176 */
  1265. { 0x0000, 0x0000, 0x0000 }, /* R1177 */
  1266. { 0x0000, 0x0000, 0x0000 }, /* R1178 */
  1267. { 0x0000, 0x0000, 0x0000 }, /* R1179 */
  1268. { 0x0000, 0x0000, 0x0000 }, /* R1180 */
  1269. { 0x0000, 0x0000, 0x0000 }, /* R1181 */
  1270. { 0x0000, 0x0000, 0x0000 }, /* R1182 */
  1271. { 0x0000, 0x0000, 0x0000 }, /* R1183 */
  1272. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1184 - AIF1 DAC2 EQ Gains (1) */
  1273. { 0xFFC0, 0xFFC0, 0x0000 }, /* R1185 - AIF1 DAC2 EQ Gains (2) */
  1274. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1186 - AIF1 DAC2 EQ Band 1 A */
  1275. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1187 - AIF1 DAC2 EQ Band 1 B */
  1276. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1188 - AIF1 DAC2 EQ Band 1 PG */
  1277. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1189 - AIF1 DAC2 EQ Band 2 A */
  1278. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1190 - AIF1 DAC2 EQ Band 2 B */
  1279. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1191 - AIF1 DAC2 EQ Band 2 C */
  1280. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1192 - AIF1 DAC2 EQ Band 2 PG */
  1281. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1193 - AIF1 DAC2 EQ Band 3 A */
  1282. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1194 - AIF1 DAC2 EQ Band 3 B */
  1283. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1195 - AIF1 DAC2 EQ Band 3 C */
  1284. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1196 - AIF1 DAC2 EQ Band 3 PG */
  1285. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1197 - AIF1 DAC2 EQ Band 4 A */
  1286. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1198 - AIF1 DAC2 EQ Band 4 B */
  1287. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1199 - AIF1 DAC2 EQ Band 4 C */
  1288. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1200 - AIF1 DAC2 EQ Band 4 PG */
  1289. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1201 - AIF1 DAC2 EQ Band 5 A */
  1290. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1202 - AIF1 DAC2 EQ Band 5 B */
  1291. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1203 - AIF1 DAC2 EQ Band 5 PG */
  1292. { 0x0000, 0x0000, 0x0000 }, /* R1204 */
  1293. { 0x0000, 0x0000, 0x0000 }, /* R1205 */
  1294. { 0x0000, 0x0000, 0x0000 }, /* R1206 */
  1295. { 0x0000, 0x0000, 0x0000 }, /* R1207 */
  1296. { 0x0000, 0x0000, 0x0000 }, /* R1208 */
  1297. { 0x0000, 0x0000, 0x0000 }, /* R1209 */
  1298. { 0x0000, 0x0000, 0x0000 }, /* R1210 */
  1299. { 0x0000, 0x0000, 0x0000 }, /* R1211 */
  1300. { 0x0000, 0x0000, 0x0000 }, /* R1212 */
  1301. { 0x0000, 0x0000, 0x0000 }, /* R1213 */
  1302. { 0x0000, 0x0000, 0x0000 }, /* R1214 */
  1303. { 0x0000, 0x0000, 0x0000 }, /* R1215 */
  1304. { 0x0000, 0x0000, 0x0000 }, /* R1216 */
  1305. { 0x0000, 0x0000, 0x0000 }, /* R1217 */
  1306. { 0x0000, 0x0000, 0x0000 }, /* R1218 */
  1307. { 0x0000, 0x0000, 0x0000 }, /* R1219 */
  1308. { 0x0000, 0x0000, 0x0000 }, /* R1220 */
  1309. { 0x0000, 0x0000, 0x0000 }, /* R1221 */
  1310. { 0x0000, 0x0000, 0x0000 }, /* R1222 */
  1311. { 0x0000, 0x0000, 0x0000 }, /* R1223 */
  1312. { 0x0000, 0x0000, 0x0000 }, /* R1224 */
  1313. { 0x0000, 0x0000, 0x0000 }, /* R1225 */
  1314. { 0x0000, 0x0000, 0x0000 }, /* R1226 */
  1315. { 0x0000, 0x0000, 0x0000 }, /* R1227 */
  1316. { 0x0000, 0x0000, 0x0000 }, /* R1228 */
  1317. { 0x0000, 0x0000, 0x0000 }, /* R1229 */
  1318. { 0x0000, 0x0000, 0x0000 }, /* R1230 */
  1319. { 0x0000, 0x0000, 0x0000 }, /* R1231 */
  1320. { 0x0000, 0x0000, 0x0000 }, /* R1232 */
  1321. { 0x0000, 0x0000, 0x0000 }, /* R1233 */
  1322. { 0x0000, 0x0000, 0x0000 }, /* R1234 */
  1323. { 0x0000, 0x0000, 0x0000 }, /* R1235 */
  1324. { 0x0000, 0x0000, 0x0000 }, /* R1236 */
  1325. { 0x0000, 0x0000, 0x0000 }, /* R1237 */
  1326. { 0x0000, 0x0000, 0x0000 }, /* R1238 */
  1327. { 0x0000, 0x0000, 0x0000 }, /* R1239 */
  1328. { 0x0000, 0x0000, 0x0000 }, /* R1240 */
  1329. { 0x0000, 0x0000, 0x0000 }, /* R1241 */
  1330. { 0x0000, 0x0000, 0x0000 }, /* R1242 */
  1331. { 0x0000, 0x0000, 0x0000 }, /* R1243 */
  1332. { 0x0000, 0x0000, 0x0000 }, /* R1244 */
  1333. { 0x0000, 0x0000, 0x0000 }, /* R1245 */
  1334. { 0x0000, 0x0000, 0x0000 }, /* R1246 */
  1335. { 0x0000, 0x0000, 0x0000 }, /* R1247 */
  1336. { 0x0000, 0x0000, 0x0000 }, /* R1248 */
  1337. { 0x0000, 0x0000, 0x0000 }, /* R1249 */
  1338. { 0x0000, 0x0000, 0x0000 }, /* R1250 */
  1339. { 0x0000, 0x0000, 0x0000 }, /* R1251 */
  1340. { 0x0000, 0x0000, 0x0000 }, /* R1252 */
  1341. { 0x0000, 0x0000, 0x0000 }, /* R1253 */
  1342. { 0x0000, 0x0000, 0x0000 }, /* R1254 */
  1343. { 0x0000, 0x0000, 0x0000 }, /* R1255 */
  1344. { 0x0000, 0x0000, 0x0000 }, /* R1256 */
  1345. { 0x0000, 0x0000, 0x0000 }, /* R1257 */
  1346. { 0x0000, 0x0000, 0x0000 }, /* R1258 */
  1347. { 0x0000, 0x0000, 0x0000 }, /* R1259 */
  1348. { 0x0000, 0x0000, 0x0000 }, /* R1260 */
  1349. { 0x0000, 0x0000, 0x0000 }, /* R1261 */
  1350. { 0x0000, 0x0000, 0x0000 }, /* R1262 */
  1351. { 0x0000, 0x0000, 0x0000 }, /* R1263 */
  1352. { 0x0000, 0x0000, 0x0000 }, /* R1264 */
  1353. { 0x0000, 0x0000, 0x0000 }, /* R1265 */
  1354. { 0x0000, 0x0000, 0x0000 }, /* R1266 */
  1355. { 0x0000, 0x0000, 0x0000 }, /* R1267 */
  1356. { 0x0000, 0x0000, 0x0000 }, /* R1268 */
  1357. { 0x0000, 0x0000, 0x0000 }, /* R1269 */
  1358. { 0x0000, 0x0000, 0x0000 }, /* R1270 */
  1359. { 0x0000, 0x0000, 0x0000 }, /* R1271 */
  1360. { 0x0000, 0x0000, 0x0000 }, /* R1272 */
  1361. { 0x0000, 0x0000, 0x0000 }, /* R1273 */
  1362. { 0x0000, 0x0000, 0x0000 }, /* R1274 */
  1363. { 0x0000, 0x0000, 0x0000 }, /* R1275 */
  1364. { 0x0000, 0x0000, 0x0000 }, /* R1276 */
  1365. { 0x0000, 0x0000, 0x0000 }, /* R1277 */
  1366. { 0x0000, 0x0000, 0x0000 }, /* R1278 */
  1367. { 0x0000, 0x0000, 0x0000 }, /* R1279 */
  1368. { 0x00FF, 0x01FF, 0x0000 }, /* R1280 - AIF2 ADC Left Volume */
  1369. { 0x00FF, 0x01FF, 0x0000 }, /* R1281 - AIF2 ADC Right Volume */
  1370. { 0x00FF, 0x01FF, 0x0000 }, /* R1282 - AIF2 DAC Left Volume */
  1371. { 0x00FF, 0x01FF, 0x0000 }, /* R1283 - AIF2 DAC Right Volume */
  1372. { 0x0000, 0x0000, 0x0000 }, /* R1284 */
  1373. { 0x0000, 0x0000, 0x0000 }, /* R1285 */
  1374. { 0x0000, 0x0000, 0x0000 }, /* R1286 */
  1375. { 0x0000, 0x0000, 0x0000 }, /* R1287 */
  1376. { 0x0000, 0x0000, 0x0000 }, /* R1288 */
  1377. { 0x0000, 0x0000, 0x0000 }, /* R1289 */
  1378. { 0x0000, 0x0000, 0x0000 }, /* R1290 */
  1379. { 0x0000, 0x0000, 0x0000 }, /* R1291 */
  1380. { 0x0000, 0x0000, 0x0000 }, /* R1292 */
  1381. { 0x0000, 0x0000, 0x0000 }, /* R1293 */
  1382. { 0x0000, 0x0000, 0x0000 }, /* R1294 */
  1383. { 0x0000, 0x0000, 0x0000 }, /* R1295 */
  1384. { 0xF800, 0xF800, 0x0000 }, /* R1296 - AIF2 ADC Filters */
  1385. { 0x0000, 0x0000, 0x0000 }, /* R1297 */
  1386. { 0x0000, 0x0000, 0x0000 }, /* R1298 */
  1387. { 0x0000, 0x0000, 0x0000 }, /* R1299 */
  1388. { 0x0000, 0x0000, 0x0000 }, /* R1300 */
  1389. { 0x0000, 0x0000, 0x0000 }, /* R1301 */
  1390. { 0x0000, 0x0000, 0x0000 }, /* R1302 */
  1391. { 0x0000, 0x0000, 0x0000 }, /* R1303 */
  1392. { 0x0000, 0x0000, 0x0000 }, /* R1304 */
  1393. { 0x0000, 0x0000, 0x0000 }, /* R1305 */
  1394. { 0x0000, 0x0000, 0x0000 }, /* R1306 */
  1395. { 0x0000, 0x0000, 0x0000 }, /* R1307 */
  1396. { 0x0000, 0x0000, 0x0000 }, /* R1308 */
  1397. { 0x0000, 0x0000, 0x0000 }, /* R1309 */
  1398. { 0x0000, 0x0000, 0x0000 }, /* R1310 */
  1399. { 0x0000, 0x0000, 0x0000 }, /* R1311 */
  1400. { 0x02B6, 0x02B6, 0x0000 }, /* R1312 - AIF2 DAC Filters (1) */
  1401. { 0x3F00, 0x3F00, 0x0000 }, /* R1313 - AIF2 DAC Filters (2) */
  1402. { 0x0000, 0x0000, 0x0000 }, /* R1314 */
  1403. { 0x0000, 0x0000, 0x0000 }, /* R1315 */
  1404. { 0x0000, 0x0000, 0x0000 }, /* R1316 */
  1405. { 0x0000, 0x0000, 0x0000 }, /* R1317 */
  1406. { 0x0000, 0x0000, 0x0000 }, /* R1318 */
  1407. { 0x0000, 0x0000, 0x0000 }, /* R1319 */
  1408. { 0x0000, 0x0000, 0x0000 }, /* R1320 */
  1409. { 0x0000, 0x0000, 0x0000 }, /* R1321 */
  1410. { 0x0000, 0x0000, 0x0000 }, /* R1322 */
  1411. { 0x0000, 0x0000, 0x0000 }, /* R1323 */
  1412. { 0x0000, 0x0000, 0x0000 }, /* R1324 */
  1413. { 0x0000, 0x0000, 0x0000 }, /* R1325 */
  1414. { 0x0000, 0x0000, 0x0000 }, /* R1326 */
  1415. { 0x0000, 0x0000, 0x0000 }, /* R1327 */
  1416. { 0x0000, 0x0000, 0x0000 }, /* R1328 */
  1417. { 0x0000, 0x0000, 0x0000 }, /* R1329 */
  1418. { 0x0000, 0x0000, 0x0000 }, /* R1330 */
  1419. { 0x0000, 0x0000, 0x0000 }, /* R1331 */
  1420. { 0x0000, 0x0000, 0x0000 }, /* R1332 */
  1421. { 0x0000, 0x0000, 0x0000 }, /* R1333 */
  1422. { 0x0000, 0x0000, 0x0000 }, /* R1334 */
  1423. { 0x0000, 0x0000, 0x0000 }, /* R1335 */
  1424. { 0x0000, 0x0000, 0x0000 }, /* R1336 */
  1425. { 0x0000, 0x0000, 0x0000 }, /* R1337 */
  1426. { 0x0000, 0x0000, 0x0000 }, /* R1338 */
  1427. { 0x0000, 0x0000, 0x0000 }, /* R1339 */
  1428. { 0x0000, 0x0000, 0x0000 }, /* R1340 */
  1429. { 0x0000, 0x0000, 0x0000 }, /* R1341 */
  1430. { 0x0000, 0x0000, 0x0000 }, /* R1342 */
  1431. { 0x0000, 0x0000, 0x0000 }, /* R1343 */
  1432. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1344 - AIF2 DRC (1) */
  1433. { 0x1FFF, 0x1FFF, 0x0000 }, /* R1345 - AIF2 DRC (2) */
  1434. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1346 - AIF2 DRC (3) */
  1435. { 0x07FF, 0x07FF, 0x0000 }, /* R1347 - AIF2 DRC (4) */
  1436. { 0x03FF, 0x03FF, 0x0000 }, /* R1348 - AIF2 DRC (5) */
  1437. { 0x0000, 0x0000, 0x0000 }, /* R1349 */
  1438. { 0x0000, 0x0000, 0x0000 }, /* R1350 */
  1439. { 0x0000, 0x0000, 0x0000 }, /* R1351 */
  1440. { 0x0000, 0x0000, 0x0000 }, /* R1352 */
  1441. { 0x0000, 0x0000, 0x0000 }, /* R1353 */
  1442. { 0x0000, 0x0000, 0x0000 }, /* R1354 */
  1443. { 0x0000, 0x0000, 0x0000 }, /* R1355 */
  1444. { 0x0000, 0x0000, 0x0000 }, /* R1356 */
  1445. { 0x0000, 0x0000, 0x0000 }, /* R1357 */
  1446. { 0x0000, 0x0000, 0x0000 }, /* R1358 */
  1447. { 0x0000, 0x0000, 0x0000 }, /* R1359 */
  1448. { 0x0000, 0x0000, 0x0000 }, /* R1360 */
  1449. { 0x0000, 0x0000, 0x0000 }, /* R1361 */
  1450. { 0x0000, 0x0000, 0x0000 }, /* R1362 */
  1451. { 0x0000, 0x0000, 0x0000 }, /* R1363 */
  1452. { 0x0000, 0x0000, 0x0000 }, /* R1364 */
  1453. { 0x0000, 0x0000, 0x0000 }, /* R1365 */
  1454. { 0x0000, 0x0000, 0x0000 }, /* R1366 */
  1455. { 0x0000, 0x0000, 0x0000 }, /* R1367 */
  1456. { 0x0000, 0x0000, 0x0000 }, /* R1368 */
  1457. { 0x0000, 0x0000, 0x0000 }, /* R1369 */
  1458. { 0x0000, 0x0000, 0x0000 }, /* R1370 */
  1459. { 0x0000, 0x0000, 0x0000 }, /* R1371 */
  1460. { 0x0000, 0x0000, 0x0000 }, /* R1372 */
  1461. { 0x0000, 0x0000, 0x0000 }, /* R1373 */
  1462. { 0x0000, 0x0000, 0x0000 }, /* R1374 */
  1463. { 0x0000, 0x0000, 0x0000 }, /* R1375 */
  1464. { 0x0000, 0x0000, 0x0000 }, /* R1376 */
  1465. { 0x0000, 0x0000, 0x0000 }, /* R1377 */
  1466. { 0x0000, 0x0000, 0x0000 }, /* R1378 */
  1467. { 0x0000, 0x0000, 0x0000 }, /* R1379 */
  1468. { 0x0000, 0x0000, 0x0000 }, /* R1380 */
  1469. { 0x0000, 0x0000, 0x0000 }, /* R1381 */
  1470. { 0x0000, 0x0000, 0x0000 }, /* R1382 */
  1471. { 0x0000, 0x0000, 0x0000 }, /* R1383 */
  1472. { 0x0000, 0x0000, 0x0000 }, /* R1384 */
  1473. { 0x0000, 0x0000, 0x0000 }, /* R1385 */
  1474. { 0x0000, 0x0000, 0x0000 }, /* R1386 */
  1475. { 0x0000, 0x0000, 0x0000 }, /* R1387 */
  1476. { 0x0000, 0x0000, 0x0000 }, /* R1388 */
  1477. { 0x0000, 0x0000, 0x0000 }, /* R1389 */
  1478. { 0x0000, 0x0000, 0x0000 }, /* R1390 */
  1479. { 0x0000, 0x0000, 0x0000 }, /* R1391 */
  1480. { 0x0000, 0x0000, 0x0000 }, /* R1392 */
  1481. { 0x0000, 0x0000, 0x0000 }, /* R1393 */
  1482. { 0x0000, 0x0000, 0x0000 }, /* R1394 */
  1483. { 0x0000, 0x0000, 0x0000 }, /* R1395 */
  1484. { 0x0000, 0x0000, 0x0000 }, /* R1396 */
  1485. { 0x0000, 0x0000, 0x0000 }, /* R1397 */
  1486. { 0x0000, 0x0000, 0x0000 }, /* R1398 */
  1487. { 0x0000, 0x0000, 0x0000 }, /* R1399 */
  1488. { 0x0000, 0x0000, 0x0000 }, /* R1400 */
  1489. { 0x0000, 0x0000, 0x0000 }, /* R1401 */
  1490. { 0x0000, 0x0000, 0x0000 }, /* R1402 */
  1491. { 0x0000, 0x0000, 0x0000 }, /* R1403 */
  1492. { 0x0000, 0x0000, 0x0000 }, /* R1404 */
  1493. { 0x0000, 0x0000, 0x0000 }, /* R1405 */
  1494. { 0x0000, 0x0000, 0x0000 }, /* R1406 */
  1495. { 0x0000, 0x0000, 0x0000 }, /* R1407 */
  1496. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1408 - AIF2 EQ Gains (1) */
  1497. { 0xFFC0, 0xFFC0, 0x0000 }, /* R1409 - AIF2 EQ Gains (2) */
  1498. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1410 - AIF2 EQ Band 1 A */
  1499. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1411 - AIF2 EQ Band 1 B */
  1500. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1412 - AIF2 EQ Band 1 PG */
  1501. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1413 - AIF2 EQ Band 2 A */
  1502. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1414 - AIF2 EQ Band 2 B */
  1503. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1415 - AIF2 EQ Band 2 C */
  1504. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1416 - AIF2 EQ Band 2 PG */
  1505. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1417 - AIF2 EQ Band 3 A */
  1506. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1418 - AIF2 EQ Band 3 B */
  1507. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1419 - AIF2 EQ Band 3 C */
  1508. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1420 - AIF2 EQ Band 3 PG */
  1509. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1421 - AIF2 EQ Band 4 A */
  1510. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1422 - AIF2 EQ Band 4 B */
  1511. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1423 - AIF2 EQ Band 4 C */
  1512. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1424 - AIF2 EQ Band 4 PG */
  1513. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1425 - AIF2 EQ Band 5 A */
  1514. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1426 - AIF2 EQ Band 5 B */
  1515. { 0xFFFF, 0xFFFF, 0x0000 }, /* R1427 - AIF2 EQ Band 5 PG */
  1516. { 0x0000, 0x0000, 0x0000 }, /* R1428 */
  1517. { 0x0000, 0x0000, 0x0000 }, /* R1429 */
  1518. { 0x0000, 0x0000, 0x0000 }, /* R1430 */
  1519. { 0x0000, 0x0000, 0x0000 }, /* R1431 */
  1520. { 0x0000, 0x0000, 0x0000 }, /* R1432 */
  1521. { 0x0000, 0x0000, 0x0000 }, /* R1433 */
  1522. { 0x0000, 0x0000, 0x0000 }, /* R1434 */
  1523. { 0x0000, 0x0000, 0x0000 }, /* R1435 */
  1524. { 0x0000, 0x0000, 0x0000 }, /* R1436 */
  1525. { 0x0000, 0x0000, 0x0000 }, /* R1437 */
  1526. { 0x0000, 0x0000, 0x0000 }, /* R1438 */
  1527. { 0x0000, 0x0000, 0x0000 }, /* R1439 */
  1528. { 0x0000, 0x0000, 0x0000 }, /* R1440 */
  1529. { 0x0000, 0x0000, 0x0000 }, /* R1441 */
  1530. { 0x0000, 0x0000, 0x0000 }, /* R1442 */
  1531. { 0x0000, 0x0000, 0x0000 }, /* R1443 */
  1532. { 0x0000, 0x0000, 0x0000 }, /* R1444 */
  1533. { 0x0000, 0x0000, 0x0000 }, /* R1445 */
  1534. { 0x0000, 0x0000, 0x0000 }, /* R1446 */
  1535. { 0x0000, 0x0000, 0x0000 }, /* R1447 */
  1536. { 0x0000, 0x0000, 0x0000 }, /* R1448 */
  1537. { 0x0000, 0x0000, 0x0000 }, /* R1449 */
  1538. { 0x0000, 0x0000, 0x0000 }, /* R1450 */
  1539. { 0x0000, 0x0000, 0x0000 }, /* R1451 */
  1540. { 0x0000, 0x0000, 0x0000 }, /* R1452 */
  1541. { 0x0000, 0x0000, 0x0000 }, /* R1453 */
  1542. { 0x0000, 0x0000, 0x0000 }, /* R1454 */
  1543. { 0x0000, 0x0000, 0x0000 }, /* R1455 */
  1544. { 0x0000, 0x0000, 0x0000 }, /* R1456 */
  1545. { 0x0000, 0x0000, 0x0000 }, /* R1457 */
  1546. { 0x0000, 0x0000, 0x0000 }, /* R1458 */
  1547. { 0x0000, 0x0000, 0x0000 }, /* R1459 */
  1548. { 0x0000, 0x0000, 0x0000 }, /* R1460 */
  1549. { 0x0000, 0x0000, 0x0000 }, /* R1461 */
  1550. { 0x0000, 0x0000, 0x0000 }, /* R1462 */
  1551. { 0x0000, 0x0000, 0x0000 }, /* R1463 */
  1552. { 0x0000, 0x0000, 0x0000 }, /* R1464 */
  1553. { 0x0000, 0x0000, 0x0000 }, /* R1465 */
  1554. { 0x0000, 0x0000, 0x0000 }, /* R1466 */
  1555. { 0x0000, 0x0000, 0x0000 }, /* R1467 */
  1556. { 0x0000, 0x0000, 0x0000 }, /* R1468 */
  1557. { 0x0000, 0x0000, 0x0000 }, /* R1469 */
  1558. { 0x0000, 0x0000, 0x0000 }, /* R1470 */
  1559. { 0x0000, 0x0000, 0x0000 }, /* R1471 */
  1560. { 0x0000, 0x0000, 0x0000 }, /* R1472 */
  1561. { 0x0000, 0x0000, 0x0000 }, /* R1473 */
  1562. { 0x0000, 0x0000, 0x0000 }, /* R1474 */
  1563. { 0x0000, 0x0000, 0x0000 }, /* R1475 */
  1564. { 0x0000, 0x0000, 0x0000 }, /* R1476 */
  1565. { 0x0000, 0x0000, 0x0000 }, /* R1477 */
  1566. { 0x0000, 0x0000, 0x0000 }, /* R1478 */
  1567. { 0x0000, 0x0000, 0x0000 }, /* R1479 */
  1568. { 0x0000, 0x0000, 0x0000 }, /* R1480 */
  1569. { 0x0000, 0x0000, 0x0000 }, /* R1481 */
  1570. { 0x0000, 0x0000, 0x0000 }, /* R1482 */
  1571. { 0x0000, 0x0000, 0x0000 }, /* R1483 */
  1572. { 0x0000, 0x0000, 0x0000 }, /* R1484 */
  1573. { 0x0000, 0x0000, 0x0000 }, /* R1485 */
  1574. { 0x0000, 0x0000, 0x0000 }, /* R1486 */
  1575. { 0x0000, 0x0000, 0x0000 }, /* R1487 */
  1576. { 0x0000, 0x0000, 0x0000 }, /* R1488 */
  1577. { 0x0000, 0x0000, 0x0000 }, /* R1489 */
  1578. { 0x0000, 0x0000, 0x0000 }, /* R1490 */
  1579. { 0x0000, 0x0000, 0x0000 }, /* R1491 */
  1580. { 0x0000, 0x0000, 0x0000 }, /* R1492 */
  1581. { 0x0000, 0x0000, 0x0000 }, /* R1493 */
  1582. { 0x0000, 0x0000, 0x0000 }, /* R1494 */
  1583. { 0x0000, 0x0000, 0x0000 }, /* R1495 */
  1584. { 0x0000, 0x0000, 0x0000 }, /* R1496 */
  1585. { 0x0000, 0x0000, 0x0000 }, /* R1497 */
  1586. { 0x0000, 0x0000, 0x0000 }, /* R1498 */
  1587. { 0x0000, 0x0000, 0x0000 }, /* R1499 */
  1588. { 0x0000, 0x0000, 0x0000 }, /* R1500 */
  1589. { 0x0000, 0x0000, 0x0000 }, /* R1501 */
  1590. { 0x0000, 0x0000, 0x0000 }, /* R1502 */
  1591. { 0x0000, 0x0000, 0x0000 }, /* R1503 */
  1592. { 0x0000, 0x0000, 0x0000 }, /* R1504 */
  1593. { 0x0000, 0x0000, 0x0000 }, /* R1505 */
  1594. { 0x0000, 0x0000, 0x0000 }, /* R1506 */
  1595. { 0x0000, 0x0000, 0x0000 }, /* R1507 */
  1596. { 0x0000, 0x0000, 0x0000 }, /* R1508 */
  1597. { 0x0000, 0x0000, 0x0000 }, /* R1509 */
  1598. { 0x0000, 0x0000, 0x0000 }, /* R1510 */
  1599. { 0x0000, 0x0000, 0x0000 }, /* R1511 */
  1600. { 0x0000, 0x0000, 0x0000 }, /* R1512 */
  1601. { 0x0000, 0x0000, 0x0000 }, /* R1513 */
  1602. { 0x0000, 0x0000, 0x0000 }, /* R1514 */
  1603. { 0x0000, 0x0000, 0x0000 }, /* R1515 */
  1604. { 0x0000, 0x0000, 0x0000 }, /* R1516 */
  1605. { 0x0000, 0x0000, 0x0000 }, /* R1517 */
  1606. { 0x0000, 0x0000, 0x0000 }, /* R1518 */
  1607. { 0x0000, 0x0000, 0x0000 }, /* R1519 */
  1608. { 0x0000, 0x0000, 0x0000 }, /* R1520 */
  1609. { 0x0000, 0x0000, 0x0000 }, /* R1521 */
  1610. { 0x0000, 0x0000, 0x0000 }, /* R1522 */
  1611. { 0x0000, 0x0000, 0x0000 }, /* R1523 */
  1612. { 0x0000, 0x0000, 0x0000 }, /* R1524 */
  1613. { 0x0000, 0x0000, 0x0000 }, /* R1525 */
  1614. { 0x0000, 0x0000, 0x0000 }, /* R1526 */
  1615. { 0x0000, 0x0000, 0x0000 }, /* R1527 */
  1616. { 0x0000, 0x0000, 0x0000 }, /* R1528 */
  1617. { 0x0000, 0x0000, 0x0000 }, /* R1529 */
  1618. { 0x0000, 0x0000, 0x0000 }, /* R1530 */
  1619. { 0x0000, 0x0000, 0x0000 }, /* R1531 */
  1620. { 0x0000, 0x0000, 0x0000 }, /* R1532 */
  1621. { 0x0000, 0x0000, 0x0000 }, /* R1533 */
  1622. { 0x0000, 0x0000, 0x0000 }, /* R1534 */
  1623. { 0x0000, 0x0000, 0x0000 }, /* R1535 */
  1624. { 0x01EF, 0x01EF, 0x0000 }, /* R1536 - DAC1 Mixer Volumes */
  1625. { 0x0037, 0x0037, 0x0000 }, /* R1537 - DAC1 Left Mixer Routing */
  1626. { 0x0037, 0x0037, 0x0000 }, /* R1538 - DAC1 Right Mixer Routing */
  1627. { 0x01EF, 0x01EF, 0x0000 }, /* R1539 - DAC2 Mixer Volumes */
  1628. { 0x0037, 0x0037, 0x0000 }, /* R1540 - DAC2 Left Mixer Routing */
  1629. { 0x0037, 0x0037, 0x0000 }, /* R1541 - DAC2 Right Mixer Routing */
  1630. { 0x0003, 0x0003, 0x0000 }, /* R1542 - AIF1 ADC1 Left Mixer Routing */
  1631. { 0x0003, 0x0003, 0x0000 }, /* R1543 - AIF1 ADC1 Right Mixer Routing */
  1632. { 0x0003, 0x0003, 0x0000 }, /* R1544 - AIF1 ADC2 Left Mixer Routing */
  1633. { 0x0003, 0x0003, 0x0000 }, /* R1545 - AIF1 ADC2 Right mixer Routing */
  1634. { 0x0000, 0x0000, 0x0000 }, /* R1546 */
  1635. { 0x0000, 0x0000, 0x0000 }, /* R1547 */
  1636. { 0x0000, 0x0000, 0x0000 }, /* R1548 */
  1637. { 0x0000, 0x0000, 0x0000 }, /* R1549 */
  1638. { 0x0000, 0x0000, 0x0000 }, /* R1550 */
  1639. { 0x0000, 0x0000, 0x0000 }, /* R1551 */
  1640. { 0x02FF, 0x03FF, 0x0000 }, /* R1552 - DAC1 Left Volume */
  1641. { 0x02FF, 0x03FF, 0x0000 }, /* R1553 - DAC1 Right Volume */
  1642. { 0x02FF, 0x03FF, 0x0000 }, /* R1554 - DAC2 Left Volume */
  1643. { 0x02FF, 0x03FF, 0x0000 }, /* R1555 - DAC2 Right Volume */
  1644. { 0x0003, 0x0003, 0x0000 }, /* R1556 - DAC Softmute */
  1645. { 0x0000, 0x0000, 0x0000 }, /* R1557 */
  1646. { 0x0000, 0x0000, 0x0000 }, /* R1558 */
  1647. { 0x0000, 0x0000, 0x0000 }, /* R1559 */
  1648. { 0x0000, 0x0000, 0x0000 }, /* R1560 */
  1649. { 0x0000, 0x0000, 0x0000 }, /* R1561 */
  1650. { 0x0000, 0x0000, 0x0000 }, /* R1562 */
  1651. { 0x0000, 0x0000, 0x0000 }, /* R1563 */
  1652. { 0x0000, 0x0000, 0x0000 }, /* R1564 */
  1653. { 0x0000, 0x0000, 0x0000 }, /* R1565 */
  1654. { 0x0000, 0x0000, 0x0000 }, /* R1566 */
  1655. { 0x0000, 0x0000, 0x0000 }, /* R1567 */
  1656. { 0x0003, 0x0003, 0x0000 }, /* R1568 - Oversampling */
  1657. { 0x03C3, 0x03C3, 0x0000 }, /* R1569 - Sidetone */
  1658. };
  1659. static int wm8994_readable(unsigned int reg)
  1660. {
  1661. if (reg >= ARRAY_SIZE(access_masks))
  1662. return 0;
  1663. return access_masks[reg].readable != 0;
  1664. }
  1665. static int wm8994_volatile(unsigned int reg)
  1666. {
  1667. if (reg >= WM8994_REG_CACHE_SIZE)
  1668. return 1;
  1669. switch (reg) {
  1670. case WM8994_SOFTWARE_RESET:
  1671. case WM8994_CHIP_REVISION:
  1672. case WM8994_DC_SERVO_1:
  1673. case WM8994_DC_SERVO_READBACK:
  1674. case WM8994_RATE_STATUS:
  1675. case WM8994_LDO_1:
  1676. case WM8994_LDO_2:
  1677. return 1;
  1678. default:
  1679. return 0;
  1680. }
  1681. }
  1682. static int wm8994_write(struct snd_soc_codec *codec, unsigned int reg,
  1683. unsigned int value)
  1684. {
  1685. struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
  1686. BUG_ON(reg > WM8994_MAX_REGISTER);
  1687. if (!wm8994_volatile(reg))
  1688. wm8994->reg_cache[reg] = value;
  1689. return wm8994_reg_write(codec->control_data, reg, value);
  1690. }
  1691. static unsigned int wm8994_read(struct snd_soc_codec *codec,
  1692. unsigned int reg)
  1693. {
  1694. u16 *reg_cache = codec->reg_cache;
  1695. BUG_ON(reg > WM8994_MAX_REGISTER);
  1696. if (wm8994_volatile(reg))
  1697. return wm8994_reg_read(codec->control_data, reg);
  1698. else
  1699. return reg_cache[reg];
  1700. }
  1701. static int configure_aif_clock(struct snd_soc_codec *codec, int aif)
  1702. {
  1703. struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
  1704. int rate;
  1705. int reg1 = 0;
  1706. int offset;
  1707. if (aif)
  1708. offset = 4;
  1709. else
  1710. offset = 0;
  1711. switch (wm8994->sysclk[aif]) {
  1712. case WM8994_SYSCLK_MCLK1:
  1713. rate = wm8994->mclk[0];
  1714. break;
  1715. case WM8994_SYSCLK_MCLK2:
  1716. reg1 |= 0x8;
  1717. rate = wm8994->mclk[1];
  1718. break;
  1719. case WM8994_SYSCLK_FLL1:
  1720. reg1 |= 0x10;
  1721. rate = wm8994->fll[0].out;
  1722. break;
  1723. case WM8994_SYSCLK_FLL2:
  1724. reg1 |= 0x18;
  1725. rate = wm8994->fll[1].out;
  1726. break;
  1727. default:
  1728. return -EINVAL;
  1729. }
  1730. if (rate >= 13500000) {
  1731. rate /= 2;
  1732. reg1 |= WM8994_AIF1CLK_DIV;
  1733. dev_dbg(codec->dev, "Dividing AIF%d clock to %dHz\n",
  1734. aif + 1, rate);
  1735. }
  1736. wm8994->aifclk[aif] = rate;
  1737. snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1 + offset,
  1738. WM8994_AIF1CLK_SRC_MASK | WM8994_AIF1CLK_DIV,
  1739. reg1);
  1740. return 0;
  1741. }
  1742. static int configure_clock(struct snd_soc_codec *codec)
  1743. {
  1744. struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
  1745. int old, new;
  1746. /* Bring up the AIF clocks first */
  1747. configure_aif_clock(codec, 0);
  1748. configure_aif_clock(codec, 1);
  1749. /* Then switch CLK_SYS over to the higher of them; a change
  1750. * can only happen as a result of a clocking change which can
  1751. * only be made outside of DAPM so we can safely redo the
  1752. * clocking.
  1753. */
  1754. /* If they're equal it doesn't matter which is used */
  1755. if (wm8994->aifclk[0] == wm8994->aifclk[1])
  1756. return 0;
  1757. if (wm8994->aifclk[0] < wm8994->aifclk[1])
  1758. new = WM8994_SYSCLK_SRC;
  1759. else
  1760. new = 0;
  1761. old = snd_soc_read(codec, WM8994_CLOCKING_1) & WM8994_SYSCLK_SRC;
  1762. /* If there's no change then we're done. */
  1763. if (old == new)
  1764. return 0;
  1765. snd_soc_update_bits(codec, WM8994_CLOCKING_1, WM8994_SYSCLK_SRC, new);
  1766. snd_soc_dapm_sync(codec);
  1767. return 0;
  1768. }
  1769. static int check_clk_sys(struct snd_soc_dapm_widget *source,
  1770. struct snd_soc_dapm_widget *sink)
  1771. {
  1772. int reg = snd_soc_read(source->codec, WM8994_CLOCKING_1);
  1773. const char *clk;
  1774. /* Check what we're currently using for CLK_SYS */
  1775. if (reg & WM8994_SYSCLK_SRC)
  1776. clk = "AIF2CLK";
  1777. else
  1778. clk = "AIF1CLK";
  1779. return strcmp(source->name, clk) == 0;
  1780. }
  1781. static const char *sidetone_hpf_text[] = {
  1782. "2.7kHz", "1.35kHz", "675Hz", "370Hz", "180Hz", "90Hz", "45Hz"
  1783. };
  1784. static const struct soc_enum sidetone_hpf =
  1785. SOC_ENUM_SINGLE(WM8994_SIDETONE, 7, 7, sidetone_hpf_text);
  1786. static const DECLARE_TLV_DB_SCALE(aif_tlv, 0, 600, 0);
  1787. static const DECLARE_TLV_DB_SCALE(digital_tlv, -7200, 75, 1);
  1788. static const DECLARE_TLV_DB_SCALE(st_tlv, -3600, 300, 0);
  1789. static const DECLARE_TLV_DB_SCALE(wm8994_3d_tlv, -1600, 183, 0);
  1790. static const DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
  1791. #define WM8994_DRC_SWITCH(xname, reg, shift) \
  1792. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
  1793. .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
  1794. .put = wm8994_put_drc_sw, \
  1795. .private_value = SOC_SINGLE_VALUE(reg, shift, 1, 0) }
  1796. static int wm8994_put_drc_sw(struct snd_kcontrol *kcontrol,
  1797. struct snd_ctl_elem_value *ucontrol)
  1798. {
  1799. struct soc_mixer_control *mc =
  1800. (struct soc_mixer_control *)kcontrol->private_value;
  1801. struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
  1802. int mask, ret;
  1803. /* Can't enable both ADC and DAC paths simultaneously */
  1804. if (mc->shift == WM8994_AIF1DAC1_DRC_ENA_SHIFT)
  1805. mask = WM8994_AIF1ADC1L_DRC_ENA_MASK |
  1806. WM8994_AIF1ADC1R_DRC_ENA_MASK;
  1807. else
  1808. mask = WM8994_AIF1DAC1_DRC_ENA_MASK;
  1809. ret = snd_soc_read(codec, mc->reg);
  1810. if (ret < 0)
  1811. return ret;
  1812. if (ret & mask)
  1813. return -EINVAL;
  1814. return snd_soc_put_volsw(kcontrol, ucontrol);
  1815. }
  1816. static void wm8994_set_drc(struct snd_soc_codec *codec, int drc)
  1817. {
  1818. struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
  1819. struct wm8994_pdata *pdata = wm8994->pdata;
  1820. int base = wm8994_drc_base[drc];
  1821. int cfg = wm8994->drc_cfg[drc];
  1822. int save, i;
  1823. /* Save any enables; the configuration should clear them. */
  1824. save = snd_soc_read(codec, base);
  1825. save &= WM8994_AIF1DAC1_DRC_ENA | WM8994_AIF1ADC1L_DRC_ENA |
  1826. WM8994_AIF1ADC1R_DRC_ENA;
  1827. for (i = 0; i < WM8994_DRC_REGS; i++)
  1828. snd_soc_update_bits(codec, base + i, 0xffff,
  1829. pdata->drc_cfgs[cfg].regs[i]);
  1830. snd_soc_update_bits(codec, base, WM8994_AIF1DAC1_DRC_ENA |
  1831. WM8994_AIF1ADC1L_DRC_ENA |
  1832. WM8994_AIF1ADC1R_DRC_ENA, save);
  1833. }
  1834. /* Icky as hell but saves code duplication */
  1835. static int wm8994_get_drc(const char *name)
  1836. {
  1837. if (strcmp(name, "AIF1DRC1 Mode") == 0)
  1838. return 0;
  1839. if (strcmp(name, "AIF1DRC2 Mode") == 0)
  1840. return 1;
  1841. if (strcmp(name, "AIF2DRC Mode") == 0)
  1842. return 2;
  1843. return -EINVAL;
  1844. }
  1845. static int wm8994_put_drc_enum(struct snd_kcontrol *kcontrol,
  1846. struct snd_ctl_elem_value *ucontrol)
  1847. {
  1848. struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
  1849. struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
  1850. struct wm8994_pdata *pdata = wm8994->pdata;
  1851. int drc = wm8994_get_drc(kcontrol->id.name);
  1852. int value = ucontrol->value.integer.value[0];
  1853. if (drc < 0)
  1854. return drc;
  1855. if (value >= pdata->num_drc_cfgs)
  1856. return -EINVAL;
  1857. wm8994->drc_cfg[drc] = value;
  1858. wm8994_set_drc(codec, drc);
  1859. return 0;
  1860. }
  1861. static int wm8994_get_drc_enum(struct snd_kcontrol *kcontrol,
  1862. struct snd_ctl_elem_value *ucontrol)
  1863. {
  1864. struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
  1865. struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
  1866. int drc = wm8994_get_drc(kcontrol->id.name);
  1867. ucontrol->value.enumerated.item[0] = wm8994->drc_cfg[drc];
  1868. return 0;
  1869. }
  1870. static void wm8994_set_retune_mobile(struct snd_soc_codec *codec, int block)
  1871. {
  1872. struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
  1873. struct wm8994_pdata *pdata = wm8994->pdata;
  1874. int base = wm8994_retune_mobile_base[block];
  1875. int iface, best, best_val, save, i, cfg;
  1876. if (!pdata || !wm8994->num_retune_mobile_texts)
  1877. return;
  1878. switch (block) {
  1879. case 0:
  1880. case 1:
  1881. iface = 0;
  1882. break;
  1883. case 2:
  1884. iface = 1;
  1885. break;
  1886. default:
  1887. return;
  1888. }
  1889. /* Find the version of the currently selected configuration
  1890. * with the nearest sample rate. */
  1891. cfg = wm8994->retune_mobile_cfg[block];
  1892. best = 0;
  1893. best_val = INT_MAX;
  1894. for (i = 0; i < pdata->num_retune_mobile_cfgs; i++) {
  1895. if (strcmp(pdata->retune_mobile_cfgs[i].name,
  1896. wm8994->retune_mobile_texts[cfg]) == 0 &&
  1897. abs(pdata->retune_mobile_cfgs[i].rate
  1898. - wm8994->dac_rates[iface]) < best_val) {
  1899. best = i;
  1900. best_val = abs(pdata->retune_mobile_cfgs[i].rate
  1901. - wm8994->dac_rates[iface]);
  1902. }
  1903. }
  1904. dev_dbg(codec->dev, "ReTune Mobile %d %s/%dHz for %dHz sample rate\n",
  1905. block,
  1906. pdata->retune_mobile_cfgs[best].name,
  1907. pdata->retune_mobile_cfgs[best].rate,
  1908. wm8994->dac_rates[iface]);
  1909. /* The EQ will be disabled while reconfiguring it, remember the
  1910. * current configuration.
  1911. */
  1912. save = snd_soc_read(codec, base);
  1913. save &= WM8994_AIF1DAC1_EQ_ENA;
  1914. for (i = 0; i < WM8994_EQ_REGS; i++)
  1915. snd_soc_update_bits(codec, base + i, 0xffff,
  1916. pdata->retune_mobile_cfgs[best].regs[i]);
  1917. snd_soc_update_bits(codec, base, WM8994_AIF1DAC1_EQ_ENA, save);
  1918. }
  1919. /* Icky as hell but saves code duplication */
  1920. static int wm8994_get_retune_mobile_block(const char *name)
  1921. {
  1922. if (strcmp(name, "AIF1.1 EQ Mode") == 0)
  1923. return 0;
  1924. if (strcmp(name, "AIF1.2 EQ Mode") == 0)
  1925. return 1;
  1926. if (strcmp(name, "AIF2 EQ Mode") == 0)
  1927. return 2;
  1928. return -EINVAL;
  1929. }
  1930. static int wm8994_put_retune_mobile_enum(struct snd_kcontrol *kcontrol,
  1931. struct snd_ctl_elem_value *ucontrol)
  1932. {
  1933. struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
  1934. struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
  1935. struct wm8994_pdata *pdata = wm8994->pdata;
  1936. int block = wm8994_get_retune_mobile_block(kcontrol->id.name);
  1937. int value = ucontrol->value.integer.value[0];
  1938. if (block < 0)
  1939. return block;
  1940. if (value >= pdata->num_retune_mobile_cfgs)
  1941. return -EINVAL;
  1942. wm8994->retune_mobile_cfg[block] = value;
  1943. wm8994_set_retune_mobile(codec, block);
  1944. return 0;
  1945. }
  1946. static int wm8994_get_retune_mobile_enum(struct snd_kcontrol *kcontrol,
  1947. struct snd_ctl_elem_value *ucontrol)
  1948. {
  1949. struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
  1950. struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
  1951. int block = wm8994_get_retune_mobile_block(kcontrol->id.name);
  1952. ucontrol->value.enumerated.item[0] = wm8994->retune_mobile_cfg[block];
  1953. return 0;
  1954. }
  1955. static const struct snd_kcontrol_new wm8994_snd_controls[] = {
  1956. SOC_DOUBLE_R_TLV("AIF1ADC1 Volume", WM8994_AIF1_ADC1_LEFT_VOLUME,
  1957. WM8994_AIF1_ADC1_RIGHT_VOLUME,
  1958. 1, 119, 0, digital_tlv),
  1959. SOC_DOUBLE_R_TLV("AIF1ADC2 Volume", WM8994_AIF1_ADC2_LEFT_VOLUME,
  1960. WM8994_AIF1_ADC2_RIGHT_VOLUME,
  1961. 1, 119, 0, digital_tlv),
  1962. SOC_DOUBLE_R_TLV("AIF2ADC Volume", WM8994_AIF2_ADC_LEFT_VOLUME,
  1963. WM8994_AIF2_ADC_RIGHT_VOLUME,
  1964. 1, 119, 0, digital_tlv),
  1965. SOC_DOUBLE_R_TLV("AIF1DAC1 Volume", WM8994_AIF1_DAC1_LEFT_VOLUME,
  1966. WM8994_AIF1_DAC1_RIGHT_VOLUME, 1, 96, 0, digital_tlv),
  1967. SOC_DOUBLE_R_TLV("AIF1DAC2 Volume", WM8994_AIF1_DAC2_LEFT_VOLUME,
  1968. WM8994_AIF1_DAC2_RIGHT_VOLUME, 1, 96, 0, digital_tlv),
  1969. SOC_DOUBLE_R_TLV("AIF2DAC Volume", WM8994_AIF2_DAC_LEFT_VOLUME,
  1970. WM8994_AIF2_DAC_RIGHT_VOLUME, 1, 96, 0, digital_tlv),
  1971. SOC_SINGLE_TLV("AIF1 Boost Volume", WM8994_AIF1_CONTROL_2, 10, 3, 0, aif_tlv),
  1972. SOC_SINGLE_TLV("AIF2 Boost Volume", WM8994_AIF2_CONTROL_2, 10, 3, 0, aif_tlv),
  1973. SOC_SINGLE("AIF1DAC1 EQ Switch", WM8994_AIF1_DAC1_EQ_GAINS_1, 0, 1, 0),
  1974. SOC_SINGLE("AIF1DAC2 EQ Switch", WM8994_AIF1_DAC2_EQ_GAINS_1, 0, 1, 0),
  1975. SOC_SINGLE("AIF2 EQ Switch", WM8994_AIF2_EQ_GAINS_1, 0, 1, 0),
  1976. WM8994_DRC_SWITCH("AIF1DAC1 DRC Switch", WM8994_AIF1_DRC1_1, 2),
  1977. WM8994_DRC_SWITCH("AIF1ADC1L DRC Switch", WM8994_AIF1_DRC1_1, 1),
  1978. WM8994_DRC_SWITCH("AIF1ADC1R DRC Switch", WM8994_AIF1_DRC1_1, 0),
  1979. WM8994_DRC_SWITCH("AIF1DAC2 DRC Switch", WM8994_AIF1_DRC2_1, 2),
  1980. WM8994_DRC_SWITCH("AIF1ADC2L DRC Switch", WM8994_AIF1_DRC2_1, 1),
  1981. WM8994_DRC_SWITCH("AIF1ADC2R DRC Switch", WM8994_AIF1_DRC2_1, 0),
  1982. WM8994_DRC_SWITCH("AIF2DAC DRC Switch", WM8994_AIF2_DRC_1, 2),
  1983. WM8994_DRC_SWITCH("AIF2ADCL DRC Switch", WM8994_AIF2_DRC_1, 1),
  1984. WM8994_DRC_SWITCH("AIF2ADCR DRC Switch", WM8994_AIF2_DRC_1, 0),
  1985. SOC_SINGLE_TLV("DAC1 Right Sidetone Volume", WM8994_DAC1_MIXER_VOLUMES,
  1986. 5, 12, 0, st_tlv),
  1987. SOC_SINGLE_TLV("DAC1 Left Sidetone Volume", WM8994_DAC1_MIXER_VOLUMES,
  1988. 0, 12, 0, st_tlv),
  1989. SOC_SINGLE_TLV("DAC2 Right Sidetone Volume", WM8994_DAC2_MIXER_VOLUMES,
  1990. 5, 12, 0, st_tlv),
  1991. SOC_SINGLE_TLV("DAC2 Left Sidetone Volume", WM8994_DAC2_MIXER_VOLUMES,
  1992. 0, 12, 0, st_tlv),
  1993. SOC_ENUM("Sidetone HPF Mux", sidetone_hpf),
  1994. SOC_SINGLE("Sidetone HPF Switch", WM8994_SIDETONE, 6, 1, 0),
  1995. SOC_DOUBLE_R_TLV("DAC1 Volume", WM8994_DAC1_LEFT_VOLUME,
  1996. WM8994_DAC1_RIGHT_VOLUME, 1, 96, 0, digital_tlv),
  1997. SOC_DOUBLE_R("DAC1 Switch", WM8994_DAC1_LEFT_VOLUME,
  1998. WM8994_DAC1_RIGHT_VOLUME, 9, 1, 1),
  1999. SOC_DOUBLE_R_TLV("DAC2 Volume", WM8994_DAC2_LEFT_VOLUME,
  2000. WM8994_DAC2_RIGHT_VOLUME, 1, 96, 0, digital_tlv),
  2001. SOC_DOUBLE_R("DAC2 Switch", WM8994_DAC2_LEFT_VOLUME,
  2002. WM8994_DAC2_RIGHT_VOLUME, 9, 1, 1),
  2003. SOC_SINGLE_TLV("SPKL DAC2 Volume", WM8994_SPKMIXL_ATTENUATION,
  2004. 6, 1, 1, wm_hubs_spkmix_tlv),
  2005. SOC_SINGLE_TLV("SPKL DAC1 Volume", WM8994_SPKMIXL_ATTENUATION,
  2006. 2, 1, 1, wm_hubs_spkmix_tlv),
  2007. SOC_SINGLE_TLV("SPKR DAC2 Volume", WM8994_SPKMIXR_ATTENUATION,
  2008. 6, 1, 1, wm_hubs_spkmix_tlv),
  2009. SOC_SINGLE_TLV("SPKR DAC1 Volume", WM8994_SPKMIXR_ATTENUATION,
  2010. 2, 1, 1, wm_hubs_spkmix_tlv),
  2011. SOC_SINGLE_TLV("AIF1DAC1 3D Stereo Volume", WM8994_AIF1_DAC1_FILTERS_2,
  2012. 10, 15, 0, wm8994_3d_tlv),
  2013. SOC_SINGLE("AIF1DAC1 3D Stereo Switch", WM8994_AIF1_DAC2_FILTERS_2,
  2014. 8, 1, 0),
  2015. SOC_SINGLE_TLV("AIF1DAC2 3D Stereo Volume", WM8994_AIF1_DAC2_FILTERS_2,
  2016. 10, 15, 0, wm8994_3d_tlv),
  2017. SOC_SINGLE("AIF1DAC2 3D Stereo Switch", WM8994_AIF1_DAC2_FILTERS_2,
  2018. 8, 1, 0),
  2019. SOC_SINGLE_TLV("AIF2DAC 3D Stereo Volume", WM8994_AIF1_DAC1_FILTERS_2,
  2020. 10, 15, 0, wm8994_3d_tlv),
  2021. SOC_SINGLE("AIF2DAC 3D Stereo Switch", WM8994_AIF1_DAC2_FILTERS_2,
  2022. 8, 1, 0),
  2023. };
  2024. static const struct snd_kcontrol_new wm8994_eq_controls[] = {
  2025. SOC_SINGLE_TLV("AIF1DAC1 EQ1 Volume", WM8994_AIF1_DAC1_EQ_GAINS_1, 11, 31, 0,
  2026. eq_tlv),
  2027. SOC_SINGLE_TLV("AIF1DAC1 EQ2 Volume", WM8994_AIF1_DAC1_EQ_GAINS_1, 6, 31, 0,
  2028. eq_tlv),
  2029. SOC_SINGLE_TLV("AIF1DAC1 EQ3 Volume", WM8994_AIF1_DAC1_EQ_GAINS_1, 1, 31, 0,
  2030. eq_tlv),
  2031. SOC_SINGLE_TLV("AIF1DAC1 EQ4 Volume", WM8994_AIF1_DAC1_EQ_GAINS_2, 11, 31, 0,
  2032. eq_tlv),
  2033. SOC_SINGLE_TLV("AIF1DAC1 EQ5 Volume", WM8994_AIF1_DAC1_EQ_GAINS_2, 6, 31, 0,
  2034. eq_tlv),
  2035. SOC_SINGLE_TLV("AIF1DAC2 EQ1 Volume", WM8994_AIF1_DAC2_EQ_GAINS_1, 11, 31, 0,
  2036. eq_tlv),
  2037. SOC_SINGLE_TLV("AIF1DAC2 EQ2 Volume", WM8994_AIF1_DAC2_EQ_GAINS_1, 6, 31, 0,
  2038. eq_tlv),
  2039. SOC_SINGLE_TLV("AIF1DAC2 EQ3 Volume", WM8994_AIF1_DAC2_EQ_GAINS_1, 1, 31, 0,
  2040. eq_tlv),
  2041. SOC_SINGLE_TLV("AIF1DAC2 EQ4 Volume", WM8994_AIF1_DAC2_EQ_GAINS_2, 11, 31, 0,
  2042. eq_tlv),
  2043. SOC_SINGLE_TLV("AIF1DAC2 EQ5 Volume", WM8994_AIF1_DAC2_EQ_GAINS_2, 6, 31, 0,
  2044. eq_tlv),
  2045. SOC_SINGLE_TLV("AIF2 EQ1 Volume", WM8994_AIF2_EQ_GAINS_1, 11, 31, 0,
  2046. eq_tlv),
  2047. SOC_SINGLE_TLV("AIF2 EQ2 Volume", WM8994_AIF2_EQ_GAINS_1, 6, 31, 0,
  2048. eq_tlv),
  2049. SOC_SINGLE_TLV("AIF2 EQ3 Volume", WM8994_AIF2_EQ_GAINS_1, 1, 31, 0,
  2050. eq_tlv),
  2051. SOC_SINGLE_TLV("AIF2 EQ4 Volume", WM8994_AIF2_EQ_GAINS_2, 11, 31, 0,
  2052. eq_tlv),
  2053. SOC_SINGLE_TLV("AIF2 EQ5 Volume", WM8994_AIF2_EQ_GAINS_2, 6, 31, 0,
  2054. eq_tlv),
  2055. };
  2056. static int clk_sys_event(struct snd_soc_dapm_widget *w,
  2057. struct snd_kcontrol *kcontrol, int event)
  2058. {
  2059. struct snd_soc_codec *codec = w->codec;
  2060. switch (event) {
  2061. case SND_SOC_DAPM_PRE_PMU:
  2062. return configure_clock(codec);
  2063. case SND_SOC_DAPM_POST_PMD:
  2064. configure_clock(codec);
  2065. break;
  2066. }
  2067. return 0;
  2068. }
  2069. static void wm8994_update_class_w(struct snd_soc_codec *codec)
  2070. {
  2071. int enable = 1;
  2072. int source = 0; /* GCC flow analysis can't track enable */
  2073. int reg, reg_r;
  2074. /* Only support direct DAC->headphone paths */
  2075. reg = snd_soc_read(codec, WM8994_OUTPUT_MIXER_1);
  2076. if (!(reg & WM8994_DAC1L_TO_HPOUT1L)) {
  2077. dev_dbg(codec->dev, "HPL connected to output mixer\n");
  2078. enable = 0;
  2079. }
  2080. reg = snd_soc_read(codec, WM8994_OUTPUT_MIXER_2);
  2081. if (!(reg & WM8994_DAC1R_TO_HPOUT1R)) {
  2082. dev_dbg(codec->dev, "HPR connected to output mixer\n");
  2083. enable = 0;
  2084. }
  2085. /* We also need the same setting for L/R and only one path */
  2086. reg = snd_soc_read(codec, WM8994_DAC1_LEFT_MIXER_ROUTING);
  2087. switch (reg) {
  2088. case WM8994_AIF2DACL_TO_DAC1L:
  2089. dev_dbg(codec->dev, "Class W source AIF2DAC\n");
  2090. source = 2 << WM8994_CP_DYN_SRC_SEL_SHIFT;
  2091. break;
  2092. case WM8994_AIF1DAC2L_TO_DAC1L:
  2093. dev_dbg(codec->dev, "Class W source AIF1DAC2\n");
  2094. source = 1 << WM8994_CP_DYN_SRC_SEL_SHIFT;
  2095. break;
  2096. case WM8994_AIF1DAC1L_TO_DAC1L:
  2097. dev_dbg(codec->dev, "Class W source AIF1DAC1\n");
  2098. source = 0 << WM8994_CP_DYN_SRC_SEL_SHIFT;
  2099. break;
  2100. default:
  2101. dev_dbg(codec->dev, "DAC mixer setting: %x\n", reg);
  2102. enable = 0;
  2103. break;
  2104. }
  2105. reg_r = snd_soc_read(codec, WM8994_DAC1_RIGHT_MIXER_ROUTING);
  2106. if (reg_r != reg) {
  2107. dev_dbg(codec->dev, "Left and right DAC mixers different\n");
  2108. enable = 0;
  2109. }
  2110. if (enable) {
  2111. dev_dbg(codec->dev, "Class W enabled\n");
  2112. snd_soc_update_bits(codec, WM8994_CLASS_W_1,
  2113. WM8994_CP_DYN_PWR |
  2114. WM8994_CP_DYN_SRC_SEL_MASK,
  2115. source | WM8994_CP_DYN_PWR);
  2116. } else {
  2117. dev_dbg(codec->dev, "Class W disabled\n");
  2118. snd_soc_update_bits(codec, WM8994_CLASS_W_1,
  2119. WM8994_CP_DYN_PWR, 0);
  2120. }
  2121. }
  2122. static const char *hp_mux_text[] = {
  2123. "Mixer",
  2124. "DAC",
  2125. };
  2126. #define WM8994_HP_ENUM(xname, xenum) \
  2127. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
  2128. .info = snd_soc_info_enum_double, \
  2129. .get = snd_soc_dapm_get_enum_double, \
  2130. .put = wm8994_put_hp_enum, \
  2131. .private_value = (unsigned long)&xenum }
  2132. static int wm8994_put_hp_enum(struct snd_kcontrol *kcontrol,
  2133. struct snd_ctl_elem_value *ucontrol)
  2134. {
  2135. struct snd_soc_dapm_widget *w = snd_kcontrol_chip(kcontrol);
  2136. struct snd_soc_codec *codec = w->codec;
  2137. int ret;
  2138. ret = snd_soc_dapm_put_enum_double(kcontrol, ucontrol);
  2139. wm8994_update_class_w(codec);
  2140. return ret;
  2141. }
  2142. static const struct soc_enum hpl_enum =
  2143. SOC_ENUM_SINGLE(WM8994_OUTPUT_MIXER_1, 8, 2, hp_mux_text);
  2144. static const struct snd_kcontrol_new hpl_mux =
  2145. WM8994_HP_ENUM("Left Headphone Mux", hpl_enum);
  2146. static const struct soc_enum hpr_enum =
  2147. SOC_ENUM_SINGLE(WM8994_OUTPUT_MIXER_2, 8, 2, hp_mux_text);
  2148. static const struct snd_kcontrol_new hpr_mux =
  2149. WM8994_HP_ENUM("Right Headphone Mux", hpr_enum);
  2150. static const char *adc_mux_text[] = {
  2151. "ADC",
  2152. "DMIC",
  2153. };
  2154. static const struct soc_enum adc_enum =
  2155. SOC_ENUM_SINGLE(0, 0, 2, adc_mux_text);
  2156. static const struct snd_kcontrol_new adcl_mux =
  2157. SOC_DAPM_ENUM_VIRT("ADCL Mux", adc_enum);
  2158. static const struct snd_kcontrol_new adcr_mux =
  2159. SOC_DAPM_ENUM_VIRT("ADCR Mux", adc_enum);
  2160. static const struct snd_kcontrol_new left_speaker_mixer[] = {
  2161. SOC_DAPM_SINGLE("DAC2 Switch", WM8994_SPEAKER_MIXER, 9, 1, 0),
  2162. SOC_DAPM_SINGLE("Input Switch", WM8994_SPEAKER_MIXER, 7, 1, 0),
  2163. SOC_DAPM_SINGLE("IN1LP Switch", WM8994_SPEAKER_MIXER, 5, 1, 0),
  2164. SOC_DAPM_SINGLE("Output Switch", WM8994_SPEAKER_MIXER, 3, 1, 0),
  2165. SOC_DAPM_SINGLE("DAC1 Switch", WM8994_SPEAKER_MIXER, 1, 1, 0),
  2166. };
  2167. static const struct snd_kcontrol_new right_speaker_mixer[] = {
  2168. SOC_DAPM_SINGLE("DAC2 Switch", WM8994_SPEAKER_MIXER, 8, 1, 0),
  2169. SOC_DAPM_SINGLE("Input Switch", WM8994_SPEAKER_MIXER, 6, 1, 0),
  2170. SOC_DAPM_SINGLE("IN1RP Switch", WM8994_SPEAKER_MIXER, 4, 1, 0),
  2171. SOC_DAPM_SINGLE("Output Switch", WM8994_SPEAKER_MIXER, 2, 1, 0),
  2172. SOC_DAPM_SINGLE("DAC1 Switch", WM8994_SPEAKER_MIXER, 0, 1, 0),
  2173. };
  2174. /* Debugging; dump chip status after DAPM transitions */
  2175. static int post_ev(struct snd_soc_dapm_widget *w,
  2176. struct snd_kcontrol *kcontrol, int event)
  2177. {
  2178. struct snd_soc_codec *codec = w->codec;
  2179. dev_dbg(codec->dev, "SRC status: %x\n",
  2180. snd_soc_read(codec,
  2181. WM8994_RATE_STATUS));
  2182. return 0;
  2183. }
  2184. static const struct snd_kcontrol_new aif1adc1l_mix[] = {
  2185. SOC_DAPM_SINGLE("ADC/DMIC Switch", WM8994_AIF1_ADC1_LEFT_MIXER_ROUTING,
  2186. 1, 1, 0),
  2187. SOC_DAPM_SINGLE("AIF2 Switch", WM8994_AIF1_ADC1_LEFT_MIXER_ROUTING,
  2188. 0, 1, 0),
  2189. };
  2190. static const struct snd_kcontrol_new aif1adc1r_mix[] = {
  2191. SOC_DAPM_SINGLE("ADC/DMIC Switch", WM8994_AIF1_ADC1_RIGHT_MIXER_ROUTING,
  2192. 1, 1, 0),
  2193. SOC_DAPM_SINGLE("AIF2 Switch", WM8994_AIF1_ADC1_RIGHT_MIXER_ROUTING,
  2194. 0, 1, 0),
  2195. };
  2196. static const struct snd_kcontrol_new aif2dac2l_mix[] = {
  2197. SOC_DAPM_SINGLE("Right Sidetone Switch", WM8994_DAC2_LEFT_MIXER_ROUTING,
  2198. 5, 1, 0),
  2199. SOC_DAPM_SINGLE("Left Sidetone Switch", WM8994_DAC2_LEFT_MIXER_ROUTING,
  2200. 4, 1, 0),
  2201. SOC_DAPM_SINGLE("AIF2 Switch", WM8994_DAC2_LEFT_MIXER_ROUTING,
  2202. 2, 1, 0),
  2203. SOC_DAPM_SINGLE("AIF1.2 Switch", WM8994_DAC2_LEFT_MIXER_ROUTING,
  2204. 1, 1, 0),
  2205. SOC_DAPM_SINGLE("AIF1.1 Switch", WM8994_DAC2_LEFT_MIXER_ROUTING,
  2206. 0, 1, 0),
  2207. };
  2208. static const struct snd_kcontrol_new aif2dac2r_mix[] = {
  2209. SOC_DAPM_SINGLE("Right Sidetone Switch", WM8994_DAC2_RIGHT_MIXER_ROUTING,
  2210. 5, 1, 0),
  2211. SOC_DAPM_SINGLE("Left Sidetone Switch", WM8994_DAC2_RIGHT_MIXER_ROUTING,
  2212. 4, 1, 0),
  2213. SOC_DAPM_SINGLE("AIF2 Switch", WM8994_DAC2_RIGHT_MIXER_ROUTING,
  2214. 2, 1, 0),
  2215. SOC_DAPM_SINGLE("AIF1.2 Switch", WM8994_DAC2_RIGHT_MIXER_ROUTING,
  2216. 1, 1, 0),
  2217. SOC_DAPM_SINGLE("AIF1.1 Switch", WM8994_DAC2_RIGHT_MIXER_ROUTING,
  2218. 0, 1, 0),
  2219. };
  2220. #define WM8994_CLASS_W_SWITCH(xname, reg, shift, max, invert) \
  2221. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
  2222. .info = snd_soc_info_volsw, \
  2223. .get = snd_soc_dapm_get_volsw, .put = wm8994_put_class_w, \
  2224. .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
  2225. static int wm8994_put_class_w(struct snd_kcontrol *kcontrol,
  2226. struct snd_ctl_elem_value *ucontrol)
  2227. {
  2228. struct snd_soc_dapm_widget *w = snd_kcontrol_chip(kcontrol);
  2229. struct snd_soc_codec *codec = w->codec;
  2230. int ret;
  2231. ret = snd_soc_dapm_put_volsw(kcontrol, ucontrol);
  2232. wm8994_update_class_w(codec);
  2233. return ret;
  2234. }
  2235. static const struct snd_kcontrol_new dac1l_mix[] = {
  2236. WM8994_CLASS_W_SWITCH("Right Sidetone Switch", WM8994_DAC1_LEFT_MIXER_ROUTING,
  2237. 5, 1, 0),
  2238. WM8994_CLASS_W_SWITCH("Left Sidetone Switch", WM8994_DAC1_LEFT_MIXER_ROUTING,
  2239. 4, 1, 0),
  2240. WM8994_CLASS_W_SWITCH("AIF2 Switch", WM8994_DAC1_LEFT_MIXER_ROUTING,
  2241. 2, 1, 0),
  2242. WM8994_CLASS_W_SWITCH("AIF1.2 Switch", WM8994_DAC1_LEFT_MIXER_ROUTING,
  2243. 1, 1, 0),
  2244. WM8994_CLASS_W_SWITCH("AIF1.1 Switch", WM8994_DAC1_LEFT_MIXER_ROUTING,
  2245. 0, 1, 0),
  2246. };
  2247. static const struct snd_kcontrol_new dac1r_mix[] = {
  2248. WM8994_CLASS_W_SWITCH("Right Sidetone Switch", WM8994_DAC1_RIGHT_MIXER_ROUTING,
  2249. 5, 1, 0),
  2250. WM8994_CLASS_W_SWITCH("Left Sidetone Switch", WM8994_DAC1_RIGHT_MIXER_ROUTING,
  2251. 4, 1, 0),
  2252. WM8994_CLASS_W_SWITCH("AIF2 Switch", WM8994_DAC1_RIGHT_MIXER_ROUTING,
  2253. 2, 1, 0),
  2254. WM8994_CLASS_W_SWITCH("AIF1.2 Switch", WM8994_DAC1_RIGHT_MIXER_ROUTING,
  2255. 1, 1, 0),
  2256. WM8994_CLASS_W_SWITCH("AIF1.1 Switch", WM8994_DAC1_RIGHT_MIXER_ROUTING,
  2257. 0, 1, 0),
  2258. };
  2259. static const char *sidetone_text[] = {
  2260. "ADC/DMIC1", "DMIC2",
  2261. };
  2262. static const struct soc_enum sidetone1_enum =
  2263. SOC_ENUM_SINGLE(WM8994_SIDETONE, 0, 2, sidetone_text);
  2264. static const struct snd_kcontrol_new sidetone1_mux =
  2265. SOC_DAPM_ENUM("Left Sidetone Mux", sidetone1_enum);
  2266. static const struct soc_enum sidetone2_enum =
  2267. SOC_ENUM_SINGLE(WM8994_SIDETONE, 1, 2, sidetone_text);
  2268. static const struct snd_kcontrol_new sidetone2_mux =
  2269. SOC_DAPM_ENUM("Right Sidetone Mux", sidetone2_enum);
  2270. static const char *aif1dac_text[] = {
  2271. "AIF1DACDAT", "AIF3DACDAT",
  2272. };
  2273. static const struct soc_enum aif1dac_enum =
  2274. SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 0, 2, aif1dac_text);
  2275. static const struct snd_kcontrol_new aif1dac_mux =
  2276. SOC_DAPM_ENUM("AIF1DAC Mux", aif1dac_enum);
  2277. static const char *aif2dac_text[] = {
  2278. "AIF2DACDAT", "AIF3DACDAT",
  2279. };
  2280. static const struct soc_enum aif2dac_enum =
  2281. SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 1, 2, aif2dac_text);
  2282. static const struct snd_kcontrol_new aif2dac_mux =
  2283. SOC_DAPM_ENUM("AIF2DAC Mux", aif2dac_enum);
  2284. static const char *aif2adc_text[] = {
  2285. "AIF2ADCDAT", "AIF3DACDAT",
  2286. };
  2287. static const struct soc_enum aif2adc_enum =
  2288. SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 2, 2, aif2adc_text);
  2289. static const struct snd_kcontrol_new aif2adc_mux =
  2290. SOC_DAPM_ENUM("AIF2ADC Mux", aif2adc_enum);
  2291. static const char *aif3adc_text[] = {
  2292. "AIF1ADCDAT", "AIF2ADCDAT", "AIF2DACDAT",
  2293. };
  2294. static const struct soc_enum aif3adc_enum =
  2295. SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 3, 3, aif3adc_text);
  2296. static const struct snd_kcontrol_new aif3adc_mux =
  2297. SOC_DAPM_ENUM("AIF3ADC Mux", aif3adc_enum);
  2298. static const struct snd_soc_dapm_widget wm8994_dapm_widgets[] = {
  2299. SND_SOC_DAPM_INPUT("DMIC1DAT"),
  2300. SND_SOC_DAPM_INPUT("DMIC2DAT"),
  2301. SND_SOC_DAPM_SUPPLY("CLK_SYS", SND_SOC_NOPM, 0, 0, clk_sys_event,
  2302. SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
  2303. SND_SOC_DAPM_SUPPLY("DSP1CLK", WM8994_CLOCKING_1, 3, 0, NULL, 0),
  2304. SND_SOC_DAPM_SUPPLY("DSP2CLK", WM8994_CLOCKING_1, 2, 0, NULL, 0),
  2305. SND_SOC_DAPM_SUPPLY("DSPINTCLK", WM8994_CLOCKING_1, 1, 0, NULL, 0),
  2306. SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, NULL, 0),
  2307. SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, NULL, 0),
  2308. SND_SOC_DAPM_AIF_OUT("AIF1ADC1L", "AIF1 Capture",
  2309. 0, WM8994_POWER_MANAGEMENT_4, 9, 0),
  2310. SND_SOC_DAPM_AIF_OUT("AIF1ADC1R", "AIF1 Capture",
  2311. 0, WM8994_POWER_MANAGEMENT_4, 8, 0),
  2312. SND_SOC_DAPM_AIF_IN("AIF1DAC1L", NULL, 0,
  2313. WM8994_POWER_MANAGEMENT_5, 9, 0),
  2314. SND_SOC_DAPM_AIF_IN("AIF1DAC1R", NULL, 0,
  2315. WM8994_POWER_MANAGEMENT_5, 8, 0),
  2316. SND_SOC_DAPM_AIF_OUT("AIF1ADC2L", "AIF1 Capture",
  2317. 0, WM8994_POWER_MANAGEMENT_4, 11, 0),
  2318. SND_SOC_DAPM_AIF_OUT("AIF1ADC2R", "AIF1 Capture",
  2319. 0, WM8994_POWER_MANAGEMENT_4, 10, 0),
  2320. SND_SOC_DAPM_AIF_IN("AIF1DAC2L", NULL, 0,
  2321. WM8994_POWER_MANAGEMENT_5, 11, 0),
  2322. SND_SOC_DAPM_AIF_IN("AIF1DAC2R", NULL, 0,
  2323. WM8994_POWER_MANAGEMENT_5, 10, 0),
  2324. SND_SOC_DAPM_MIXER("AIF1ADC1L Mixer", SND_SOC_NOPM, 0, 0,
  2325. aif1adc1l_mix, ARRAY_SIZE(aif1adc1l_mix)),
  2326. SND_SOC_DAPM_MIXER("AIF1ADC1R Mixer", SND_SOC_NOPM, 0, 0,
  2327. aif1adc1r_mix, ARRAY_SIZE(aif1adc1r_mix)),
  2328. SND_SOC_DAPM_MIXER("AIF2DAC2L Mixer", SND_SOC_NOPM, 0, 0,
  2329. aif2dac2l_mix, ARRAY_SIZE(aif2dac2l_mix)),
  2330. SND_SOC_DAPM_MIXER("AIF2DAC2R Mixer", SND_SOC_NOPM, 0, 0,
  2331. aif2dac2r_mix, ARRAY_SIZE(aif2dac2r_mix)),
  2332. SND_SOC_DAPM_MUX("Left Sidetone", SND_SOC_NOPM, 0, 0, &sidetone1_mux),
  2333. SND_SOC_DAPM_MUX("Right Sidetone", SND_SOC_NOPM, 0, 0, &sidetone2_mux),
  2334. SND_SOC_DAPM_MIXER("DAC1L Mixer", SND_SOC_NOPM, 0, 0,
  2335. dac1l_mix, ARRAY_SIZE(dac1l_mix)),
  2336. SND_SOC_DAPM_MIXER("DAC1R Mixer", SND_SOC_NOPM, 0, 0,
  2337. dac1r_mix, ARRAY_SIZE(dac1r_mix)),
  2338. SND_SOC_DAPM_AIF_OUT("AIF2ADCL", NULL, 0,
  2339. WM8994_POWER_MANAGEMENT_4, 13, 0),
  2340. SND_SOC_DAPM_AIF_OUT("AIF2ADCR", NULL, 0,
  2341. WM8994_POWER_MANAGEMENT_4, 12, 0),
  2342. SND_SOC_DAPM_AIF_IN("AIF2DACL", NULL, 0,
  2343. WM8994_POWER_MANAGEMENT_5, 13, 0),
  2344. SND_SOC_DAPM_AIF_IN("AIF2DACR", NULL, 0,
  2345. WM8994_POWER_MANAGEMENT_5, 12, 0),
  2346. SND_SOC_DAPM_AIF_IN("AIF1DACDAT", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0),
  2347. SND_SOC_DAPM_AIF_IN("AIF2DACDAT", "AIF2 Playback", 0, SND_SOC_NOPM, 0, 0),
  2348. SND_SOC_DAPM_AIF_OUT("AIF2ADCDAT", "AIF2 Capture", 0, SND_SOC_NOPM, 0, 0),
  2349. SND_SOC_DAPM_MUX("AIF1DAC Mux", SND_SOC_NOPM, 0, 0, &aif1dac_mux),
  2350. SND_SOC_DAPM_MUX("AIF2DAC Mux", SND_SOC_NOPM, 0, 0, &aif2dac_mux),
  2351. SND_SOC_DAPM_MUX("AIF2ADC Mux", SND_SOC_NOPM, 0, 0, &aif2adc_mux),
  2352. SND_SOC_DAPM_MUX("AIF3ADC Mux", SND_SOC_NOPM, 0, 0, &aif3adc_mux),
  2353. SND_SOC_DAPM_AIF_IN("AIF3DACDAT", "AIF3 Playback", 0, SND_SOC_NOPM, 0, 0),
  2354. SND_SOC_DAPM_AIF_IN("AIF3ADCDAT", "AIF3 Capture", 0, SND_SOC_NOPM, 0, 0),
  2355. SND_SOC_DAPM_SUPPLY("TOCLK", WM8994_CLOCKING_1, 4, 0, NULL, 0),
  2356. SND_SOC_DAPM_ADC("DMIC2L", NULL, WM8994_POWER_MANAGEMENT_4, 5, 0),
  2357. SND_SOC_DAPM_ADC("DMIC2R", NULL, WM8994_POWER_MANAGEMENT_4, 4, 0),
  2358. SND_SOC_DAPM_ADC("DMIC1L", NULL, WM8994_POWER_MANAGEMENT_4, 3, 0),
  2359. SND_SOC_DAPM_ADC("DMIC1R", NULL, WM8994_POWER_MANAGEMENT_4, 2, 0),
  2360. /* Power is done with the muxes since the ADC power also controls the
  2361. * downsampling chain, the chip will automatically manage the analogue
  2362. * specific portions.
  2363. */
  2364. SND_SOC_DAPM_ADC("ADCL", NULL, SND_SOC_NOPM, 1, 0),
  2365. SND_SOC_DAPM_ADC("ADCR", NULL, SND_SOC_NOPM, 0, 0),
  2366. SND_SOC_DAPM_MUX("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux),
  2367. SND_SOC_DAPM_MUX("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux),
  2368. SND_SOC_DAPM_DAC("DAC2L", NULL, WM8994_POWER_MANAGEMENT_5, 3, 0),
  2369. SND_SOC_DAPM_DAC("DAC2R", NULL, WM8994_POWER_MANAGEMENT_5, 2, 0),
  2370. SND_SOC_DAPM_DAC("DAC1L", NULL, WM8994_POWER_MANAGEMENT_5, 1, 0),
  2371. SND_SOC_DAPM_DAC("DAC1R", NULL, WM8994_POWER_MANAGEMENT_5, 0, 0),
  2372. SND_SOC_DAPM_MUX("Left Headphone Mux", SND_SOC_NOPM, 0, 0, &hpl_mux),
  2373. SND_SOC_DAPM_MUX("Right Headphone Mux", SND_SOC_NOPM, 0, 0, &hpr_mux),
  2374. SND_SOC_DAPM_MIXER("SPKL", WM8994_POWER_MANAGEMENT_3, 8, 0,
  2375. left_speaker_mixer, ARRAY_SIZE(left_speaker_mixer)),
  2376. SND_SOC_DAPM_MIXER("SPKR", WM8994_POWER_MANAGEMENT_3, 9, 0,
  2377. right_speaker_mixer, ARRAY_SIZE(right_speaker_mixer)),
  2378. SND_SOC_DAPM_POST("Debug log", post_ev),
  2379. };
  2380. static const struct snd_soc_dapm_route intercon[] = {
  2381. { "CLK_SYS", NULL, "AIF1CLK", check_clk_sys },
  2382. { "CLK_SYS", NULL, "AIF2CLK", check_clk_sys },
  2383. { "DSP1CLK", NULL, "CLK_SYS" },
  2384. { "DSP2CLK", NULL, "CLK_SYS" },
  2385. { "DSPINTCLK", NULL, "CLK_SYS" },
  2386. { "AIF1ADC1L", NULL, "AIF1CLK" },
  2387. { "AIF1ADC1L", NULL, "DSP1CLK" },
  2388. { "AIF1ADC1R", NULL, "AIF1CLK" },
  2389. { "AIF1ADC1R", NULL, "DSP1CLK" },
  2390. { "AIF1ADC1R", NULL, "DSPINTCLK" },
  2391. { "AIF1DAC1L", NULL, "AIF1CLK" },
  2392. { "AIF1DAC1L", NULL, "DSP1CLK" },
  2393. { "AIF1DAC1R", NULL, "AIF1CLK" },
  2394. { "AIF1DAC1R", NULL, "DSP1CLK" },
  2395. { "AIF1DAC1R", NULL, "DSPINTCLK" },
  2396. { "AIF1ADC2L", NULL, "AIF1CLK" },
  2397. { "AIF1ADC2L", NULL, "DSP1CLK" },
  2398. { "AIF1ADC2R", NULL, "AIF1CLK" },
  2399. { "AIF1ADC2R", NULL, "DSP1CLK" },
  2400. { "AIF1ADC2R", NULL, "DSPINTCLK" },
  2401. { "AIF1DAC2L", NULL, "AIF1CLK" },
  2402. { "AIF1DAC2L", NULL, "DSP1CLK" },
  2403. { "AIF1DAC2R", NULL, "AIF1CLK" },
  2404. { "AIF1DAC2R", NULL, "DSP1CLK" },
  2405. { "AIF1DAC2R", NULL, "DSPINTCLK" },
  2406. { "AIF2ADCL", NULL, "AIF2CLK" },
  2407. { "AIF2ADCL", NULL, "DSP2CLK" },
  2408. { "AIF2ADCR", NULL, "AIF2CLK" },
  2409. { "AIF2ADCR", NULL, "DSP2CLK" },
  2410. { "AIF2ADCR", NULL, "DSPINTCLK" },
  2411. { "AIF2DACL", NULL, "AIF2CLK" },
  2412. { "AIF2DACL", NULL, "DSP2CLK" },
  2413. { "AIF2DACR", NULL, "AIF2CLK" },
  2414. { "AIF2DACR", NULL, "DSP2CLK" },
  2415. { "AIF2DACR", NULL, "DSPINTCLK" },
  2416. { "DMIC1L", NULL, "DMIC1DAT" },
  2417. { "DMIC1L", NULL, "CLK_SYS" },
  2418. { "DMIC1R", NULL, "DMIC1DAT" },
  2419. { "DMIC1R", NULL, "CLK_SYS" },
  2420. { "DMIC2L", NULL, "DMIC2DAT" },
  2421. { "DMIC2L", NULL, "CLK_SYS" },
  2422. { "DMIC2R", NULL, "DMIC2DAT" },
  2423. { "DMIC2R", NULL, "CLK_SYS" },
  2424. { "ADCL", NULL, "AIF1CLK" },
  2425. { "ADCL", NULL, "DSP1CLK" },
  2426. { "ADCL", NULL, "DSPINTCLK" },
  2427. { "ADCR", NULL, "AIF1CLK" },
  2428. { "ADCR", NULL, "DSP1CLK" },
  2429. { "ADCR", NULL, "DSPINTCLK" },
  2430. { "ADCL Mux", "ADC", "ADCL" },
  2431. { "ADCL Mux", "DMIC", "DMIC1L" },
  2432. { "ADCR Mux", "ADC", "ADCR" },
  2433. { "ADCR Mux", "DMIC", "DMIC1R" },
  2434. { "DAC1L", NULL, "AIF1CLK" },
  2435. { "DAC1L", NULL, "DSP1CLK" },
  2436. { "DAC1L", NULL, "DSPINTCLK" },
  2437. { "DAC1R", NULL, "AIF1CLK" },
  2438. { "DAC1R", NULL, "DSP1CLK" },
  2439. { "DAC1R", NULL, "DSPINTCLK" },
  2440. { "DAC2L", NULL, "AIF2CLK" },
  2441. { "DAC2L", NULL, "DSP2CLK" },
  2442. { "DAC2L", NULL, "DSPINTCLK" },
  2443. { "DAC2R", NULL, "AIF2DACR" },
  2444. { "DAC2R", NULL, "AIF2CLK" },
  2445. { "DAC2R", NULL, "DSP2CLK" },
  2446. { "DAC2R", NULL, "DSPINTCLK" },
  2447. { "TOCLK", NULL, "CLK_SYS" },
  2448. /* AIF1 outputs */
  2449. { "AIF1ADC1L", NULL, "AIF1ADC1L Mixer" },
  2450. { "AIF1ADC1L Mixer", "ADC/DMIC Switch", "ADCL Mux" },
  2451. { "AIF1ADC1L Mixer", "AIF2 Switch", "AIF2DACL" },
  2452. { "AIF1ADC1R", NULL, "AIF1ADC1R Mixer" },
  2453. { "AIF1ADC1R Mixer", "ADC/DMIC Switch", "ADCR Mux" },
  2454. { "AIF1ADC1R Mixer", "AIF2 Switch", "AIF2DACR" },
  2455. /* Pin level routing for AIF3 */
  2456. { "AIF1DAC1L", NULL, "AIF1DAC Mux" },
  2457. { "AIF1DAC1R", NULL, "AIF1DAC Mux" },
  2458. { "AIF1DAC2L", NULL, "AIF1DAC Mux" },
  2459. { "AIF1DAC2R", NULL, "AIF1DAC Mux" },
  2460. { "AIF2DACL", NULL, "AIF2DAC Mux" },
  2461. { "AIF2DACR", NULL, "AIF2DAC Mux" },
  2462. { "AIF1DAC Mux", "AIF1DACDAT", "AIF1DACDAT" },
  2463. { "AIF1DAC Mux", "AIF3DACDAT", "AIF3DACDAT" },
  2464. { "AIF2DAC Mux", "AIF2DACDAT", "AIF2DACDAT" },
  2465. { "AIF2DAC Mux", "AIF3DACDAT", "AIF3DACDAT" },
  2466. { "AIF2ADC Mux", "AIF2ADCDAT", "AIF2ADCL" },
  2467. { "AIF2ADC Mux", "AIF2ADCDAT", "AIF2ADCR" },
  2468. { "AIF2ADC Mux", "AIF3DACDAT", "AIF3ADCDAT" },
  2469. /* DAC1 inputs */
  2470. { "DAC1L", NULL, "DAC1L Mixer" },
  2471. { "DAC1L Mixer", "AIF2 Switch", "AIF2DACL" },
  2472. { "DAC1L Mixer", "AIF1.2 Switch", "AIF1DAC2L" },
  2473. { "DAC1L Mixer", "AIF1.1 Switch", "AIF1DAC1L" },
  2474. { "DAC1L Mixer", "Left Sidetone Switch", "Left Sidetone" },
  2475. { "DAC1L Mixer", "Right Sidetone Switch", "Right Sidetone" },
  2476. { "DAC1R", NULL, "DAC1R Mixer" },
  2477. { "DAC1R Mixer", "AIF2 Switch", "AIF2DACR" },
  2478. { "DAC1R Mixer", "AIF1.2 Switch", "AIF1DAC2R" },
  2479. { "DAC1R Mixer", "AIF1.1 Switch", "AIF1DAC1R" },
  2480. { "DAC1R Mixer", "Left Sidetone Switch", "Left Sidetone" },
  2481. { "DAC1R Mixer", "Right Sidetone Switch", "Right Sidetone" },
  2482. /* DAC2/AIF2 outputs */
  2483. { "AIF2ADCL", NULL, "AIF2DAC2L Mixer" },
  2484. { "DAC2L", NULL, "AIF2DAC2L Mixer" },
  2485. { "AIF2DAC2L Mixer", "AIF2 Switch", "AIF2DACL" },
  2486. { "AIF2DAC2L Mixer", "AIF1.2 Switch", "AIF1DAC2L" },
  2487. { "AIF2DAC2L Mixer", "AIF1.1 Switch", "AIF1DAC1L" },
  2488. { "AIF2DAC2L Mixer", "Left Sidetone Switch", "Left Sidetone" },
  2489. { "AIF2DAC2L Mixer", "Right Sidetone Switch", "Right Sidetone" },
  2490. { "AIF2ADCR", NULL, "AIF2DAC2R Mixer" },
  2491. { "DAC2R", NULL, "AIF2DAC2R Mixer" },
  2492. { "AIF2DAC2R Mixer", "AIF2 Switch", "AIF2DACR" },
  2493. { "AIF2DAC2R Mixer", "AIF1.2 Switch", "AIF1DAC2R" },
  2494. { "AIF2DAC2R Mixer", "AIF1.1 Switch", "AIF1DAC1R" },
  2495. { "AIF2DAC2R Mixer", "Left Sidetone Switch", "Left Sidetone" },
  2496. { "AIF2DAC2R Mixer", "Right Sidetone Switch", "Right Sidetone" },
  2497. { "AIF2ADCDAT", NULL, "AIF2ADC Mux" },
  2498. /* AIF3 output */
  2499. { "AIF3ADCDAT", "AIF1ADCDAT", "AIF1ADC1L" },
  2500. { "AIF3ADCDAT", "AIF1ADCDAT", "AIF1ADC1R" },
  2501. { "AIF3ADCDAT", "AIF1ADCDAT", "AIF1ADC2L" },
  2502. { "AIF3ADCDAT", "AIF1ADCDAT", "AIF1ADC2R" },
  2503. { "AIF3ADCDAT", "AIF2ADCDAT", "AIF2ADCL" },
  2504. { "AIF3ADCDAT", "AIF2ADCDAT", "AIF2ADCR" },
  2505. { "AIF3ADCDAT", "AIF2DACDAT", "AIF2DACL" },
  2506. { "AIF3ADCDAT", "AIF2DACDAT", "AIF2DACR" },
  2507. /* Sidetone */
  2508. { "Left Sidetone", "ADC/DMIC1", "ADCL Mux" },
  2509. { "Left Sidetone", "DMIC2", "DMIC2L" },
  2510. { "Right Sidetone", "ADC/DMIC1", "ADCR Mux" },
  2511. { "Right Sidetone", "DMIC2", "DMIC2R" },
  2512. /* Output stages */
  2513. { "Left Output Mixer", "DAC Switch", "DAC1L" },
  2514. { "Right Output Mixer", "DAC Switch", "DAC1R" },
  2515. { "SPKL", "DAC1 Switch", "DAC1L" },
  2516. { "SPKL", "DAC2 Switch", "DAC2L" },
  2517. { "SPKR", "DAC1 Switch", "DAC1R" },
  2518. { "SPKR", "DAC2 Switch", "DAC2R" },
  2519. { "Left Headphone Mux", "DAC", "DAC1L" },
  2520. { "Right Headphone Mux", "DAC", "DAC1R" },
  2521. };
  2522. /* The size in bits of the FLL divide multiplied by 10
  2523. * to allow rounding later */
  2524. #define FIXED_FLL_SIZE ((1 << 16) * 10)
  2525. struct fll_div {
  2526. u16 outdiv;
  2527. u16 n;
  2528. u16 k;
  2529. u16 clk_ref_div;
  2530. u16 fll_fratio;
  2531. };
  2532. static int wm8994_get_fll_config(struct fll_div *fll,
  2533. int freq_in, int freq_out)
  2534. {
  2535. u64 Kpart;
  2536. unsigned int K, Ndiv, Nmod;
  2537. pr_debug("FLL input=%dHz, output=%dHz\n", freq_in, freq_out);
  2538. /* Scale the input frequency down to <= 13.5MHz */
  2539. fll->clk_ref_div = 0;
  2540. while (freq_in > 13500000) {
  2541. fll->clk_ref_div++;
  2542. freq_in /= 2;
  2543. if (fll->clk_ref_div > 3)
  2544. return -EINVAL;
  2545. }
  2546. pr_debug("CLK_REF_DIV=%d, Fref=%dHz\n", fll->clk_ref_div, freq_in);
  2547. /* Scale the output to give 90MHz<=Fvco<=100MHz */
  2548. fll->outdiv = 3;
  2549. while (freq_out * (fll->outdiv + 1) < 90000000) {
  2550. fll->outdiv++;
  2551. if (fll->outdiv > 63)
  2552. return -EINVAL;
  2553. }
  2554. freq_out *= fll->outdiv + 1;
  2555. pr_debug("OUTDIV=%d, Fvco=%dHz\n", fll->outdiv, freq_out);
  2556. if (freq_in > 1000000) {
  2557. fll->fll_fratio = 0;
  2558. } else {
  2559. fll->fll_fratio = 3;
  2560. freq_in *= 8;
  2561. }
  2562. pr_debug("FLL_FRATIO=%d, Fref=%dHz\n", fll->fll_fratio, freq_in);
  2563. /* Now, calculate N.K */
  2564. Ndiv = freq_out / freq_in;
  2565. fll->n = Ndiv;
  2566. Nmod = freq_out % freq_in;
  2567. pr_debug("Nmod=%d\n", Nmod);
  2568. /* Calculate fractional part - scale up so we can round. */
  2569. Kpart = FIXED_FLL_SIZE * (long long)Nmod;
  2570. do_div(Kpart, freq_in);
  2571. K = Kpart & 0xFFFFFFFF;
  2572. if ((K % 10) >= 5)
  2573. K += 5;
  2574. /* Move down to proper range now rounding is done */
  2575. fll->k = K / 10;
  2576. pr_debug("N=%x K=%x\n", fll->n, fll->k);
  2577. return 0;
  2578. }
  2579. static int wm8994_set_fll(struct snd_soc_dai *dai, int id, int src,
  2580. unsigned int freq_in, unsigned int freq_out)
  2581. {
  2582. struct snd_soc_codec *codec = dai->codec;
  2583. struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
  2584. int reg_offset, ret;
  2585. struct fll_div fll;
  2586. u16 reg, aif1, aif2;
  2587. aif1 = snd_soc_read(codec, WM8994_AIF1_CLOCKING_1)
  2588. & WM8994_AIF1CLK_ENA;
  2589. aif2 = snd_soc_read(codec, WM8994_AIF2_CLOCKING_1)
  2590. & WM8994_AIF2CLK_ENA;
  2591. switch (id) {
  2592. case WM8994_FLL1:
  2593. reg_offset = 0;
  2594. id = 0;
  2595. break;
  2596. case WM8994_FLL2:
  2597. reg_offset = 0x20;
  2598. id = 1;
  2599. break;
  2600. default:
  2601. return -EINVAL;
  2602. }
  2603. switch (src) {
  2604. case WM8994_FLL_SRC_MCLK1:
  2605. case WM8994_FLL_SRC_MCLK2:
  2606. case WM8994_FLL_SRC_LRCLK:
  2607. case WM8994_FLL_SRC_BCLK:
  2608. break;
  2609. default:
  2610. return -EINVAL;
  2611. }
  2612. /* Are we changing anything? */
  2613. if (wm8994->fll[id].src == src &&
  2614. wm8994->fll[id].in == freq_in && wm8994->fll[id].out == freq_out)
  2615. return 0;
  2616. /* If we're stopping the FLL redo the old config - no
  2617. * registers will actually be written but we avoid GCC flow
  2618. * analysis bugs spewing warnings.
  2619. */
  2620. if (freq_out)
  2621. ret = wm8994_get_fll_config(&fll, freq_in, freq_out);
  2622. else
  2623. ret = wm8994_get_fll_config(&fll, wm8994->fll[id].in,
  2624. wm8994->fll[id].out);
  2625. if (ret < 0)
  2626. return ret;
  2627. /* Gate the AIF clocks while we reclock */
  2628. snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1,
  2629. WM8994_AIF1CLK_ENA, 0);
  2630. snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1,
  2631. WM8994_AIF2CLK_ENA, 0);
  2632. /* We always need to disable the FLL while reconfiguring */
  2633. snd_soc_update_bits(codec, WM8994_FLL1_CONTROL_1 + reg_offset,
  2634. WM8994_FLL1_ENA, 0);
  2635. reg = (fll.outdiv << WM8994_FLL1_OUTDIV_SHIFT) |
  2636. (fll.fll_fratio << WM8994_FLL1_FRATIO_SHIFT);
  2637. snd_soc_update_bits(codec, WM8994_FLL1_CONTROL_2 + reg_offset,
  2638. WM8994_FLL1_OUTDIV_MASK |
  2639. WM8994_FLL1_FRATIO_MASK, reg);
  2640. snd_soc_write(codec, WM8994_FLL1_CONTROL_3 + reg_offset, fll.k);
  2641. snd_soc_update_bits(codec, WM8994_FLL1_CONTROL_4 + reg_offset,
  2642. WM8994_FLL1_N_MASK,
  2643. fll.n << WM8994_FLL1_N_SHIFT);
  2644. snd_soc_update_bits(codec, WM8994_FLL1_CONTROL_5 + reg_offset,
  2645. WM8994_FLL1_REFCLK_DIV_MASK |
  2646. WM8994_FLL1_REFCLK_SRC_MASK,
  2647. (fll.clk_ref_div << WM8994_FLL1_REFCLK_DIV_SHIFT) |
  2648. (src - 1));
  2649. /* Enable (with fractional mode if required) */
  2650. if (freq_out) {
  2651. if (fll.k)
  2652. reg = WM8994_FLL1_ENA | WM8994_FLL1_FRAC;
  2653. else
  2654. reg = WM8994_FLL1_ENA;
  2655. snd_soc_update_bits(codec, WM8994_FLL1_CONTROL_1 + reg_offset,
  2656. WM8994_FLL1_ENA | WM8994_FLL1_FRAC,
  2657. reg);
  2658. }
  2659. wm8994->fll[id].in = freq_in;
  2660. wm8994->fll[id].out = freq_out;
  2661. wm8994->fll[id].src = src;
  2662. /* Enable any gated AIF clocks */
  2663. snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1,
  2664. WM8994_AIF1CLK_ENA, aif1);
  2665. snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1,
  2666. WM8994_AIF2CLK_ENA, aif2);
  2667. configure_clock(codec);
  2668. return 0;
  2669. }
  2670. static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai,
  2671. int clk_id, unsigned int freq, int dir)
  2672. {
  2673. struct snd_soc_codec *codec = dai->codec;
  2674. struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
  2675. switch (dai->id) {
  2676. case 1:
  2677. case 2:
  2678. break;
  2679. default:
  2680. /* AIF3 shares clocking with AIF1/2 */
  2681. return -EINVAL;
  2682. }
  2683. switch (clk_id) {
  2684. case WM8994_SYSCLK_MCLK1:
  2685. wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_MCLK1;
  2686. wm8994->mclk[0] = freq;
  2687. dev_dbg(dai->dev, "AIF%d using MCLK1 at %uHz\n",
  2688. dai->id, freq);
  2689. break;
  2690. case WM8994_SYSCLK_MCLK2:
  2691. /* TODO: Set GPIO AF */
  2692. wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_MCLK2;
  2693. wm8994->mclk[1] = freq;
  2694. dev_dbg(dai->dev, "AIF%d using MCLK2 at %uHz\n",
  2695. dai->id, freq);
  2696. break;
  2697. case WM8994_SYSCLK_FLL1:
  2698. wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_FLL1;
  2699. dev_dbg(dai->dev, "AIF%d using FLL1\n", dai->id);
  2700. break;
  2701. case WM8994_SYSCLK_FLL2:
  2702. wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_FLL2;
  2703. dev_dbg(dai->dev, "AIF%d using FLL2\n", dai->id);
  2704. break;
  2705. default:
  2706. return -EINVAL;
  2707. }
  2708. configure_clock(codec);
  2709. return 0;
  2710. }
  2711. static int wm8994_set_bias_level(struct snd_soc_codec *codec,
  2712. enum snd_soc_bias_level level)
  2713. {
  2714. switch (level) {
  2715. case SND_SOC_BIAS_ON:
  2716. break;
  2717. case SND_SOC_BIAS_PREPARE:
  2718. /* VMID=2x40k */
  2719. snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_1,
  2720. WM8994_VMID_SEL_MASK, 0x2);
  2721. break;
  2722. case SND_SOC_BIAS_STANDBY:
  2723. if (codec->bias_level == SND_SOC_BIAS_OFF) {
  2724. /* Tweak DC servo configuration for improved
  2725. * performance. */
  2726. snd_soc_write(codec, 0x102, 0x3);
  2727. snd_soc_write(codec, 0x56, 0x3);
  2728. snd_soc_write(codec, 0x102, 0);
  2729. /* Discharge LINEOUT1 & 2 */
  2730. snd_soc_update_bits(codec, WM8994_ANTIPOP_1,
  2731. WM8994_LINEOUT1_DISCH |
  2732. WM8994_LINEOUT2_DISCH,
  2733. WM8994_LINEOUT1_DISCH |
  2734. WM8994_LINEOUT2_DISCH);
  2735. /* Startup bias, VMID ramp & buffer */
  2736. snd_soc_update_bits(codec, WM8994_ANTIPOP_2,
  2737. WM8994_STARTUP_BIAS_ENA |
  2738. WM8994_VMID_BUF_ENA |
  2739. WM8994_VMID_RAMP_MASK,
  2740. WM8994_STARTUP_BIAS_ENA |
  2741. WM8994_VMID_BUF_ENA |
  2742. (0x11 << WM8994_VMID_RAMP_SHIFT));
  2743. /* Main bias enable, VMID=2x40k */
  2744. snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_1,
  2745. WM8994_BIAS_ENA |
  2746. WM8994_VMID_SEL_MASK,
  2747. WM8994_BIAS_ENA | 0x2);
  2748. msleep(20);
  2749. }
  2750. /* VMID=2x500k */
  2751. snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_1,
  2752. WM8994_VMID_SEL_MASK, 0x4);
  2753. break;
  2754. case SND_SOC_BIAS_OFF:
  2755. if (codec->bias_level == SND_SOC_BIAS_STANDBY) {
  2756. /* Switch over to startup biases */
  2757. snd_soc_update_bits(codec, WM8994_ANTIPOP_2,
  2758. WM8994_BIAS_SRC |
  2759. WM8994_STARTUP_BIAS_ENA |
  2760. WM8994_VMID_BUF_ENA |
  2761. WM8994_VMID_RAMP_MASK,
  2762. WM8994_BIAS_SRC |
  2763. WM8994_STARTUP_BIAS_ENA |
  2764. WM8994_VMID_BUF_ENA |
  2765. (1 << WM8994_VMID_RAMP_SHIFT));
  2766. /* Disable main biases */
  2767. snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_1,
  2768. WM8994_BIAS_ENA |
  2769. WM8994_VMID_SEL_MASK, 0);
  2770. /* Discharge line */
  2771. snd_soc_update_bits(codec, WM8994_ANTIPOP_1,
  2772. WM8994_LINEOUT1_DISCH |
  2773. WM8994_LINEOUT2_DISCH,
  2774. WM8994_LINEOUT1_DISCH |
  2775. WM8994_LINEOUT2_DISCH);
  2776. msleep(5);
  2777. /* Switch off startup biases */
  2778. snd_soc_update_bits(codec, WM8994_ANTIPOP_2,
  2779. WM8994_BIAS_SRC |
  2780. WM8994_STARTUP_BIAS_ENA |
  2781. WM8994_VMID_BUF_ENA |
  2782. WM8994_VMID_RAMP_MASK, 0);
  2783. }
  2784. break;
  2785. }
  2786. codec->bias_level = level;
  2787. return 0;
  2788. }
  2789. static int wm8994_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
  2790. {
  2791. struct snd_soc_codec *codec = dai->codec;
  2792. int ms_reg;
  2793. int aif1_reg;
  2794. int ms = 0;
  2795. int aif1 = 0;
  2796. switch (dai->id) {
  2797. case 1:
  2798. ms_reg = WM8994_AIF1_MASTER_SLAVE;
  2799. aif1_reg = WM8994_AIF1_CONTROL_1;
  2800. break;
  2801. case 2:
  2802. ms_reg = WM8994_AIF2_MASTER_SLAVE;
  2803. aif1_reg = WM8994_AIF2_CONTROL_1;
  2804. break;
  2805. default:
  2806. return -EINVAL;
  2807. }
  2808. switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
  2809. case SND_SOC_DAIFMT_CBS_CFS:
  2810. break;
  2811. case SND_SOC_DAIFMT_CBM_CFM:
  2812. ms = WM8994_AIF1_MSTR;
  2813. break;
  2814. default:
  2815. return -EINVAL;
  2816. }
  2817. switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
  2818. case SND_SOC_DAIFMT_DSP_B:
  2819. aif1 |= WM8994_AIF1_LRCLK_INV;
  2820. case SND_SOC_DAIFMT_DSP_A:
  2821. aif1 |= 0x18;
  2822. break;
  2823. case SND_SOC_DAIFMT_I2S:
  2824. aif1 |= 0x10;
  2825. break;
  2826. case SND_SOC_DAIFMT_RIGHT_J:
  2827. break;
  2828. case SND_SOC_DAIFMT_LEFT_J:
  2829. aif1 |= 0x8;
  2830. break;
  2831. default:
  2832. return -EINVAL;
  2833. }
  2834. switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
  2835. case SND_SOC_DAIFMT_DSP_A:
  2836. case SND_SOC_DAIFMT_DSP_B:
  2837. /* frame inversion not valid for DSP modes */
  2838. switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
  2839. case SND_SOC_DAIFMT_NB_NF:
  2840. break;
  2841. case SND_SOC_DAIFMT_IB_NF:
  2842. aif1 |= WM8994_AIF1_BCLK_INV;
  2843. break;
  2844. default:
  2845. return -EINVAL;
  2846. }
  2847. break;
  2848. case SND_SOC_DAIFMT_I2S:
  2849. case SND_SOC_DAIFMT_RIGHT_J:
  2850. case SND_SOC_DAIFMT_LEFT_J:
  2851. switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
  2852. case SND_SOC_DAIFMT_NB_NF:
  2853. break;
  2854. case SND_SOC_DAIFMT_IB_IF:
  2855. aif1 |= WM8994_AIF1_BCLK_INV | WM8994_AIF1_LRCLK_INV;
  2856. break;
  2857. case SND_SOC_DAIFMT_IB_NF:
  2858. aif1 |= WM8994_AIF1_BCLK_INV;
  2859. break;
  2860. case SND_SOC_DAIFMT_NB_IF:
  2861. aif1 |= WM8994_AIF1_LRCLK_INV;
  2862. break;
  2863. default:
  2864. return -EINVAL;
  2865. }
  2866. break;
  2867. default:
  2868. return -EINVAL;
  2869. }
  2870. snd_soc_update_bits(codec, aif1_reg,
  2871. WM8994_AIF1_BCLK_INV | WM8994_AIF1_LRCLK_INV |
  2872. WM8994_AIF1_FMT_MASK,
  2873. aif1);
  2874. snd_soc_update_bits(codec, ms_reg, WM8994_AIF1_MSTR,
  2875. ms);
  2876. return 0;
  2877. }
  2878. static struct {
  2879. int val, rate;
  2880. } srs[] = {
  2881. { 0, 8000 },
  2882. { 1, 11025 },
  2883. { 2, 12000 },
  2884. { 3, 16000 },
  2885. { 4, 22050 },
  2886. { 5, 24000 },
  2887. { 6, 32000 },
  2888. { 7, 44100 },
  2889. { 8, 48000 },
  2890. { 9, 88200 },
  2891. { 10, 96000 },
  2892. };
  2893. static int fs_ratios[] = {
  2894. 64, 128, 192, 256, 348, 512, 768, 1024, 1408, 1536
  2895. };
  2896. static int bclk_divs[] = {
  2897. 10, 15, 20, 30, 40, 50, 60, 80, 110, 120, 160, 220, 240, 320, 440, 480,
  2898. 640, 880, 960, 1280, 1760, 1920
  2899. };
  2900. static int wm8994_hw_params(struct snd_pcm_substream *substream,
  2901. struct snd_pcm_hw_params *params,
  2902. struct snd_soc_dai *dai)
  2903. {
  2904. struct snd_soc_codec *codec = dai->codec;
  2905. struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
  2906. int aif1_reg;
  2907. int bclk_reg;
  2908. int lrclk_reg;
  2909. int rate_reg;
  2910. int aif1 = 0;
  2911. int bclk = 0;
  2912. int lrclk = 0;
  2913. int rate_val = 0;
  2914. int id = dai->id - 1;
  2915. int i, cur_val, best_val, bclk_rate, best;
  2916. switch (dai->id) {
  2917. case 1:
  2918. aif1_reg = WM8994_AIF1_CONTROL_1;
  2919. bclk_reg = WM8994_AIF1_BCLK;
  2920. rate_reg = WM8994_AIF1_RATE;
  2921. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK ||
  2922. wm8994->lrclk_shared[0])
  2923. lrclk_reg = WM8994_AIF1DAC_LRCLK;
  2924. else
  2925. lrclk_reg = WM8994_AIF1ADC_LRCLK;
  2926. break;
  2927. case 2:
  2928. aif1_reg = WM8994_AIF2_CONTROL_1;
  2929. bclk_reg = WM8994_AIF2_BCLK;
  2930. rate_reg = WM8994_AIF2_RATE;
  2931. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK ||
  2932. wm8994->lrclk_shared[1])
  2933. lrclk_reg = WM8994_AIF2DAC_LRCLK;
  2934. else
  2935. lrclk_reg = WM8994_AIF2ADC_LRCLK;
  2936. break;
  2937. default:
  2938. return -EINVAL;
  2939. }
  2940. bclk_rate = params_rate(params) * 2;
  2941. switch (params_format(params)) {
  2942. case SNDRV_PCM_FORMAT_S16_LE:
  2943. bclk_rate *= 16;
  2944. break;
  2945. case SNDRV_PCM_FORMAT_S20_3LE:
  2946. bclk_rate *= 20;
  2947. aif1 |= 0x20;
  2948. break;
  2949. case SNDRV_PCM_FORMAT_S24_LE:
  2950. bclk_rate *= 24;
  2951. aif1 |= 0x40;
  2952. break;
  2953. case SNDRV_PCM_FORMAT_S32_LE:
  2954. bclk_rate *= 32;
  2955. aif1 |= 0x60;
  2956. break;
  2957. default:
  2958. return -EINVAL;
  2959. }
  2960. /* Try to find an appropriate sample rate; look for an exact match. */
  2961. for (i = 0; i < ARRAY_SIZE(srs); i++)
  2962. if (srs[i].rate == params_rate(params))
  2963. break;
  2964. if (i == ARRAY_SIZE(srs))
  2965. return -EINVAL;
  2966. rate_val |= srs[i].val << WM8994_AIF1_SR_SHIFT;
  2967. dev_dbg(dai->dev, "Sample rate is %dHz\n", srs[i].rate);
  2968. dev_dbg(dai->dev, "AIF%dCLK is %dHz, target BCLK %dHz\n",
  2969. dai->id, wm8994->aifclk[id], bclk_rate);
  2970. if (wm8994->aifclk[id] == 0) {
  2971. dev_err(dai->dev, "AIF%dCLK not configured\n", dai->id);
  2972. return -EINVAL;
  2973. }
  2974. /* AIFCLK/fs ratio; look for a close match in either direction */
  2975. best = 0;
  2976. best_val = abs((fs_ratios[0] * params_rate(params))
  2977. - wm8994->aifclk[id]);
  2978. for (i = 1; i < ARRAY_SIZE(fs_ratios); i++) {
  2979. cur_val = abs((fs_ratios[i] * params_rate(params))
  2980. - wm8994->aifclk[id]);
  2981. if (cur_val >= best_val)
  2982. continue;
  2983. best = i;
  2984. best_val = cur_val;
  2985. }
  2986. dev_dbg(dai->dev, "Selected AIF%dCLK/fs = %d\n",
  2987. dai->id, fs_ratios[best]);
  2988. rate_val |= best;
  2989. /* We may not get quite the right frequency if using
  2990. * approximate clocks so look for the closest match that is
  2991. * higher than the target (we need to ensure that there enough
  2992. * BCLKs to clock out the samples).
  2993. */
  2994. best = 0;
  2995. for (i = 0; i < ARRAY_SIZE(bclk_divs); i++) {
  2996. cur_val = (wm8994->aifclk[id] * 10 / bclk_divs[i]) - bclk_rate;
  2997. if (cur_val < 0) /* BCLK table is sorted */
  2998. break;
  2999. best = i;
  3000. }
  3001. bclk_rate = wm8994->aifclk[id] * 10 / bclk_divs[best];
  3002. dev_dbg(dai->dev, "Using BCLK_DIV %d for actual BCLK %dHz\n",
  3003. bclk_divs[best], bclk_rate);
  3004. bclk |= best << WM8994_AIF1_BCLK_DIV_SHIFT;
  3005. lrclk = bclk_rate / params_rate(params);
  3006. dev_dbg(dai->dev, "Using LRCLK rate %d for actual LRCLK %dHz\n",
  3007. lrclk, bclk_rate / lrclk);
  3008. snd_soc_update_bits(codec, aif1_reg, WM8994_AIF1_WL_MASK, aif1);
  3009. snd_soc_update_bits(codec, bclk_reg, WM8994_AIF1_BCLK_DIV_MASK, bclk);
  3010. snd_soc_update_bits(codec, lrclk_reg, WM8994_AIF1DAC_RATE_MASK,
  3011. lrclk);
  3012. snd_soc_update_bits(codec, rate_reg, WM8994_AIF1_SR_MASK |
  3013. WM8994_AIF1CLK_RATE_MASK, rate_val);
  3014. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
  3015. switch (dai->id) {
  3016. case 1:
  3017. wm8994->dac_rates[0] = params_rate(params);
  3018. wm8994_set_retune_mobile(codec, 0);
  3019. wm8994_set_retune_mobile(codec, 1);
  3020. break;
  3021. case 2:
  3022. wm8994->dac_rates[1] = params_rate(params);
  3023. wm8994_set_retune_mobile(codec, 2);
  3024. break;
  3025. }
  3026. }
  3027. return 0;
  3028. }
  3029. static int wm8994_aif_mute(struct snd_soc_dai *codec_dai, int mute)
  3030. {
  3031. struct snd_soc_codec *codec = codec_dai->codec;
  3032. int mute_reg;
  3033. int reg;
  3034. switch (codec_dai->id) {
  3035. case 1:
  3036. mute_reg = WM8994_AIF1_DAC1_FILTERS_1;
  3037. break;
  3038. case 2:
  3039. mute_reg = WM8994_AIF2_DAC_FILTERS_1;
  3040. break;
  3041. default:
  3042. return -EINVAL;
  3043. }
  3044. if (mute)
  3045. reg = WM8994_AIF1DAC1_MUTE;
  3046. else
  3047. reg = 0;
  3048. snd_soc_update_bits(codec, mute_reg, WM8994_AIF1DAC1_MUTE, reg);
  3049. return 0;
  3050. }
  3051. static int wm8994_set_tristate(struct snd_soc_dai *codec_dai, int tristate)
  3052. {
  3053. struct snd_soc_codec *codec = codec_dai->codec;
  3054. int reg, val, mask;
  3055. switch (codec_dai->id) {
  3056. case 1:
  3057. reg = WM8994_AIF1_MASTER_SLAVE;
  3058. mask = WM8994_AIF1_TRI;
  3059. break;
  3060. case 2:
  3061. reg = WM8994_AIF2_MASTER_SLAVE;
  3062. mask = WM8994_AIF2_TRI;
  3063. break;
  3064. case 3:
  3065. reg = WM8994_POWER_MANAGEMENT_6;
  3066. mask = WM8994_AIF3_TRI;
  3067. break;
  3068. default:
  3069. return -EINVAL;
  3070. }
  3071. if (tristate)
  3072. val = mask;
  3073. else
  3074. val = 0;
  3075. return snd_soc_update_bits(codec, reg, mask, reg);
  3076. }
  3077. #define WM8994_RATES SNDRV_PCM_RATE_8000_96000
  3078. #define WM8994_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
  3079. SNDRV_PCM_FMTBIT_S24_LE)
  3080. static struct snd_soc_dai_ops wm8994_aif1_dai_ops = {
  3081. .set_sysclk = wm8994_set_dai_sysclk,
  3082. .set_fmt = wm8994_set_dai_fmt,
  3083. .hw_params = wm8994_hw_params,
  3084. .digital_mute = wm8994_aif_mute,
  3085. .set_pll = wm8994_set_fll,
  3086. .set_tristate = wm8994_set_tristate,
  3087. };
  3088. static struct snd_soc_dai_ops wm8994_aif2_dai_ops = {
  3089. .set_sysclk = wm8994_set_dai_sysclk,
  3090. .set_fmt = wm8994_set_dai_fmt,
  3091. .hw_params = wm8994_hw_params,
  3092. .digital_mute = wm8994_aif_mute,
  3093. .set_pll = wm8994_set_fll,
  3094. .set_tristate = wm8994_set_tristate,
  3095. };
  3096. static struct snd_soc_dai_ops wm8994_aif3_dai_ops = {
  3097. .set_tristate = wm8994_set_tristate,
  3098. };
  3099. struct snd_soc_dai wm8994_dai[] = {
  3100. {
  3101. .name = "WM8994 AIF1",
  3102. .id = 1,
  3103. .playback = {
  3104. .stream_name = "AIF1 Playback",
  3105. .channels_min = 2,
  3106. .channels_max = 2,
  3107. .rates = WM8994_RATES,
  3108. .formats = WM8994_FORMATS,
  3109. },
  3110. .capture = {
  3111. .stream_name = "AIF1 Capture",
  3112. .channels_min = 2,
  3113. .channels_max = 2,
  3114. .rates = WM8994_RATES,
  3115. .formats = WM8994_FORMATS,
  3116. },
  3117. .ops = &wm8994_aif1_dai_ops,
  3118. },
  3119. {
  3120. .name = "WM8994 AIF2",
  3121. .id = 2,
  3122. .playback = {
  3123. .stream_name = "AIF2 Playback",
  3124. .channels_min = 2,
  3125. .channels_max = 2,
  3126. .rates = WM8994_RATES,
  3127. .formats = WM8994_FORMATS,
  3128. },
  3129. .capture = {
  3130. .stream_name = "AIF2 Capture",
  3131. .channels_min = 2,
  3132. .channels_max = 2,
  3133. .rates = WM8994_RATES,
  3134. .formats = WM8994_FORMATS,
  3135. },
  3136. .ops = &wm8994_aif2_dai_ops,
  3137. },
  3138. {
  3139. .name = "WM8994 AIF3",
  3140. .id = 3,
  3141. .playback = {
  3142. .stream_name = "AIF3 Playback",
  3143. .channels_min = 2,
  3144. .channels_max = 2,
  3145. .rates = WM8994_RATES,
  3146. .formats = WM8994_FORMATS,
  3147. },
  3148. .capture = {
  3149. .stream_name = "AIF3 Capture",
  3150. .channels_min = 2,
  3151. .channels_max = 2,
  3152. .rates = WM8994_RATES,
  3153. .formats = WM8994_FORMATS,
  3154. },
  3155. .ops = &wm8994_aif3_dai_ops,
  3156. }
  3157. };
  3158. EXPORT_SYMBOL_GPL(wm8994_dai);
  3159. #ifdef CONFIG_PM
  3160. static int wm8994_suspend(struct platform_device *pdev, pm_message_t state)
  3161. {
  3162. struct snd_soc_device *socdev = platform_get_drvdata(pdev);
  3163. struct snd_soc_codec *codec = socdev->card->codec;
  3164. struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
  3165. int i, ret;
  3166. for (i = 0; i < ARRAY_SIZE(wm8994->fll); i++) {
  3167. memcpy(&wm8994->fll_suspend[i], &wm8994->fll[i],
  3168. sizeof(struct fll_config));
  3169. ret = wm8994_set_fll(&codec->dai[0], i + 1, 0, 0, 0);
  3170. if (ret < 0)
  3171. dev_warn(codec->dev, "Failed to stop FLL%d: %d\n",
  3172. i + 1, ret);
  3173. }
  3174. wm8994_set_bias_level(codec, SND_SOC_BIAS_OFF);
  3175. return 0;
  3176. }
  3177. static int wm8994_resume(struct platform_device *pdev)
  3178. {
  3179. struct snd_soc_device *socdev = platform_get_drvdata(pdev);
  3180. struct snd_soc_codec *codec = socdev->card->codec;
  3181. struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
  3182. u16 *reg_cache = codec->reg_cache;
  3183. int i, ret;
  3184. /* Restore the registers */
  3185. for (i = 1; i < ARRAY_SIZE(wm8994->reg_cache); i++) {
  3186. switch (i) {
  3187. case WM8994_LDO_1:
  3188. case WM8994_LDO_2:
  3189. case WM8994_SOFTWARE_RESET:
  3190. /* Handled by other MFD drivers */
  3191. continue;
  3192. default:
  3193. break;
  3194. }
  3195. if (!access_masks[i].writable)
  3196. continue;
  3197. wm8994_reg_write(codec->control_data, i, reg_cache[i]);
  3198. }
  3199. wm8994_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
  3200. for (i = 0; i < ARRAY_SIZE(wm8994->fll); i++) {
  3201. ret = wm8994_set_fll(&codec->dai[0], i + 1,
  3202. wm8994->fll_suspend[i].src,
  3203. wm8994->fll_suspend[i].in,
  3204. wm8994->fll_suspend[i].out);
  3205. if (ret < 0)
  3206. dev_warn(codec->dev, "Failed to restore FLL%d: %d\n",
  3207. i + 1, ret);
  3208. }
  3209. return 0;
  3210. }
  3211. #else
  3212. #define wm8994_suspend NULL
  3213. #define wm8994_resume NULL
  3214. #endif
  3215. static void wm8994_handle_retune_mobile_pdata(struct wm8994_priv *wm8994)
  3216. {
  3217. struct snd_soc_codec *codec = &wm8994->codec;
  3218. struct wm8994_pdata *pdata = wm8994->pdata;
  3219. struct snd_kcontrol_new controls[] = {
  3220. SOC_ENUM_EXT("AIF1.1 EQ Mode",
  3221. wm8994->retune_mobile_enum,
  3222. wm8994_get_retune_mobile_enum,
  3223. wm8994_put_retune_mobile_enum),
  3224. SOC_ENUM_EXT("AIF1.2 EQ Mode",
  3225. wm8994->retune_mobile_enum,
  3226. wm8994_get_retune_mobile_enum,
  3227. wm8994_put_retune_mobile_enum),
  3228. SOC_ENUM_EXT("AIF2 EQ Mode",
  3229. wm8994->retune_mobile_enum,
  3230. wm8994_get_retune_mobile_enum,
  3231. wm8994_put_retune_mobile_enum),
  3232. };
  3233. int ret, i, j;
  3234. const char **t;
  3235. /* We need an array of texts for the enum API but the number
  3236. * of texts is likely to be less than the number of
  3237. * configurations due to the sample rate dependency of the
  3238. * configurations. */
  3239. wm8994->num_retune_mobile_texts = 0;
  3240. wm8994->retune_mobile_texts = NULL;
  3241. for (i = 0; i < pdata->num_retune_mobile_cfgs; i++) {
  3242. for (j = 0; j < wm8994->num_retune_mobile_texts; j++) {
  3243. if (strcmp(pdata->retune_mobile_cfgs[i].name,
  3244. wm8994->retune_mobile_texts[j]) == 0)
  3245. break;
  3246. }
  3247. if (j != wm8994->num_retune_mobile_texts)
  3248. continue;
  3249. /* Expand the array... */
  3250. t = krealloc(wm8994->retune_mobile_texts,
  3251. sizeof(char *) *
  3252. (wm8994->num_retune_mobile_texts + 1),
  3253. GFP_KERNEL);
  3254. if (t == NULL)
  3255. continue;
  3256. /* ...store the new entry... */
  3257. t[wm8994->num_retune_mobile_texts] =
  3258. pdata->retune_mobile_cfgs[i].name;
  3259. /* ...and remember the new version. */
  3260. wm8994->num_retune_mobile_texts++;
  3261. wm8994->retune_mobile_texts = t;
  3262. }
  3263. dev_dbg(codec->dev, "Allocated %d unique ReTune Mobile names\n",
  3264. wm8994->num_retune_mobile_texts);
  3265. wm8994->retune_mobile_enum.max = wm8994->num_retune_mobile_texts;
  3266. wm8994->retune_mobile_enum.texts = wm8994->retune_mobile_texts;
  3267. ret = snd_soc_add_controls(&wm8994->codec, controls,
  3268. ARRAY_SIZE(controls));
  3269. if (ret != 0)
  3270. dev_err(wm8994->codec.dev,
  3271. "Failed to add ReTune Mobile controls: %d\n", ret);
  3272. }
  3273. static void wm8994_handle_pdata(struct wm8994_priv *wm8994)
  3274. {
  3275. struct snd_soc_codec *codec = &wm8994->codec;
  3276. struct wm8994_pdata *pdata = wm8994->pdata;
  3277. int ret, i;
  3278. if (!pdata)
  3279. return;
  3280. wm_hubs_handle_analogue_pdata(codec, pdata->lineout1_diff,
  3281. pdata->lineout2_diff,
  3282. pdata->lineout1fb,
  3283. pdata->lineout2fb,
  3284. pdata->jd_scthr,
  3285. pdata->jd_thr,
  3286. pdata->micbias1_lvl,
  3287. pdata->micbias2_lvl);
  3288. dev_dbg(codec->dev, "%d DRC configurations\n", pdata->num_drc_cfgs);
  3289. if (pdata->num_drc_cfgs) {
  3290. struct snd_kcontrol_new controls[] = {
  3291. SOC_ENUM_EXT("AIF1DRC1 Mode", wm8994->drc_enum,
  3292. wm8994_get_drc_enum, wm8994_put_drc_enum),
  3293. SOC_ENUM_EXT("AIF1DRC2 Mode", wm8994->drc_enum,
  3294. wm8994_get_drc_enum, wm8994_put_drc_enum),
  3295. SOC_ENUM_EXT("AIF2DRC Mode", wm8994->drc_enum,
  3296. wm8994_get_drc_enum, wm8994_put_drc_enum),
  3297. };
  3298. /* We need an array of texts for the enum API */
  3299. wm8994->drc_texts = kmalloc(sizeof(char *)
  3300. * pdata->num_drc_cfgs, GFP_KERNEL);
  3301. if (!wm8994->drc_texts) {
  3302. dev_err(wm8994->codec.dev,
  3303. "Failed to allocate %d DRC config texts\n",
  3304. pdata->num_drc_cfgs);
  3305. return;
  3306. }
  3307. for (i = 0; i < pdata->num_drc_cfgs; i++)
  3308. wm8994->drc_texts[i] = pdata->drc_cfgs[i].name;
  3309. wm8994->drc_enum.max = pdata->num_drc_cfgs;
  3310. wm8994->drc_enum.texts = wm8994->drc_texts;
  3311. ret = snd_soc_add_controls(&wm8994->codec, controls,
  3312. ARRAY_SIZE(controls));
  3313. if (ret != 0)
  3314. dev_err(wm8994->codec.dev,
  3315. "Failed to add DRC mode controls: %d\n", ret);
  3316. for (i = 0; i < WM8994_NUM_DRC; i++)
  3317. wm8994_set_drc(codec, i);
  3318. }
  3319. dev_dbg(codec->dev, "%d ReTune Mobile configurations\n",
  3320. pdata->num_retune_mobile_cfgs);
  3321. if (pdata->num_retune_mobile_cfgs)
  3322. wm8994_handle_retune_mobile_pdata(wm8994);
  3323. else
  3324. snd_soc_add_controls(&wm8994->codec, wm8994_eq_controls,
  3325. ARRAY_SIZE(wm8994_eq_controls));
  3326. }
  3327. static int wm8994_probe(struct platform_device *pdev)
  3328. {
  3329. struct snd_soc_device *socdev = platform_get_drvdata(pdev);
  3330. struct snd_soc_codec *codec;
  3331. int ret = 0;
  3332. if (wm8994_codec == NULL) {
  3333. dev_err(&pdev->dev, "Codec device not registered\n");
  3334. return -ENODEV;
  3335. }
  3336. socdev->card->codec = wm8994_codec;
  3337. codec = wm8994_codec;
  3338. /* register pcms */
  3339. ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
  3340. if (ret < 0) {
  3341. dev_err(codec->dev, "failed to create pcms: %d\n", ret);
  3342. return ret;
  3343. }
  3344. wm8994_handle_pdata(snd_soc_codec_get_drvdata(codec));
  3345. wm_hubs_add_analogue_controls(codec);
  3346. snd_soc_add_controls(codec, wm8994_snd_controls,
  3347. ARRAY_SIZE(wm8994_snd_controls));
  3348. snd_soc_dapm_new_controls(codec, wm8994_dapm_widgets,
  3349. ARRAY_SIZE(wm8994_dapm_widgets));
  3350. wm_hubs_add_analogue_routes(codec, 0, 0);
  3351. snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon));
  3352. return 0;
  3353. }
  3354. static int wm8994_remove(struct platform_device *pdev)
  3355. {
  3356. struct snd_soc_device *socdev = platform_get_drvdata(pdev);
  3357. snd_soc_free_pcms(socdev);
  3358. snd_soc_dapm_free(socdev);
  3359. return 0;
  3360. }
  3361. struct snd_soc_codec_device soc_codec_dev_wm8994 = {
  3362. .probe = wm8994_probe,
  3363. .remove = wm8994_remove,
  3364. .suspend = wm8994_suspend,
  3365. .resume = wm8994_resume,
  3366. };
  3367. EXPORT_SYMBOL_GPL(soc_codec_dev_wm8994);
  3368. /**
  3369. * wm8994_mic_detect - Enable microphone detection via the WM8994 IRQ
  3370. *
  3371. * @codec: WM8994 codec
  3372. * @jack: jack to report detection events on
  3373. * @micbias: microphone bias to detect on
  3374. * @det: value to report for presence detection
  3375. * @shrt: value to report for short detection
  3376. *
  3377. * Enable microphone detection via IRQ on the WM8994. If GPIOs are
  3378. * being used to bring out signals to the processor then only platform
  3379. * data configuration is needed for WM8903 and processor GPIOs should
  3380. * be configured using snd_soc_jack_add_gpios() instead.
  3381. *
  3382. * Configuration of detection levels is available via the micbias1_lvl
  3383. * and micbias2_lvl platform data members.
  3384. */
  3385. int wm8994_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack,
  3386. int micbias, int det, int shrt)
  3387. {
  3388. struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
  3389. struct wm8994_micdet *micdet;
  3390. int reg;
  3391. switch (micbias) {
  3392. case 1:
  3393. micdet = &wm8994->micdet[0];
  3394. break;
  3395. case 2:
  3396. micdet = &wm8994->micdet[1];
  3397. break;
  3398. default:
  3399. return -EINVAL;
  3400. }
  3401. dev_dbg(codec->dev, "Configuring microphone detection on %d: %x %x\n",
  3402. micbias, det, shrt);
  3403. /* Store the configuration */
  3404. micdet->jack = jack;
  3405. micdet->det = det;
  3406. micdet->shrt = shrt;
  3407. /* If either of the jacks is set up then enable detection */
  3408. if (wm8994->micdet[0].jack || wm8994->micdet[1].jack)
  3409. reg = WM8994_MICD_ENA;
  3410. else
  3411. reg = 0;
  3412. snd_soc_update_bits(codec, WM8994_MICBIAS, WM8994_MICD_ENA, reg);
  3413. return 0;
  3414. }
  3415. EXPORT_SYMBOL_GPL(wm8994_mic_detect);
  3416. static irqreturn_t wm8994_mic_irq(int irq, void *data)
  3417. {
  3418. struct wm8994_priv *priv = data;
  3419. struct snd_soc_codec *codec = &priv->codec;
  3420. int reg;
  3421. int report;
  3422. reg = snd_soc_read(codec, WM8994_INTERRUPT_RAW_STATUS_2);
  3423. if (reg < 0) {
  3424. dev_err(codec->dev, "Failed to read microphone status: %d\n",
  3425. reg);
  3426. return IRQ_HANDLED;
  3427. }
  3428. dev_dbg(codec->dev, "Microphone status: %x\n", reg);
  3429. report = 0;
  3430. if (reg & WM8994_MIC1_DET_STS)
  3431. report |= priv->micdet[0].det;
  3432. if (reg & WM8994_MIC1_SHRT_STS)
  3433. report |= priv->micdet[0].shrt;
  3434. snd_soc_jack_report(priv->micdet[0].jack, report,
  3435. priv->micdet[0].det | priv->micdet[0].shrt);
  3436. report = 0;
  3437. if (reg & WM8994_MIC2_DET_STS)
  3438. report |= priv->micdet[1].det;
  3439. if (reg & WM8994_MIC2_SHRT_STS)
  3440. report |= priv->micdet[1].shrt;
  3441. snd_soc_jack_report(priv->micdet[1].jack, report,
  3442. priv->micdet[1].det | priv->micdet[1].shrt);
  3443. return IRQ_HANDLED;
  3444. }
  3445. static int wm8994_codec_probe(struct platform_device *pdev)
  3446. {
  3447. int ret;
  3448. struct wm8994_priv *wm8994;
  3449. struct snd_soc_codec *codec;
  3450. int i;
  3451. u16 rev;
  3452. if (wm8994_codec) {
  3453. dev_err(&pdev->dev, "Another WM8994 is registered\n");
  3454. return -EINVAL;
  3455. }
  3456. wm8994 = kzalloc(sizeof(struct wm8994_priv), GFP_KERNEL);
  3457. if (!wm8994) {
  3458. dev_err(&pdev->dev, "Failed to allocate private data\n");
  3459. return -ENOMEM;
  3460. }
  3461. codec = &wm8994->codec;
  3462. mutex_init(&codec->mutex);
  3463. INIT_LIST_HEAD(&codec->dapm_widgets);
  3464. INIT_LIST_HEAD(&codec->dapm_paths);
  3465. snd_soc_codec_set_drvdata(codec, wm8994);
  3466. codec->control_data = dev_get_drvdata(pdev->dev.parent);
  3467. codec->name = "WM8994";
  3468. codec->owner = THIS_MODULE;
  3469. codec->read = wm8994_read;
  3470. codec->write = wm8994_write;
  3471. codec->readable_register = wm8994_readable;
  3472. codec->bias_level = SND_SOC_BIAS_OFF;
  3473. codec->set_bias_level = wm8994_set_bias_level;
  3474. codec->dai = &wm8994_dai[0];
  3475. codec->num_dai = 3;
  3476. codec->reg_cache_size = WM8994_MAX_REGISTER;
  3477. codec->reg_cache = &wm8994->reg_cache;
  3478. codec->dev = &pdev->dev;
  3479. wm8994->pdata = pdev->dev.parent->platform_data;
  3480. /* Fill the cache with physical values we inherited; don't reset */
  3481. ret = wm8994_bulk_read(codec->control_data, 0,
  3482. ARRAY_SIZE(wm8994->reg_cache) - 1,
  3483. codec->reg_cache);
  3484. if (ret < 0) {
  3485. dev_err(codec->dev, "Failed to fill register cache: %d\n",
  3486. ret);
  3487. goto err;
  3488. }
  3489. /* Clear the cached values for unreadable/volatile registers to
  3490. * avoid potential confusion.
  3491. */
  3492. for (i = 0; i < ARRAY_SIZE(wm8994->reg_cache); i++)
  3493. if (wm8994_volatile(i) || !wm8994_readable(i))
  3494. wm8994->reg_cache[i] = 0;
  3495. /* Set revision-specific configuration */
  3496. rev = snd_soc_read(codec, WM8994_CHIP_REVISION);
  3497. switch (rev) {
  3498. case 2:
  3499. case 3:
  3500. wm8994->hubs.dcs_codes = -5;
  3501. wm8994->hubs.hp_startup_mode = 1;
  3502. wm8994->hubs.dcs_readback_mode = 1;
  3503. break;
  3504. default:
  3505. wm8994->hubs.dcs_readback_mode = 1;
  3506. break;
  3507. }
  3508. ret = wm8994_request_irq(codec->control_data, WM8994_IRQ_MIC1_DET,
  3509. wm8994_mic_irq, "Mic 1 detect", wm8994);
  3510. if (ret != 0)
  3511. dev_warn(&pdev->dev,
  3512. "Failed to request Mic1 detect IRQ: %d\n", ret);
  3513. ret = wm8994_request_irq(codec->control_data, WM8994_IRQ_MIC1_SHRT,
  3514. wm8994_mic_irq, "Mic 1 short", wm8994);
  3515. if (ret != 0)
  3516. dev_warn(&pdev->dev,
  3517. "Failed to request Mic1 short IRQ: %d\n", ret);
  3518. ret = wm8994_request_irq(codec->control_data, WM8994_IRQ_MIC2_DET,
  3519. wm8994_mic_irq, "Mic 2 detect", wm8994);
  3520. if (ret != 0)
  3521. dev_warn(&pdev->dev,
  3522. "Failed to request Mic2 detect IRQ: %d\n", ret);
  3523. ret = wm8994_request_irq(codec->control_data, WM8994_IRQ_MIC2_SHRT,
  3524. wm8994_mic_irq, "Mic 2 short", wm8994);
  3525. if (ret != 0)
  3526. dev_warn(&pdev->dev,
  3527. "Failed to request Mic2 short IRQ: %d\n", ret);
  3528. /* Remember if AIFnLRCLK is configured as a GPIO. This should be
  3529. * configured on init - if a system wants to do this dynamically
  3530. * at runtime we can deal with that then.
  3531. */
  3532. ret = wm8994_reg_read(codec->control_data, WM8994_GPIO_1);
  3533. if (ret < 0) {
  3534. dev_err(codec->dev, "Failed to read GPIO1 state: %d\n", ret);
  3535. goto err_irq;
  3536. }
  3537. if ((ret & WM8994_GPN_FN_MASK) != WM8994_GP_FN_PIN_SPECIFIC) {
  3538. wm8994->lrclk_shared[0] = 1;
  3539. wm8994_dai[0].symmetric_rates = 1;
  3540. } else {
  3541. wm8994->lrclk_shared[0] = 0;
  3542. }
  3543. ret = wm8994_reg_read(codec->control_data, WM8994_GPIO_6);
  3544. if (ret < 0) {
  3545. dev_err(codec->dev, "Failed to read GPIO6 state: %d\n", ret);
  3546. goto err_irq;
  3547. }
  3548. if ((ret & WM8994_GPN_FN_MASK) != WM8994_GP_FN_PIN_SPECIFIC) {
  3549. wm8994->lrclk_shared[1] = 1;
  3550. wm8994_dai[1].symmetric_rates = 1;
  3551. } else {
  3552. wm8994->lrclk_shared[1] = 0;
  3553. }
  3554. for (i = 0; i < ARRAY_SIZE(wm8994_dai); i++)
  3555. wm8994_dai[i].dev = codec->dev;
  3556. wm8994_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
  3557. wm8994_codec = codec;
  3558. /* Latch volume updates (right only; we always do left then right). */
  3559. snd_soc_update_bits(codec, WM8994_AIF1_DAC1_RIGHT_VOLUME,
  3560. WM8994_AIF1DAC1_VU, WM8994_AIF1DAC1_VU);
  3561. snd_soc_update_bits(codec, WM8994_AIF1_DAC2_RIGHT_VOLUME,
  3562. WM8994_AIF1DAC2_VU, WM8994_AIF1DAC2_VU);
  3563. snd_soc_update_bits(codec, WM8994_AIF2_DAC_RIGHT_VOLUME,
  3564. WM8994_AIF2DAC_VU, WM8994_AIF2DAC_VU);
  3565. snd_soc_update_bits(codec, WM8994_AIF1_ADC1_RIGHT_VOLUME,
  3566. WM8994_AIF1ADC1_VU, WM8994_AIF1ADC1_VU);
  3567. snd_soc_update_bits(codec, WM8994_AIF1_ADC2_RIGHT_VOLUME,
  3568. WM8994_AIF1ADC2_VU, WM8994_AIF1ADC2_VU);
  3569. snd_soc_update_bits(codec, WM8994_AIF2_ADC_RIGHT_VOLUME,
  3570. WM8994_AIF2ADC_VU, WM8994_AIF1ADC2_VU);
  3571. snd_soc_update_bits(codec, WM8994_DAC1_RIGHT_VOLUME,
  3572. WM8994_DAC1_VU, WM8994_DAC1_VU);
  3573. snd_soc_update_bits(codec, WM8994_DAC2_RIGHT_VOLUME,
  3574. WM8994_DAC2_VU, WM8994_DAC2_VU);
  3575. /* Set the low bit of the 3D stereo depth so TLV matches */
  3576. snd_soc_update_bits(codec, WM8994_AIF1_DAC1_FILTERS_2,
  3577. 1 << WM8994_AIF1DAC1_3D_GAIN_SHIFT,
  3578. 1 << WM8994_AIF1DAC1_3D_GAIN_SHIFT);
  3579. snd_soc_update_bits(codec, WM8994_AIF1_DAC2_FILTERS_2,
  3580. 1 << WM8994_AIF1DAC2_3D_GAIN_SHIFT,
  3581. 1 << WM8994_AIF1DAC2_3D_GAIN_SHIFT);
  3582. snd_soc_update_bits(codec, WM8994_AIF2_DAC_FILTERS_2,
  3583. 1 << WM8994_AIF2DAC_3D_GAIN_SHIFT,
  3584. 1 << WM8994_AIF2DAC_3D_GAIN_SHIFT);
  3585. wm8994_update_class_w(codec);
  3586. ret = snd_soc_register_codec(codec);
  3587. if (ret != 0) {
  3588. dev_err(codec->dev, "Failed to register codec: %d\n", ret);
  3589. goto err_irq;
  3590. }
  3591. ret = snd_soc_register_dais(wm8994_dai, ARRAY_SIZE(wm8994_dai));
  3592. if (ret != 0) {
  3593. dev_err(codec->dev, "Failed to register DAIs: %d\n", ret);
  3594. goto err_codec;
  3595. }
  3596. platform_set_drvdata(pdev, wm8994);
  3597. return 0;
  3598. err_codec:
  3599. snd_soc_unregister_codec(codec);
  3600. err_irq:
  3601. wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC2_SHRT, wm8994);
  3602. wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC2_DET, wm8994);
  3603. wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_SHRT, wm8994);
  3604. wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_DET, wm8994);
  3605. err:
  3606. kfree(wm8994);
  3607. return ret;
  3608. }
  3609. static int __devexit wm8994_codec_remove(struct platform_device *pdev)
  3610. {
  3611. struct wm8994_priv *wm8994 = platform_get_drvdata(pdev);
  3612. struct snd_soc_codec *codec = &wm8994->codec;
  3613. wm8994_set_bias_level(codec, SND_SOC_BIAS_OFF);
  3614. snd_soc_unregister_dais(wm8994_dai, ARRAY_SIZE(wm8994_dai));
  3615. snd_soc_unregister_codec(&wm8994->codec);
  3616. wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC2_SHRT, wm8994);
  3617. wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC2_DET, wm8994);
  3618. wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_SHRT, wm8994);
  3619. wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_DET, wm8994);
  3620. kfree(wm8994);
  3621. wm8994_codec = NULL;
  3622. return 0;
  3623. }
  3624. static struct platform_driver wm8994_codec_driver = {
  3625. .driver = {
  3626. .name = "wm8994-codec",
  3627. .owner = THIS_MODULE,
  3628. },
  3629. .probe = wm8994_codec_probe,
  3630. .remove = __devexit_p(wm8994_codec_remove),
  3631. };
  3632. static __init int wm8994_init(void)
  3633. {
  3634. return platform_driver_register(&wm8994_codec_driver);
  3635. }
  3636. module_init(wm8994_init);
  3637. static __exit void wm8994_exit(void)
  3638. {
  3639. platform_driver_unregister(&wm8994_codec_driver);
  3640. }
  3641. module_exit(wm8994_exit);
  3642. MODULE_DESCRIPTION("ASoC WM8994 driver");
  3643. MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
  3644. MODULE_LICENSE("GPL");
  3645. MODULE_ALIAS("platform:wm8994-codec");