wm8994.c 135 KB

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