msm-pcm-routing-v2.c 183 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884
  1. /* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #include <linux/init.h>
  13. #include <linux/err.h>
  14. #include <linux/module.h>
  15. #include <linux/moduleparam.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/bitops.h>
  18. #include <linux/mutex.h>
  19. #include <linux/of_device.h>
  20. #include <sound/core.h>
  21. #include <sound/soc.h>
  22. #include <sound/soc-dapm.h>
  23. #include <sound/pcm.h>
  24. #include <sound/initval.h>
  25. #include <sound/control.h>
  26. #include <sound/q6adm-v2.h>
  27. #include <sound/q6asm-v2.h>
  28. #include <sound/q6afe-v2.h>
  29. #include <sound/tlv.h>
  30. #include <sound/asound.h>
  31. #include <sound/pcm_params.h>
  32. #include <sound/q6core.h>
  33. #include <linux/slab.h>
  34. #include "msm-pcm-routing-v2.h"
  35. #include "msm-dolby-dap-config.h"
  36. #include "q6voice.h"
  37. extern u32 score;
  38. struct msm_pcm_routing_bdai_data {
  39. u16 port_id; /* AFE port ID */
  40. u8 active; /* track if this backend is enabled */
  41. unsigned long fe_sessions; /* Front-end sessions */
  42. u64 port_sessions; /* track Tx BE ports -> Rx BE
  43. * number of BE should not exceed
  44. * the size of this field
  45. */
  46. unsigned int sample_rate;
  47. unsigned int channel;
  48. unsigned int format;
  49. };
  50. struct msm_pcm_routing_fdai_data {
  51. u16 be_srate; /* track prior backend sample rate for flushing purpose */
  52. int strm_id; /* ASM stream ID */
  53. struct msm_pcm_routing_evt event_info;
  54. };
  55. #define INVALID_SESSION -1
  56. #define SESSION_TYPE_RX 0
  57. #define SESSION_TYPE_TX 1
  58. #define MAX_LSM_SESSIONS 8
  59. #define EC_PORT_ID_PRIMARY_MI2S_TX 1
  60. #define EC_PORT_ID_SECONDARY_MI2S_TX 2
  61. #define EC_PORT_ID_TERTIARY_MI2S_TX 3
  62. #define EC_PORT_ID_QUATERNARY_MI2S_TX 4
  63. static struct mutex routing_lock;
  64. static int fm_switch_enable;
  65. static int fm_pcmrx_switch_enable;
  66. static int srs_alsa_ctrl_ever_called;
  67. static int lsm_mux_slim_port;
  68. static int slim0_rx_aanc_fb_port;
  69. static int msm_route_ec_ref_rx = 7; /* NONE */
  70. static uint32_t voc_session_id = ALL_SESSION_VSID;
  71. static int msm_route_ext_ec_ref = AFE_PORT_INVALID;
  72. enum {
  73. MADNONE,
  74. MADAUDIO,
  75. MADBEACON,
  76. MADULTRASOUND,
  77. MADSWAUDIO,
  78. };
  79. #define SLIMBUS_0_TX_TEXT "SLIMBUS_0_TX"
  80. #define SLIMBUS_1_TX_TEXT "SLIMBUS_1_TX"
  81. #define SLIMBUS_2_TX_TEXT "SLIMBUS_2_TX"
  82. #define SLIMBUS_3_TX_TEXT "SLIMBUS_3_TX"
  83. #define SLIMBUS_4_TX_TEXT "SLIMBUS_4_TX"
  84. #define SLIMBUS_5_TX_TEXT "SLIMBUS_5_TX"
  85. #define LSM_FUNCTION_TEXT "LSM Function"
  86. static const char * const mad_audio_mux_text[] = {
  87. "None",
  88. SLIMBUS_0_TX_TEXT, SLIMBUS_1_TX_TEXT, SLIMBUS_2_TX_TEXT,
  89. SLIMBUS_3_TX_TEXT, SLIMBUS_4_TX_TEXT, SLIMBUS_5_TX_TEXT
  90. };
  91. #define INT_RX_VOL_MAX_STEPS 0x2000
  92. #define INT_RX_VOL_GAIN 0x2000
  93. static int msm_route_fm_vol_control;
  94. static const DECLARE_TLV_DB_LINEAR(fm_rx_vol_gain, 0,
  95. INT_RX_VOL_MAX_STEPS);
  96. static int msm_route_hfp_vol_control;
  97. static const DECLARE_TLV_DB_LINEAR(hfp_rx_vol_gain, 0,
  98. INT_RX_VOL_MAX_STEPS);
  99. static int msm_route_multimedia2_vol_control;
  100. static const DECLARE_TLV_DB_LINEAR(multimedia2_rx_vol_gain, 0,
  101. INT_RX_VOL_MAX_STEPS);
  102. static int msm_route_multimedia5_vol_control;
  103. static const DECLARE_TLV_DB_LINEAR(multimedia5_rx_vol_gain, 0,
  104. INT_RX_VOL_MAX_STEPS);
  105. /* Equal to Frontend after last of the MULTIMEDIA SESSIONS */
  106. #define MAX_EQ_SESSIONS MSM_FRONTEND_DAI_CS_VOICE
  107. enum {
  108. EQ_BAND1 = 0,
  109. EQ_BAND2,
  110. EQ_BAND3,
  111. EQ_BAND4,
  112. EQ_BAND5,
  113. EQ_BAND6,
  114. EQ_BAND7,
  115. EQ_BAND8,
  116. EQ_BAND9,
  117. EQ_BAND10,
  118. EQ_BAND11,
  119. EQ_BAND12,
  120. EQ_BAND_MAX,
  121. };
  122. struct msm_audio_eq_band {
  123. uint16_t band_idx; /* The band index, 0 .. 11 */
  124. uint32_t filter_type; /* Filter band type */
  125. uint32_t center_freq_hz; /* Filter band center frequency */
  126. uint32_t filter_gain; /* Filter band initial gain (dB) */
  127. /* Range is +12 dB to -12 dB with 1dB increments. */
  128. uint32_t q_factor;
  129. } __packed;
  130. struct msm_audio_eq_stream_config {
  131. uint32_t enable; /* Number of consequtive bands specified */
  132. uint32_t num_bands;
  133. struct msm_audio_eq_band eq_bands[EQ_BAND_MAX];
  134. } __packed;
  135. struct msm_audio_eq_stream_config eq_data[MAX_EQ_SESSIONS];
  136. static void msm_send_eq_values(int eq_idx);
  137. /* This array is indexed by back-end DAI ID defined in msm-pcm-routing.h
  138. * If new back-end is defined, add new back-end DAI ID at the end of enum
  139. */
  140. #define SRS_TRUMEDIA_INDEX 2
  141. union srs_trumedia_params_u {
  142. struct srs_trumedia_params srs_params;
  143. unsigned short int raw_params[1];
  144. };
  145. static union srs_trumedia_params_u msm_srs_trumedia_params[SRS_TRUMEDIA_INDEX];
  146. static int srs_port_id = -1;
  147. static void srs_send_params(int port_id, unsigned int techs,
  148. int param_block_idx)
  149. {
  150. /* only send commands to dsp if srs alsa ctrl was used
  151. at least one time */
  152. if (!srs_alsa_ctrl_ever_called)
  153. return;
  154. pr_debug("SRS %s: called, port_id = %d, techs flags = %u, paramblockidx %d",
  155. __func__, port_id, techs, param_block_idx);
  156. /* force all if techs is set to 1 */
  157. if (techs == 1)
  158. techs = 0xFFFFFFFF;
  159. if (techs & (1 << SRS_ID_WOWHD))
  160. srs_trumedia_open(port_id, SRS_ID_WOWHD,
  161. (void *)&msm_srs_trumedia_params[param_block_idx].srs_params.wowhd);
  162. if (techs & (1 << SRS_ID_CSHP))
  163. srs_trumedia_open(port_id, SRS_ID_CSHP,
  164. (void *)&msm_srs_trumedia_params[param_block_idx].srs_params.cshp);
  165. if (techs & (1 << SRS_ID_HPF))
  166. srs_trumedia_open(port_id, SRS_ID_HPF,
  167. (void *)&msm_srs_trumedia_params[param_block_idx].srs_params.hpf);
  168. if (techs & (1 << SRS_ID_PEQ))
  169. srs_trumedia_open(port_id, SRS_ID_PEQ,
  170. (void *)&msm_srs_trumedia_params[param_block_idx].srs_params.peq);
  171. if (techs & (1 << SRS_ID_HL))
  172. srs_trumedia_open(port_id, SRS_ID_HL,
  173. (void *)&msm_srs_trumedia_params[param_block_idx].srs_params.hl);
  174. if (techs & (1 << SRS_ID_GLOBAL))
  175. srs_trumedia_open(port_id, SRS_ID_GLOBAL,
  176. (void *)&msm_srs_trumedia_params[param_block_idx].srs_params.global);
  177. }
  178. int get_topology(int path_type)
  179. {
  180. int topology_id = 0;
  181. if (path_type == ADM_PATH_PLAYBACK)
  182. topology_id = get_adm_rx_topology();
  183. else
  184. topology_id = get_adm_tx_topology();
  185. #ifdef CONFIG_SND_SOC_MAXIM_DSM_COPP
  186. if((path_type!=ADM_PATH_PLAYBACK) && (topology_id ==0 || 0x00010315/*AUDIO_TX_MONO_COPP*/)) {
  187. topology_id = ADM_CUSTOM_PP_TX_TOPO_ID_DYNAMIC;
  188. }
  189. #endif
  190. if (topology_id == 0)
  191. topology_id = NULL_COPP_TOPOLOGY;
  192. return topology_id;
  193. }
  194. #define SLIMBUS_EXTPROC_RX AFE_PORT_INVALID
  195. static struct msm_pcm_routing_bdai_data msm_bedais[MSM_BACKEND_DAI_MAX] = {
  196. { PRIMARY_I2S_RX, 0, 0, 0, 0, 0},
  197. { PRIMARY_I2S_TX, 0, 0, 0, 0, 0},
  198. { SLIMBUS_0_RX, 0, 0, 0, 0, 0},
  199. { SLIMBUS_0_TX, 0, 0, 0, 0, 0},
  200. { HDMI_RX, 0, 0, 0, 0, 0},
  201. { INT_BT_SCO_RX, 0, 0, 0, 0, 0},
  202. { INT_BT_SCO_TX, 0, 0, 0, 0, 0},
  203. { INT_FM_RX, 0, 0, 0, 0, 0},
  204. { INT_FM_TX, 0, 0, 0, 0, 0},
  205. { RT_PROXY_PORT_001_RX, 0, 0, 0, 0, 0},
  206. { RT_PROXY_PORT_001_TX, 0, 0, 0, 0, 0},
  207. { AFE_PORT_ID_PRIMARY_PCM_RX, 0, 0, 0, 0, 0},
  208. { AFE_PORT_ID_PRIMARY_PCM_TX, 0, 0, 0, 0, 0},
  209. { VOICE_PLAYBACK_TX, 0, 0, 0, 0, 0},
  210. { VOICE2_PLAYBACK_TX, 0, 0, 0, 0, 0},
  211. { VOICE_RECORD_RX, 0, 0, 0, 0, 0},
  212. { VOICE_RECORD_TX, 0, 0, 0, 0, 0},
  213. { MI2S_RX, 0, 0, 0, 0, 0},
  214. { MI2S_TX, 0, 0, 0, 0},
  215. { SECONDARY_I2S_RX, 0, 0, 0, 0, 0},
  216. { SLIMBUS_1_RX, 0, 0, 0, 0, 0},
  217. { SLIMBUS_1_TX, 0, 0, 0, 0, 0},
  218. { SLIMBUS_4_RX, 0, 0, 0, 0, 0},
  219. { SLIMBUS_4_TX, 0, 0, 0, 0, 0},
  220. { SLIMBUS_3_RX, 0, 0, 0, 0, 0},
  221. { SLIMBUS_3_TX, 0, 0, 0, 0, 0},
  222. { SLIMBUS_5_TX, 0, 0, 0, 0, 0 },
  223. { SLIMBUS_EXTPROC_RX, 0, 0, 0, 0, 0},
  224. { SLIMBUS_EXTPROC_RX, 0, 0, 0, 0, 0},
  225. { SLIMBUS_EXTPROC_RX, 0, 0, 0, 0, 0},
  226. { AFE_PORT_ID_QUATERNARY_MI2S_RX, 0, 0, 0, 0, 0},
  227. { AFE_PORT_ID_QUATERNARY_MI2S_TX, 0, 0, 0, 0, 0},
  228. { AFE_PORT_ID_TERTIARY_MI2S_RX, 0, 0, 0, 0, 0},
  229. { AFE_PORT_ID_TERTIARY_MI2S_TX, 0, 0, 0, 0, 0},
  230. { AFE_PORT_ID_SECONDARY_MI2S_RX, 0, 0, 0, 0, 0},
  231. { AFE_PORT_ID_SECONDARY_MI2S_TX, 0, 0, 0, 0, 0},
  232. { AFE_PORT_ID_PRIMARY_MI2S_RX, 0, 0, 0, 0, 0},
  233. { AFE_PORT_ID_PRIMARY_MI2S_TX, 0, 0, 0, 0, 0},
  234. { AUDIO_PORT_ID_I2S_RX, 0, 0, 0, 0, 0},
  235. { AFE_PORT_ID_SECONDARY_PCM_RX, 0, 0, 0, 0, 0},
  236. { AFE_PORT_ID_SECONDARY_PCM_TX, 0, 0, 0, 0, 0},
  237. };
  238. /* Track ASM playback & capture sessions of DAI */
  239. static struct msm_pcm_routing_fdai_data
  240. fe_dai_map[MSM_FRONTEND_DAI_MM_SIZE][2] = {
  241. /* MULTIMEDIA1 */
  242. {{0, INVALID_SESSION, {NULL, NULL} },
  243. {0, INVALID_SESSION, {NULL, NULL} } },
  244. /* MULTIMEDIA2 */
  245. {{0, INVALID_SESSION, {NULL, NULL} },
  246. {0, INVALID_SESSION, {NULL, NULL} } },
  247. /* MULTIMEDIA3 */
  248. {{0, INVALID_SESSION, {NULL, NULL} },
  249. {0, INVALID_SESSION, {NULL, NULL} } },
  250. /* MULTIMEDIA4 */
  251. {{0, INVALID_SESSION, {NULL, NULL} },
  252. {0, INVALID_SESSION, {NULL, NULL} } },
  253. /* MULTIMEDIA5 */
  254. {{0, INVALID_SESSION, {NULL, NULL} },
  255. {0, INVALID_SESSION, {NULL, NULL} } },
  256. /* MULTIMEDIA6 */
  257. {{0, INVALID_SESSION, {NULL, NULL} },
  258. {0, INVALID_SESSION, {NULL, NULL} } },
  259. /* MULTIMEDIA7*/
  260. {{0, INVALID_SESSION, {NULL, NULL} },
  261. {0, INVALID_SESSION, {NULL, NULL} } },
  262. /* MULTIMEDIA8 */
  263. {{0, INVALID_SESSION, {NULL, NULL} },
  264. {0, INVALID_SESSION, {NULL, NULL} } },
  265. /* MULTIMEDIA9 */
  266. {{0, INVALID_SESSION, {NULL, NULL} },
  267. {0, INVALID_SESSION, {NULL, NULL} } },
  268. #ifdef CONFIG_JACK_AUDIO
  269. /* MULTIMEDIA10 */
  270. {{0, INVALID_SESSION, {NULL, NULL} },
  271. {0, INVALID_SESSION, {NULL, NULL} } },
  272. #endif
  273. };
  274. /* Track performance mode of all front-end multimedia sessions.
  275. * Performance mode is only valid when session is valid.
  276. */
  277. static int fe_dai_perf_mode[MSM_FRONTEND_DAI_MM_SIZE][2];
  278. static uint8_t is_be_dai_extproc(int be_dai)
  279. {
  280. if (be_dai == MSM_BACKEND_DAI_EXTPROC_RX ||
  281. be_dai == MSM_BACKEND_DAI_EXTPROC_TX ||
  282. be_dai == MSM_BACKEND_DAI_EXTPROC_EC_TX)
  283. return 1;
  284. else
  285. return 0;
  286. }
  287. static void msm_pcm_routing_build_matrix(int fedai_id, int dspst_id,
  288. int path_type, int perf_mode)
  289. {
  290. int i, port_type;
  291. struct route_payload payload;
  292. payload.num_copps = 0;
  293. port_type = (path_type == ADM_PATH_PLAYBACK ?
  294. MSM_AFE_PORT_TYPE_RX : MSM_AFE_PORT_TYPE_TX);
  295. for (i = 0; i < MSM_BACKEND_DAI_MAX; i++) {
  296. if (!is_be_dai_extproc(i) &&
  297. (afe_get_port_type(msm_bedais[i].port_id) == port_type) &&
  298. (msm_bedais[i].active) &&
  299. (test_bit(fedai_id, &msm_bedais[i].fe_sessions)))
  300. payload.copp_ids[payload.num_copps++] =
  301. msm_bedais[i].port_id;
  302. }
  303. if (payload.num_copps)
  304. adm_matrix_map(dspst_id, path_type,
  305. payload.num_copps, payload.copp_ids, 0, perf_mode);
  306. }
  307. void msm_pcm_routing_reg_psthr_stream(int fedai_id, int dspst_id,
  308. int stream_type)
  309. {
  310. int i, session_type, path_type, port_type;
  311. u32 mode = 0;
  312. if (fedai_id > MSM_FRONTEND_DAI_MM_MAX_ID) {
  313. /* bad ID assigned in machine driver */
  314. pr_err("%s: bad MM ID\n", __func__);
  315. return;
  316. }
  317. if (stream_type == SNDRV_PCM_STREAM_PLAYBACK) {
  318. session_type = SESSION_TYPE_RX;
  319. path_type = ADM_PATH_PLAYBACK;
  320. port_type = MSM_AFE_PORT_TYPE_RX;
  321. } else {
  322. session_type = SESSION_TYPE_TX;
  323. path_type = ADM_PATH_LIVE_REC;
  324. port_type = MSM_AFE_PORT_TYPE_TX;
  325. }
  326. mutex_lock(&routing_lock);
  327. fe_dai_map[fedai_id][session_type].strm_id = dspst_id;
  328. for (i = 0; i < MSM_BACKEND_DAI_MAX; i++) {
  329. if (!is_be_dai_extproc(i) &&
  330. (afe_get_port_type(msm_bedais[i].port_id) == port_type) &&
  331. (msm_bedais[i].active) &&
  332. (test_bit(fedai_id, &msm_bedais[i].fe_sessions))) {
  333. mode = afe_get_port_type(msm_bedais[i].port_id);
  334. adm_connect_afe_port(mode, dspst_id,
  335. msm_bedais[i].port_id);
  336. break;
  337. }
  338. }
  339. mutex_unlock(&routing_lock);
  340. }
  341. void msm_pcm_routing_reg_phy_stream(int fedai_id, int perf_mode,
  342. int dspst_id, int stream_type)
  343. {
  344. int i, session_type, path_type, port_type, port_id, topology;
  345. struct route_payload payload;
  346. u32 channels;
  347. uint16_t bits_per_sample = 16;
  348. if (fedai_id > MSM_FRONTEND_DAI_MM_MAX_ID) {
  349. /* bad ID assigned in machine driver */
  350. pr_err("%s: bad MM ID %d\n", __func__, fedai_id);
  351. return;
  352. }
  353. if (stream_type == SNDRV_PCM_STREAM_PLAYBACK) {
  354. session_type = SESSION_TYPE_RX;
  355. path_type = ADM_PATH_PLAYBACK;
  356. port_type = MSM_AFE_PORT_TYPE_RX;
  357. } else {
  358. session_type = SESSION_TYPE_TX;
  359. path_type = ADM_PATH_LIVE_REC;
  360. port_type = MSM_AFE_PORT_TYPE_TX;
  361. }
  362. mutex_lock(&routing_lock);
  363. payload.num_copps = 0; /* only RX needs to use payload */
  364. fe_dai_map[fedai_id][session_type].strm_id = dspst_id;
  365. fe_dai_perf_mode[fedai_id][session_type] = perf_mode;
  366. /* re-enable EQ if active */
  367. if (eq_data[fedai_id].enable)
  368. msm_send_eq_values(fedai_id);
  369. topology = get_topology(path_type);
  370. for (i = 0; i < MSM_BACKEND_DAI_MAX; i++) {
  371. if (!is_be_dai_extproc(i) &&
  372. (afe_get_port_type(msm_bedais[i].port_id) == port_type) &&
  373. (msm_bedais[i].active) &&
  374. (test_bit(fedai_id, &msm_bedais[i].fe_sessions))) {
  375. channels = msm_bedais[i].channel;
  376. if (msm_bedais[i].format == SNDRV_PCM_FORMAT_S16_LE)
  377. bits_per_sample = 16;
  378. else if (msm_bedais[i].format ==
  379. SNDRV_PCM_FORMAT_S24_LE)
  380. bits_per_sample = 24;
  381. if (msm_bedais[i].port_id == VOICE_RECORD_RX ||
  382. msm_bedais[i].port_id == VOICE_RECORD_TX)
  383. topology = DEFAULT_COPP_TOPOLOGY;
  384. if ((stream_type == SNDRV_PCM_STREAM_PLAYBACK) &&
  385. (channels > 0))
  386. adm_multi_ch_copp_open(msm_bedais[i].port_id,
  387. path_type,
  388. msm_bedais[i].sample_rate,
  389. msm_bedais[i].channel,
  390. topology, perf_mode,
  391. bits_per_sample);
  392. else
  393. adm_open(msm_bedais[i].port_id,
  394. path_type,
  395. msm_bedais[i].sample_rate,
  396. msm_bedais[i].channel,
  397. topology, perf_mode,
  398. bits_per_sample);
  399. payload.copp_ids[payload.num_copps++] =
  400. msm_bedais[i].port_id;
  401. port_id = srs_port_id = msm_bedais[i].port_id;
  402. srs_send_params(srs_port_id, 1, 0);
  403. if ((DOLBY_ADM_COPP_TOPOLOGY_ID == topology) &&
  404. (perf_mode == LEGACY_PCM_MODE))
  405. if (dolby_dap_init(port_id,
  406. msm_bedais[i].channel) < 0)
  407. pr_err("%s: Err init dolby dap\n",
  408. __func__);
  409. }
  410. }
  411. if (payload.num_copps)
  412. adm_matrix_map(dspst_id, path_type,
  413. payload.num_copps, payload.copp_ids, 0, perf_mode);
  414. mutex_unlock(&routing_lock);
  415. }
  416. void msm_pcm_routing_reg_phy_stream_v2(int fedai_id, bool perf_mode,
  417. int dspst_id, int stream_type,
  418. struct msm_pcm_routing_evt event_info)
  419. {
  420. msm_pcm_routing_reg_phy_stream(fedai_id, perf_mode, dspst_id,
  421. stream_type);
  422. if (stream_type == SNDRV_PCM_STREAM_PLAYBACK)
  423. fe_dai_map[fedai_id][SESSION_TYPE_RX].event_info = event_info;
  424. else
  425. fe_dai_map[fedai_id][SESSION_TYPE_TX].event_info = event_info;
  426. }
  427. void msm_pcm_routing_dereg_phy_stream(int fedai_id, int stream_type)
  428. {
  429. int i, port_type, session_type, path_type, topology;
  430. if (fedai_id > MSM_FRONTEND_DAI_MM_MAX_ID) {
  431. /* bad ID assigned in machine driver */
  432. pr_err("%s: bad MM ID\n", __func__);
  433. return;
  434. }
  435. if (stream_type == SNDRV_PCM_STREAM_PLAYBACK) {
  436. port_type = MSM_AFE_PORT_TYPE_RX;
  437. session_type = SESSION_TYPE_RX;
  438. path_type = ADM_PATH_PLAYBACK;
  439. } else {
  440. port_type = MSM_AFE_PORT_TYPE_TX;
  441. session_type = SESSION_TYPE_TX;
  442. path_type = ADM_PATH_LIVE_REC;
  443. }
  444. mutex_lock(&routing_lock);
  445. topology = get_topology(path_type);
  446. for (i = 0; i < MSM_BACKEND_DAI_MAX; i++) {
  447. if (!is_be_dai_extproc(i) &&
  448. (afe_get_port_type(msm_bedais[i].port_id) == port_type) &&
  449. (msm_bedais[i].active) &&
  450. (test_bit(fedai_id, &msm_bedais[i].fe_sessions))) {
  451. adm_close(msm_bedais[i].port_id,
  452. fe_dai_perf_mode[fedai_id][session_type]);
  453. if ((DOLBY_ADM_COPP_TOPOLOGY_ID == topology) &&
  454. (fe_dai_perf_mode[fedai_id][session_type] ==
  455. LEGACY_PCM_MODE))
  456. dolby_dap_deinit(msm_bedais[i].port_id);
  457. }
  458. }
  459. fe_dai_map[fedai_id][session_type].strm_id = INVALID_SESSION;
  460. fe_dai_map[fedai_id][session_type].be_srate = 0;
  461. mutex_unlock(&routing_lock);
  462. }
  463. /* Check if FE/BE route is set */
  464. static bool msm_pcm_routing_route_is_set(u16 be_id, u16 fe_id)
  465. {
  466. bool rc = false;
  467. if (fe_id > MSM_FRONTEND_DAI_MM_MAX_ID) {
  468. /* recheck FE ID in the mixer control defined in this file */
  469. pr_err("%s: bad MM ID\n", __func__);
  470. return rc;
  471. }
  472. if (test_bit(fe_id, &msm_bedais[be_id].fe_sessions))
  473. rc = true;
  474. return rc;
  475. }
  476. static void msm_pcm_routing_process_audio(u16 reg, u16 val, int set)
  477. {
  478. int session_type, path_type, port_id, topology;
  479. u32 channels;
  480. uint16_t bits_per_sample = 16;
  481. struct msm_pcm_routing_fdai_data *fdai;
  482. pr_debug("%s: reg %x val %x set %x\n", __func__, reg, val, set);
  483. if (val > MSM_FRONTEND_DAI_MM_MAX_ID) {
  484. /* recheck FE ID in the mixer control defined in this file */
  485. pr_err("%s: bad MM ID\n", __func__);
  486. return;
  487. }
  488. if (afe_get_port_type(msm_bedais[reg].port_id) ==
  489. MSM_AFE_PORT_TYPE_RX) {
  490. session_type = SESSION_TYPE_RX;
  491. path_type = ADM_PATH_PLAYBACK;
  492. } else {
  493. session_type = SESSION_TYPE_TX;
  494. path_type = ADM_PATH_LIVE_REC;
  495. }
  496. mutex_lock(&routing_lock);
  497. topology = get_topology(path_type);
  498. if (set) {
  499. if (!test_bit(val, &msm_bedais[reg].fe_sessions) &&
  500. ((msm_bedais[reg].port_id == VOICE_PLAYBACK_TX) ||
  501. (msm_bedais[reg].port_id == VOICE2_PLAYBACK_TX)))
  502. voc_start_playback(set, msm_bedais[reg].port_id);
  503. set_bit(val, &msm_bedais[reg].fe_sessions);
  504. fdai = &fe_dai_map[val][session_type];
  505. if (msm_bedais[reg].active && fdai->strm_id !=
  506. INVALID_SESSION) {
  507. channels = msm_bedais[reg].channel;
  508. if (session_type == SESSION_TYPE_TX &&
  509. fdai->be_srate &&
  510. (fdai->be_srate != msm_bedais[reg].sample_rate)) {
  511. pr_debug("%s: flush strm %d diff BE rates\n",
  512. __func__, fdai->strm_id);
  513. if (fdai->event_info.event_func)
  514. fdai->event_info.event_func(
  515. MSM_PCM_RT_EVT_BUF_RECFG,
  516. fdai->event_info.priv_data);
  517. fdai->be_srate = 0; /* might not need it */
  518. }
  519. if (msm_bedais[reg].format == SNDRV_PCM_FORMAT_S24_LE)
  520. bits_per_sample = 24;
  521. if (msm_bedais[reg].port_id == VOICE_RECORD_RX ||
  522. msm_bedais[reg].port_id == VOICE_RECORD_TX)
  523. topology = DEFAULT_COPP_TOPOLOGY;
  524. if ((session_type == SESSION_TYPE_RX) &&
  525. (channels > 0)) {
  526. adm_multi_ch_copp_open(msm_bedais[reg].port_id,
  527. path_type,
  528. msm_bedais[reg].sample_rate,
  529. channels,
  530. topology,
  531. fe_dai_perf_mode[val][session_type],
  532. bits_per_sample);
  533. } else
  534. adm_open(msm_bedais[reg].port_id,
  535. path_type,
  536. msm_bedais[reg].sample_rate, channels,
  537. topology, false, bits_per_sample);
  538. if (session_type == SESSION_TYPE_RX &&
  539. fdai->event_info.event_func)
  540. fdai->event_info.event_func(
  541. MSM_PCM_RT_EVT_DEVSWITCH,
  542. fdai->event_info.priv_data);
  543. msm_pcm_routing_build_matrix(val,
  544. fdai->strm_id, path_type,
  545. fe_dai_perf_mode[val][session_type]);
  546. port_id = srs_port_id = msm_bedais[reg].port_id;
  547. srs_send_params(srs_port_id, 1, 0);
  548. if ((DOLBY_ADM_COPP_TOPOLOGY_ID == topology) &&
  549. (fe_dai_perf_mode[val][session_type] ==
  550. LEGACY_PCM_MODE))
  551. if (dolby_dap_init(port_id, channels) < 0)
  552. pr_err("%s: Err init dolby dap\n",
  553. __func__);
  554. }
  555. } else {
  556. if (test_bit(val, &msm_bedais[reg].fe_sessions) &&
  557. ((msm_bedais[reg].port_id == VOICE_PLAYBACK_TX) ||
  558. (msm_bedais[reg].port_id == VOICE2_PLAYBACK_TX)))
  559. voc_start_playback(set, msm_bedais[reg].port_id);
  560. clear_bit(val, &msm_bedais[reg].fe_sessions);
  561. fdai = &fe_dai_map[val][session_type];
  562. if (msm_bedais[reg].active && fdai->strm_id !=
  563. INVALID_SESSION) {
  564. adm_close(msm_bedais[reg].port_id,
  565. fe_dai_perf_mode[val][session_type]);
  566. if ((DOLBY_ADM_COPP_TOPOLOGY_ID == topology) &&
  567. (fe_dai_perf_mode[val][session_type] ==
  568. LEGACY_PCM_MODE))
  569. dolby_dap_deinit(msm_bedais[reg].port_id);
  570. msm_pcm_routing_build_matrix(val,
  571. fdai->strm_id, path_type,
  572. fe_dai_perf_mode[val][session_type]);
  573. }
  574. }
  575. if ((msm_bedais[reg].port_id == VOICE_RECORD_RX)
  576. || (msm_bedais[reg].port_id == VOICE_RECORD_TX))
  577. voc_start_record(msm_bedais[reg].port_id, set, voc_session_id);
  578. mutex_unlock(&routing_lock);
  579. }
  580. static int msm_routing_get_audio_mixer(struct snd_kcontrol *kcontrol,
  581. struct snd_ctl_elem_value *ucontrol)
  582. {
  583. struct soc_mixer_control *mc =
  584. (struct soc_mixer_control *)kcontrol->private_value;
  585. if (test_bit(mc->shift, &msm_bedais[mc->reg].fe_sessions))
  586. ucontrol->value.integer.value[0] = 1;
  587. else
  588. ucontrol->value.integer.value[0] = 0;
  589. pr_debug("%s: reg %x shift %x val %ld\n", __func__, mc->reg, mc->shift,
  590. ucontrol->value.integer.value[0]);
  591. return 0;
  592. }
  593. static int msm_routing_put_audio_mixer(struct snd_kcontrol *kcontrol,
  594. struct snd_ctl_elem_value *ucontrol)
  595. {
  596. struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol);
  597. struct snd_soc_dapm_widget *widget = wlist->widgets[0];
  598. struct soc_mixer_control *mc =
  599. (struct soc_mixer_control *)kcontrol->private_value;
  600. if (ucontrol->value.integer.value[0] &&
  601. msm_pcm_routing_route_is_set(mc->reg, mc->shift) == false) {
  602. msm_pcm_routing_process_audio(mc->reg, mc->shift, 1);
  603. snd_soc_dapm_mixer_update_power(widget, kcontrol, 1);
  604. } else if (!ucontrol->value.integer.value[0] &&
  605. msm_pcm_routing_route_is_set(mc->reg, mc->shift) == true) {
  606. msm_pcm_routing_process_audio(mc->reg, mc->shift, 0);
  607. snd_soc_dapm_mixer_update_power(widget, kcontrol, 0);
  608. }
  609. return 1;
  610. }
  611. static void msm_pcm_routing_process_voice(u16 reg, u16 val, int set)
  612. {
  613. u32 session_id = 0;
  614. pr_debug("%s: reg %x val %x set %x\n", __func__, reg, val, set);
  615. if (val == MSM_FRONTEND_DAI_CS_VOICE)
  616. session_id = voc_get_session_id(VOICE_SESSION_NAME);
  617. else if (val == MSM_FRONTEND_DAI_VOLTE)
  618. session_id = voc_get_session_id(VOLTE_SESSION_NAME);
  619. else if (val == MSM_FRONTEND_DAI_VOWLAN)
  620. session_id = voc_get_session_id(VOWLAN_SESSION_NAME);
  621. else if (val == MSM_FRONTEND_DAI_VOICE2)
  622. session_id = voc_get_session_id(VOICE2_SESSION_NAME);
  623. else if (val == MSM_FRONTEND_DAI_QCHAT)
  624. session_id = voc_get_session_id(QCHAT_SESSION_NAME);
  625. else
  626. session_id = voc_get_session_id(VOIP_SESSION_NAME);
  627. pr_debug("%s: FE DAI 0x%x session_id 0x%x\n",
  628. __func__, val, session_id);
  629. mutex_lock(&routing_lock);
  630. if (set)
  631. set_bit(val, &msm_bedais[reg].fe_sessions);
  632. else
  633. clear_bit(val, &msm_bedais[reg].fe_sessions);
  634. if (val == MSM_FRONTEND_DAI_DTMF_RX &&
  635. afe_get_port_type(msm_bedais[reg].port_id) ==
  636. MSM_AFE_PORT_TYPE_RX) {
  637. pr_debug("%s(): set=%d port id=0x%x for dtmf generation\n",
  638. __func__, set, msm_bedais[reg].port_id);
  639. afe_set_dtmf_gen_rx_portid(msm_bedais[reg].port_id, set);
  640. }
  641. mutex_unlock(&routing_lock);
  642. if (afe_get_port_type(msm_bedais[reg].port_id) ==
  643. MSM_AFE_PORT_TYPE_RX) {
  644. voc_set_route_flag(session_id, RX_PATH, set);
  645. if (set) {
  646. voc_set_rxtx_port(session_id,
  647. msm_bedais[reg].port_id, DEV_RX);
  648. if (voc_get_route_flag(session_id, RX_PATH) &&
  649. voc_get_route_flag(session_id, TX_PATH))
  650. voc_enable_device(session_id);
  651. } else {
  652. voc_disable_device(session_id);
  653. }
  654. } else {
  655. voc_set_route_flag(session_id, TX_PATH, set);
  656. if (set) {
  657. voc_set_rxtx_port(session_id,
  658. msm_bedais[reg].port_id, DEV_TX);
  659. if (voc_get_route_flag(session_id, RX_PATH) &&
  660. voc_get_route_flag(session_id, TX_PATH))
  661. voc_enable_device(session_id);
  662. } else {
  663. voc_disable_device(session_id);
  664. }
  665. }
  666. }
  667. static int msm_routing_get_voice_mixer(struct snd_kcontrol *kcontrol,
  668. struct snd_ctl_elem_value *ucontrol)
  669. {
  670. struct soc_mixer_control *mc =
  671. (struct soc_mixer_control *)kcontrol->private_value;
  672. mutex_lock(&routing_lock);
  673. if (test_bit(mc->shift, &msm_bedais[mc->reg].fe_sessions))
  674. ucontrol->value.integer.value[0] = 1;
  675. else
  676. ucontrol->value.integer.value[0] = 0;
  677. mutex_unlock(&routing_lock);
  678. pr_debug("%s: reg %x shift %x val %ld\n", __func__, mc->reg, mc->shift,
  679. ucontrol->value.integer.value[0]);
  680. return 0;
  681. }
  682. static int msm_routing_put_voice_mixer(struct snd_kcontrol *kcontrol,
  683. struct snd_ctl_elem_value *ucontrol)
  684. {
  685. struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol);
  686. struct snd_soc_dapm_widget *widget = wlist->widgets[0];
  687. struct soc_mixer_control *mc =
  688. (struct soc_mixer_control *)kcontrol->private_value;
  689. if (ucontrol->value.integer.value[0]) {
  690. msm_pcm_routing_process_voice(mc->reg, mc->shift, 1);
  691. snd_soc_dapm_mixer_update_power(widget, kcontrol, 1);
  692. } else {
  693. msm_pcm_routing_process_voice(mc->reg, mc->shift, 0);
  694. snd_soc_dapm_mixer_update_power(widget, kcontrol, 0);
  695. }
  696. return 1;
  697. }
  698. static int msm_routing_get_voice_stub_mixer(struct snd_kcontrol *kcontrol,
  699. struct snd_ctl_elem_value *ucontrol)
  700. {
  701. struct soc_mixer_control *mc =
  702. (struct soc_mixer_control *)kcontrol->private_value;
  703. mutex_lock(&routing_lock);
  704. if (test_bit(mc->shift, &msm_bedais[mc->reg].fe_sessions))
  705. ucontrol->value.integer.value[0] = 1;
  706. else
  707. ucontrol->value.integer.value[0] = 0;
  708. mutex_unlock(&routing_lock);
  709. pr_debug("%s: reg %x shift %x val %ld\n", __func__, mc->reg, mc->shift,
  710. ucontrol->value.integer.value[0]);
  711. return 0;
  712. }
  713. static int msm_routing_put_voice_stub_mixer(struct snd_kcontrol *kcontrol,
  714. struct snd_ctl_elem_value *ucontrol)
  715. {
  716. struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol);
  717. struct snd_soc_dapm_widget *widget = wlist->widgets[0];
  718. struct soc_mixer_control *mc =
  719. (struct soc_mixer_control *)kcontrol->private_value;
  720. if (ucontrol->value.integer.value[0]) {
  721. mutex_lock(&routing_lock);
  722. set_bit(mc->shift, &msm_bedais[mc->reg].fe_sessions);
  723. mutex_unlock(&routing_lock);
  724. snd_soc_dapm_mixer_update_power(widget, kcontrol, 1);
  725. } else {
  726. mutex_lock(&routing_lock);
  727. clear_bit(mc->shift, &msm_bedais[mc->reg].fe_sessions);
  728. mutex_unlock(&routing_lock);
  729. snd_soc_dapm_mixer_update_power(widget, kcontrol, 0);
  730. }
  731. pr_debug("%s: reg %x shift %x val %ld\n", __func__, mc->reg, mc->shift,
  732. ucontrol->value.integer.value[0]);
  733. return 1;
  734. }
  735. static int msm_routing_get_switch_mixer(struct snd_kcontrol *kcontrol,
  736. struct snd_ctl_elem_value *ucontrol)
  737. {
  738. ucontrol->value.integer.value[0] = fm_switch_enable;
  739. pr_debug("%s: FM Switch enable %ld\n", __func__,
  740. ucontrol->value.integer.value[0]);
  741. return 0;
  742. }
  743. static int msm_routing_put_switch_mixer(struct snd_kcontrol *kcontrol,
  744. struct snd_ctl_elem_value *ucontrol)
  745. {
  746. struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol);
  747. struct snd_soc_dapm_widget *widget = wlist->widgets[0];
  748. pr_debug("%s: FM Switch enable %ld\n", __func__,
  749. ucontrol->value.integer.value[0]);
  750. if (ucontrol->value.integer.value[0])
  751. snd_soc_dapm_mixer_update_power(widget, kcontrol, 1);
  752. else
  753. snd_soc_dapm_mixer_update_power(widget, kcontrol, 0);
  754. fm_switch_enable = ucontrol->value.integer.value[0];
  755. return 1;
  756. }
  757. static int msm_routing_get_fm_pcmrx_switch_mixer(struct snd_kcontrol *kcontrol,
  758. struct snd_ctl_elem_value *ucontrol)
  759. {
  760. ucontrol->value.integer.value[0] = fm_pcmrx_switch_enable;
  761. pr_debug("%s: FM Switch enable %ld\n", __func__,
  762. ucontrol->value.integer.value[0]);
  763. return 0;
  764. }
  765. static int msm_routing_put_fm_pcmrx_switch_mixer(struct snd_kcontrol *kcontrol,
  766. struct snd_ctl_elem_value *ucontrol)
  767. {
  768. struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol);
  769. struct snd_soc_dapm_widget *widget = wlist->widgets[0];
  770. pr_debug("%s: FM Switch enable %ld\n", __func__,
  771. ucontrol->value.integer.value[0]);
  772. if (ucontrol->value.integer.value[0])
  773. snd_soc_dapm_mixer_update_power(widget, kcontrol, 1);
  774. else
  775. snd_soc_dapm_mixer_update_power(widget, kcontrol, 0);
  776. fm_pcmrx_switch_enable = ucontrol->value.integer.value[0];
  777. return 1;
  778. }
  779. static int msm_routing_lsm_mux_get(struct snd_kcontrol *kcontrol,
  780. struct snd_ctl_elem_value *ucontrol)
  781. {
  782. ucontrol->value.integer.value[0] = lsm_mux_slim_port;
  783. return 0;
  784. }
  785. static int msm_routing_lsm_mux_put(struct snd_kcontrol *kcontrol,
  786. struct snd_ctl_elem_value *ucontrol)
  787. {
  788. struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol);
  789. struct snd_soc_dapm_widget *widget = wlist->widgets[0];
  790. struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
  791. int mux = ucontrol->value.enumerated.item[0];
  792. pr_debug("%s: LSM enable %ld\n", __func__,
  793. ucontrol->value.integer.value[0]);
  794. if (ucontrol->value.integer.value[0]) {
  795. lsm_mux_slim_port = ucontrol->value.integer.value[0];
  796. snd_soc_dapm_mux_update_power(widget, kcontrol, 1, mux, e);
  797. } else {
  798. snd_soc_dapm_mux_update_power(widget, kcontrol, 1, mux, e);
  799. lsm_mux_slim_port = ucontrol->value.integer.value[0];
  800. }
  801. return 0;
  802. }
  803. static int msm_routing_lsm_func_get(struct snd_kcontrol *kcontrol,
  804. struct snd_ctl_elem_value *ucontrol)
  805. {
  806. int i;
  807. u16 port_id;
  808. enum afe_mad_type mad_type;
  809. pr_debug("%s: enter\n", __func__);
  810. for (i = 0; i < ARRAY_SIZE(mad_audio_mux_text); i++)
  811. if (!strncmp(kcontrol->id.name, mad_audio_mux_text[i],
  812. strlen(mad_audio_mux_text[i])))
  813. break;
  814. if (i-- == ARRAY_SIZE(mad_audio_mux_text)) {
  815. WARN(1, "Invalid id name %s\n", kcontrol->id.name);
  816. return -EINVAL;
  817. }
  818. port_id = i * 2 + 1 + SLIMBUS_0_RX;
  819. mad_type = afe_port_get_mad_type(port_id);
  820. pr_debug("%s: port_id 0x%x, mad_type %d\n", __func__, port_id,
  821. mad_type);
  822. switch (mad_type) {
  823. case MAD_HW_NONE:
  824. ucontrol->value.integer.value[0] = MADNONE;
  825. break;
  826. case MAD_HW_AUDIO:
  827. ucontrol->value.integer.value[0] = MADAUDIO;
  828. break;
  829. case MAD_HW_BEACON:
  830. ucontrol->value.integer.value[0] = MADBEACON;
  831. break;
  832. case MAD_HW_ULTRASOUND:
  833. ucontrol->value.integer.value[0] = MADULTRASOUND;
  834. break;
  835. case MAD_SW_AUDIO:
  836. ucontrol->value.integer.value[0] = MADSWAUDIO;
  837. break;
  838. default:
  839. WARN(1, "Unknown\n");
  840. return -EINVAL;
  841. }
  842. return 0;
  843. }
  844. static int msm_routing_lsm_func_put(struct snd_kcontrol *kcontrol,
  845. struct snd_ctl_elem_value *ucontrol)
  846. {
  847. int i;
  848. u16 port_id;
  849. enum afe_mad_type mad_type;
  850. pr_debug("%s: enter\n", __func__);
  851. for (i = 0; i < ARRAY_SIZE(mad_audio_mux_text); i++)
  852. if (!strncmp(kcontrol->id.name, mad_audio_mux_text[i],
  853. strlen(mad_audio_mux_text[i])))
  854. break;
  855. if (i-- == ARRAY_SIZE(mad_audio_mux_text)) {
  856. WARN(1, "Invalid id name %s\n", kcontrol->id.name);
  857. return -EINVAL;
  858. }
  859. port_id = i * 2 + 1 + SLIMBUS_0_RX;
  860. switch (ucontrol->value.integer.value[0]) {
  861. case MADNONE:
  862. mad_type = MAD_HW_NONE;
  863. break;
  864. case MADAUDIO:
  865. mad_type = MAD_HW_AUDIO;
  866. break;
  867. case MADBEACON:
  868. mad_type = MAD_HW_BEACON;
  869. break;
  870. case MADULTRASOUND:
  871. mad_type = MAD_HW_ULTRASOUND;
  872. break;
  873. case MADSWAUDIO:
  874. mad_type = MAD_SW_AUDIO;
  875. break;
  876. default:
  877. WARN(1, "Unknown\n");
  878. return -EINVAL;
  879. }
  880. pr_debug("%s: port_id 0x%x, mad_type %d\n", __func__, port_id,
  881. mad_type);
  882. return afe_port_set_mad_type(port_id, mad_type);
  883. }
  884. static int msm_routing_slim_0_rx_aanc_mux_get(struct snd_kcontrol *kcontrol,
  885. struct snd_ctl_elem_value *ucontrol)
  886. {
  887. mutex_lock(&routing_lock);
  888. ucontrol->value.integer.value[0] = slim0_rx_aanc_fb_port;
  889. mutex_unlock(&routing_lock);
  890. pr_debug("%s: AANC Mux Port %ld\n", __func__,
  891. ucontrol->value.integer.value[0]);
  892. return 0;
  893. };
  894. static int msm_routing_slim_0_rx_aanc_mux_put(struct snd_kcontrol *kcontrol,
  895. struct snd_ctl_elem_value *ucontrol)
  896. {
  897. struct aanc_data aanc_info;
  898. mutex_lock(&routing_lock);
  899. memset(&aanc_info, 0x00, sizeof(aanc_info));
  900. pr_debug("%s: AANC Mux Port %ld\n", __func__,
  901. ucontrol->value.integer.value[0]);
  902. slim0_rx_aanc_fb_port = ucontrol->value.integer.value[0];
  903. if (ucontrol->value.integer.value[0] == 0) {
  904. aanc_info.aanc_active = false;
  905. aanc_info.aanc_tx_port = 0;
  906. aanc_info.aanc_rx_port = 0;
  907. } else {
  908. aanc_info.aanc_active = true;
  909. aanc_info.aanc_rx_port = SLIMBUS_0_RX;
  910. aanc_info.aanc_tx_port =
  911. (SLIMBUS_0_RX - 1 + (slim0_rx_aanc_fb_port * 2));
  912. }
  913. afe_set_aanc_info(&aanc_info);
  914. mutex_unlock(&routing_lock);
  915. return 0;
  916. };
  917. static int msm_routing_get_port_mixer(struct snd_kcontrol *kcontrol,
  918. struct snd_ctl_elem_value *ucontrol)
  919. {
  920. struct soc_mixer_control *mc =
  921. (struct soc_mixer_control *)kcontrol->private_value;
  922. if (test_bit(mc->shift,
  923. (unsigned long *)&msm_bedais[mc->reg].port_sessions))
  924. ucontrol->value.integer.value[0] = 1;
  925. else
  926. ucontrol->value.integer.value[0] = 0;
  927. pr_debug("%s: reg %x shift %x val %ld\n", __func__, mc->reg, mc->shift,
  928. ucontrol->value.integer.value[0]);
  929. return 0;
  930. }
  931. static int msm_routing_put_port_mixer(struct snd_kcontrol *kcontrol,
  932. struct snd_ctl_elem_value *ucontrol)
  933. {
  934. struct soc_mixer_control *mc =
  935. (struct soc_mixer_control *)kcontrol->private_value;
  936. pr_debug("%s: reg 0x%x shift 0x%x val %ld\n", __func__, mc->reg,
  937. mc->shift, ucontrol->value.integer.value[0]);
  938. if (ucontrol->value.integer.value[0]) {
  939. afe_loopback(1, msm_bedais[mc->reg].port_id,
  940. msm_bedais[mc->shift].port_id);
  941. set_bit(mc->shift,
  942. (unsigned long *)&msm_bedais[mc->reg].port_sessions);
  943. } else {
  944. afe_loopback(0, msm_bedais[mc->reg].port_id,
  945. msm_bedais[mc->shift].port_id);
  946. clear_bit(mc->shift,
  947. (unsigned long *)&msm_bedais[mc->reg].port_sessions);
  948. }
  949. return 1;
  950. }
  951. static int msm_routing_get_fm_vol_mixer(struct snd_kcontrol *kcontrol,
  952. struct snd_ctl_elem_value *ucontrol)
  953. {
  954. ucontrol->value.integer.value[0] = msm_route_fm_vol_control;
  955. return 0;
  956. }
  957. static int msm_routing_set_fm_vol_mixer(struct snd_kcontrol *kcontrol,
  958. struct snd_ctl_elem_value *ucontrol)
  959. {
  960. afe_loopback_gain(INT_FM_TX , ucontrol->value.integer.value[0]);
  961. msm_route_fm_vol_control = ucontrol->value.integer.value[0];
  962. return 0;
  963. }
  964. static int msm_routing_get_hfp_vol_mixer(struct snd_kcontrol *kcontrol,
  965. struct snd_ctl_elem_value *ucontrol)
  966. {
  967. ucontrol->value.integer.value[0] = msm_route_hfp_vol_control;
  968. return 0;
  969. }
  970. static int msm_routing_set_hfp_vol_mixer(struct snd_kcontrol *kcontrol,
  971. struct snd_ctl_elem_value *ucontrol)
  972. {
  973. afe_loopback_gain(INT_BT_SCO_TX , ucontrol->value.integer.value[0]);
  974. msm_route_hfp_vol_control = ucontrol->value.integer.value[0];
  975. return 0;
  976. }
  977. static int msm_routing_get_multimedia2_vol_mixer(struct snd_kcontrol *kcontrol,
  978. struct snd_ctl_elem_value *ucontrol)
  979. {
  980. ucontrol->value.integer.value[0] = msm_route_multimedia2_vol_control;
  981. return 0;
  982. }
  983. static int msm_routing_get_multimedia5_vol_mixer(struct snd_kcontrol *kcontrol,
  984. struct snd_ctl_elem_value *ucontrol)
  985. {
  986. ucontrol->value.integer.value[0] = msm_route_multimedia5_vol_control;
  987. return 0;
  988. }
  989. static int msm_routing_set_multimedia5_vol_mixer(struct snd_kcontrol *kcontrol,
  990. struct snd_ctl_elem_value *ucontrol)
  991. {
  992. if (!multi_ch_pcm_set_volume(ucontrol->value.integer.value[0]))
  993. msm_route_multimedia5_vol_control =
  994. ucontrol->value.integer.value[0];
  995. return 0;
  996. }
  997. static int msm_routing_set_multimedia2_vol_mixer(struct snd_kcontrol *kcontrol,
  998. struct snd_ctl_elem_value *ucontrol)
  999. {
  1000. if (!multi_ch_pcm_set_volume(ucontrol->value.integer.value[0]))
  1001. msm_route_multimedia2_vol_control =
  1002. ucontrol->value.integer.value[0];
  1003. return 0;
  1004. }
  1005. static int msm_routing_get_channel_map_mixer(struct snd_kcontrol *kcontrol,
  1006. struct snd_ctl_elem_value *ucontrol)
  1007. {
  1008. char channel_map[PCM_FORMAT_MAX_NUM_CHANNEL] = {0};
  1009. int i;
  1010. adm_get_multi_ch_map(channel_map);
  1011. for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL; i++)
  1012. ucontrol->value.integer.value[i] = (unsigned) channel_map[i];
  1013. return 0;
  1014. }
  1015. static int msm_routing_put_channel_map_mixer(struct snd_kcontrol *kcontrol,
  1016. struct snd_ctl_elem_value *ucontrol)
  1017. {
  1018. char channel_map[PCM_FORMAT_MAX_NUM_CHANNEL];
  1019. int i;
  1020. for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL; i++)
  1021. channel_map[i] = (char)(ucontrol->value.integer.value[i]);
  1022. adm_set_multi_ch_map(channel_map);
  1023. return 0;
  1024. }
  1025. static int msm_routing_get_srs_trumedia_control(struct snd_kcontrol *kcontrol,
  1026. struct snd_ctl_elem_value *ucontrol)
  1027. {
  1028. ucontrol->value.integer.value[0] = 0;
  1029. return 0;
  1030. }
  1031. static int msm_routing_set_srs_trumedia_control_(struct snd_kcontrol *kcontrol,
  1032. struct snd_ctl_elem_value *ucontrol)
  1033. {
  1034. unsigned int techs = 0;
  1035. unsigned short offset, value, max, index;
  1036. srs_alsa_ctrl_ever_called = 1;
  1037. max = sizeof(msm_srs_trumedia_params) >> 1;
  1038. index = (unsigned short)((ucontrol->value.integer.value[0] &
  1039. SRS_PARAM_INDEX_MASK) >> 31);
  1040. if (SRS_CMD_UPLOAD ==
  1041. (ucontrol->value.integer.value[0] & SRS_CMD_UPLOAD)) {
  1042. techs = ucontrol->value.integer.value[0] & 0xFF;
  1043. pr_debug("SRS %s: send params request, flags = %u",
  1044. __func__, techs);
  1045. if (srs_port_id >= 0 && techs)
  1046. srs_send_params(srs_port_id, techs, index);
  1047. return 0;
  1048. }
  1049. offset = (unsigned short)((ucontrol->value.integer.value[0] &
  1050. SRS_PARAM_OFFSET_MASK) >> 16);
  1051. value = (unsigned short)(ucontrol->value.integer.value[0] &
  1052. SRS_PARAM_VALUE_MASK);
  1053. if ((offset < max) && (index < SRS_TRUMEDIA_INDEX)) {
  1054. msm_srs_trumedia_params[index].raw_params[offset] = value;
  1055. pr_debug("SRS %s: index set... (max %d, requested %d, val %d, paramblockidx %d)",
  1056. __func__, max, offset, value, index);
  1057. } else {
  1058. pr_err("SRS %s: index out of bounds! (max %d, requested %d)",
  1059. __func__, max, offset);
  1060. }
  1061. if (offset == 4) {
  1062. int i;
  1063. for (i = 0; i < max; i++) {
  1064. if (i == 0) {
  1065. pr_debug("SRS %s: global block start",
  1066. __func__);
  1067. }
  1068. if (i ==
  1069. (sizeof(struct srs_trumedia_params_GLOBAL) >> 1)) {
  1070. pr_debug("SRS %s: wowhd block start at offset %d word offset %d",
  1071. __func__, i, i>>1);
  1072. break;
  1073. }
  1074. pr_debug("SRS %s: param_index %d index %d val %d",
  1075. __func__, index, i,
  1076. msm_srs_trumedia_params[index].raw_params[i]);
  1077. }
  1078. }
  1079. return 0;
  1080. }
  1081. static int msm_routing_set_srs_trumedia_control(struct snd_kcontrol *kcontrol,
  1082. struct snd_ctl_elem_value *ucontrol) {
  1083. int ret;
  1084. pr_debug("SRS control normal called");
  1085. mutex_lock(&routing_lock);
  1086. srs_port_id = SLIMBUS_0_RX;
  1087. ret = msm_routing_set_srs_trumedia_control_(kcontrol, ucontrol);
  1088. mutex_unlock(&routing_lock);
  1089. return ret;
  1090. }
  1091. static int msm_routing_set_srs_trumedia_control_I2S(
  1092. struct snd_kcontrol *kcontrol,
  1093. struct snd_ctl_elem_value *ucontrol) {
  1094. int ret;
  1095. pr_debug("SRS control I2S called");
  1096. mutex_lock(&routing_lock);
  1097. srs_port_id = PRIMARY_I2S_RX;
  1098. ret = msm_routing_set_srs_trumedia_control_(kcontrol, ucontrol);
  1099. mutex_unlock(&routing_lock);
  1100. return ret;
  1101. }
  1102. static int msm_routing_set_srs_trumedia_control_HDMI(
  1103. struct snd_kcontrol *kcontrol,
  1104. struct snd_ctl_elem_value *ucontrol) {
  1105. int ret;
  1106. pr_debug("SRS control HDMI called");
  1107. mutex_lock(&routing_lock);
  1108. srs_port_id = HDMI_RX;
  1109. ret = msm_routing_set_srs_trumedia_control_(kcontrol, ucontrol);
  1110. mutex_unlock(&routing_lock);
  1111. return ret;
  1112. }
  1113. static void msm_send_eq_values(int eq_idx)
  1114. {
  1115. int result;
  1116. struct audio_client *ac = q6asm_get_audio_client(
  1117. fe_dai_map[eq_idx][SESSION_TYPE_RX].strm_id);
  1118. if (ac == NULL) {
  1119. pr_err("%s: Could not get audio client for session: %d\n",
  1120. __func__, fe_dai_map[eq_idx][SESSION_TYPE_RX].strm_id);
  1121. goto done;
  1122. }
  1123. result = q6asm_equalizer(ac, &eq_data[eq_idx]);
  1124. if (result < 0)
  1125. pr_err("%s: Call to ASM equalizer failed, returned = %d\n",
  1126. __func__, result);
  1127. done:
  1128. return;
  1129. }
  1130. static int msm_routing_get_eq_enable_mixer(struct snd_kcontrol *kcontrol,
  1131. struct snd_ctl_elem_value *ucontrol)
  1132. {
  1133. int eq_idx = ((struct soc_multi_mixer_control *)
  1134. kcontrol->private_value)->reg;
  1135. ucontrol->value.integer.value[0] = eq_data[eq_idx].enable;
  1136. pr_debug("%s: EQ #%d enable %d\n", __func__,
  1137. eq_idx, eq_data[eq_idx].enable);
  1138. return 0;
  1139. }
  1140. static int msm_routing_put_eq_enable_mixer(struct snd_kcontrol *kcontrol,
  1141. struct snd_ctl_elem_value *ucontrol)
  1142. {
  1143. int eq_idx = ((struct soc_multi_mixer_control *)
  1144. kcontrol->private_value)->reg;
  1145. int value = ucontrol->value.integer.value[0];
  1146. pr_debug("%s: EQ #%d enable %d\n", __func__,
  1147. eq_idx, value);
  1148. eq_data[eq_idx].enable = value;
  1149. msm_send_eq_values(eq_idx);
  1150. return 0;
  1151. }
  1152. static int msm_routing_get_eq_band_count_audio_mixer(
  1153. struct snd_kcontrol *kcontrol,
  1154. struct snd_ctl_elem_value *ucontrol)
  1155. {
  1156. int eq_idx = ((struct soc_multi_mixer_control *)
  1157. kcontrol->private_value)->reg;
  1158. ucontrol->value.integer.value[0] = eq_data[eq_idx].num_bands;
  1159. pr_debug("%s: EQ #%d bands %d\n", __func__,
  1160. eq_idx, eq_data[eq_idx].num_bands);
  1161. return eq_data[eq_idx].num_bands;
  1162. }
  1163. static int msm_routing_put_eq_band_count_audio_mixer(
  1164. struct snd_kcontrol *kcontrol,
  1165. struct snd_ctl_elem_value *ucontrol)
  1166. {
  1167. int eq_idx = ((struct soc_multi_mixer_control *)
  1168. kcontrol->private_value)->reg;
  1169. int value = ucontrol->value.integer.value[0];
  1170. pr_debug("%s: EQ #%d bands %d\n", __func__,
  1171. eq_idx, value);
  1172. eq_data[eq_idx].num_bands = value;
  1173. return 0;
  1174. }
  1175. static int msm_routing_get_eq_band_audio_mixer(struct snd_kcontrol *kcontrol,
  1176. struct snd_ctl_elem_value *ucontrol)
  1177. {
  1178. int eq_idx = ((struct soc_multi_mixer_control *)
  1179. kcontrol->private_value)->reg;
  1180. int band_idx = ((struct soc_multi_mixer_control *)
  1181. kcontrol->private_value)->shift;
  1182. ucontrol->value.integer.value[0] =
  1183. eq_data[eq_idx].eq_bands[band_idx].band_idx;
  1184. ucontrol->value.integer.value[1] =
  1185. eq_data[eq_idx].eq_bands[band_idx].filter_type;
  1186. ucontrol->value.integer.value[2] =
  1187. eq_data[eq_idx].eq_bands[band_idx].center_freq_hz;
  1188. ucontrol->value.integer.value[3] =
  1189. eq_data[eq_idx].eq_bands[band_idx].filter_gain;
  1190. ucontrol->value.integer.value[4] =
  1191. eq_data[eq_idx].eq_bands[band_idx].q_factor;
  1192. pr_debug("%s: band_idx = %d\n", __func__,
  1193. eq_data[eq_idx].eq_bands[band_idx].band_idx);
  1194. pr_debug("%s: filter_type = %d\n", __func__,
  1195. eq_data[eq_idx].eq_bands[band_idx].filter_type);
  1196. pr_debug("%s: center_freq_hz = %d\n", __func__,
  1197. eq_data[eq_idx].eq_bands[band_idx].center_freq_hz);
  1198. pr_debug("%s: filter_gain = %d\n", __func__,
  1199. eq_data[eq_idx].eq_bands[band_idx].filter_gain);
  1200. pr_debug("%s: q_factor = %d\n", __func__,
  1201. eq_data[eq_idx].eq_bands[band_idx].q_factor);
  1202. return 0;
  1203. }
  1204. static int msm_routing_put_eq_band_audio_mixer(struct snd_kcontrol *kcontrol,
  1205. struct snd_ctl_elem_value *ucontrol)
  1206. {
  1207. int eq_idx = ((struct soc_multi_mixer_control *)
  1208. kcontrol->private_value)->reg;
  1209. int band_idx = ((struct soc_multi_mixer_control *)
  1210. kcontrol->private_value)->shift;
  1211. eq_data[eq_idx].eq_bands[band_idx].band_idx =
  1212. ucontrol->value.integer.value[0];
  1213. eq_data[eq_idx].eq_bands[band_idx].filter_type =
  1214. ucontrol->value.integer.value[1];
  1215. eq_data[eq_idx].eq_bands[band_idx].center_freq_hz =
  1216. ucontrol->value.integer.value[2];
  1217. eq_data[eq_idx].eq_bands[band_idx].filter_gain =
  1218. ucontrol->value.integer.value[3];
  1219. eq_data[eq_idx].eq_bands[band_idx].q_factor =
  1220. ucontrol->value.integer.value[4];
  1221. return 0;
  1222. }
  1223. static int msm_sec_sa_get(struct snd_kcontrol *kcontrol,
  1224. struct snd_ctl_elem_value *ucontrol)
  1225. {
  1226. return 0;
  1227. }
  1228. static int msm_sec_vsp_get(struct snd_kcontrol *kcontrol,
  1229. struct snd_ctl_elem_value *ucontrol)
  1230. {
  1231. return 0;
  1232. }
  1233. static int msm_sec_dha_get(struct snd_kcontrol *kcontrol,
  1234. struct snd_ctl_elem_value *ucontrol)
  1235. {
  1236. return 0;
  1237. }
  1238. static int msm_sec_sa_ep_get(struct snd_kcontrol *kcontrol,
  1239. struct snd_ctl_elem_value *ucontrol)
  1240. {
  1241. struct audio_client *ac;
  1242. mutex_lock(&routing_lock);
  1243. ac = q6asm_get_audio_client(fe_dai_map[3][SESSION_TYPE_RX].strm_id);
  1244. pr_info("%s: sa_ep ret=%d score=%d", __func__, q6asm_get_sa_ep(ac), score);
  1245. ucontrol->value.integer.value[0] = score;
  1246. mutex_unlock(&routing_lock);
  1247. return 0;
  1248. }
  1249. static int msm_sec_lrsm_get(struct snd_kcontrol *kcontrol,
  1250. struct snd_ctl_elem_value *ucontrol)
  1251. {
  1252. return 0;
  1253. }
  1254. static int msm_sec_msp_get(struct snd_kcontrol *kcontrol,
  1255. struct snd_ctl_elem_value *ucontrol)
  1256. {
  1257. return 0;
  1258. }
  1259. static int msm_sec_sa_put(struct snd_kcontrol *kcontrol,
  1260. struct snd_ctl_elem_value *ucontrol)
  1261. {
  1262. int ret = 0;
  1263. struct audio_client *ac;
  1264. mutex_lock(&routing_lock);
  1265. ac = q6asm_get_audio_client(fe_dai_map[3][SESSION_TYPE_RX].strm_id);
  1266. ret = q6asm_set_sa(ac,(int*)ucontrol->value.integer.value);
  1267. mutex_unlock(&routing_lock);
  1268. return ret;
  1269. }
  1270. static int msm_sec_vsp_put(struct snd_kcontrol *kcontrol,
  1271. struct snd_ctl_elem_value *ucontrol)
  1272. {
  1273. int ret = 0;
  1274. struct audio_client *ac;
  1275. mutex_lock(&routing_lock);
  1276. ac = q6asm_get_audio_client(fe_dai_map[3][SESSION_TYPE_RX].strm_id);
  1277. ret = q6asm_set_vsp(ac,(int*)ucontrol->value.integer.value);
  1278. mutex_unlock(&routing_lock);
  1279. return ret;
  1280. }
  1281. static int msm_sec_dha_put(struct snd_kcontrol *kcontrol,
  1282. struct snd_ctl_elem_value *ucontrol)
  1283. {
  1284. int ret = 0;
  1285. struct audio_client *ac;
  1286. mutex_lock(&routing_lock);
  1287. ac = q6asm_get_audio_client(fe_dai_map[3][SESSION_TYPE_RX].strm_id);
  1288. ret = q6asm_set_dha(ac,(int*)ucontrol->value.integer.value);
  1289. mutex_unlock(&routing_lock);
  1290. return ret;
  1291. }
  1292. static int msm_sec_lrsm_put(struct snd_kcontrol *kcontrol,
  1293. struct snd_ctl_elem_value *ucontrol)
  1294. {
  1295. int ret = 0;
  1296. struct audio_client *ac;
  1297. mutex_lock(&routing_lock);
  1298. ac = q6asm_get_audio_client(fe_dai_map[3][SESSION_TYPE_RX].strm_id);
  1299. ret = q6asm_set_lrsm(ac,(int*)ucontrol->value.integer.value);
  1300. mutex_unlock(&routing_lock);
  1301. return ret;
  1302. }
  1303. static int msm_sec_sa_ep_put(struct snd_kcontrol *kcontrol,
  1304. struct snd_ctl_elem_value *ucontrol)
  1305. {
  1306. int ret = 0;
  1307. struct audio_client *ac;
  1308. mutex_lock(&routing_lock);
  1309. ac = q6asm_get_audio_client(fe_dai_map[3][SESSION_TYPE_RX].strm_id);
  1310. ret = q6asm_set_sa_ep(ac,(int*)ucontrol->value.integer.value);
  1311. mutex_unlock(&routing_lock);
  1312. return ret;
  1313. }
  1314. static int msm_sec_msp_put(struct snd_kcontrol *kcontrol,
  1315. struct snd_ctl_elem_value *ucontrol)
  1316. {
  1317. int ret = 0;
  1318. struct audio_client *ac;
  1319. mutex_lock(&routing_lock);
  1320. ac = q6asm_get_audio_client(fe_dai_map[3][SESSION_TYPE_RX].strm_id);
  1321. ret = q6asm_set_msp(ac, (long*)ucontrol->value.integer.value);
  1322. mutex_unlock(&routing_lock);
  1323. return ret;
  1324. }
  1325. static int msm_routing_ec_ref_rx_get(struct snd_kcontrol *kcontrol,
  1326. struct snd_ctl_elem_value *ucontrol)
  1327. {
  1328. pr_debug("%s: ec_ref_rx = %d", __func__, msm_route_ec_ref_rx);
  1329. ucontrol->value.integer.value[0] = msm_route_ec_ref_rx;
  1330. return 0;
  1331. }
  1332. static int msm_routing_ec_ref_rx_put(struct snd_kcontrol *kcontrol,
  1333. struct snd_ctl_elem_value *ucontrol)
  1334. {
  1335. int ec_ref_port_id;
  1336. struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol);
  1337. struct snd_soc_dapm_widget *widget = wlist->widgets[0];
  1338. int mux = ucontrol->value.enumerated.item[0];
  1339. struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
  1340. if (mux >= e->max) {
  1341. pr_err("%s: Invalid mux value %d\n", __func__, mux);
  1342. return -EINVAL;
  1343. }
  1344. mutex_lock(&routing_lock);
  1345. switch (ucontrol->value.integer.value[0]) {
  1346. case 0:
  1347. msm_route_ec_ref_rx = 0;
  1348. ec_ref_port_id = AFE_PORT_INVALID;
  1349. break;
  1350. case 1:
  1351. msm_route_ec_ref_rx = 1;
  1352. ec_ref_port_id = SLIMBUS_0_RX;
  1353. break;
  1354. case 2:
  1355. msm_route_ec_ref_rx = 2;
  1356. ec_ref_port_id = AFE_PORT_ID_PRIMARY_MI2S_RX;
  1357. break;
  1358. case 3:
  1359. msm_route_ec_ref_rx = 3;
  1360. ec_ref_port_id = AFE_PORT_ID_PRIMARY_MI2S_TX;
  1361. break;
  1362. case 4:
  1363. msm_route_ec_ref_rx = 4;
  1364. ec_ref_port_id = AFE_PORT_ID_SECONDARY_MI2S_TX;
  1365. break;
  1366. case 5:
  1367. msm_route_ec_ref_rx = 5;
  1368. ec_ref_port_id = AFE_PORT_ID_TERTIARY_MI2S_TX;
  1369. break;
  1370. case 6:
  1371. msm_route_ec_ref_rx = 6;
  1372. ec_ref_port_id = AFE_PORT_ID_QUATERNARY_MI2S_TX;
  1373. break;
  1374. default:
  1375. msm_route_ec_ref_rx = 0; /* NONE */
  1376. pr_err("%s EC ref rx %ld not valid\n",
  1377. __func__, ucontrol->value.integer.value[0]);
  1378. ec_ref_port_id = AFE_PORT_INVALID;
  1379. break;
  1380. }
  1381. adm_ec_ref_rx_id(ec_ref_port_id);
  1382. pr_debug("%s: msm_route_ec_ref_rx = %d\n",
  1383. __func__, msm_route_ec_ref_rx);
  1384. mutex_unlock(&routing_lock);
  1385. snd_soc_dapm_mux_update_power(widget, kcontrol, 1, mux, e);
  1386. return 0;
  1387. }
  1388. static const char *const ec_ref_rx[] = { "None", "SLIM_RX", "I2S_RX",
  1389. "PRI_MI2S_TX",
  1390. "SEC_MI2S_TX", "TERT_MI2S_TX", "QUAT_MI2S_TX", "PROXY_RX"};
  1391. static const struct soc_enum msm_route_ec_ref_rx_enum[] = {
  1392. SOC_ENUM_SINGLE_EXT(8, ec_ref_rx),
  1393. };
  1394. static const struct snd_kcontrol_new ext_ec_ref_mux_ul1 =
  1395. SOC_DAPM_ENUM_EXT("AUDIO_REF_EC_UL1 MUX Mux",
  1396. msm_route_ec_ref_rx_enum[0],
  1397. msm_routing_ec_ref_rx_get, msm_routing_ec_ref_rx_put);
  1398. static const struct snd_kcontrol_new ext_ec_ref_mux_ul2 =
  1399. SOC_DAPM_ENUM_EXT("AUDIO_REF_EC_UL2 MUX Mux",
  1400. msm_route_ec_ref_rx_enum[0],
  1401. msm_routing_ec_ref_rx_get, msm_routing_ec_ref_rx_put);
  1402. static const struct snd_kcontrol_new ext_ec_ref_mux_ul4 =
  1403. SOC_DAPM_ENUM_EXT("AUDIO_REF_EC_UL4 MUX Mux",
  1404. msm_route_ec_ref_rx_enum[0],
  1405. msm_routing_ec_ref_rx_get, msm_routing_ec_ref_rx_put);
  1406. static const struct snd_kcontrol_new ext_ec_ref_mux_ul5 =
  1407. SOC_DAPM_ENUM_EXT("AUDIO_REF_EC_UL5 MUX Mux",
  1408. msm_route_ec_ref_rx_enum[0],
  1409. msm_routing_ec_ref_rx_get, msm_routing_ec_ref_rx_put);
  1410. static const struct snd_kcontrol_new ext_ec_ref_mux_ul6 =
  1411. SOC_DAPM_ENUM_EXT("AUDIO_REF_EC_UL6 MUX Mux",
  1412. msm_route_ec_ref_rx_enum[0],
  1413. msm_routing_ec_ref_rx_get, msm_routing_ec_ref_rx_put);
  1414. static const struct snd_kcontrol_new ext_ec_ref_mux_ul8 =
  1415. SOC_DAPM_ENUM_EXT("AUDIO_REF_EC_UL8 MUX Mux",
  1416. msm_route_ec_ref_rx_enum[0],
  1417. msm_routing_ec_ref_rx_get, msm_routing_ec_ref_rx_put);
  1418. static const struct snd_kcontrol_new ext_ec_ref_mux_ul9 =
  1419. SOC_DAPM_ENUM_EXT("AUDIO_REF_EC_UL9 MUX Mux",
  1420. msm_route_ec_ref_rx_enum[0],
  1421. msm_routing_ec_ref_rx_get, msm_routing_ec_ref_rx_put);
  1422. static int msm_routing_ext_ec_get(struct snd_kcontrol *kcontrol,
  1423. struct snd_ctl_elem_value *ucontrol)
  1424. {
  1425. pr_debug("%s: ext_ec_ref_rx = %x\n", __func__, msm_route_ext_ec_ref);
  1426. mutex_lock(&routing_lock);
  1427. ucontrol->value.integer.value[0] = msm_route_ext_ec_ref;
  1428. mutex_unlock(&routing_lock);
  1429. return 0;
  1430. }
  1431. static int msm_routing_ext_ec_put(struct snd_kcontrol *kcontrol,
  1432. struct snd_ctl_elem_value *ucontrol)
  1433. {
  1434. struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol);
  1435. struct snd_soc_dapm_widget *widget = wlist->widgets[0];
  1436. int mux = ucontrol->value.enumerated.item[0];
  1437. struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
  1438. int ret = 0;
  1439. bool state = false;
  1440. pr_debug("%s: msm_route_ec_ref_rx = %d value = %ld\n",
  1441. __func__, msm_route_ext_ec_ref,
  1442. ucontrol->value.integer.value[0]);
  1443. if (mux >= e->max) {
  1444. pr_err("%s: Invalid mux value %d\n", __func__, mux);
  1445. return -EINVAL;
  1446. }
  1447. mutex_lock(&routing_lock);
  1448. switch (ucontrol->value.integer.value[0]) {
  1449. case EC_PORT_ID_PRIMARY_MI2S_TX:
  1450. msm_route_ext_ec_ref = AFE_PORT_ID_PRIMARY_MI2S_TX;
  1451. state = true;
  1452. break;
  1453. case EC_PORT_ID_SECONDARY_MI2S_TX:
  1454. msm_route_ext_ec_ref = AFE_PORT_ID_SECONDARY_MI2S_TX;
  1455. state = true;
  1456. break;
  1457. case EC_PORT_ID_TERTIARY_MI2S_TX:
  1458. msm_route_ext_ec_ref = AFE_PORT_ID_TERTIARY_MI2S_TX;
  1459. state = true;
  1460. break;
  1461. case EC_PORT_ID_QUATERNARY_MI2S_TX:
  1462. msm_route_ext_ec_ref = AFE_PORT_ID_QUATERNARY_MI2S_TX;
  1463. state = true;
  1464. break;
  1465. default:
  1466. msm_route_ext_ec_ref = AFE_PORT_INVALID;
  1467. break;
  1468. }
  1469. if (!voc_set_ext_ec_ref(msm_route_ext_ec_ref, state)) {
  1470. mutex_unlock(&routing_lock);
  1471. snd_soc_dapm_mux_update_power(widget, kcontrol, 1, mux, e);
  1472. } else {
  1473. ret = -EINVAL;
  1474. mutex_unlock(&routing_lock);
  1475. }
  1476. return ret;
  1477. }
  1478. static const char * const ext_ec_ref_rx[] = {"NONE", "PRI_MI2S_TX",
  1479. "SEC_MI2S_TX", "TERT_MI2S_TX",
  1480. "QUAT_MI2S_TX"};
  1481. static const struct soc_enum msm_route_ext_ec_ref_rx_enum[] = {
  1482. SOC_ENUM_SINGLE_EXT(5, ext_ec_ref_rx),
  1483. };
  1484. static const struct snd_kcontrol_new voc_ext_ec_mux =
  1485. SOC_DAPM_ENUM_EXT("VOC_EXT_EC MUX Mux", msm_route_ext_ec_ref_rx_enum[0],
  1486. msm_routing_ext_ec_get, msm_routing_ext_ec_put);
  1487. static const struct snd_kcontrol_new pri_i2s_rx_mixer_controls[] = {
  1488. SOC_SINGLE_EXT("MultiMedia1", MSM_BACKEND_DAI_PRI_I2S_RX ,
  1489. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1490. msm_routing_put_audio_mixer),
  1491. SOC_SINGLE_EXT("MultiMedia2", MSM_BACKEND_DAI_PRI_I2S_RX,
  1492. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1493. msm_routing_put_audio_mixer),
  1494. SOC_SINGLE_EXT("MultiMedia3", MSM_BACKEND_DAI_PRI_I2S_RX,
  1495. MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
  1496. msm_routing_put_audio_mixer),
  1497. SOC_SINGLE_EXT("MultiMedia4", MSM_BACKEND_DAI_PRI_I2S_RX,
  1498. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  1499. msm_routing_put_audio_mixer),
  1500. SOC_SINGLE_EXT("MultiMedia5", MSM_BACKEND_DAI_PRI_I2S_RX,
  1501. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  1502. msm_routing_put_audio_mixer),
  1503. SOC_SINGLE_EXT("MultiMedia6", MSM_BACKEND_DAI_PRI_I2S_RX,
  1504. MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
  1505. msm_routing_put_audio_mixer),
  1506. SOC_SINGLE_EXT("MultiMedia7", MSM_BACKEND_DAI_PRI_I2S_RX,
  1507. MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
  1508. msm_routing_put_audio_mixer),
  1509. SOC_SINGLE_EXT("MultiMedia8", MSM_BACKEND_DAI_PRI_I2S_RX,
  1510. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  1511. msm_routing_put_audio_mixer),
  1512. SOC_SINGLE_EXT("MultiMedia9", MSM_BACKEND_DAI_PRI_I2S_RX,
  1513. MSM_FRONTEND_DAI_MULTIMEDIA9, 1, 0, msm_routing_get_audio_mixer,
  1514. msm_routing_put_audio_mixer),
  1515. };
  1516. static const struct snd_kcontrol_new sec_i2s_rx_mixer_controls[] = {
  1517. SOC_SINGLE_EXT("MultiMedia1", MSM_BACKEND_DAI_SEC_I2S_RX ,
  1518. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1519. msm_routing_put_audio_mixer),
  1520. SOC_SINGLE_EXT("MultiMedia2", MSM_BACKEND_DAI_SEC_I2S_RX,
  1521. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1522. msm_routing_put_audio_mixer),
  1523. SOC_SINGLE_EXT("MultiMedia3", MSM_BACKEND_DAI_SEC_I2S_RX,
  1524. MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
  1525. msm_routing_put_audio_mixer),
  1526. SOC_SINGLE_EXT("MultiMedia4", MSM_BACKEND_DAI_SEC_I2S_RX,
  1527. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  1528. msm_routing_put_audio_mixer),
  1529. SOC_SINGLE_EXT("MultiMedia5", MSM_BACKEND_DAI_SEC_I2S_RX,
  1530. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  1531. msm_routing_put_audio_mixer),
  1532. SOC_SINGLE_EXT("MultiMedia6", MSM_BACKEND_DAI_SEC_I2S_RX,
  1533. MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
  1534. msm_routing_put_audio_mixer),
  1535. SOC_SINGLE_EXT("MultiMedia7", MSM_BACKEND_DAI_SEC_I2S_RX,
  1536. MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
  1537. msm_routing_put_audio_mixer),
  1538. SOC_SINGLE_EXT("MultiMedia8", MSM_BACKEND_DAI_SEC_I2S_RX,
  1539. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  1540. msm_routing_put_audio_mixer),
  1541. SOC_SINGLE_EXT("MultiMedia9", MSM_BACKEND_DAI_SEC_I2S_RX,
  1542. MSM_FRONTEND_DAI_MULTIMEDIA9, 1, 0, msm_routing_get_audio_mixer,
  1543. msm_routing_put_audio_mixer),
  1544. };
  1545. static const struct snd_kcontrol_new slimbus_rx_mixer_controls[] = {
  1546. SOC_SINGLE_EXT("MultiMedia1", MSM_BACKEND_DAI_SLIMBUS_0_RX ,
  1547. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1548. msm_routing_put_audio_mixer),
  1549. SOC_SINGLE_EXT("MultiMedia2", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  1550. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1551. msm_routing_put_audio_mixer),
  1552. SOC_SINGLE_EXT("MultiMedia3", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  1553. MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
  1554. msm_routing_put_audio_mixer),
  1555. SOC_SINGLE_EXT("MultiMedia4", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  1556. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  1557. msm_routing_put_audio_mixer),
  1558. SOC_SINGLE_EXT("MultiMedia5", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  1559. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  1560. msm_routing_put_audio_mixer),
  1561. SOC_SINGLE_EXT("MultiMedia6", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  1562. MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
  1563. msm_routing_put_audio_mixer),
  1564. SOC_SINGLE_EXT("MultiMedia7", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  1565. MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
  1566. msm_routing_put_audio_mixer),
  1567. SOC_SINGLE_EXT("MultiMedia8", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  1568. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  1569. msm_routing_put_audio_mixer),
  1570. SOC_SINGLE_EXT("MultiMedia9", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  1571. MSM_FRONTEND_DAI_MULTIMEDIA9, 1, 0, msm_routing_get_audio_mixer,
  1572. msm_routing_put_audio_mixer),
  1573. #ifdef CONFIG_JACK_AUDIO
  1574. SOC_SINGLE_EXT("MultiMedia10", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  1575. MSM_FRONTEND_DAI_MULTIMEDIA10, 1, 0, msm_routing_get_audio_mixer,
  1576. msm_routing_put_audio_mixer),
  1577. #endif
  1578. };
  1579. static const struct snd_kcontrol_new mi2s_rx_mixer_controls[] = {
  1580. SOC_SINGLE_EXT("MultiMedia1", MSM_BACKEND_DAI_MI2S_RX ,
  1581. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1582. msm_routing_put_audio_mixer),
  1583. SOC_SINGLE_EXT("MultiMedia2", MSM_BACKEND_DAI_MI2S_RX,
  1584. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1585. msm_routing_put_audio_mixer),
  1586. SOC_SINGLE_EXT("MultiMedia3", MSM_BACKEND_DAI_MI2S_RX,
  1587. MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
  1588. msm_routing_put_audio_mixer),
  1589. SOC_SINGLE_EXT("MultiMedia4", MSM_BACKEND_DAI_MI2S_RX,
  1590. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  1591. msm_routing_put_audio_mixer),
  1592. SOC_SINGLE_EXT("MultiMedia5", MSM_BACKEND_DAI_MI2S_RX,
  1593. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  1594. msm_routing_put_audio_mixer),
  1595. SOC_SINGLE_EXT("MultiMedia6", MSM_BACKEND_DAI_MI2S_RX,
  1596. MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
  1597. msm_routing_put_audio_mixer),
  1598. SOC_SINGLE_EXT("MultiMedia7", MSM_BACKEND_DAI_MI2S_RX,
  1599. MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
  1600. msm_routing_put_audio_mixer),
  1601. SOC_SINGLE_EXT("MultiMedia8", MSM_BACKEND_DAI_MI2S_RX,
  1602. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  1603. msm_routing_put_audio_mixer),
  1604. SOC_SINGLE_EXT("MultiMedia9", MSM_BACKEND_DAI_MI2S_RX,
  1605. MSM_FRONTEND_DAI_MULTIMEDIA9, 1, 0, msm_routing_get_audio_mixer,
  1606. msm_routing_put_audio_mixer),
  1607. };
  1608. static const struct snd_kcontrol_new quaternary_mi2s_rx_mixer_controls[] = {
  1609. SOC_SINGLE_EXT("MultiMedia1", MSM_BACKEND_DAI_QUATERNARY_MI2S_RX ,
  1610. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1611. msm_routing_put_audio_mixer),
  1612. SOC_SINGLE_EXT("MultiMedia2", MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
  1613. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1614. msm_routing_put_audio_mixer),
  1615. SOC_SINGLE_EXT("MultiMedia3", MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
  1616. MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
  1617. msm_routing_put_audio_mixer),
  1618. SOC_SINGLE_EXT("MultiMedia4", MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
  1619. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  1620. msm_routing_put_audio_mixer),
  1621. SOC_SINGLE_EXT("MultiMedia5", MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
  1622. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  1623. msm_routing_put_audio_mixer),
  1624. SOC_SINGLE_EXT("MultiMedia6", MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
  1625. MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
  1626. msm_routing_put_audio_mixer),
  1627. SOC_SINGLE_EXT("MultiMedia7", MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
  1628. MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
  1629. msm_routing_put_audio_mixer),
  1630. SOC_SINGLE_EXT("MultiMedia8", MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
  1631. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  1632. msm_routing_put_audio_mixer),
  1633. SOC_SINGLE_EXT("MultiMedia9", MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
  1634. MSM_FRONTEND_DAI_MULTIMEDIA9, 1, 0, msm_routing_get_audio_mixer,
  1635. msm_routing_put_audio_mixer),
  1636. };
  1637. static const struct snd_kcontrol_new tertiary_mi2s_rx_mixer_controls[] = {
  1638. SOC_SINGLE_EXT("MultiMedia1", MSM_BACKEND_DAI_TERTIARY_MI2S_RX ,
  1639. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1640. msm_routing_put_audio_mixer),
  1641. SOC_SINGLE_EXT("MultiMedia2", MSM_BACKEND_DAI_TERTIARY_MI2S_RX,
  1642. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1643. msm_routing_put_audio_mixer),
  1644. SOC_SINGLE_EXT("MultiMedia3", MSM_BACKEND_DAI_TERTIARY_MI2S_RX,
  1645. MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
  1646. msm_routing_put_audio_mixer),
  1647. SOC_SINGLE_EXT("MultiMedia4", MSM_BACKEND_DAI_TERTIARY_MI2S_RX,
  1648. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  1649. msm_routing_put_audio_mixer),
  1650. SOC_SINGLE_EXT("MultiMedia5", MSM_BACKEND_DAI_TERTIARY_MI2S_RX,
  1651. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  1652. msm_routing_put_audio_mixer),
  1653. SOC_SINGLE_EXT("MultiMedia10", MSM_BACKEND_DAI_TERTIARY_MI2S_RX,
  1654. MSM_FRONTEND_DAI_MULTIMEDIA10, 1, 0, msm_routing_get_audio_mixer,
  1655. msm_routing_put_audio_mixer),
  1656. };
  1657. static const struct snd_kcontrol_new secondary_mi2s_rx_mixer_controls[] = {
  1658. SOC_SINGLE_EXT("MultiMedia1", MSM_BACKEND_DAI_SECONDARY_MI2S_RX ,
  1659. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1660. msm_routing_put_audio_mixer),
  1661. SOC_SINGLE_EXT("MultiMedia2", MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  1662. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1663. msm_routing_put_audio_mixer),
  1664. SOC_SINGLE_EXT("MultiMedia3", MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  1665. MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
  1666. msm_routing_put_audio_mixer),
  1667. SOC_SINGLE_EXT("MultiMedia4", MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  1668. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  1669. msm_routing_put_audio_mixer),
  1670. SOC_SINGLE_EXT("MultiMedia5", MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  1671. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  1672. msm_routing_put_audio_mixer),
  1673. SOC_SINGLE_EXT("MultiMedia6", MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  1674. MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
  1675. msm_routing_put_audio_mixer),
  1676. SOC_SINGLE_EXT("MultiMedia7", MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  1677. MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
  1678. msm_routing_put_audio_mixer),
  1679. SOC_SINGLE_EXT("MultiMedia8", MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  1680. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  1681. msm_routing_put_audio_mixer),
  1682. SOC_SINGLE_EXT("MultiMedia9", MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  1683. MSM_FRONTEND_DAI_MULTIMEDIA9, 1, 0, msm_routing_get_audio_mixer,
  1684. msm_routing_put_audio_mixer),
  1685. };
  1686. static const struct snd_kcontrol_new mi2s_hl_mixer_controls[] = {
  1687. SOC_SINGLE_EXT("PRI_MI2S_TX", MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  1688. MSM_BACKEND_DAI_PRI_MI2S_TX, 1, 0, msm_routing_get_port_mixer,
  1689. msm_routing_put_port_mixer),
  1690. SOC_SINGLE_EXT("INTERNAL_FM_TX", MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  1691. MSM_BACKEND_DAI_INT_FM_TX, 1, 0, msm_routing_get_port_mixer,
  1692. msm_routing_put_port_mixer),
  1693. };
  1694. static const struct snd_kcontrol_new primary_mi2s_rx_mixer_controls[] = {
  1695. SOC_SINGLE_EXT("MultiMedia1", MSM_BACKEND_DAI_PRI_MI2S_RX ,
  1696. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1697. msm_routing_put_audio_mixer),
  1698. SOC_SINGLE_EXT("MultiMedia2", MSM_BACKEND_DAI_PRI_MI2S_RX,
  1699. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1700. msm_routing_put_audio_mixer),
  1701. SOC_SINGLE_EXT("MultiMedia3", MSM_BACKEND_DAI_PRI_MI2S_RX,
  1702. MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
  1703. msm_routing_put_audio_mixer),
  1704. SOC_SINGLE_EXT("MultiMedia4", MSM_BACKEND_DAI_PRI_MI2S_RX,
  1705. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  1706. msm_routing_put_audio_mixer),
  1707. SOC_SINGLE_EXT("MultiMedia5", MSM_BACKEND_DAI_PRI_MI2S_RX,
  1708. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  1709. msm_routing_put_audio_mixer),
  1710. SOC_SINGLE_EXT("MultiMedia6", MSM_BACKEND_DAI_PRI_MI2S_RX,
  1711. MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
  1712. msm_routing_put_audio_mixer),
  1713. SOC_SINGLE_EXT("MultiMedia7", MSM_BACKEND_DAI_PRI_MI2S_RX,
  1714. MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
  1715. msm_routing_put_audio_mixer),
  1716. SOC_SINGLE_EXT("MultiMedia8", MSM_BACKEND_DAI_PRI_MI2S_RX,
  1717. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  1718. msm_routing_put_audio_mixer),
  1719. SOC_SINGLE_EXT("MultiMedia9", MSM_BACKEND_DAI_PRI_MI2S_RX,
  1720. MSM_FRONTEND_DAI_MULTIMEDIA9, 1, 0, msm_routing_get_audio_mixer,
  1721. msm_routing_put_audio_mixer),
  1722. };
  1723. static const struct snd_kcontrol_new hdmi_mixer_controls[] = {
  1724. SOC_SINGLE_EXT("MultiMedia1", MSM_BACKEND_DAI_HDMI_RX,
  1725. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1726. msm_routing_put_audio_mixer),
  1727. SOC_SINGLE_EXT("MultiMedia2", MSM_BACKEND_DAI_HDMI_RX,
  1728. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1729. msm_routing_put_audio_mixer),
  1730. SOC_SINGLE_EXT("MultiMedia3", MSM_BACKEND_DAI_HDMI_RX,
  1731. MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
  1732. msm_routing_put_audio_mixer),
  1733. SOC_SINGLE_EXT("MultiMedia4", MSM_BACKEND_DAI_HDMI_RX,
  1734. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  1735. msm_routing_put_audio_mixer),
  1736. SOC_SINGLE_EXT("MultiMedia5", MSM_BACKEND_DAI_HDMI_RX,
  1737. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  1738. msm_routing_put_audio_mixer),
  1739. SOC_SINGLE_EXT("MultiMedia6", MSM_BACKEND_DAI_HDMI_RX,
  1740. MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
  1741. msm_routing_put_audio_mixer),
  1742. SOC_SINGLE_EXT("MultiMedia7", MSM_BACKEND_DAI_HDMI_RX,
  1743. MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
  1744. msm_routing_put_audio_mixer),
  1745. SOC_SINGLE_EXT("MultiMedia8", MSM_BACKEND_DAI_HDMI_RX,
  1746. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  1747. msm_routing_put_audio_mixer),
  1748. SOC_SINGLE_EXT("MultiMedia9", MSM_BACKEND_DAI_HDMI_RX,
  1749. MSM_FRONTEND_DAI_MULTIMEDIA9, 1, 0, msm_routing_get_audio_mixer,
  1750. msm_routing_put_audio_mixer),
  1751. };
  1752. /* incall music delivery mixer */
  1753. static const struct snd_kcontrol_new incall_music_delivery_mixer_controls[] = {
  1754. SOC_SINGLE_EXT("MultiMedia1", MSM_BACKEND_DAI_VOICE_PLAYBACK_TX,
  1755. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1756. msm_routing_put_audio_mixer),
  1757. SOC_SINGLE_EXT("MultiMedia2", MSM_BACKEND_DAI_VOICE_PLAYBACK_TX,
  1758. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1759. msm_routing_put_audio_mixer),
  1760. SOC_SINGLE_EXT("MultiMedia5", MSM_BACKEND_DAI_VOICE_PLAYBACK_TX,
  1761. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  1762. msm_routing_put_audio_mixer),
  1763. SOC_SINGLE_EXT("MultiMedia9", MSM_BACKEND_DAI_VOICE_PLAYBACK_TX,
  1764. MSM_FRONTEND_DAI_MULTIMEDIA9, 1, 0, msm_routing_get_audio_mixer,
  1765. msm_routing_put_audio_mixer),
  1766. };
  1767. static const struct snd_kcontrol_new incall_music2_delivery_mixer_controls[] = {
  1768. SOC_SINGLE_EXT("MultiMedia1", MSM_BACKEND_DAI_VOICE2_PLAYBACK_TX,
  1769. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1770. msm_routing_put_audio_mixer),
  1771. SOC_SINGLE_EXT("MultiMedia2", MSM_BACKEND_DAI_VOICE2_PLAYBACK_TX,
  1772. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1773. msm_routing_put_audio_mixer),
  1774. SOC_SINGLE_EXT("MultiMedia5", MSM_BACKEND_DAI_VOICE2_PLAYBACK_TX,
  1775. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  1776. msm_routing_put_audio_mixer),
  1777. SOC_SINGLE_EXT("MultiMedia9", MSM_BACKEND_DAI_VOICE2_PLAYBACK_TX,
  1778. MSM_FRONTEND_DAI_MULTIMEDIA9, 1, 0, msm_routing_get_audio_mixer,
  1779. msm_routing_put_audio_mixer),
  1780. };
  1781. static const struct snd_kcontrol_new slimbus_4_rx_mixer_controls[] = {
  1782. SOC_SINGLE_EXT("MultiMedia1", MSM_BACKEND_DAI_SLIMBUS_4_RX,
  1783. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1784. msm_routing_put_audio_mixer),
  1785. SOC_SINGLE_EXT("MultiMedia2", MSM_BACKEND_DAI_SLIMBUS_4_RX,
  1786. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1787. msm_routing_put_audio_mixer),
  1788. };
  1789. static const struct snd_kcontrol_new int_bt_sco_rx_mixer_controls[] = {
  1790. SOC_SINGLE_EXT("MultiMedia1", MSM_BACKEND_DAI_INT_BT_SCO_RX,
  1791. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1792. msm_routing_put_audio_mixer),
  1793. SOC_SINGLE_EXT("MultiMedia2", MSM_BACKEND_DAI_INT_BT_SCO_RX,
  1794. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1795. msm_routing_put_audio_mixer),
  1796. SOC_SINGLE_EXT("MultiMedia3", MSM_BACKEND_DAI_INT_BT_SCO_RX,
  1797. MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
  1798. msm_routing_put_audio_mixer),
  1799. SOC_SINGLE_EXT("MultiMedia4", MSM_BACKEND_DAI_INT_BT_SCO_RX,
  1800. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  1801. msm_routing_put_audio_mixer),
  1802. SOC_SINGLE_EXT("MultiMedia5", MSM_BACKEND_DAI_INT_BT_SCO_RX,
  1803. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  1804. msm_routing_put_audio_mixer),
  1805. SOC_SINGLE_EXT("MultiMedia6", MSM_BACKEND_DAI_INT_BT_SCO_RX,
  1806. MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
  1807. msm_routing_put_audio_mixer),
  1808. SOC_SINGLE_EXT("MultiMedia7", MSM_BACKEND_DAI_INT_BT_SCO_RX,
  1809. MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
  1810. msm_routing_put_audio_mixer),
  1811. SOC_SINGLE_EXT("MultiMedia8", MSM_BACKEND_DAI_INT_BT_SCO_RX,
  1812. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  1813. msm_routing_put_audio_mixer),
  1814. SOC_SINGLE_EXT("MultiMedia9", MSM_BACKEND_DAI_INT_BT_SCO_RX,
  1815. MSM_FRONTEND_DAI_MULTIMEDIA9, 1, 0, msm_routing_get_audio_mixer,
  1816. msm_routing_put_audio_mixer),
  1817. };
  1818. static const struct snd_kcontrol_new int_fm_rx_mixer_controls[] = {
  1819. SOC_SINGLE_EXT("MultiMedia1", MSM_BACKEND_DAI_INT_FM_RX,
  1820. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1821. msm_routing_put_audio_mixer),
  1822. SOC_SINGLE_EXT("MultiMedia2", MSM_BACKEND_DAI_INT_FM_RX,
  1823. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1824. msm_routing_put_audio_mixer),
  1825. SOC_SINGLE_EXT("MultiMedia3", MSM_BACKEND_DAI_INT_FM_RX,
  1826. MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
  1827. msm_routing_put_audio_mixer),
  1828. SOC_SINGLE_EXT("MultiMedia4", MSM_BACKEND_DAI_INT_FM_RX,
  1829. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  1830. msm_routing_put_audio_mixer),
  1831. SOC_SINGLE_EXT("MultiMedia5", MSM_BACKEND_DAI_INT_FM_RX,
  1832. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  1833. msm_routing_put_audio_mixer),
  1834. SOC_SINGLE_EXT("MultiMedia6", MSM_BACKEND_DAI_INT_FM_RX,
  1835. MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
  1836. msm_routing_put_audio_mixer),
  1837. SOC_SINGLE_EXT("MultiMedia7", MSM_BACKEND_DAI_INT_FM_RX,
  1838. MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
  1839. msm_routing_put_audio_mixer),
  1840. SOC_SINGLE_EXT("MultiMedia8", MSM_BACKEND_DAI_INT_FM_RX,
  1841. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  1842. msm_routing_put_audio_mixer),
  1843. SOC_SINGLE_EXT("MultiMedia9", MSM_BACKEND_DAI_INT_FM_RX,
  1844. MSM_FRONTEND_DAI_MULTIMEDIA9, 1, 0, msm_routing_get_audio_mixer,
  1845. msm_routing_put_audio_mixer),
  1846. };
  1847. static const struct snd_kcontrol_new afe_pcm_rx_mixer_controls[] = {
  1848. SOC_SINGLE_EXT("MultiMedia1", MSM_BACKEND_DAI_AFE_PCM_RX,
  1849. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1850. msm_routing_put_audio_mixer),
  1851. SOC_SINGLE_EXT("MultiMedia2", MSM_BACKEND_DAI_AFE_PCM_RX,
  1852. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1853. msm_routing_put_audio_mixer),
  1854. SOC_SINGLE_EXT("MultiMedia3", MSM_BACKEND_DAI_AFE_PCM_RX,
  1855. MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
  1856. msm_routing_put_audio_mixer),
  1857. SOC_SINGLE_EXT("MultiMedia4", MSM_BACKEND_DAI_AFE_PCM_RX,
  1858. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  1859. msm_routing_put_audio_mixer),
  1860. SOC_SINGLE_EXT("MultiMedia5", MSM_BACKEND_DAI_AFE_PCM_RX,
  1861. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  1862. msm_routing_put_audio_mixer),
  1863. SOC_SINGLE_EXT("MultiMedia6", MSM_BACKEND_DAI_AFE_PCM_RX,
  1864. MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
  1865. msm_routing_put_audio_mixer),
  1866. SOC_SINGLE_EXT("MultiMedia7", MSM_BACKEND_DAI_AFE_PCM_RX,
  1867. MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
  1868. msm_routing_put_audio_mixer),
  1869. SOC_SINGLE_EXT("MultiMedia8", MSM_BACKEND_DAI_AFE_PCM_RX,
  1870. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  1871. msm_routing_put_audio_mixer),
  1872. SOC_SINGLE_EXT("MultiMedia9", MSM_BACKEND_DAI_AFE_PCM_RX,
  1873. MSM_FRONTEND_DAI_MULTIMEDIA9, 1, 0, msm_routing_get_audio_mixer,
  1874. msm_routing_put_audio_mixer),
  1875. };
  1876. static const struct snd_kcontrol_new auxpcm_rx_mixer_controls[] = {
  1877. SOC_SINGLE_EXT("MultiMedia1", MSM_BACKEND_DAI_AUXPCM_RX,
  1878. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1879. msm_routing_put_audio_mixer),
  1880. SOC_SINGLE_EXT("MultiMedia2", MSM_BACKEND_DAI_AUXPCM_RX,
  1881. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1882. msm_routing_put_audio_mixer),
  1883. SOC_SINGLE_EXT("MultiMedia3", MSM_BACKEND_DAI_AUXPCM_RX,
  1884. MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
  1885. msm_routing_put_audio_mixer),
  1886. SOC_SINGLE_EXT("MultiMedia4", MSM_BACKEND_DAI_AUXPCM_RX,
  1887. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  1888. msm_routing_put_audio_mixer),
  1889. SOC_SINGLE_EXT("MultiMedia5", MSM_BACKEND_DAI_AUXPCM_RX,
  1890. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  1891. msm_routing_put_audio_mixer),
  1892. SOC_SINGLE_EXT("MultiMedia6", MSM_BACKEND_DAI_AUXPCM_RX,
  1893. MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
  1894. msm_routing_put_audio_mixer),
  1895. SOC_SINGLE_EXT("MultiMedia7", MSM_BACKEND_DAI_AUXPCM_RX,
  1896. MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
  1897. msm_routing_put_audio_mixer),
  1898. SOC_SINGLE_EXT("MultiMedia8", MSM_BACKEND_DAI_AUXPCM_RX,
  1899. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  1900. msm_routing_put_audio_mixer),
  1901. SOC_SINGLE_EXT("MultiMedia9", MSM_BACKEND_DAI_AUXPCM_RX,
  1902. MSM_FRONTEND_DAI_MULTIMEDIA9, 1, 0, msm_routing_get_audio_mixer,
  1903. msm_routing_put_audio_mixer),
  1904. #ifdef CONFIG_JACK_AUDIO
  1905. SOC_SINGLE_EXT("MultiMedia10", MSM_BACKEND_DAI_AUXPCM_RX,
  1906. MSM_FRONTEND_DAI_MULTIMEDIA10, 1, 0, msm_routing_get_audio_mixer,
  1907. msm_routing_put_audio_mixer),
  1908. #endif
  1909. };
  1910. static const struct snd_kcontrol_new sec_auxpcm_rx_mixer_controls[] = {
  1911. SOC_SINGLE_EXT("MultiMedia1", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  1912. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1913. msm_routing_put_audio_mixer),
  1914. SOC_SINGLE_EXT("MultiMedia2", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  1915. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1916. msm_routing_put_audio_mixer),
  1917. SOC_SINGLE_EXT("MultiMedia3", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  1918. MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer,
  1919. msm_routing_put_audio_mixer),
  1920. SOC_SINGLE_EXT("MultiMedia4", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  1921. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  1922. msm_routing_put_audio_mixer),
  1923. SOC_SINGLE_EXT("MultiMedia5", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  1924. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  1925. msm_routing_put_audio_mixer),
  1926. SOC_SINGLE_EXT("MultiMedia6", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  1927. MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
  1928. msm_routing_put_audio_mixer),
  1929. SOC_SINGLE_EXT("MultiMedia7", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  1930. MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer,
  1931. msm_routing_put_audio_mixer),
  1932. SOC_SINGLE_EXT("MultiMedia8", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  1933. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  1934. msm_routing_put_audio_mixer),
  1935. SOC_SINGLE_EXT("MultiMedia9", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  1936. MSM_FRONTEND_DAI_MULTIMEDIA9, 1, 0, msm_routing_get_audio_mixer,
  1937. msm_routing_put_audio_mixer),
  1938. };
  1939. static const struct snd_kcontrol_new mmul1_mixer_controls[] = {
  1940. SOC_SINGLE_EXT("PRI_TX", MSM_BACKEND_DAI_PRI_I2S_TX,
  1941. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1942. msm_routing_put_audio_mixer),
  1943. SOC_SINGLE_EXT("MI2S_TX", MSM_BACKEND_DAI_MI2S_TX,
  1944. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1945. msm_routing_put_audio_mixer),
  1946. SOC_SINGLE_EXT("PRI_MI2S_TX", MSM_BACKEND_DAI_PRI_MI2S_TX,
  1947. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1948. msm_routing_put_audio_mixer),
  1949. SOC_SINGLE_EXT("QUAT_MI2S_TX", MSM_BACKEND_DAI_QUATERNARY_MI2S_TX,
  1950. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1951. msm_routing_put_audio_mixer),
  1952. SOC_SINGLE_EXT("TERT_MI2S_TX", MSM_BACKEND_DAI_TERTIARY_MI2S_TX,
  1953. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1954. msm_routing_put_audio_mixer),
  1955. SOC_SINGLE_EXT("SEC_MI2S_TX", MSM_BACKEND_DAI_SECONDARY_MI2S_TX,
  1956. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1957. msm_routing_put_audio_mixer),
  1958. SOC_SINGLE_EXT("SLIM_0_TX", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  1959. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1960. msm_routing_put_audio_mixer),
  1961. SOC_SINGLE_EXT("AUX_PCM_UL_TX", MSM_BACKEND_DAI_AUXPCM_TX,
  1962. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1963. msm_routing_put_audio_mixer),
  1964. SOC_SINGLE_EXT("SEC_AUX_PCM_UL_TX", MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  1965. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1966. msm_routing_put_audio_mixer),
  1967. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX", MSM_BACKEND_DAI_INT_BT_SCO_TX,
  1968. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1969. msm_routing_put_audio_mixer),
  1970. SOC_SINGLE_EXT("INTERNAL_FM_TX", MSM_BACKEND_DAI_INT_FM_TX,
  1971. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1972. msm_routing_put_audio_mixer),
  1973. SOC_SINGLE_EXT("AFE_PCM_TX", MSM_BACKEND_DAI_AFE_PCM_TX,
  1974. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1975. msm_routing_put_audio_mixer),
  1976. SOC_SINGLE_EXT("VOC_REC_DL", MSM_BACKEND_DAI_INCALL_RECORD_RX,
  1977. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1978. msm_routing_put_audio_mixer),
  1979. SOC_SINGLE_EXT("VOC_REC_UL", MSM_BACKEND_DAI_INCALL_RECORD_TX,
  1980. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1981. msm_routing_put_audio_mixer),
  1982. SOC_SINGLE_EXT("SLIM_4_TX", MSM_BACKEND_DAI_SLIMBUS_4_TX,
  1983. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer,
  1984. msm_routing_put_audio_mixer),
  1985. };
  1986. static const struct snd_kcontrol_new mmul2_mixer_controls[] = {
  1987. SOC_SINGLE_EXT("INTERNAL_FM_TX", MSM_BACKEND_DAI_INT_FM_TX,
  1988. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1989. msm_routing_put_audio_mixer),
  1990. SOC_SINGLE_EXT("MI2S_TX", MSM_BACKEND_DAI_MI2S_TX,
  1991. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1992. msm_routing_put_audio_mixer),
  1993. #ifdef CONFIG_TERT_MI2S_ENABLE
  1994. SOC_SINGLE_EXT("TERT_MI2S_TX", MSM_BACKEND_DAI_TERTIARY_MI2S_TX,
  1995. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  1996. msm_routing_put_audio_mixer),
  1997. #elif defined(CONFIG_SND_SOC_MAX98504) || defined(CONFIG_SND_SOC_MAX98506)
  1998. SOC_SINGLE_EXT("SEC_MI2S_TX", MSM_BACKEND_DAI_SECONDARY_MI2S_TX,
  1999. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  2000. msm_routing_put_audio_mixer),
  2001. #endif
  2002. SOC_SINGLE_EXT("SLIM_0_TX", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2003. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer,
  2004. msm_routing_put_audio_mixer),
  2005. };
  2006. static const struct snd_kcontrol_new mmul4_mixer_controls[] = {
  2007. SOC_SINGLE_EXT("SLIM_0_TX", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2008. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  2009. msm_routing_put_audio_mixer),
  2010. SOC_SINGLE_EXT("PRI_MI2S_TX", MSM_BACKEND_DAI_PRI_MI2S_TX,
  2011. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  2012. msm_routing_put_audio_mixer),
  2013. SOC_SINGLE_EXT("INTERNAL_FM_TX", MSM_BACKEND_DAI_INT_FM_TX,
  2014. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  2015. msm_routing_put_audio_mixer),
  2016. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX", MSM_BACKEND_DAI_INT_BT_SCO_TX,
  2017. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  2018. msm_routing_put_audio_mixer),
  2019. SOC_SINGLE_EXT("AFE_PCM_TX", MSM_BACKEND_DAI_AFE_PCM_TX,
  2020. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  2021. msm_routing_put_audio_mixer),
  2022. SOC_SINGLE_EXT("VOC_REC_DL", MSM_BACKEND_DAI_INCALL_RECORD_RX,
  2023. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  2024. msm_routing_put_audio_mixer),
  2025. SOC_SINGLE_EXT("VOC_REC_UL", MSM_BACKEND_DAI_INCALL_RECORD_TX,
  2026. MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer,
  2027. msm_routing_put_audio_mixer),
  2028. };
  2029. static const struct snd_kcontrol_new mmul5_mixer_controls[] = {
  2030. SOC_SINGLE_EXT("SLIM_0_TX", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2031. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  2032. msm_routing_put_audio_mixer),
  2033. SOC_SINGLE_EXT("INTERNAL_FM_TX", MSM_BACKEND_DAI_INT_FM_TX,
  2034. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  2035. msm_routing_put_audio_mixer),
  2036. SOC_SINGLE_EXT("MI2S_TX", MSM_BACKEND_DAI_MI2S_TX,
  2037. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  2038. msm_routing_put_audio_mixer),
  2039. SOC_SINGLE_EXT("AFE_PCM_TX", MSM_BACKEND_DAI_AFE_PCM_TX,
  2040. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  2041. msm_routing_put_audio_mixer),
  2042. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX", MSM_BACKEND_DAI_INT_BT_SCO_TX,
  2043. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  2044. msm_routing_put_audio_mixer),
  2045. SOC_SINGLE_EXT("AUX_PCM_TX", MSM_BACKEND_DAI_AUXPCM_TX,
  2046. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  2047. msm_routing_put_audio_mixer),
  2048. SOC_SINGLE_EXT("SEC_AUX_PCM_TX", MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  2049. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  2050. msm_routing_put_audio_mixer),
  2051. SOC_SINGLE_EXT("PRI_MI2S_TX", MSM_BACKEND_DAI_PRI_MI2S_TX,
  2052. MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer,
  2053. msm_routing_put_audio_mixer),
  2054. };
  2055. #ifdef CONFIG_JACK_AUDIO
  2056. static const struct snd_kcontrol_new mmul10_mixer_controls[] = {
  2057. SOC_SINGLE_EXT("SLIM_0_TX", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2058. MSM_FRONTEND_DAI_MULTIMEDIA10, 1, 0, msm_routing_get_audio_mixer,
  2059. msm_routing_put_audio_mixer),
  2060. SOC_SINGLE_EXT("AUX_PCM_TX", MSM_BACKEND_DAI_AUXPCM_TX,
  2061. MSM_FRONTEND_DAI_MULTIMEDIA10, 1, 0, msm_routing_get_audio_mixer,
  2062. msm_routing_put_audio_mixer),
  2063. };
  2064. #endif
  2065. static const struct snd_kcontrol_new mmul8_mixer_controls[] = {
  2066. SOC_SINGLE_EXT("SLIM_0_TX", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2067. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  2068. msm_routing_put_audio_mixer),
  2069. SOC_SINGLE_EXT("PRI_MI2S_TX", MSM_BACKEND_DAI_PRI_MI2S_TX,
  2070. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  2071. msm_routing_put_audio_mixer),
  2072. SOC_SINGLE_EXT("INTERNAL_FM_TX", MSM_BACKEND_DAI_INT_FM_TX,
  2073. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  2074. msm_routing_put_audio_mixer),
  2075. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX", MSM_BACKEND_DAI_INT_BT_SCO_TX,
  2076. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  2077. msm_routing_put_audio_mixer),
  2078. SOC_SINGLE_EXT("AFE_PCM_TX", MSM_BACKEND_DAI_AFE_PCM_TX,
  2079. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  2080. msm_routing_put_audio_mixer),
  2081. SOC_SINGLE_EXT("VOC_REC_DL", MSM_BACKEND_DAI_INCALL_RECORD_RX,
  2082. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  2083. msm_routing_put_audio_mixer),
  2084. SOC_SINGLE_EXT("VOC_REC_UL", MSM_BACKEND_DAI_INCALL_RECORD_TX,
  2085. MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer,
  2086. msm_routing_put_audio_mixer),
  2087. };
  2088. static const struct snd_kcontrol_new mmul6_mixer_controls[] = {
  2089. SOC_SINGLE_EXT("INTERNAL_FM_TX", MSM_BACKEND_DAI_INT_FM_TX,
  2090. MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
  2091. msm_routing_put_audio_mixer),
  2092. SOC_SINGLE_EXT("SLIM_0_TX", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2093. MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer,
  2094. msm_routing_put_audio_mixer),
  2095. };
  2096. static const struct snd_kcontrol_new pri_rx_voice_mixer_controls[] = {
  2097. SOC_SINGLE_EXT("CSVoice", MSM_BACKEND_DAI_PRI_I2S_RX,
  2098. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2099. msm_routing_put_voice_mixer),
  2100. SOC_SINGLE_EXT("Voice2", MSM_BACKEND_DAI_PRI_I2S_RX,
  2101. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2102. msm_routing_put_voice_mixer),
  2103. SOC_SINGLE_EXT("Voip", MSM_BACKEND_DAI_PRI_I2S_RX,
  2104. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2105. msm_routing_put_voice_mixer),
  2106. SOC_SINGLE_EXT("VoLTE", MSM_BACKEND_DAI_PRI_I2S_RX,
  2107. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2108. msm_routing_put_voice_mixer),
  2109. SOC_SINGLE_EXT("VoWLAN", MSM_BACKEND_DAI_PRI_I2S_RX,
  2110. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2111. msm_routing_put_voice_mixer),
  2112. SOC_SINGLE_EXT("DTMF", MSM_BACKEND_DAI_PRI_I2S_RX,
  2113. MSM_FRONTEND_DAI_DTMF_RX, 1, 0, msm_routing_get_voice_mixer,
  2114. msm_routing_put_voice_mixer),
  2115. SOC_SINGLE_EXT("QCHAT", MSM_BACKEND_DAI_PRI_I2S_RX,
  2116. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2117. msm_routing_put_voice_mixer),
  2118. };
  2119. static const struct snd_kcontrol_new sec_i2s_rx_voice_mixer_controls[] = {
  2120. SOC_SINGLE_EXT("CSVoice", MSM_BACKEND_DAI_SEC_I2S_RX,
  2121. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2122. msm_routing_put_voice_mixer),
  2123. SOC_SINGLE_EXT("Voice2", MSM_BACKEND_DAI_SEC_I2S_RX,
  2124. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2125. msm_routing_put_voice_mixer),
  2126. SOC_SINGLE_EXT("Voip", MSM_BACKEND_DAI_SEC_I2S_RX,
  2127. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2128. msm_routing_put_voice_mixer),
  2129. SOC_SINGLE_EXT("VoLTE", MSM_BACKEND_DAI_SEC_I2S_RX,
  2130. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2131. msm_routing_put_voice_mixer),
  2132. SOC_SINGLE_EXT("VoWLAN", MSM_BACKEND_DAI_SEC_I2S_RX,
  2133. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2134. msm_routing_put_voice_mixer),
  2135. SOC_SINGLE_EXT("DTMF", MSM_BACKEND_DAI_SEC_I2S_RX,
  2136. MSM_FRONTEND_DAI_DTMF_RX, 1, 0, msm_routing_get_voice_mixer,
  2137. msm_routing_put_voice_mixer),
  2138. SOC_SINGLE_EXT("QCHAT", MSM_BACKEND_DAI_SEC_I2S_RX,
  2139. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2140. msm_routing_put_voice_mixer),
  2141. };
  2142. static const struct snd_kcontrol_new sec_mi2s_rx_voice_mixer_controls[] = {
  2143. SOC_SINGLE_EXT("CSVoice", MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  2144. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2145. msm_routing_put_voice_mixer),
  2146. SOC_SINGLE_EXT("Voice2", MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  2147. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2148. msm_routing_put_voice_mixer),
  2149. SOC_SINGLE_EXT("Voip", MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  2150. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2151. msm_routing_put_voice_mixer),
  2152. SOC_SINGLE_EXT("VoLTE", MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  2153. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2154. msm_routing_put_voice_mixer),
  2155. SOC_SINGLE_EXT("VoWLAN", MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  2156. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2157. msm_routing_put_voice_mixer),
  2158. SOC_SINGLE_EXT("DTMF", MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  2159. MSM_FRONTEND_DAI_DTMF_RX, 1, 0, msm_routing_get_voice_mixer,
  2160. msm_routing_put_voice_mixer),
  2161. SOC_SINGLE_EXT("QCHAT", MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  2162. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2163. msm_routing_put_voice_mixer),
  2164. };
  2165. static const struct snd_kcontrol_new slimbus_rx_voice_mixer_controls[] = {
  2166. SOC_SINGLE_EXT("CSVoice", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  2167. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2168. msm_routing_put_voice_mixer),
  2169. SOC_SINGLE_EXT("Voice2", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  2170. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2171. msm_routing_put_voice_mixer),
  2172. SOC_SINGLE_EXT("Voip", MSM_BACKEND_DAI_SLIMBUS_0_RX ,
  2173. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2174. msm_routing_put_voice_mixer),
  2175. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  2176. SOC_SINGLE_EXT("Voice Stub", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  2177. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2178. msm_routing_put_voice_stub_mixer),
  2179. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  2180. SOC_SINGLE_EXT("VoLTE", MSM_BACKEND_DAI_SLIMBUS_0_RX ,
  2181. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2182. msm_routing_put_voice_mixer),
  2183. SOC_SINGLE_EXT("VoWLAN", MSM_BACKEND_DAI_SLIMBUS_0_RX ,
  2184. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2185. msm_routing_put_voice_mixer),
  2186. SOC_SINGLE_EXT("DTMF", MSM_BACKEND_DAI_SLIMBUS_0_RX ,
  2187. MSM_FRONTEND_DAI_DTMF_RX, 1, 0, msm_routing_get_voice_mixer,
  2188. msm_routing_put_voice_mixer),
  2189. SOC_SINGLE_EXT("QCHAT", MSM_BACKEND_DAI_SLIMBUS_0_RX ,
  2190. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2191. msm_routing_put_voice_mixer),
  2192. };
  2193. static const struct snd_kcontrol_new bt_sco_rx_voice_mixer_controls[] = {
  2194. SOC_SINGLE_EXT("CSVoice", MSM_BACKEND_DAI_INT_BT_SCO_RX,
  2195. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2196. msm_routing_put_voice_mixer),
  2197. SOC_SINGLE_EXT("Voice2", MSM_BACKEND_DAI_INT_BT_SCO_RX,
  2198. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2199. msm_routing_put_voice_mixer),
  2200. SOC_SINGLE_EXT("Voip", MSM_BACKEND_DAI_INT_BT_SCO_RX ,
  2201. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2202. msm_routing_put_voice_mixer),
  2203. SOC_SINGLE_EXT("Voice Stub", MSM_BACKEND_DAI_INT_BT_SCO_RX,
  2204. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2205. msm_routing_put_voice_stub_mixer),
  2206. SOC_SINGLE_EXT("VoLTE", MSM_BACKEND_DAI_INT_BT_SCO_RX ,
  2207. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2208. msm_routing_put_voice_mixer),
  2209. SOC_SINGLE_EXT("VoWLAN", MSM_BACKEND_DAI_INT_BT_SCO_RX ,
  2210. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2211. msm_routing_put_voice_mixer),
  2212. SOC_SINGLE_EXT("DTMF", MSM_BACKEND_DAI_INT_BT_SCO_RX ,
  2213. MSM_FRONTEND_DAI_DTMF_RX, 1, 0, msm_routing_get_voice_mixer,
  2214. msm_routing_put_voice_mixer),
  2215. SOC_SINGLE_EXT("QCHAT", MSM_BACKEND_DAI_INT_BT_SCO_RX ,
  2216. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2217. msm_routing_put_voice_mixer),
  2218. };
  2219. static const struct snd_kcontrol_new mi2s_rx_voice_mixer_controls[] = {
  2220. SOC_SINGLE_EXT("CSVoice", MSM_BACKEND_DAI_MI2S_RX,
  2221. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2222. msm_routing_put_voice_mixer),
  2223. SOC_SINGLE_EXT("Voice2", MSM_BACKEND_DAI_MI2S_RX,
  2224. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2225. msm_routing_put_voice_mixer),
  2226. SOC_SINGLE_EXT("Voip", MSM_BACKEND_DAI_MI2S_RX,
  2227. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2228. msm_routing_put_voice_mixer),
  2229. SOC_SINGLE_EXT("Voice Stub", MSM_BACKEND_DAI_MI2S_RX,
  2230. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2231. msm_routing_put_voice_stub_mixer),
  2232. SOC_SINGLE_EXT("VoLTE", MSM_BACKEND_DAI_MI2S_RX,
  2233. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2234. msm_routing_put_voice_mixer),
  2235. SOC_SINGLE_EXT("VoWLAN", MSM_BACKEND_DAI_MI2S_RX,
  2236. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2237. msm_routing_put_voice_mixer),
  2238. SOC_SINGLE_EXT("DTMF", MSM_BACKEND_DAI_MI2S_RX,
  2239. MSM_FRONTEND_DAI_DTMF_RX, 1, 0, msm_routing_get_voice_mixer,
  2240. msm_routing_put_voice_mixer),
  2241. SOC_SINGLE_EXT("QCHAT", MSM_BACKEND_DAI_MI2S_RX,
  2242. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2243. msm_routing_put_voice_mixer),
  2244. };
  2245. static const struct snd_kcontrol_new afe_pcm_rx_voice_mixer_controls[] = {
  2246. SOC_SINGLE_EXT("CSVoice", MSM_BACKEND_DAI_AFE_PCM_RX,
  2247. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2248. msm_routing_put_voice_mixer),
  2249. SOC_SINGLE_EXT("Voice2", MSM_BACKEND_DAI_AFE_PCM_RX,
  2250. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2251. msm_routing_put_voice_mixer),
  2252. SOC_SINGLE_EXT("Voip", MSM_BACKEND_DAI_AFE_PCM_RX,
  2253. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2254. msm_routing_put_voice_mixer),
  2255. SOC_SINGLE_EXT("Voice Stub", MSM_BACKEND_DAI_AFE_PCM_RX,
  2256. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2257. msm_routing_put_voice_stub_mixer),
  2258. SOC_SINGLE_EXT("VoLTE", MSM_BACKEND_DAI_AFE_PCM_RX,
  2259. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2260. msm_routing_put_voice_mixer),
  2261. SOC_SINGLE_EXT("VoWLAN", MSM_BACKEND_DAI_AFE_PCM_RX,
  2262. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2263. msm_routing_put_voice_mixer),
  2264. SOC_SINGLE_EXT("DTMF", MSM_BACKEND_DAI_AFE_PCM_RX,
  2265. MSM_FRONTEND_DAI_DTMF_RX, 1, 0, msm_routing_get_voice_mixer,
  2266. msm_routing_put_voice_mixer),
  2267. SOC_SINGLE_EXT("QCHAT", MSM_BACKEND_DAI_AFE_PCM_RX,
  2268. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2269. msm_routing_put_voice_mixer),
  2270. };
  2271. static const struct snd_kcontrol_new aux_pcm_rx_voice_mixer_controls[] = {
  2272. SOC_SINGLE_EXT("CSVoice", MSM_BACKEND_DAI_AUXPCM_RX,
  2273. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2274. msm_routing_put_voice_mixer),
  2275. SOC_SINGLE_EXT("Voice2", MSM_BACKEND_DAI_AUXPCM_RX,
  2276. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2277. msm_routing_put_voice_mixer),
  2278. SOC_SINGLE_EXT("Voip", MSM_BACKEND_DAI_AUXPCM_RX,
  2279. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2280. msm_routing_put_voice_mixer),
  2281. SOC_SINGLE_EXT("Voice Stub", MSM_BACKEND_DAI_AUXPCM_RX,
  2282. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2283. msm_routing_put_voice_stub_mixer),
  2284. SOC_SINGLE_EXT("VoLTE", MSM_BACKEND_DAI_AUXPCM_RX,
  2285. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2286. msm_routing_put_voice_mixer),
  2287. SOC_SINGLE_EXT("VoWLAN", MSM_BACKEND_DAI_AUXPCM_RX,
  2288. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2289. msm_routing_put_voice_mixer),
  2290. SOC_SINGLE_EXT("DTMF", MSM_BACKEND_DAI_AUXPCM_RX,
  2291. MSM_FRONTEND_DAI_DTMF_RX, 1, 0, msm_routing_get_voice_mixer,
  2292. msm_routing_put_voice_mixer),
  2293. SOC_SINGLE_EXT("QCHAT", MSM_BACKEND_DAI_AUXPCM_RX,
  2294. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2295. msm_routing_put_voice_mixer),
  2296. };
  2297. static const struct snd_kcontrol_new sec_aux_pcm_rx_voice_mixer_controls[] = {
  2298. SOC_SINGLE_EXT("CSVoice", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2299. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2300. msm_routing_put_voice_mixer),
  2301. SOC_SINGLE_EXT("Voice2", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2302. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2303. msm_routing_put_voice_mixer),
  2304. SOC_SINGLE_EXT("Voip", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2305. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2306. msm_routing_put_voice_mixer),
  2307. SOC_SINGLE_EXT("Voice Stub", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2308. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2309. msm_routing_put_voice_stub_mixer),
  2310. SOC_SINGLE_EXT("VoLTE", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2311. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2312. msm_routing_put_voice_mixer),
  2313. SOC_SINGLE_EXT("VoWLAN", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2314. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2315. msm_routing_put_voice_mixer),
  2316. SOC_SINGLE_EXT("DTMF", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2317. MSM_FRONTEND_DAI_DTMF_RX, 1, 0, msm_routing_get_voice_mixer,
  2318. msm_routing_put_voice_mixer),
  2319. SOC_SINGLE_EXT("QCHAT", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2320. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2321. msm_routing_put_voice_mixer),
  2322. };
  2323. static const struct snd_kcontrol_new hdmi_rx_voice_mixer_controls[] = {
  2324. SOC_SINGLE_EXT("CSVoice", MSM_BACKEND_DAI_HDMI_RX,
  2325. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2326. msm_routing_put_voice_mixer),
  2327. SOC_SINGLE_EXT("Voice2", MSM_BACKEND_DAI_HDMI_RX,
  2328. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2329. msm_routing_put_voice_mixer),
  2330. SOC_SINGLE_EXT("Voip", MSM_BACKEND_DAI_HDMI_RX,
  2331. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2332. msm_routing_put_voice_mixer),
  2333. SOC_SINGLE_EXT("VoLTE", MSM_BACKEND_DAI_HDMI_RX,
  2334. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2335. msm_routing_put_voice_mixer),
  2336. SOC_SINGLE_EXT("VoWLAN", MSM_BACKEND_DAI_HDMI_RX,
  2337. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2338. msm_routing_put_voice_mixer),
  2339. SOC_SINGLE_EXT("Voice Stub", MSM_BACKEND_DAI_HDMI_RX,
  2340. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2341. msm_routing_put_voice_stub_mixer),
  2342. SOC_SINGLE_EXT("DTMF", MSM_BACKEND_DAI_HDMI_RX,
  2343. MSM_FRONTEND_DAI_DTMF_RX, 1, 0, msm_routing_get_voice_mixer,
  2344. msm_routing_put_voice_mixer),
  2345. SOC_SINGLE_EXT("QCHAT", MSM_BACKEND_DAI_HDMI_RX,
  2346. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2347. msm_routing_put_voice_mixer),
  2348. };
  2349. static const struct snd_kcontrol_new stub_rx_mixer_controls[] = {
  2350. SOC_SINGLE_EXT("Voice Stub", MSM_BACKEND_DAI_EXTPROC_RX,
  2351. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2352. msm_routing_put_voice_stub_mixer),
  2353. };
  2354. static const struct snd_kcontrol_new slimbus_1_rx_mixer_controls[] = {
  2355. SOC_SINGLE_EXT("Voice Stub", MSM_BACKEND_DAI_SLIMBUS_1_RX,
  2356. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2357. msm_routing_put_voice_stub_mixer),
  2358. };
  2359. static const struct snd_kcontrol_new slimbus_3_rx_mixer_controls[] = {
  2360. SOC_SINGLE_EXT("Voice Stub", MSM_BACKEND_DAI_SLIMBUS_3_RX,
  2361. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2362. msm_routing_put_voice_stub_mixer),
  2363. };
  2364. static const struct snd_kcontrol_new tx_voice_mixer_controls[] = {
  2365. SOC_SINGLE_EXT("PRI_TX_Voice", MSM_BACKEND_DAI_PRI_I2S_TX,
  2366. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2367. msm_routing_put_voice_mixer),
  2368. SOC_SINGLE_EXT("MI2S_TX_Voice", MSM_BACKEND_DAI_MI2S_TX,
  2369. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2370. msm_routing_put_voice_mixer),
  2371. SOC_SINGLE_EXT("SLIM_0_TX_Voice", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2372. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2373. msm_routing_put_voice_mixer),
  2374. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX_Voice",
  2375. MSM_BACKEND_DAI_INT_BT_SCO_TX, MSM_FRONTEND_DAI_CS_VOICE, 1, 0,
  2376. msm_routing_get_voice_mixer, msm_routing_put_voice_mixer),
  2377. SOC_SINGLE_EXT("AFE_PCM_TX_Voice", MSM_BACKEND_DAI_AFE_PCM_TX,
  2378. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2379. msm_routing_put_voice_mixer),
  2380. SOC_SINGLE_EXT("AUX_PCM_TX_Voice", MSM_BACKEND_DAI_AUXPCM_TX,
  2381. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2382. msm_routing_put_voice_mixer),
  2383. SOC_SINGLE_EXT("SEC_AUX_PCM_TX_Voice", MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  2384. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2385. msm_routing_put_voice_mixer),
  2386. SOC_SINGLE_EXT("PRI_MI2S_TX_Voice", MSM_BACKEND_DAI_PRI_MI2S_TX,
  2387. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2388. msm_routing_put_voice_mixer),
  2389. };
  2390. static const struct snd_kcontrol_new tx_voice2_mixer_controls[] = {
  2391. SOC_SINGLE_EXT("PRI_TX_Voice2", MSM_BACKEND_DAI_PRI_I2S_TX,
  2392. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2393. msm_routing_put_voice_mixer),
  2394. SOC_SINGLE_EXT("MI2S_TX_Voice2", MSM_BACKEND_DAI_MI2S_TX,
  2395. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2396. msm_routing_put_voice_mixer),
  2397. SOC_SINGLE_EXT("SLIM_0_TX_Voice2", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2398. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2399. msm_routing_put_voice_mixer),
  2400. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX_Voice2",
  2401. MSM_BACKEND_DAI_INT_BT_SCO_TX, MSM_FRONTEND_DAI_VOICE2, 1, 0,
  2402. msm_routing_get_voice_mixer, msm_routing_put_voice_mixer),
  2403. SOC_SINGLE_EXT("AFE_PCM_TX_Voice2", MSM_BACKEND_DAI_AFE_PCM_TX,
  2404. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2405. msm_routing_put_voice_mixer),
  2406. SOC_SINGLE_EXT("AUX_PCM_TX_Voice2", MSM_BACKEND_DAI_AUXPCM_TX,
  2407. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2408. msm_routing_put_voice_mixer),
  2409. SOC_SINGLE_EXT("SEC_AUX_PCM_TX_Voice2", MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  2410. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2411. msm_routing_put_voice_mixer),
  2412. SOC_SINGLE_EXT("PRI_MI2S_TX_Voice2", MSM_BACKEND_DAI_PRI_MI2S_TX,
  2413. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2414. msm_routing_put_voice_mixer),
  2415. };
  2416. static const struct snd_kcontrol_new tx_volte_mixer_controls[] = {
  2417. SOC_SINGLE_EXT("PRI_TX_VoLTE", MSM_BACKEND_DAI_PRI_I2S_TX,
  2418. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2419. msm_routing_put_voice_mixer),
  2420. SOC_SINGLE_EXT("SLIM_0_TX_VoLTE", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2421. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2422. msm_routing_put_voice_mixer),
  2423. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX_VoLTE",
  2424. MSM_BACKEND_DAI_INT_BT_SCO_TX, MSM_FRONTEND_DAI_VOLTE, 1, 0,
  2425. msm_routing_get_voice_mixer, msm_routing_put_voice_mixer),
  2426. SOC_SINGLE_EXT("AFE_PCM_TX_VoLTE", MSM_BACKEND_DAI_AFE_PCM_TX,
  2427. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2428. msm_routing_put_voice_mixer),
  2429. SOC_SINGLE_EXT("AUX_PCM_TX_VoLTE", MSM_BACKEND_DAI_AUXPCM_TX,
  2430. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2431. msm_routing_put_voice_mixer),
  2432. SOC_SINGLE_EXT("SEC_AUX_PCM_TX_VoLTE", MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  2433. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2434. msm_routing_put_voice_mixer),
  2435. SOC_SINGLE_EXT("MI2S_TX_VoLTE", MSM_BACKEND_DAI_MI2S_TX,
  2436. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2437. msm_routing_put_voice_mixer),
  2438. };
  2439. static const struct snd_kcontrol_new tx_vowlan_mixer_controls[] = {
  2440. SOC_SINGLE_EXT("PRI_TX_VoWLAN", MSM_BACKEND_DAI_PRI_I2S_TX,
  2441. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2442. msm_routing_put_voice_mixer),
  2443. SOC_SINGLE_EXT("SLIM_0_TX_VoWLAN", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2444. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2445. msm_routing_put_voice_mixer),
  2446. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX_VoWLAN",
  2447. MSM_BACKEND_DAI_INT_BT_SCO_TX, MSM_FRONTEND_DAI_VOWLAN, 1, 0,
  2448. msm_routing_get_voice_mixer, msm_routing_put_voice_mixer),
  2449. SOC_SINGLE_EXT("AFE_PCM_TX_VoWLAN", MSM_BACKEND_DAI_AFE_PCM_TX,
  2450. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2451. msm_routing_put_voice_mixer),
  2452. SOC_SINGLE_EXT("AUX_PCM_TX_VoWLAN", MSM_BACKEND_DAI_AUXPCM_TX,
  2453. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2454. msm_routing_put_voice_mixer),
  2455. SOC_SINGLE_EXT("SEC_AUX_PCM_TX_VoWLAN", MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  2456. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2457. msm_routing_put_voice_mixer),
  2458. SOC_SINGLE_EXT("MI2S_TX_VoWLAN", MSM_BACKEND_DAI_MI2S_TX,
  2459. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2460. msm_routing_put_voice_mixer),
  2461. SOC_SINGLE_EXT("PRI_MI2S_TX_VoWLAN", MSM_BACKEND_DAI_PRI_MI2S_TX,
  2462. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2463. msm_routing_put_voice_mixer),
  2464. };
  2465. static const struct snd_kcontrol_new tx_voip_mixer_controls[] = {
  2466. SOC_SINGLE_EXT("PRI_TX_Voip", MSM_BACKEND_DAI_PRI_I2S_TX,
  2467. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2468. msm_routing_put_voice_mixer),
  2469. SOC_SINGLE_EXT("MI2S_TX_Voip", MSM_BACKEND_DAI_MI2S_TX,
  2470. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2471. msm_routing_put_voice_mixer),
  2472. SOC_SINGLE_EXT("SLIM_0_TX_Voip", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2473. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2474. msm_routing_put_voice_mixer),
  2475. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX_Voip", MSM_BACKEND_DAI_INT_BT_SCO_TX,
  2476. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2477. msm_routing_put_voice_mixer),
  2478. SOC_SINGLE_EXT("AFE_PCM_TX_Voip", MSM_BACKEND_DAI_AFE_PCM_TX,
  2479. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2480. msm_routing_put_voice_mixer),
  2481. SOC_SINGLE_EXT("AUX_PCM_TX_Voip", MSM_BACKEND_DAI_AUXPCM_TX,
  2482. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2483. msm_routing_put_voice_mixer),
  2484. SOC_SINGLE_EXT("SEC_AUX_PCM_TX_Voip", MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  2485. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2486. msm_routing_put_voice_mixer),
  2487. SOC_SINGLE_EXT("PRI_MI2S_TX_Voip", MSM_BACKEND_DAI_PRI_MI2S_TX,
  2488. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2489. msm_routing_put_voice_mixer),
  2490. };
  2491. static const struct snd_kcontrol_new tx_voice_stub_mixer_controls[] = {
  2492. SOC_SINGLE_EXT("STUB_TX_HL", MSM_BACKEND_DAI_EXTPROC_TX,
  2493. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2494. msm_routing_put_voice_stub_mixer),
  2495. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX", MSM_BACKEND_DAI_INT_BT_SCO_TX,
  2496. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2497. msm_routing_put_voice_stub_mixer),
  2498. SOC_SINGLE_EXT("SLIM_1_TX", MSM_BACKEND_DAI_SLIMBUS_1_TX,
  2499. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2500. msm_routing_put_voice_stub_mixer),
  2501. SOC_SINGLE_EXT("STUB_1_TX_HL", MSM_BACKEND_DAI_EXTPROC_EC_TX,
  2502. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2503. msm_routing_put_voice_stub_mixer),
  2504. SOC_SINGLE_EXT("MI2S_TX", MSM_BACKEND_DAI_MI2S_TX,
  2505. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2506. msm_routing_put_voice_stub_mixer),
  2507. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  2508. SOC_SINGLE_EXT("AUX_PCM_UL_TX", MSM_BACKEND_DAI_AUXPCM_TX,
  2509. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2510. msm_routing_put_voice_stub_mixer),
  2511. SOC_SINGLE_EXT("SEC_AUX_PCM_UL_TX", MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  2512. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2513. msm_routing_put_voice_stub_mixer),
  2514. SOC_SINGLE_EXT("SLIM_0_TX", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2515. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2516. msm_routing_put_voice_stub_mixer),
  2517. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  2518. };
  2519. static const struct snd_kcontrol_new tx_qchat_mixer_controls[] = {
  2520. SOC_SINGLE_EXT("PRI_TX_QCHAT", MSM_BACKEND_DAI_PRI_I2S_TX,
  2521. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2522. msm_routing_put_voice_mixer),
  2523. SOC_SINGLE_EXT("SLIM_0_TX_QCHAT", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2524. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2525. msm_routing_put_voice_mixer),
  2526. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX_QCHAT",
  2527. MSM_BACKEND_DAI_INT_BT_SCO_TX, MSM_FRONTEND_DAI_QCHAT, 1, 0,
  2528. msm_routing_get_voice_mixer, msm_routing_put_voice_mixer),
  2529. SOC_SINGLE_EXT("AFE_PCM_TX_QCHAT", MSM_BACKEND_DAI_AFE_PCM_TX,
  2530. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2531. msm_routing_put_voice_mixer),
  2532. SOC_SINGLE_EXT("AUX_PCM_TX_QCHAT", MSM_BACKEND_DAI_AUXPCM_TX,
  2533. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2534. msm_routing_put_voice_mixer),
  2535. SOC_SINGLE_EXT("SEC_AUX_PCM_TX_QCHAT", MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  2536. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2537. msm_routing_put_voice_mixer),
  2538. SOC_SINGLE_EXT("MI2S_TX_QCHAT", MSM_BACKEND_DAI_MI2S_TX,
  2539. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2540. msm_routing_put_voice_mixer),
  2541. SOC_SINGLE_EXT("PRI_MI2S_TX_QCHAT", MSM_BACKEND_DAI_PRI_MI2S_TX,
  2542. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2543. msm_routing_put_voice_mixer),
  2544. };
  2545. static const struct snd_kcontrol_new sbus_0_rx_port_mixer_controls[] = {
  2546. SOC_SINGLE_EXT("INTERNAL_FM_TX", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  2547. MSM_BACKEND_DAI_INT_FM_TX, 1, 0, msm_routing_get_port_mixer,
  2548. msm_routing_put_port_mixer),
  2549. SOC_SINGLE_EXT("SLIM_0_TX", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  2550. MSM_BACKEND_DAI_SLIMBUS_0_TX, 1, 0, msm_routing_get_port_mixer,
  2551. msm_routing_put_port_mixer),
  2552. SOC_SINGLE_EXT("AUX_PCM_UL_TX", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  2553. MSM_BACKEND_DAI_AUXPCM_TX, 1, 0, msm_routing_get_port_mixer,
  2554. msm_routing_put_port_mixer),
  2555. SOC_SINGLE_EXT("SEC_AUX_PCM_UL_TX", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  2556. MSM_BACKEND_DAI_SEC_AUXPCM_TX, 1, 0, msm_routing_get_port_mixer,
  2557. msm_routing_put_port_mixer),
  2558. SOC_SINGLE_EXT("MI2S_TX", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  2559. MSM_BACKEND_DAI_MI2S_TX, 1, 0, msm_routing_get_port_mixer,
  2560. msm_routing_put_port_mixer),
  2561. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  2562. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  2563. MSM_BACKEND_DAI_INT_BT_SCO_TX, 1, 0, msm_routing_get_port_mixer,
  2564. msm_routing_put_port_mixer),
  2565. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  2566. };
  2567. static const struct snd_kcontrol_new auxpcm_rx_port_mixer_controls[] = {
  2568. SOC_SINGLE_EXT("AUX_PCM_UL_TX", MSM_BACKEND_DAI_AUXPCM_RX,
  2569. MSM_BACKEND_DAI_AUXPCM_TX, 1, 0, msm_routing_get_port_mixer,
  2570. msm_routing_put_port_mixer),
  2571. SOC_SINGLE_EXT("SLIM_0_TX", MSM_BACKEND_DAI_AUXPCM_RX,
  2572. MSM_BACKEND_DAI_SLIMBUS_0_TX, 1, 0, msm_routing_get_port_mixer,
  2573. msm_routing_put_port_mixer),
  2574. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  2575. SOC_SINGLE_EXT("SEC_AUX_PCM_UL_TX", MSM_BACKEND_DAI_AUXPCM_RX,
  2576. MSM_BACKEND_DAI_SEC_AUXPCM_TX, 1, 0, msm_routing_get_port_mixer,
  2577. msm_routing_put_port_mixer),
  2578. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  2579. };
  2580. static const struct snd_kcontrol_new sec_auxpcm_rx_port_mixer_controls[] = {
  2581. SOC_SINGLE_EXT("SEC_AUX_PCM_UL_TX", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2582. MSM_BACKEND_DAI_SEC_AUXPCM_TX, 1, 0, msm_routing_get_port_mixer,
  2583. msm_routing_put_port_mixer),
  2584. SOC_SINGLE_EXT("SLIM_0_TX", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2585. MSM_BACKEND_DAI_SLIMBUS_0_TX, 1, 0, msm_routing_get_port_mixer,
  2586. msm_routing_put_port_mixer),
  2587. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  2588. SOC_SINGLE_EXT("AUX_PCM_UL_TX", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2589. MSM_BACKEND_DAI_AUXPCM_TX, 1, 0, msm_routing_get_port_mixer,
  2590. msm_routing_put_port_mixer),
  2591. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  2592. };
  2593. static const struct snd_kcontrol_new sbus_1_rx_port_mixer_controls[] = {
  2594. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX", MSM_BACKEND_DAI_SLIMBUS_1_RX,
  2595. MSM_BACKEND_DAI_INT_BT_SCO_TX, 1, 0, msm_routing_get_port_mixer,
  2596. msm_routing_put_port_mixer),
  2597. };
  2598. static const struct snd_kcontrol_new sbus_3_rx_port_mixer_controls[] = {
  2599. SOC_SINGLE_EXT("INTERNAL_BT_SCO_RX", MSM_BACKEND_DAI_SLIMBUS_3_RX,
  2600. MSM_BACKEND_DAI_INT_BT_SCO_RX, 1, 0, msm_routing_get_port_mixer,
  2601. msm_routing_put_port_mixer),
  2602. SOC_SINGLE_EXT("MI2S_TX", MSM_BACKEND_DAI_SLIMBUS_3_RX,
  2603. MSM_BACKEND_DAI_MI2S_TX, 1, 0, msm_routing_get_port_mixer,
  2604. msm_routing_put_port_mixer),
  2605. };
  2606. static const struct snd_kcontrol_new bt_sco_rx_port_mixer_controls[] = {
  2607. SOC_SINGLE_EXT("SLIM_1_TX", MSM_BACKEND_DAI_INT_BT_SCO_RX,
  2608. MSM_BACKEND_DAI_SLIMBUS_1_TX, 1, 0, msm_routing_get_port_mixer,
  2609. msm_routing_put_port_mixer),
  2610. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  2611. SOC_SINGLE_EXT("SLIM_0_TX", MSM_BACKEND_DAI_INT_BT_SCO_RX,
  2612. MSM_BACKEND_DAI_SLIMBUS_0_TX, 1, 0, msm_routing_get_port_mixer,
  2613. msm_routing_put_port_mixer),
  2614. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  2615. };
  2616. static const struct snd_kcontrol_new afe_pcm_rx_port_mixer_controls[] = {
  2617. SOC_SINGLE_EXT("INTERNAL_FM_TX", MSM_BACKEND_DAI_AFE_PCM_RX,
  2618. MSM_BACKEND_DAI_INT_FM_TX, 1, 0, msm_routing_get_port_mixer,
  2619. msm_routing_put_port_mixer),
  2620. };
  2621. static const struct snd_kcontrol_new hdmi_rx_port_mixer_controls[] = {
  2622. SOC_SINGLE_EXT("MI2S_TX", MSM_BACKEND_DAI_HDMI_RX,
  2623. MSM_BACKEND_DAI_MI2S_TX, 1, 0, msm_routing_get_port_mixer,
  2624. msm_routing_put_port_mixer),
  2625. };
  2626. static const struct snd_kcontrol_new sec_i2s_rx_port_mixer_controls[] = {
  2627. SOC_SINGLE_EXT("MI2S_TX", MSM_BACKEND_DAI_SEC_I2S_RX,
  2628. MSM_BACKEND_DAI_MI2S_TX, 1, 0, msm_routing_get_port_mixer,
  2629. msm_routing_put_port_mixer),
  2630. };
  2631. static const struct snd_kcontrol_new mi2s_rx_port_mixer_controls[] = {
  2632. SOC_SINGLE_EXT("SLIM_1_TX", MSM_BACKEND_DAI_MI2S_RX,
  2633. MSM_BACKEND_DAI_SLIMBUS_1_TX, 1, 0, msm_routing_get_port_mixer,
  2634. msm_routing_put_port_mixer),
  2635. SOC_SINGLE_EXT("MI2S_TX", MSM_BACKEND_DAI_MI2S_RX,
  2636. MSM_BACKEND_DAI_MI2S_TX, 1, 0, msm_routing_get_port_mixer,
  2637. msm_routing_put_port_mixer),
  2638. };
  2639. static const struct snd_kcontrol_new primary_mi2s_rx_port_mixer_controls[] = {
  2640. SOC_SINGLE_EXT("SEC_MI2S_TX", MSM_BACKEND_DAI_PRI_MI2S_RX,
  2641. MSM_BACKEND_DAI_SECONDARY_MI2S_TX, 1, 0, msm_routing_get_port_mixer,
  2642. msm_routing_put_port_mixer),
  2643. };
  2644. static const struct snd_kcontrol_new fm_switch_mixer_controls =
  2645. SOC_SINGLE_EXT("Switch", SND_SOC_NOPM,
  2646. 0, 1, 0, msm_routing_get_switch_mixer,
  2647. msm_routing_put_switch_mixer);
  2648. static const struct snd_kcontrol_new pcm_rx_switch_mixer_controls =
  2649. SOC_SINGLE_EXT("Switch", SND_SOC_NOPM,
  2650. 0, 1, 0, msm_routing_get_fm_pcmrx_switch_mixer,
  2651. msm_routing_put_fm_pcmrx_switch_mixer);
  2652. static const struct snd_kcontrol_new pri_mi2s_rx_switch_mixer_controls =
  2653. SOC_SINGLE_EXT("Switch", SND_SOC_NOPM,
  2654. 0, 1, 0, msm_routing_get_switch_mixer,
  2655. msm_routing_put_switch_mixer);
  2656. static const struct soc_enum lsm_mux_enum =
  2657. SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(mad_audio_mux_text), mad_audio_mux_text);
  2658. static const struct snd_kcontrol_new lsm1_mux =
  2659. SOC_DAPM_ENUM_EXT("LSM1 MUX", lsm_mux_enum,
  2660. msm_routing_lsm_mux_get,
  2661. msm_routing_lsm_mux_put);
  2662. static const struct snd_kcontrol_new lsm2_mux =
  2663. SOC_DAPM_ENUM_EXT("LSM2 MUX", lsm_mux_enum,
  2664. msm_routing_lsm_mux_get,
  2665. msm_routing_lsm_mux_put);
  2666. static const struct snd_kcontrol_new lsm3_mux =
  2667. SOC_DAPM_ENUM_EXT("LSM3 MUX", lsm_mux_enum,
  2668. msm_routing_lsm_mux_get,
  2669. msm_routing_lsm_mux_put);
  2670. static const struct snd_kcontrol_new lsm4_mux =
  2671. SOC_DAPM_ENUM_EXT("LSM4 MUX", lsm_mux_enum,
  2672. msm_routing_lsm_mux_get,
  2673. msm_routing_lsm_mux_put);
  2674. static const struct snd_kcontrol_new lsm5_mux =
  2675. SOC_DAPM_ENUM_EXT("LSM5 MUX", lsm_mux_enum,
  2676. msm_routing_lsm_mux_get,
  2677. msm_routing_lsm_mux_put);
  2678. static const struct snd_kcontrol_new lsm6_mux =
  2679. SOC_DAPM_ENUM_EXT("LSM6 MUX", lsm_mux_enum,
  2680. msm_routing_lsm_mux_get,
  2681. msm_routing_lsm_mux_put);
  2682. static const struct snd_kcontrol_new lsm7_mux =
  2683. SOC_DAPM_ENUM_EXT("LSM7 MUX", lsm_mux_enum,
  2684. msm_routing_lsm_mux_get,
  2685. msm_routing_lsm_mux_put);
  2686. static const struct snd_kcontrol_new lsm8_mux =
  2687. SOC_DAPM_ENUM_EXT("LSM8 MUX", lsm_mux_enum,
  2688. msm_routing_lsm_mux_get,
  2689. msm_routing_lsm_mux_put);
  2690. static const char * const lsm_func_text[] = {
  2691. "None", "AUDIO", "BEACON", "ULTRASOUND", "SWAUDIO",
  2692. };
  2693. static const struct soc_enum lsm_func_enum =
  2694. SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(lsm_func_text), lsm_func_text);
  2695. static const struct snd_kcontrol_new lsm_function[] = {
  2696. SOC_ENUM_EXT(SLIMBUS_0_TX_TEXT" "LSM_FUNCTION_TEXT, lsm_func_enum,
  2697. msm_routing_lsm_func_get, msm_routing_lsm_func_put),
  2698. SOC_ENUM_EXT(SLIMBUS_1_TX_TEXT" "LSM_FUNCTION_TEXT, lsm_func_enum,
  2699. msm_routing_lsm_func_get, msm_routing_lsm_func_put),
  2700. SOC_ENUM_EXT(SLIMBUS_2_TX_TEXT" "LSM_FUNCTION_TEXT, lsm_func_enum,
  2701. msm_routing_lsm_func_get, msm_routing_lsm_func_put),
  2702. SOC_ENUM_EXT(SLIMBUS_3_TX_TEXT" "LSM_FUNCTION_TEXT, lsm_func_enum,
  2703. msm_routing_lsm_func_get, msm_routing_lsm_func_put),
  2704. SOC_ENUM_EXT(SLIMBUS_4_TX_TEXT" "LSM_FUNCTION_TEXT, lsm_func_enum,
  2705. msm_routing_lsm_func_get, msm_routing_lsm_func_put),
  2706. SOC_ENUM_EXT(SLIMBUS_5_TX_TEXT" "LSM_FUNCTION_TEXT, lsm_func_enum,
  2707. msm_routing_lsm_func_get, msm_routing_lsm_func_put),
  2708. };
  2709. static const char * const aanc_slim_0_rx_text[] = {
  2710. "ZERO", "SLIMBUS_0_TX", "SLIMBUS_1_TX", "SLIMBUS_2_TX", "SLIMBUS_3_TX",
  2711. "SLIMBUS_4_TX", "SLIMBUS_5_TX", "SLIMBUS_6_TX"
  2712. };
  2713. static const struct soc_enum aanc_slim_0_rx_enum =
  2714. SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(aanc_slim_0_rx_text),
  2715. aanc_slim_0_rx_text);
  2716. static const struct snd_kcontrol_new aanc_slim_0_rx_mux[] = {
  2717. SOC_DAPM_ENUM_EXT("AANC_SLIM_0_RX MUX", aanc_slim_0_rx_enum,
  2718. msm_routing_slim_0_rx_aanc_mux_get,
  2719. msm_routing_slim_0_rx_aanc_mux_put)
  2720. };
  2721. static const struct snd_kcontrol_new int_fm_vol_mixer_controls[] = {
  2722. SOC_SINGLE_EXT_TLV("Internal FM RX Volume", SND_SOC_NOPM, 0,
  2723. INT_RX_VOL_GAIN, 0, msm_routing_get_fm_vol_mixer,
  2724. msm_routing_set_fm_vol_mixer, fm_rx_vol_gain),
  2725. };
  2726. static const struct snd_kcontrol_new int_hfp_vol_mixer_controls[] = {
  2727. SOC_SINGLE_EXT_TLV("Internal HFP RX Volume", SND_SOC_NOPM, 0,
  2728. INT_RX_VOL_GAIN, 0, msm_routing_get_hfp_vol_mixer,
  2729. msm_routing_set_hfp_vol_mixer, hfp_rx_vol_gain),
  2730. };
  2731. static const struct snd_kcontrol_new multimedia2_vol_mixer_controls[] = {
  2732. SOC_SINGLE_EXT_TLV("HIFI2 RX Volume", SND_SOC_NOPM, 0,
  2733. INT_RX_VOL_GAIN, 0, msm_routing_get_multimedia2_vol_mixer,
  2734. msm_routing_set_multimedia2_vol_mixer, multimedia2_rx_vol_gain),
  2735. };
  2736. static const struct snd_kcontrol_new multimedia5_vol_mixer_controls[] = {
  2737. SOC_SINGLE_EXT_TLV("HIFI3 RX Volume", SND_SOC_NOPM, 0,
  2738. INT_RX_VOL_GAIN, 0, msm_routing_get_multimedia5_vol_mixer,
  2739. msm_routing_set_multimedia5_vol_mixer, multimedia5_rx_vol_gain),
  2740. };
  2741. static const struct snd_kcontrol_new multi_ch_channel_map_mixer_controls[] = {
  2742. SOC_SINGLE_MULTI_EXT("Playback Channel Map", SND_SOC_NOPM, 0, 16,
  2743. 0, 8, msm_routing_get_channel_map_mixer,
  2744. msm_routing_put_channel_map_mixer),
  2745. };
  2746. static const struct snd_kcontrol_new lpa_SRS_trumedia_controls[] = {
  2747. {.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  2748. .name = "SRS TruMedia",
  2749. .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |
  2750. SNDRV_CTL_ELEM_ACCESS_READWRITE,
  2751. .info = snd_soc_info_volsw, \
  2752. .get = msm_routing_get_srs_trumedia_control,
  2753. .put = msm_routing_set_srs_trumedia_control,
  2754. .private_value = ((unsigned long)&(struct soc_mixer_control)
  2755. {.reg = SND_SOC_NOPM,
  2756. .rreg = SND_SOC_NOPM,
  2757. .shift = 0,
  2758. .rshift = 0,
  2759. .max = 0xFFFFFFFF,
  2760. .platform_max = 0xFFFFFFFF,
  2761. .invert = 0
  2762. })
  2763. }
  2764. };
  2765. static const struct snd_kcontrol_new lpa_SRS_trumedia_controls_HDMI[] = {
  2766. {.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  2767. .name = "SRS TruMedia HDMI",
  2768. .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |
  2769. SNDRV_CTL_ELEM_ACCESS_READWRITE,
  2770. .info = snd_soc_info_volsw, \
  2771. .get = msm_routing_get_srs_trumedia_control,
  2772. .put = msm_routing_set_srs_trumedia_control_HDMI,
  2773. .private_value = ((unsigned long)&(struct soc_mixer_control)
  2774. {.reg = SND_SOC_NOPM,
  2775. .rreg = SND_SOC_NOPM,
  2776. .shift = 0,
  2777. .rshift = 0,
  2778. .max = 0xFFFFFFFF,
  2779. .platform_max = 0xFFFFFFFF,
  2780. .invert = 0
  2781. })
  2782. }
  2783. };
  2784. static const struct snd_kcontrol_new lpa_SRS_trumedia_controls_I2S[] = {
  2785. {.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  2786. .name = "SRS TruMedia I2S",
  2787. .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |
  2788. SNDRV_CTL_ELEM_ACCESS_READWRITE,
  2789. .info = snd_soc_info_volsw, \
  2790. .get = msm_routing_get_srs_trumedia_control,
  2791. .put = msm_routing_set_srs_trumedia_control_I2S,
  2792. .private_value = ((unsigned long)&(struct soc_mixer_control)
  2793. {.reg = SND_SOC_NOPM,
  2794. .rreg = SND_SOC_NOPM,
  2795. .shift = 0,
  2796. .rshift = 0,
  2797. .max = 0xFFFFFFFF,
  2798. .platform_max = 0xFFFFFFFF,
  2799. .invert = 0
  2800. })
  2801. }
  2802. };
  2803. int msm_routing_get_dolby_security_control(
  2804. struct snd_kcontrol *kcontrol,
  2805. struct snd_ctl_elem_value *ucontrol) {
  2806. /* not used while setting the manfr id*/
  2807. return 0;
  2808. }
  2809. int msm_routing_put_dolby_security_control(
  2810. struct snd_kcontrol *kcontrol,
  2811. struct snd_ctl_elem_value *ucontrol) {
  2812. int manufacturer_id = ucontrol->value.integer.value[0];
  2813. core_set_dolby_manufacturer_id(manufacturer_id);
  2814. return 0;
  2815. }
  2816. static const struct snd_kcontrol_new dolby_security_controls[] = {
  2817. SOC_SINGLE_MULTI_EXT("DS1 Security", SND_SOC_NOPM, 0,
  2818. 0xFFFFFFFF, 0, 1, msm_routing_get_dolby_security_control,
  2819. msm_routing_put_dolby_security_control),
  2820. };
  2821. static const struct snd_kcontrol_new dolby_dap_param_to_set_controls[] = {
  2822. SOC_SINGLE_MULTI_EXT("DS1 DAP Set Param", SND_SOC_NOPM, 0, 0xFFFFFFFF,
  2823. 0, 128, msm_routing_get_dolby_dap_param_to_set_control,
  2824. msm_routing_put_dolby_dap_param_to_set_control),
  2825. };
  2826. static const struct snd_kcontrol_new dolby_dap_param_to_get_controls[] = {
  2827. SOC_SINGLE_MULTI_EXT("DS1 DAP Get Param", SND_SOC_NOPM, 0, 0xFFFFFFFF,
  2828. 0, 128, msm_routing_get_dolby_dap_param_to_get_control,
  2829. msm_routing_put_dolby_dap_param_to_get_control),
  2830. };
  2831. static const struct snd_kcontrol_new dolby_dap_param_visualizer_controls[] = {
  2832. SOC_SINGLE_MULTI_EXT("DS1 DAP Get Visualizer", SND_SOC_NOPM, 0,
  2833. 0xFFFFFFFF, 0, 41, msm_routing_get_dolby_dap_param_visualizer_control,
  2834. msm_routing_put_dolby_dap_param_visualizer_control),
  2835. };
  2836. static const struct snd_kcontrol_new dolby_dap_param_end_point_controls[] = {
  2837. SOC_SINGLE_MULTI_EXT("DS1 DAP Endpoint", SND_SOC_NOPM, 0,
  2838. 0xFFFFFFFF, 0, 1, msm_routing_get_dolby_dap_endpoint_control,
  2839. msm_routing_put_dolby_dap_endpoint_control),
  2840. };
  2841. int msm_routing_get_rms_value_control(struct snd_kcontrol *kcontrol,
  2842. struct snd_ctl_elem_value *ucontrol) {
  2843. int rc = 0;
  2844. int be_idx = 0;
  2845. char *param_value;
  2846. int *update_param_value;
  2847. uint32_t param_length = sizeof(uint32_t);
  2848. uint32_t param_payload_len = RMS_PAYLOAD_LEN * sizeof(uint32_t);
  2849. param_value = kzalloc(param_length, GFP_KERNEL);
  2850. if (!param_value) {
  2851. pr_err("%s, param memory alloc failed\n", __func__);
  2852. return -ENOMEM;
  2853. }
  2854. for (be_idx = 0; be_idx < MSM_BACKEND_DAI_MAX; be_idx++)
  2855. if (msm_bedais[be_idx].port_id == SLIMBUS_0_TX)
  2856. break;
  2857. if ((be_idx < MSM_BACKEND_DAI_MAX) && msm_bedais[be_idx].active) {
  2858. rc = adm_get_params(SLIMBUS_0_TX,
  2859. RMS_MODULEID_APPI_PASSTHRU,
  2860. RMS_PARAM_FIRST_SAMPLE,
  2861. param_length + param_payload_len,
  2862. param_value);
  2863. if (rc) {
  2864. pr_err("%s: get parameters failed\n", __func__);
  2865. kfree(param_value);
  2866. return -EINVAL;
  2867. }
  2868. update_param_value = (int *)param_value;
  2869. ucontrol->value.integer.value[0] = update_param_value[0];
  2870. pr_debug("%s: FROM DSP value[0] 0x%x\n",
  2871. __func__, update_param_value[0]);
  2872. }
  2873. kfree(param_value);
  2874. return 0;
  2875. }
  2876. int msm_routing_put_rms_value_control(struct snd_kcontrol *kcontrol,
  2877. struct snd_ctl_elem_value *ucontrol) {
  2878. /* not used */
  2879. return 0;
  2880. }
  2881. static const struct snd_kcontrol_new get_rms_controls[] = {
  2882. SOC_SINGLE_EXT("Get RMS", SND_SOC_NOPM, 0, 0xFFFFFFFF,
  2883. 0, msm_routing_get_rms_value_control,
  2884. msm_routing_put_rms_value_control),
  2885. };
  2886. static int msm_voc_session_id_put(struct snd_kcontrol *kcontrol,
  2887. struct snd_ctl_elem_value *ucontrol)
  2888. {
  2889. voc_session_id = ucontrol->value.integer.value[0];
  2890. pr_debug("%s: voc_session_id=%u\n", __func__, voc_session_id);
  2891. return 0;
  2892. }
  2893. static int msm_voc_session_id_get(struct snd_kcontrol *kcontrol,
  2894. struct snd_ctl_elem_value *ucontrol)
  2895. {
  2896. ucontrol->value.integer.value[0] = voc_session_id;
  2897. return 0;
  2898. }
  2899. static struct snd_kcontrol_new msm_voc_session_controls[] = {
  2900. SOC_SINGLE_MULTI_EXT("Voc VSID", SND_SOC_NOPM, 0,
  2901. 0xFFFFFFFF, 0, 1, msm_voc_session_id_get,
  2902. msm_voc_session_id_put),
  2903. };
  2904. static const struct snd_kcontrol_new eq_enable_mixer_controls[] = {
  2905. SOC_SINGLE_EXT("MultiMedia1 EQ Enable", SND_SOC_NOPM,
  2906. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_eq_enable_mixer,
  2907. msm_routing_put_eq_enable_mixer),
  2908. SOC_SINGLE_EXT("MultiMedia2 EQ Enable", SND_SOC_NOPM,
  2909. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_eq_enable_mixer,
  2910. msm_routing_put_eq_enable_mixer),
  2911. SOC_SINGLE_EXT("MultiMedia3 EQ Enable", SND_SOC_NOPM,
  2912. MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_eq_enable_mixer,
  2913. msm_routing_put_eq_enable_mixer),
  2914. };
  2915. static const struct snd_kcontrol_new eq_band_mixer_controls[] = {
  2916. SOC_SINGLE_EXT("MultiMedia1 EQ Band Count", SND_SOC_NOPM,
  2917. MSM_FRONTEND_DAI_MULTIMEDIA1, 11, 0,
  2918. msm_routing_get_eq_band_count_audio_mixer,
  2919. msm_routing_put_eq_band_count_audio_mixer),
  2920. SOC_SINGLE_EXT("MultiMedia2 EQ Band Count", SND_SOC_NOPM,
  2921. MSM_FRONTEND_DAI_MULTIMEDIA2, 11, 0,
  2922. msm_routing_get_eq_band_count_audio_mixer,
  2923. msm_routing_put_eq_band_count_audio_mixer),
  2924. SOC_SINGLE_EXT("MultiMedia3 EQ Band Count", SND_SOC_NOPM,
  2925. MSM_FRONTEND_DAI_MULTIMEDIA3, 11, 0,
  2926. msm_routing_get_eq_band_count_audio_mixer,
  2927. msm_routing_put_eq_band_count_audio_mixer),
  2928. };
  2929. static const struct snd_kcontrol_new eq_coeff_mixer_controls[] = {
  2930. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band1", EQ_BAND1,
  2931. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2932. msm_routing_get_eq_band_audio_mixer,
  2933. msm_routing_put_eq_band_audio_mixer),
  2934. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band2", EQ_BAND2,
  2935. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2936. msm_routing_get_eq_band_audio_mixer,
  2937. msm_routing_put_eq_band_audio_mixer),
  2938. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band3", EQ_BAND3,
  2939. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2940. msm_routing_get_eq_band_audio_mixer,
  2941. msm_routing_put_eq_band_audio_mixer),
  2942. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band4", EQ_BAND4,
  2943. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2944. msm_routing_get_eq_band_audio_mixer,
  2945. msm_routing_put_eq_band_audio_mixer),
  2946. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band5", EQ_BAND5,
  2947. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2948. msm_routing_get_eq_band_audio_mixer,
  2949. msm_routing_put_eq_band_audio_mixer),
  2950. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band6", EQ_BAND6,
  2951. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2952. msm_routing_get_eq_band_audio_mixer,
  2953. msm_routing_put_eq_band_audio_mixer),
  2954. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band7", EQ_BAND7,
  2955. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2956. msm_routing_get_eq_band_audio_mixer,
  2957. msm_routing_put_eq_band_audio_mixer),
  2958. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band8", EQ_BAND8,
  2959. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2960. msm_routing_get_eq_band_audio_mixer,
  2961. msm_routing_put_eq_band_audio_mixer),
  2962. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band9", EQ_BAND9,
  2963. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2964. msm_routing_get_eq_band_audio_mixer,
  2965. msm_routing_put_eq_band_audio_mixer),
  2966. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band10", EQ_BAND10,
  2967. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2968. msm_routing_get_eq_band_audio_mixer,
  2969. msm_routing_put_eq_band_audio_mixer),
  2970. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band11", EQ_BAND11,
  2971. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2972. msm_routing_get_eq_band_audio_mixer,
  2973. msm_routing_put_eq_band_audio_mixer),
  2974. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band12", EQ_BAND12,
  2975. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2976. msm_routing_get_eq_band_audio_mixer,
  2977. msm_routing_put_eq_band_audio_mixer),
  2978. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band1", EQ_BAND1,
  2979. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  2980. msm_routing_get_eq_band_audio_mixer,
  2981. msm_routing_put_eq_band_audio_mixer),
  2982. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band2", EQ_BAND2,
  2983. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  2984. msm_routing_get_eq_band_audio_mixer,
  2985. msm_routing_put_eq_band_audio_mixer),
  2986. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band3", EQ_BAND3,
  2987. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  2988. msm_routing_get_eq_band_audio_mixer,
  2989. msm_routing_put_eq_band_audio_mixer),
  2990. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band4", EQ_BAND4,
  2991. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  2992. msm_routing_get_eq_band_audio_mixer,
  2993. msm_routing_put_eq_band_audio_mixer),
  2994. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band5", EQ_BAND5,
  2995. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  2996. msm_routing_get_eq_band_audio_mixer,
  2997. msm_routing_put_eq_band_audio_mixer),
  2998. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band6", EQ_BAND6,
  2999. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  3000. msm_routing_get_eq_band_audio_mixer,
  3001. msm_routing_put_eq_band_audio_mixer),
  3002. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band7", EQ_BAND7,
  3003. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  3004. msm_routing_get_eq_band_audio_mixer,
  3005. msm_routing_put_eq_band_audio_mixer),
  3006. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band8", EQ_BAND8,
  3007. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  3008. msm_routing_get_eq_band_audio_mixer,
  3009. msm_routing_put_eq_band_audio_mixer),
  3010. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band9", EQ_BAND9,
  3011. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  3012. msm_routing_get_eq_band_audio_mixer,
  3013. msm_routing_put_eq_band_audio_mixer),
  3014. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band10", EQ_BAND10,
  3015. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  3016. msm_routing_get_eq_band_audio_mixer,
  3017. msm_routing_put_eq_band_audio_mixer),
  3018. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band11", EQ_BAND11,
  3019. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  3020. msm_routing_get_eq_band_audio_mixer,
  3021. msm_routing_put_eq_band_audio_mixer),
  3022. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band12", EQ_BAND12,
  3023. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  3024. msm_routing_get_eq_band_audio_mixer,
  3025. msm_routing_put_eq_band_audio_mixer),
  3026. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band1", EQ_BAND1,
  3027. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3028. msm_routing_get_eq_band_audio_mixer,
  3029. msm_routing_put_eq_band_audio_mixer),
  3030. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band2", EQ_BAND2,
  3031. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3032. msm_routing_get_eq_band_audio_mixer,
  3033. msm_routing_put_eq_band_audio_mixer),
  3034. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band3", EQ_BAND3,
  3035. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3036. msm_routing_get_eq_band_audio_mixer,
  3037. msm_routing_put_eq_band_audio_mixer),
  3038. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band4", EQ_BAND4,
  3039. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3040. msm_routing_get_eq_band_audio_mixer,
  3041. msm_routing_put_eq_band_audio_mixer),
  3042. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band5", EQ_BAND5,
  3043. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3044. msm_routing_get_eq_band_audio_mixer,
  3045. msm_routing_put_eq_band_audio_mixer),
  3046. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band6", EQ_BAND6,
  3047. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3048. msm_routing_get_eq_band_audio_mixer,
  3049. msm_routing_put_eq_band_audio_mixer),
  3050. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band7", EQ_BAND7,
  3051. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3052. msm_routing_get_eq_band_audio_mixer,
  3053. msm_routing_put_eq_band_audio_mixer),
  3054. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band8", EQ_BAND8,
  3055. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3056. msm_routing_get_eq_band_audio_mixer,
  3057. msm_routing_put_eq_band_audio_mixer),
  3058. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band9", EQ_BAND9,
  3059. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3060. msm_routing_get_eq_band_audio_mixer,
  3061. msm_routing_put_eq_band_audio_mixer),
  3062. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band10", EQ_BAND10,
  3063. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3064. msm_routing_get_eq_band_audio_mixer,
  3065. msm_routing_put_eq_band_audio_mixer),
  3066. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band11", EQ_BAND11,
  3067. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3068. msm_routing_get_eq_band_audio_mixer,
  3069. msm_routing_put_eq_band_audio_mixer),
  3070. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band12", EQ_BAND12,
  3071. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3072. msm_routing_get_eq_band_audio_mixer,
  3073. msm_routing_put_eq_band_audio_mixer),
  3074. };
  3075. static int spkr_prot_put_vi_lch_port(struct snd_kcontrol *kcontrol,
  3076. struct snd_ctl_elem_value *ucontrol)
  3077. {
  3078. int ret = 0;
  3079. int item;
  3080. struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
  3081. pr_debug("%s item is %d\n", __func__,
  3082. ucontrol->value.enumerated.item[0]);
  3083. mutex_lock(&routing_lock);
  3084. item = ucontrol->value.enumerated.item[0];
  3085. if (item < e->max) {
  3086. pr_debug("%s RX DAI ID %d TX DAI id %d\n",
  3087. __func__, e->shift_l , e->values[item]);
  3088. if (e->shift_l < MSM_BACKEND_DAI_MAX &&
  3089. e->values[item] < MSM_BACKEND_DAI_MAX)
  3090. /* Enable feedback TX path */
  3091. ret = afe_spk_prot_feed_back_cfg(
  3092. msm_bedais[e->values[item]].port_id,
  3093. msm_bedais[e->shift_l].port_id, 1, 0, 1);
  3094. else {
  3095. pr_debug("%s values are out of range item %d\n",
  3096. __func__, e->values[item]);
  3097. /* Disable feedback TX path */
  3098. if (e->values[item] == MSM_BACKEND_DAI_MAX)
  3099. ret = afe_spk_prot_feed_back_cfg(0, 0, 0, 0, 0);
  3100. else
  3101. ret = -EINVAL;
  3102. }
  3103. } else {
  3104. pr_err("%s item value is out of range item\n", __func__);
  3105. ret = -EINVAL;
  3106. }
  3107. mutex_unlock(&routing_lock);
  3108. return ret;
  3109. }
  3110. static int spkr_prot_get_vi_lch_port(struct snd_kcontrol *kcontrol,
  3111. struct snd_ctl_elem_value *ucontrol)
  3112. {
  3113. pr_debug("%s\n", __func__);
  3114. return 0;
  3115. }
  3116. static const char * const slim0_rx_vi_fb_tx_lch_mux_text[] = {
  3117. "ZERO", "SLIM4_TX"
  3118. };
  3119. static const int slim0_rx_vi_fb_tx_lch_value[] = {
  3120. MSM_BACKEND_DAI_MAX, MSM_BACKEND_DAI_SLIMBUS_4_TX
  3121. };
  3122. static const struct soc_enum slim0_rx_vi_fb_lch_mux_enum =
  3123. SOC_VALUE_ENUM_DOUBLE(0, MSM_BACKEND_DAI_SLIMBUS_0_RX, 0, 0,
  3124. ARRAY_SIZE(slim0_rx_vi_fb_tx_lch_mux_text),
  3125. slim0_rx_vi_fb_tx_lch_mux_text, slim0_rx_vi_fb_tx_lch_value);
  3126. static const struct snd_kcontrol_new slim0_rx_vi_fb_lch_mux =
  3127. SOC_DAPM_ENUM_EXT("SLIM0_RX_VI_FB_LCH_MUX",
  3128. slim0_rx_vi_fb_lch_mux_enum, spkr_prot_get_vi_lch_port,
  3129. spkr_prot_put_vi_lch_port);
  3130. static const struct snd_kcontrol_new ss_solution_mixer_controls[] = {
  3131. SOC_SINGLE_MULTI_EXT("SA data", SND_SOC_NOPM, 0, 65535, 0, 19,
  3132. msm_sec_sa_get, msm_sec_sa_put),
  3133. SOC_SINGLE_MULTI_EXT("VSP data", SND_SOC_NOPM, 0, 65535, 0, 1,
  3134. msm_sec_vsp_get, msm_sec_vsp_put),
  3135. SOC_SINGLE_MULTI_EXT("Audio DHA data", SND_SOC_NOPM, 0, 65535, 0, 13,
  3136. msm_sec_dha_get, msm_sec_dha_put),
  3137. SOC_SINGLE_MULTI_EXT("LRSM data", SND_SOC_NOPM, 0, 65535, 0, 2,
  3138. msm_sec_lrsm_get, msm_sec_lrsm_put),
  3139. SOC_SINGLE_MULTI_EXT("SA_EP data", SND_SOC_NOPM, 0, 65535, 0, 2,
  3140. msm_sec_sa_ep_get, msm_sec_sa_ep_put),
  3141. SOC_SINGLE_MULTI_EXT("MSP data", SND_SOC_NOPM, 0, 65535, 0, 1,
  3142. msm_sec_msp_get, msm_sec_msp_put),
  3143. };
  3144. static const struct snd_soc_dapm_widget msm_qdsp6_widgets[] = {
  3145. /* Frontend AIF */
  3146. /* Widget name equals to Front-End DAI name<Need confirmation>,
  3147. * Stream name must contains substring of front-end dai name
  3148. */
  3149. SND_SOC_DAPM_AIF_IN("MM_DL1", "MultiMedia1 Playback", 0, 0, 0, 0),
  3150. SND_SOC_DAPM_AIF_IN("MM_DL2", "MultiMedia2 Playback", 0, 0, 0, 0),
  3151. SND_SOC_DAPM_AIF_IN("MM_DL3", "MultiMedia3 Playback", 0, 0, 0, 0),
  3152. SND_SOC_DAPM_AIF_IN("MM_DL4", "MultiMedia4 Playback", 0, 0, 0, 0),
  3153. SND_SOC_DAPM_AIF_IN("MM_DL5", "MultiMedia5 Playback", 0, 0, 0, 0),
  3154. SND_SOC_DAPM_AIF_IN("MM_DL6", "MultiMedia6 Playback", 0, 0, 0, 0),
  3155. SND_SOC_DAPM_AIF_IN("MM_DL7", "MultiMedia7 Playback", 0, 0, 0, 0),
  3156. SND_SOC_DAPM_AIF_IN("MM_DL8", "MultiMedia8 Playback", 0, 0, 0, 0),
  3157. SND_SOC_DAPM_AIF_IN("MM_DL9", "MultiMedia9 Playback", 0, 0, 0, 0),
  3158. #ifdef CONFIG_JACK_AUDIO
  3159. SND_SOC_DAPM_AIF_IN("MM_DL10", "MultiMedia10 Playback", 0, 0, 0, 0),
  3160. #endif
  3161. SND_SOC_DAPM_AIF_IN("VOIP_DL", "VoIP Playback", 0, 0, 0, 0),
  3162. SND_SOC_DAPM_AIF_OUT("MM_UL1", "MultiMedia1 Capture", 0, 0, 0, 0),
  3163. SND_SOC_DAPM_AIF_OUT("MM_UL2", "MultiMedia2 Capture", 0, 0, 0, 0),
  3164. SND_SOC_DAPM_AIF_OUT("MM_UL4", "MultiMedia4 Capture", 0, 0, 0, 0),
  3165. SND_SOC_DAPM_AIF_OUT("MM_UL5", "MultiMedia5 Capture", 0, 0, 0, 0),
  3166. SND_SOC_DAPM_AIF_OUT("MM_UL8", "MultiMedia8 Capture", 0, 0, 0, 0),
  3167. SND_SOC_DAPM_AIF_OUT("MM_UL6", "MultiMedia6 Capture", 0, 0, 0, 0),
  3168. SND_SOC_DAPM_AIF_OUT("MM_UL9", "MultiMedia9 Capture", 0, 0, 0, 0),
  3169. #ifdef CONFIG_JACK_AUDIO
  3170. SND_SOC_DAPM_AIF_OUT("MM_UL10", "MultiMedia10 Capture", 0, 0, 0, 0),
  3171. #endif
  3172. SND_SOC_DAPM_AIF_IN("CS-VOICE_DL1", "CS-VOICE Playback", 0, 0, 0, 0),
  3173. SND_SOC_DAPM_AIF_OUT("CS-VOICE_UL1", "CS-VOICE Capture", 0, 0, 0, 0),
  3174. SND_SOC_DAPM_AIF_IN("VOICE2_DL", "Voice2 Playback", 0, 0, 0, 0),
  3175. SND_SOC_DAPM_AIF_OUT("VOICE2_UL", "Voice2 Capture", 0, 0, 0, 0),
  3176. SND_SOC_DAPM_AIF_IN("VoLTE_DL", "VoLTE Playback", 0, 0, 0, 0),
  3177. SND_SOC_DAPM_AIF_OUT("VoLTE_UL", "VoLTE Capture", 0, 0, 0, 0),
  3178. SND_SOC_DAPM_AIF_IN("VoWLAN_DL", "VoWLAN Playback", 0, 0, 0, 0),
  3179. SND_SOC_DAPM_AIF_OUT("VoWLAN_UL", "VoWLAN Capture", 0, 0, 0, 0),
  3180. SND_SOC_DAPM_AIF_OUT("VOIP_UL", "VoIP Capture", 0, 0, 0, 0),
  3181. SND_SOC_DAPM_AIF_IN("SLIM0_DL_HL", "SLIMBUS0_HOSTLESS Playback",
  3182. 0, 0, 0, 0),
  3183. SND_SOC_DAPM_AIF_OUT("SLIM0_UL_HL", "SLIMBUS0_HOSTLESS Capture",
  3184. 0, 0, 0, 0),
  3185. SND_SOC_DAPM_AIF_IN("SLIM1_DL_HL", "SLIMBUS1_HOSTLESS Playback",
  3186. 0, 0, 0, 0),
  3187. SND_SOC_DAPM_AIF_OUT("SLIM1_UL_HL", "SLIMBUS1_HOSTLESS Capture",
  3188. 0, 0, 0, 0),
  3189. SND_SOC_DAPM_AIF_IN("SLIM3_DL_HL", "SLIMBUS3_HOSTLESS Playback",
  3190. 0, 0, 0, 0),
  3191. SND_SOC_DAPM_AIF_OUT("SLIM3_UL_HL", "SLIMBUS3_HOSTLESS Capture",
  3192. 0, 0, 0, 0),
  3193. SND_SOC_DAPM_AIF_IN("SLIM4_DL_HL", "SLIMBUS4_HOSTLESS Playback",
  3194. 0, 0, 0, 0),
  3195. SND_SOC_DAPM_AIF_OUT("SLIM4_UL_HL", "SLIMBUS4_HOSTLESS Capture",
  3196. 0, 0, 0, 0),
  3197. SND_SOC_DAPM_AIF_IN("INTFM_DL_HL", "INT_FM_HOSTLESS Playback",
  3198. 0, 0, 0, 0),
  3199. SND_SOC_DAPM_AIF_OUT("INTFM_UL_HL", "INT_FM_HOSTLESS Capture",
  3200. 0, 0, 0, 0),
  3201. SND_SOC_DAPM_AIF_IN("INTHFP_DL_HL", "INT_HFP_BT_HOSTLESS Playback",
  3202. 0, 0, 0, 0),
  3203. SND_SOC_DAPM_AIF_OUT("INTHFP_UL_HL", "INT_HFP_BT_HOSTLESS Capture",
  3204. 0, 0, 0, 0),
  3205. SND_SOC_DAPM_AIF_IN("HDMI_DL_HL", "HDMI_HOSTLESS Playback", 0, 0, 0, 0),
  3206. SND_SOC_DAPM_AIF_IN("SEC_I2S_DL_HL", "SEC_I2S_RX_HOSTLESS Playback",
  3207. 0, 0, 0, 0),
  3208. SND_SOC_DAPM_AIF_IN("SEC_MI2S_DL_HL",
  3209. "Secondary MI2S_RX Hostless Playback",
  3210. 0, 0, 0, 0),
  3211. SND_SOC_DAPM_AIF_IN("AUXPCM_DL_HL", "AUXPCM_HOSTLESS Playback",
  3212. 0, 0, 0, 0),
  3213. SND_SOC_DAPM_AIF_OUT("AUXPCM_UL_HL", "AUXPCM_HOSTLESS Capture",
  3214. 0, 0, 0, 0),
  3215. SND_SOC_DAPM_AIF_OUT("MI2S_UL_HL", "MI2S_TX_HOSTLESS Capture",
  3216. 0, 0, 0, 0),
  3217. SND_SOC_DAPM_AIF_OUT("PRI_MI2S_UL_HL",
  3218. "Primary MI2S_TX Hostless Capture",
  3219. 0, 0, 0, 0),
  3220. SND_SOC_DAPM_AIF_IN("PRI_MI2S_DL_HL",
  3221. "Primary MI2S_RX Hostless Playback",
  3222. 0, 0, 0, 0),
  3223. SND_SOC_DAPM_AIF_OUT("MI2S_DL_HL", "MI2S_RX_HOSTLESS Playback",
  3224. 0, 0, 0, 0),
  3225. SND_SOC_DAPM_AIF_IN("DTMF_DL_HL", "DTMF_RX_HOSTLESS Playback",
  3226. 0, 0, 0, 0),
  3227. /* LSM */
  3228. SND_SOC_DAPM_AIF_OUT("LSM1_UL_HL", "Listen 1 Audio Service Capture",
  3229. 0, 0, 0, 0),
  3230. SND_SOC_DAPM_AIF_OUT("LSM2_UL_HL", "Listen 2 Audio Service Capture",
  3231. 0, 0, 0, 0),
  3232. SND_SOC_DAPM_AIF_OUT("LSM3_UL_HL", "Listen 3 Audio Service Capture",
  3233. 0, 0, 0, 0),
  3234. SND_SOC_DAPM_AIF_OUT("LSM4_UL_HL", "Listen 4 Audio Service Capture",
  3235. 0, 0, 0, 0),
  3236. SND_SOC_DAPM_AIF_OUT("LSM5_UL_HL", "Listen 5 Audio Service Capture",
  3237. 0, 0, 0, 0),
  3238. SND_SOC_DAPM_AIF_OUT("LSM6_UL_HL", "Listen 6 Audio Service Capture",
  3239. 0, 0, 0, 0),
  3240. SND_SOC_DAPM_AIF_OUT("LSM7_UL_HL", "Listen 7 Audio Service Capture",
  3241. 0, 0, 0, 0),
  3242. SND_SOC_DAPM_AIF_OUT("LSM8_UL_HL", "Listen 8 Audio Service Capture",
  3243. 0, 0, 0, 0),
  3244. SND_SOC_DAPM_AIF_IN("QCHAT_DL", "QCHAT Playback", 0, 0, 0, 0),
  3245. SND_SOC_DAPM_AIF_OUT("QCHAT_UL", "QCHAT Capture", 0, 0, 0, 0),
  3246. /* Backend AIF */
  3247. /* Stream name equals to backend dai link stream name
  3248. */
  3249. SND_SOC_DAPM_AIF_OUT("PRI_I2S_RX", "Primary I2S Playback", 0, 0, 0, 0),
  3250. SND_SOC_DAPM_AIF_OUT("SEC_I2S_RX", "Secondary I2S Playback",
  3251. 0, 0, 0 , 0),
  3252. SND_SOC_DAPM_AIF_OUT("SLIMBUS_0_RX", "Slimbus Playback", 0, 0, 0, 0),
  3253. SND_SOC_DAPM_AIF_OUT("HDMI", "HDMI Playback", 0, 0, 0 , 0),
  3254. SND_SOC_DAPM_AIF_OUT("MI2S_RX", "MI2S Playback", 0, 0, 0, 0),
  3255. SND_SOC_DAPM_AIF_OUT("QUAT_MI2S_RX", "Quaternary MI2S Playback",
  3256. 0, 0, 0, 0),
  3257. SND_SOC_DAPM_AIF_OUT("TERT_MI2S_RX", "Tertiary MI2S Playback",
  3258. 0, 0, 0, 0),
  3259. SND_SOC_DAPM_AIF_OUT("SEC_MI2S_RX", "Secondary MI2S Playback",
  3260. 0, 0, 0, 0),
  3261. SND_SOC_DAPM_AIF_OUT("PRI_MI2S_RX", "Primary MI2S Playback",
  3262. 0, 0, 0, 0),
  3263. SND_SOC_DAPM_AIF_IN("PRI_I2S_TX", "Primary I2S Capture", 0, 0, 0, 0),
  3264. SND_SOC_DAPM_AIF_IN("MI2S_TX", "MI2S Capture", 0, 0, 0, 0),
  3265. SND_SOC_DAPM_AIF_IN("QUAT_MI2S_TX", "Quaternary MI2S Capture",
  3266. 0, 0, 0, 0),
  3267. SND_SOC_DAPM_AIF_IN("PRI_MI2S_TX", "Primary MI2S Capture",
  3268. 0, 0, 0, 0),
  3269. SND_SOC_DAPM_AIF_IN("TERT_MI2S_TX", "Tertiary MI2S Capture",
  3270. 0, 0, 0, 0),
  3271. SND_SOC_DAPM_AIF_IN("SEC_MI2S_TX", "Secondary MI2S Capture",
  3272. 0, 0, 0, 0),
  3273. SND_SOC_DAPM_AIF_IN("SLIMBUS_0_TX", "Slimbus Capture", 0, 0, 0, 0),
  3274. SND_SOC_DAPM_AIF_OUT("INT_BT_SCO_RX", "Internal BT-SCO Playback",
  3275. 0, 0, 0 , 0),
  3276. SND_SOC_DAPM_AIF_IN("INT_BT_SCO_TX", "Internal BT-SCO Capture",
  3277. 0, 0, 0, 0),
  3278. SND_SOC_DAPM_AIF_OUT("INT_FM_RX", "Internal FM Playback",
  3279. 0, 0, 0 , 0),
  3280. SND_SOC_DAPM_AIF_IN("INT_FM_TX", "Internal FM Capture",
  3281. 0, 0, 0, 0),
  3282. SND_SOC_DAPM_AIF_OUT("PCM_RX", "AFE Playback",
  3283. 0, 0, 0 , 0),
  3284. SND_SOC_DAPM_AIF_IN("PCM_TX", "AFE Capture",
  3285. 0, 0, 0 , 0),
  3286. /* incall */
  3287. SND_SOC_DAPM_AIF_OUT("VOICE_PLAYBACK_TX", "Voice Farend Playback",
  3288. 0, 0, 0 , 0),
  3289. SND_SOC_DAPM_AIF_OUT("VOICE2_PLAYBACK_TX", "Voice2 Farend Playback",
  3290. 0, 0, 0 , 0),
  3291. SND_SOC_DAPM_AIF_OUT("SLIMBUS_4_RX", "Slimbus4 Playback",
  3292. 0, 0, 0 , 0),
  3293. SND_SOC_DAPM_AIF_IN("INCALL_RECORD_TX", "Voice Uplink Capture",
  3294. 0, 0, 0, 0),
  3295. SND_SOC_DAPM_AIF_IN("INCALL_RECORD_RX", "Voice Downlink Capture",
  3296. 0, 0, 0, 0),
  3297. SND_SOC_DAPM_AIF_IN("SLIMBUS_4_TX", "Slimbus4 Capture",
  3298. 0, 0, 0, 0),
  3299. SND_SOC_DAPM_AIF_IN("SLIMBUS_5_TX", "Slimbus5 Capture", 0, 0, 0, 0),
  3300. SND_SOC_DAPM_AIF_OUT("AUX_PCM_RX", "AUX PCM Playback", 0, 0, 0, 0),
  3301. SND_SOC_DAPM_AIF_IN("AUX_PCM_TX", "AUX PCM Capture", 0, 0, 0, 0),
  3302. SND_SOC_DAPM_AIF_OUT("SEC_AUX_PCM_RX", "Sec AUX PCM Playback",
  3303. 0, 0, 0, 0),
  3304. SND_SOC_DAPM_AIF_IN("SEC_AUX_PCM_TX", "Sec AUX PCM Capture",
  3305. 0, 0, 0, 0),
  3306. SND_SOC_DAPM_AIF_IN("VOICE_STUB_DL", "VOICE_STUB Playback", 0, 0, 0, 0),
  3307. SND_SOC_DAPM_AIF_OUT("VOICE_STUB_UL", "VOICE_STUB Capture", 0, 0, 0, 0),
  3308. SND_SOC_DAPM_AIF_OUT("STUB_RX", "Stub Playback", 0, 0, 0, 0),
  3309. SND_SOC_DAPM_AIF_IN("STUB_TX", "Stub Capture", 0, 0, 0, 0),
  3310. SND_SOC_DAPM_AIF_OUT("SLIMBUS_1_RX", "Slimbus1 Playback", 0, 0, 0, 0),
  3311. SND_SOC_DAPM_AIF_IN("SLIMBUS_1_TX", "Slimbus1 Capture", 0, 0, 0, 0),
  3312. SND_SOC_DAPM_AIF_IN("STUB_1_TX", "Stub1 Capture", 0, 0, 0, 0),
  3313. SND_SOC_DAPM_AIF_OUT("SLIMBUS_3_RX", "Slimbus3 Playback", 0, 0, 0, 0),
  3314. SND_SOC_DAPM_AIF_IN("SLIMBUS_3_TX", "Slimbus3 Capture", 0, 0, 0, 0),
  3315. /* Switch Definitions */
  3316. SND_SOC_DAPM_SWITCH("SLIMBUS_DL_HL", SND_SOC_NOPM, 0, 0,
  3317. &fm_switch_mixer_controls),
  3318. SND_SOC_DAPM_SWITCH("SLIMBUS1_DL_HL", SND_SOC_NOPM, 0, 0,
  3319. &fm_switch_mixer_controls),
  3320. SND_SOC_DAPM_SWITCH("SLIMBUS3_DL_HL", SND_SOC_NOPM, 0, 0,
  3321. &fm_switch_mixer_controls),
  3322. SND_SOC_DAPM_SWITCH("SLIMBUS4_DL_HL", SND_SOC_NOPM, 0, 0,
  3323. &fm_switch_mixer_controls),
  3324. SND_SOC_DAPM_SWITCH("PCM_RX_DL_HL", SND_SOC_NOPM, 0, 0,
  3325. &pcm_rx_switch_mixer_controls),
  3326. SND_SOC_DAPM_SWITCH("PRI_MI2S_RX_DL_HL", SND_SOC_NOPM, 0, 0,
  3327. &pri_mi2s_rx_switch_mixer_controls),
  3328. /* Mux Definitions */
  3329. SND_SOC_DAPM_MUX("LSM1 MUX", SND_SOC_NOPM, 0, 0, &lsm1_mux),
  3330. SND_SOC_DAPM_MUX("LSM2 MUX", SND_SOC_NOPM, 0, 0, &lsm2_mux),
  3331. SND_SOC_DAPM_MUX("LSM3 MUX", SND_SOC_NOPM, 0, 0, &lsm3_mux),
  3332. SND_SOC_DAPM_MUX("LSM4 MUX", SND_SOC_NOPM, 0, 0, &lsm4_mux),
  3333. SND_SOC_DAPM_MUX("LSM5 MUX", SND_SOC_NOPM, 0, 0, &lsm5_mux),
  3334. SND_SOC_DAPM_MUX("LSM6 MUX", SND_SOC_NOPM, 0, 0, &lsm6_mux),
  3335. SND_SOC_DAPM_MUX("LSM7 MUX", SND_SOC_NOPM, 0, 0, &lsm7_mux),
  3336. SND_SOC_DAPM_MUX("LSM8 MUX", SND_SOC_NOPM, 0, 0, &lsm8_mux),
  3337. SND_SOC_DAPM_MUX("SLIM_0_RX AANC MUX", SND_SOC_NOPM, 0, 0,
  3338. aanc_slim_0_rx_mux),
  3339. /* Mixer definitions */
  3340. SND_SOC_DAPM_MIXER("PRI_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3341. pri_i2s_rx_mixer_controls, ARRAY_SIZE(pri_i2s_rx_mixer_controls)),
  3342. SND_SOC_DAPM_MIXER("SEC_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3343. sec_i2s_rx_mixer_controls, ARRAY_SIZE(sec_i2s_rx_mixer_controls)),
  3344. SND_SOC_DAPM_MIXER("SLIMBUS_0_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3345. slimbus_rx_mixer_controls, ARRAY_SIZE(slimbus_rx_mixer_controls)),
  3346. SND_SOC_DAPM_MIXER("HDMI Mixer", SND_SOC_NOPM, 0, 0,
  3347. hdmi_mixer_controls, ARRAY_SIZE(hdmi_mixer_controls)),
  3348. SND_SOC_DAPM_MIXER("MI2S_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3349. mi2s_rx_mixer_controls, ARRAY_SIZE(mi2s_rx_mixer_controls)),
  3350. SND_SOC_DAPM_MIXER("QUAT_MI2S_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3351. quaternary_mi2s_rx_mixer_controls,
  3352. ARRAY_SIZE(quaternary_mi2s_rx_mixer_controls)),
  3353. SND_SOC_DAPM_MIXER("TERT_MI2S_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3354. tertiary_mi2s_rx_mixer_controls,
  3355. ARRAY_SIZE(tertiary_mi2s_rx_mixer_controls)),
  3356. SND_SOC_DAPM_MIXER("SEC_MI2S_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3357. secondary_mi2s_rx_mixer_controls,
  3358. ARRAY_SIZE(secondary_mi2s_rx_mixer_controls)),
  3359. SND_SOC_DAPM_MIXER("SEC_MI2S_RX Port Mixer", SND_SOC_NOPM, 0, 0,
  3360. mi2s_hl_mixer_controls,
  3361. ARRAY_SIZE(mi2s_hl_mixer_controls)),
  3362. SND_SOC_DAPM_MIXER("PRI_MI2S_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3363. primary_mi2s_rx_mixer_controls,
  3364. ARRAY_SIZE(primary_mi2s_rx_mixer_controls)),
  3365. SND_SOC_DAPM_MIXER("MultiMedia1 Mixer", SND_SOC_NOPM, 0, 0,
  3366. mmul1_mixer_controls, ARRAY_SIZE(mmul1_mixer_controls)),
  3367. SND_SOC_DAPM_MIXER("MultiMedia2 Mixer", SND_SOC_NOPM, 0, 0,
  3368. mmul2_mixer_controls, ARRAY_SIZE(mmul2_mixer_controls)),
  3369. SND_SOC_DAPM_MIXER("MultiMedia4 Mixer", SND_SOC_NOPM, 0, 0,
  3370. mmul4_mixer_controls, ARRAY_SIZE(mmul4_mixer_controls)),
  3371. SND_SOC_DAPM_MIXER("MultiMedia5 Mixer", SND_SOC_NOPM, 0, 0,
  3372. mmul5_mixer_controls, ARRAY_SIZE(mmul5_mixer_controls)),
  3373. SND_SOC_DAPM_MIXER("MultiMedia8 Mixer", SND_SOC_NOPM, 0, 0,
  3374. mmul8_mixer_controls, ARRAY_SIZE(mmul8_mixer_controls)),
  3375. SND_SOC_DAPM_MIXER("MultiMedia6 Mixer", SND_SOC_NOPM, 0, 0,
  3376. mmul6_mixer_controls, ARRAY_SIZE(mmul6_mixer_controls)),
  3377. #ifdef CONFIG_JACK_AUDIO
  3378. SND_SOC_DAPM_MIXER("MultiMedia10 Mixer", SND_SOC_NOPM, 0, 0,
  3379. mmul10_mixer_controls, ARRAY_SIZE(mmul10_mixer_controls)),
  3380. #endif
  3381. SND_SOC_DAPM_MIXER("AUX_PCM_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3382. auxpcm_rx_mixer_controls, ARRAY_SIZE(auxpcm_rx_mixer_controls)),
  3383. SND_SOC_DAPM_MIXER("SEC_AUX_PCM_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3384. sec_auxpcm_rx_mixer_controls, ARRAY_SIZE(sec_auxpcm_rx_mixer_controls)),
  3385. /* incall */
  3386. SND_SOC_DAPM_MIXER("Incall_Music Audio Mixer", SND_SOC_NOPM, 0, 0,
  3387. incall_music_delivery_mixer_controls,
  3388. ARRAY_SIZE(incall_music_delivery_mixer_controls)),
  3389. SND_SOC_DAPM_MIXER("Incall_Music_2 Audio Mixer", SND_SOC_NOPM, 0, 0,
  3390. incall_music2_delivery_mixer_controls,
  3391. ARRAY_SIZE(incall_music2_delivery_mixer_controls)),
  3392. SND_SOC_DAPM_MIXER("SLIMBUS_4_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3393. slimbus_4_rx_mixer_controls,
  3394. ARRAY_SIZE(slimbus_4_rx_mixer_controls)),
  3395. /* Voice Mixer */
  3396. SND_SOC_DAPM_MIXER("PRI_RX_Voice Mixer",
  3397. SND_SOC_NOPM, 0, 0, pri_rx_voice_mixer_controls,
  3398. ARRAY_SIZE(pri_rx_voice_mixer_controls)),
  3399. SND_SOC_DAPM_MIXER("SEC_RX_Voice Mixer",
  3400. SND_SOC_NOPM, 0, 0,
  3401. sec_i2s_rx_voice_mixer_controls,
  3402. ARRAY_SIZE(sec_i2s_rx_voice_mixer_controls)),
  3403. SND_SOC_DAPM_MIXER("SEC_MI2S_RX_Voice Mixer",
  3404. SND_SOC_NOPM, 0, 0,
  3405. sec_mi2s_rx_voice_mixer_controls,
  3406. ARRAY_SIZE(sec_mi2s_rx_voice_mixer_controls)),
  3407. SND_SOC_DAPM_MIXER("SLIM_0_RX_Voice Mixer",
  3408. SND_SOC_NOPM, 0, 0,
  3409. slimbus_rx_voice_mixer_controls,
  3410. ARRAY_SIZE(slimbus_rx_voice_mixer_controls)),
  3411. SND_SOC_DAPM_MIXER("INTERNAL_BT_SCO_RX_Voice Mixer",
  3412. SND_SOC_NOPM, 0, 0,
  3413. bt_sco_rx_voice_mixer_controls,
  3414. ARRAY_SIZE(bt_sco_rx_voice_mixer_controls)),
  3415. SND_SOC_DAPM_MIXER("AFE_PCM_RX_Voice Mixer",
  3416. SND_SOC_NOPM, 0, 0,
  3417. afe_pcm_rx_voice_mixer_controls,
  3418. ARRAY_SIZE(afe_pcm_rx_voice_mixer_controls)),
  3419. SND_SOC_DAPM_MIXER("AUX_PCM_RX_Voice Mixer",
  3420. SND_SOC_NOPM, 0, 0,
  3421. aux_pcm_rx_voice_mixer_controls,
  3422. ARRAY_SIZE(aux_pcm_rx_voice_mixer_controls)),
  3423. SND_SOC_DAPM_MIXER("SEC_AUX_PCM_RX_Voice Mixer",
  3424. SND_SOC_NOPM, 0, 0,
  3425. sec_aux_pcm_rx_voice_mixer_controls,
  3426. ARRAY_SIZE(sec_aux_pcm_rx_voice_mixer_controls)),
  3427. SND_SOC_DAPM_MIXER("HDMI_RX_Voice Mixer",
  3428. SND_SOC_NOPM, 0, 0,
  3429. hdmi_rx_voice_mixer_controls,
  3430. ARRAY_SIZE(hdmi_rx_voice_mixer_controls)),
  3431. SND_SOC_DAPM_MIXER("MI2S_RX_Voice Mixer",
  3432. SND_SOC_NOPM, 0, 0,
  3433. mi2s_rx_voice_mixer_controls,
  3434. ARRAY_SIZE(mi2s_rx_voice_mixer_controls)),
  3435. SND_SOC_DAPM_MIXER("Voice_Tx Mixer",
  3436. SND_SOC_NOPM, 0, 0, tx_voice_mixer_controls,
  3437. ARRAY_SIZE(tx_voice_mixer_controls)),
  3438. SND_SOC_DAPM_MIXER("Voice2_Tx Mixer",
  3439. SND_SOC_NOPM, 0, 0, tx_voice2_mixer_controls,
  3440. ARRAY_SIZE(tx_voice2_mixer_controls)),
  3441. SND_SOC_DAPM_MIXER("Voip_Tx Mixer",
  3442. SND_SOC_NOPM, 0, 0, tx_voip_mixer_controls,
  3443. ARRAY_SIZE(tx_voip_mixer_controls)),
  3444. SND_SOC_DAPM_MIXER("VoLTE_Tx Mixer",
  3445. SND_SOC_NOPM, 0, 0, tx_volte_mixer_controls,
  3446. ARRAY_SIZE(tx_volte_mixer_controls)),
  3447. SND_SOC_DAPM_MIXER("VoWLAN_Tx Mixer",
  3448. SND_SOC_NOPM, 0, 0, tx_vowlan_mixer_controls,
  3449. ARRAY_SIZE(tx_vowlan_mixer_controls)),
  3450. SND_SOC_DAPM_MIXER("INTERNAL_BT_SCO_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3451. int_bt_sco_rx_mixer_controls, ARRAY_SIZE(int_bt_sco_rx_mixer_controls)),
  3452. SND_SOC_DAPM_MIXER("INTERNAL_FM_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3453. int_fm_rx_mixer_controls, ARRAY_SIZE(int_fm_rx_mixer_controls)),
  3454. SND_SOC_DAPM_MIXER("AFE_PCM_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3455. afe_pcm_rx_mixer_controls, ARRAY_SIZE(afe_pcm_rx_mixer_controls)),
  3456. SND_SOC_DAPM_MIXER("Voice Stub Tx Mixer", SND_SOC_NOPM, 0, 0,
  3457. tx_voice_stub_mixer_controls, ARRAY_SIZE(tx_voice_stub_mixer_controls)),
  3458. SND_SOC_DAPM_MIXER("STUB_RX Mixer", SND_SOC_NOPM, 0, 0,
  3459. stub_rx_mixer_controls, ARRAY_SIZE(stub_rx_mixer_controls)),
  3460. SND_SOC_DAPM_MIXER("SLIMBUS_1_RX Mixer", SND_SOC_NOPM, 0, 0,
  3461. slimbus_1_rx_mixer_controls, ARRAY_SIZE(slimbus_1_rx_mixer_controls)),
  3462. SND_SOC_DAPM_MIXER("SLIMBUS_3_RX_Voice Mixer", SND_SOC_NOPM, 0, 0,
  3463. slimbus_3_rx_mixer_controls, ARRAY_SIZE(slimbus_3_rx_mixer_controls)),
  3464. SND_SOC_DAPM_MIXER("SLIMBUS_0_RX Port Mixer",
  3465. SND_SOC_NOPM, 0, 0, sbus_0_rx_port_mixer_controls,
  3466. ARRAY_SIZE(sbus_0_rx_port_mixer_controls)),
  3467. SND_SOC_DAPM_MIXER("AUXPCM_RX Port Mixer",
  3468. SND_SOC_NOPM, 0, 0, auxpcm_rx_port_mixer_controls,
  3469. ARRAY_SIZE(auxpcm_rx_port_mixer_controls)),
  3470. SND_SOC_DAPM_MIXER("SEC_AUXPCM_RX Port Mixer",
  3471. SND_SOC_NOPM, 0, 0, sec_auxpcm_rx_port_mixer_controls,
  3472. ARRAY_SIZE(sec_auxpcm_rx_port_mixer_controls)),
  3473. SND_SOC_DAPM_MIXER("SLIMBUS_1_RX Port Mixer", SND_SOC_NOPM, 0, 0,
  3474. sbus_1_rx_port_mixer_controls,
  3475. ARRAY_SIZE(sbus_1_rx_port_mixer_controls)),
  3476. SND_SOC_DAPM_MIXER("INTERNAL_BT_SCO_RX Port Mixer", SND_SOC_NOPM, 0, 0,
  3477. bt_sco_rx_port_mixer_controls,
  3478. ARRAY_SIZE(bt_sco_rx_port_mixer_controls)),
  3479. SND_SOC_DAPM_MIXER("AFE_PCM_RX Port Mixer",
  3480. SND_SOC_NOPM, 0, 0, afe_pcm_rx_port_mixer_controls,
  3481. ARRAY_SIZE(afe_pcm_rx_port_mixer_controls)),
  3482. SND_SOC_DAPM_MIXER("HDMI_RX Port Mixer",
  3483. SND_SOC_NOPM, 0, 0, hdmi_rx_port_mixer_controls,
  3484. ARRAY_SIZE(hdmi_rx_port_mixer_controls)),
  3485. SND_SOC_DAPM_MIXER("SEC_I2S_RX Port Mixer",
  3486. SND_SOC_NOPM, 0, 0, sec_i2s_rx_port_mixer_controls,
  3487. ARRAY_SIZE(sec_i2s_rx_port_mixer_controls)),
  3488. SND_SOC_DAPM_MIXER("SLIMBUS_3_RX Port Mixer",
  3489. SND_SOC_NOPM, 0, 0, sbus_3_rx_port_mixer_controls,
  3490. ARRAY_SIZE(sbus_3_rx_port_mixer_controls)),
  3491. SND_SOC_DAPM_MIXER("MI2S_RX Port Mixer", SND_SOC_NOPM, 0, 0,
  3492. mi2s_rx_port_mixer_controls, ARRAY_SIZE(mi2s_rx_port_mixer_controls)),
  3493. SND_SOC_DAPM_MIXER("PRI_MI2S_RX Port Mixer", SND_SOC_NOPM, 0, 0,
  3494. primary_mi2s_rx_port_mixer_controls,
  3495. ARRAY_SIZE(primary_mi2s_rx_port_mixer_controls)),
  3496. SND_SOC_DAPM_MIXER("QCHAT_Tx Mixer",
  3497. SND_SOC_NOPM, 0, 0, tx_qchat_mixer_controls,
  3498. ARRAY_SIZE(tx_qchat_mixer_controls)),
  3499. /* Virtual Pins to force backends ON atm */
  3500. SND_SOC_DAPM_OUTPUT("BE_OUT"),
  3501. SND_SOC_DAPM_INPUT("BE_IN"),
  3502. SND_SOC_DAPM_MUX("SLIM0_RX_VI_FB_LCH_MUX", SND_SOC_NOPM, 0, 0,
  3503. &slim0_rx_vi_fb_lch_mux),
  3504. SND_SOC_DAPM_MUX("VOC_EXT_EC MUX", SND_SOC_NOPM, 0, 0,
  3505. &voc_ext_ec_mux),
  3506. SND_SOC_DAPM_MUX("AUDIO_REF_EC_UL1 MUX", SND_SOC_NOPM, 0, 0,
  3507. &ext_ec_ref_mux_ul1),
  3508. SND_SOC_DAPM_MUX("AUDIO_REF_EC_UL2 MUX", SND_SOC_NOPM, 0, 0,
  3509. &ext_ec_ref_mux_ul2),
  3510. SND_SOC_DAPM_MUX("AUDIO_REF_EC_UL4 MUX", SND_SOC_NOPM, 0, 0,
  3511. &ext_ec_ref_mux_ul4),
  3512. SND_SOC_DAPM_MUX("AUDIO_REF_EC_UL5 MUX", SND_SOC_NOPM, 0, 0,
  3513. &ext_ec_ref_mux_ul5),
  3514. SND_SOC_DAPM_MUX("AUDIO_REF_EC_UL6 MUX", SND_SOC_NOPM, 0, 0,
  3515. &ext_ec_ref_mux_ul6),
  3516. SND_SOC_DAPM_MUX("AUDIO_REF_EC_UL8 MUX", SND_SOC_NOPM, 0, 0,
  3517. &ext_ec_ref_mux_ul8),
  3518. SND_SOC_DAPM_MUX("AUDIO_REF_EC_UL9 MUX", SND_SOC_NOPM, 0, 0,
  3519. &ext_ec_ref_mux_ul9),
  3520. };
  3521. static const struct snd_soc_dapm_route intercon[] = {
  3522. {"PRI_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3523. {"PRI_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3524. {"PRI_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3525. {"PRI_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3526. {"PRI_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3527. {"PRI_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3528. {"PRI_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3529. {"PRI_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3530. {"PRI_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3531. {"PRI_I2S_RX", NULL, "PRI_RX Audio Mixer"},
  3532. {"SEC_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3533. {"SEC_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3534. {"SEC_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3535. {"SEC_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3536. {"SEC_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3537. {"SEC_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3538. {"SEC_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3539. {"SEC_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3540. {"SEC_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3541. {"SEC_I2S_RX", NULL, "SEC_RX Audio Mixer"},
  3542. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3543. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3544. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3545. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3546. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3547. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3548. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3549. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3550. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3551. #ifdef CONFIG_JACK_AUDIO
  3552. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia10", "MM_DL10"},
  3553. #endif
  3554. {"SLIMBUS_0_RX", NULL, "SLIMBUS_0_RX Audio Mixer"},
  3555. {"HDMI Mixer", "MultiMedia1", "MM_DL1"},
  3556. {"HDMI Mixer", "MultiMedia2", "MM_DL2"},
  3557. {"HDMI Mixer", "MultiMedia3", "MM_DL3"},
  3558. {"HDMI Mixer", "MultiMedia4", "MM_DL4"},
  3559. {"HDMI Mixer", "MultiMedia5", "MM_DL5"},
  3560. {"HDMI Mixer", "MultiMedia6", "MM_DL6"},
  3561. {"HDMI Mixer", "MultiMedia7", "MM_DL7"},
  3562. {"HDMI Mixer", "MultiMedia8", "MM_DL8"},
  3563. {"HDMI Mixer", "MultiMedia9", "MM_DL9"},
  3564. {"HDMI", NULL, "HDMI Mixer"},
  3565. /* incall */
  3566. {"Incall_Music Audio Mixer", "MultiMedia1", "MM_DL1"},
  3567. {"Incall_Music Audio Mixer", "MultiMedia2", "MM_DL2"},
  3568. {"Incall_Music Audio Mixer", "MultiMedia5", "MM_DL5"},
  3569. {"Incall_Music Audio Mixer", "MultiMedia9", "MM_DL9"},
  3570. {"VOICE_PLAYBACK_TX", NULL, "Incall_Music Audio Mixer"},
  3571. {"Incall_Music_2 Audio Mixer", "MultiMedia1", "MM_DL1"},
  3572. {"Incall_Music_2 Audio Mixer", "MultiMedia2", "MM_DL2"},
  3573. {"Incall_Music_2 Audio Mixer", "MultiMedia5", "MM_DL5"},
  3574. {"Incall_Music_2 Audio Mixer", "MultiMedia9", "MM_DL9"},
  3575. {"VOICE2_PLAYBACK_TX", NULL, "Incall_Music_2 Audio Mixer"},
  3576. {"SLIMBUS_4_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3577. {"SLIMBUS_4_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3578. {"SLIMBUS_4_RX", NULL, "SLIMBUS_4_RX Audio Mixer"},
  3579. {"MultiMedia1 Mixer", "VOC_REC_UL", "INCALL_RECORD_TX"},
  3580. {"MultiMedia4 Mixer", "VOC_REC_UL", "INCALL_RECORD_TX"},
  3581. {"MultiMedia8 Mixer", "VOC_REC_UL", "INCALL_RECORD_TX"},
  3582. {"MultiMedia1 Mixer", "VOC_REC_DL", "INCALL_RECORD_RX"},
  3583. {"MultiMedia4 Mixer", "VOC_REC_DL", "INCALL_RECORD_RX"},
  3584. {"MultiMedia8 Mixer", "VOC_REC_DL", "INCALL_RECORD_RX"},
  3585. {"MultiMedia1 Mixer", "SLIM_4_TX", "SLIMBUS_4_TX"},
  3586. {"MultiMedia4 Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  3587. {"MultiMedia8 Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  3588. {"MultiMedia4 Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
  3589. {"MultiMedia8 Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
  3590. {"MultiMedia5 Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  3591. #ifdef CONFIG_JACK_AUDIO
  3592. {"MultiMedia10 Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  3593. #endif
  3594. {"MI2S_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3595. {"MI2S_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3596. {"MI2S_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3597. {"MI2S_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3598. {"MI2S_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3599. {"MI2S_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3600. {"MI2S_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3601. {"MI2S_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3602. {"MI2S_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3603. {"MI2S_RX", NULL, "MI2S_RX Audio Mixer"},
  3604. {"QUAT_MI2S_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3605. {"QUAT_MI2S_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3606. {"QUAT_MI2S_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3607. {"QUAT_MI2S_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3608. {"QUAT_MI2S_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3609. {"QUAT_MI2S_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3610. {"QUAT_MI2S_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3611. {"QUAT_MI2S_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3612. {"QUAT_MI2S_RX", NULL, "QUAT_MI2S_RX Audio Mixer"},
  3613. {"TERT_MI2S_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3614. {"TERT_MI2S_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3615. {"TERT_MI2S_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3616. {"TERT_MI2S_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3617. {"TERT_MI2S_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3618. {"TERT_MI2S_RX", NULL, "TERT_MI2S_RX Audio Mixer"},
  3619. {"SEC_MI2S_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3620. {"SEC_MI2S_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3621. {"SEC_MI2S_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3622. {"SEC_MI2S_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3623. {"SEC_MI2S_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3624. {"SEC_MI2S_RX", NULL, "SEC_MI2S_RX Audio Mixer"},
  3625. {"SEC_MI2S_RX Port Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
  3626. {"SEC_MI2S_RX Port Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  3627. {"PRI_MI2S_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3628. {"PRI_MI2S_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3629. {"PRI_MI2S_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3630. {"PRI_MI2S_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3631. {"PRI_MI2S_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3632. {"PRI_MI2S_RX", NULL, "PRI_MI2S_RX Audio Mixer"},
  3633. {"MultiMedia1 Mixer", "PRI_TX", "PRI_I2S_TX"},
  3634. {"MultiMedia1 Mixer", "MI2S_TX", "MI2S_TX"},
  3635. {"MultiMedia2 Mixer", "MI2S_TX", "MI2S_TX"},
  3636. {"MultiMedia5 Mixer", "MI2S_TX", "MI2S_TX"},
  3637. {"MultiMedia1 Mixer", "QUAT_MI2S_TX", "QUAT_MI2S_TX"},
  3638. {"MultiMedia1 Mixer", "TERT_MI2S_TX", "TERT_MI2S_TX"},
  3639. {"MultiMedia1 Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  3640. {"MultiMedia1 Mixer", "AUX_PCM_UL_TX", "AUX_PCM_TX"},
  3641. {"MultiMedia5 Mixer", "AUX_PCM_TX", "AUX_PCM_TX"},
  3642. #ifdef CONFIG_JACK_AUDIO
  3643. {"MultiMedia10 Mixer", "AUX_PCM_TX", "AUX_PCM_TX"},
  3644. #endif
  3645. {"MultiMedia1 Mixer", "SEC_AUX_PCM_UL_TX", "SEC_AUX_PCM_TX"},
  3646. {"MultiMedia5 Mixer", "SEC_AUX_PCM_TX", "SEC_AUX_PCM_TX"},
  3647. {"MultiMedia2 Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  3648. {"MultiMedia1 Mixer", "SEC_MI2S_TX", "SEC_MI2S_TX"},
  3649. {"MultiMedia1 Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
  3650. {"MultiMedia6 Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  3651. #ifdef CONFIG_TERT_MI2S_ENABLE
  3652. {"MultiMedia2 Mixer", "TERT_MI2S_TX", "TERT_MI2S_TX"},
  3653. #elif defined(CONFIG_SND_SOC_MAX98504) || defined(CONFIG_SND_SOC_MAX98506)
  3654. {"MultiMedia2 Mixer", "SEC_MI2S_TX", "SEC_MI2S_TX"},
  3655. #endif
  3656. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3657. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3658. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3659. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3660. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3661. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3662. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3663. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3664. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3665. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia6", "MM_UL6"},
  3666. {"INT_BT_SCO_RX", NULL, "INTERNAL_BT_SCO_RX Audio Mixer"},
  3667. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3668. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3669. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3670. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3671. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3672. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3673. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3674. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3675. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3676. {"INT_FM_RX", NULL, "INTERNAL_FM_RX Audio Mixer"},
  3677. {"AFE_PCM_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3678. {"AFE_PCM_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3679. {"AFE_PCM_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3680. {"AFE_PCM_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3681. {"AFE_PCM_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3682. {"AFE_PCM_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3683. {"AFE_PCM_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3684. {"AFE_PCM_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3685. {"AFE_PCM_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3686. {"PCM_RX", NULL, "AFE_PCM_RX Audio Mixer"},
  3687. {"MultiMedia1 Mixer", "INTERNAL_BT_SCO_TX", "INT_BT_SCO_TX"},
  3688. {"MultiMedia4 Mixer", "INTERNAL_BT_SCO_TX", "INT_BT_SCO_TX"},
  3689. {"MultiMedia5 Mixer", "INTERNAL_BT_SCO_TX", "INT_BT_SCO_TX"},
  3690. {"MultiMedia8 Mixer", "INTERNAL_BT_SCO_TX", "INT_BT_SCO_TX"},
  3691. {"MultiMedia1 Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  3692. {"MultiMedia4 Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  3693. {"MultiMedia5 Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  3694. {"MultiMedia8 Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  3695. {"MultiMedia6 Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  3696. {"MultiMedia1 Mixer", "AFE_PCM_TX", "PCM_TX"},
  3697. {"MultiMedia4 Mixer", "AFE_PCM_TX", "PCM_TX"},
  3698. {"MultiMedia5 Mixer", "AFE_PCM_TX", "PCM_TX"},
  3699. {"MultiMedia8 Mixer", "AFE_PCM_TX", "PCM_TX"},
  3700. {"MM_UL1", NULL, "MultiMedia1 Mixer"},
  3701. {"MultiMedia2 Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  3702. {"MM_UL2", NULL, "MultiMedia2 Mixer"},
  3703. {"MM_UL4", NULL, "MultiMedia4 Mixer"},
  3704. {"MM_UL5", NULL, "MultiMedia5 Mixer"},
  3705. {"MM_UL8", NULL, "MultiMedia8 Mixer"},
  3706. {"MM_UL6", NULL, "MultiMedia6 Mixer"},
  3707. #ifdef CONFIG_JACK_AUDIO
  3708. {"MM_UL10", NULL, "MultiMedia10 Mixer"},
  3709. #endif
  3710. {"AUX_PCM_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3711. {"AUX_PCM_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3712. {"AUX_PCM_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3713. {"AUX_PCM_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3714. {"AUX_PCM_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3715. {"AUX_PCM_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3716. {"AUX_PCM_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3717. {"AUX_PCM_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3718. {"AUX_PCM_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3719. #ifdef CONFIG_JACK_AUDIO
  3720. {"AUX_PCM_RX Audio Mixer", "MultiMedia10", "MM_DL10"},
  3721. #endif
  3722. {"AUX_PCM_RX", NULL, "AUX_PCM_RX Audio Mixer"},
  3723. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3724. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3725. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3726. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3727. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3728. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3729. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3730. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3731. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3732. {"SEC_AUX_PCM_RX", NULL, "SEC_AUX_PCM_RX Audio Mixer"},
  3733. {"MI2S_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3734. {"MI2S_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3735. {"MI2S_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3736. {"MI2S_RX_Voice Mixer", "Voice Stub", "VOICE_STUB_DL"},
  3737. {"MI2S_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3738. {"MI2S_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3739. {"MI2S_RX", NULL, "MI2S_RX_Voice Mixer"},
  3740. {"PRI_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3741. {"PRI_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3742. {"PRI_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3743. {"PRI_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3744. {"PRI_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3745. {"PRI_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3746. {"PRI_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3747. {"PRI_I2S_RX", NULL, "PRI_RX_Voice Mixer"},
  3748. {"SEC_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3749. {"SEC_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3750. {"SEC_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3751. {"SEC_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3752. {"SEC_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3753. {"SEC_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3754. {"SEC_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3755. {"SEC_I2S_RX", NULL, "SEC_RX_Voice Mixer"},
  3756. {"SEC_MI2S_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3757. {"SEC_MI2S_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3758. {"SEC_MI2S_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3759. {"SEC_MI2S_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3760. {"SEC_MI2S_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3761. {"SEC_MI2S_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3762. {"SEC_MI2S_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3763. {"SEC_MI2S_RX", NULL, "SEC_MI2S_RX_Voice Mixer"},
  3764. {"SLIM_0_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3765. {"SLIM_0_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3766. {"SLIM_0_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3767. {"SLIM_0_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3768. {"SLIM_0_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3769. {"SLIM_0_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3770. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  3771. {"SLIM_0_RX_Voice Mixer", "Voice Stub", "VOICE_STUB_DL"},
  3772. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  3773. {"SLIM_0_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3774. {"SLIMBUS_0_RX", NULL, "SLIM_0_RX_Voice Mixer"},
  3775. {"INTERNAL_BT_SCO_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3776. {"INTERNAL_BT_SCO_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3777. {"INTERNAL_BT_SCO_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3778. {"INTERNAL_BT_SCO_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3779. {"INTERNAL_BT_SCO_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3780. {"INTERNAL_BT_SCO_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3781. {"INTERNAL_BT_SCO_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3782. {"INT_BT_SCO_RX", NULL, "INTERNAL_BT_SCO_RX_Voice Mixer"},
  3783. {"AFE_PCM_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3784. {"AFE_PCM_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3785. {"AFE_PCM_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3786. {"AFE_PCM_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3787. {"AFE_PCM_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3788. {"AFE_PCM_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3789. {"AFE_PCM_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3790. {"PCM_RX", NULL, "AFE_PCM_RX_Voice Mixer"},
  3791. {"AUX_PCM_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3792. {"AUX_PCM_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3793. {"AUX_PCM_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3794. {"AUX_PCM_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3795. {"AUX_PCM_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3796. {"AUX_PCM_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3797. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  3798. {"AUX_PCM_RX_Voice Mixer", "Voice Stub", "VOICE_STUB_DL"},
  3799. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING*/
  3800. {"AUX_PCM_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3801. {"AUX_PCM_RX", NULL, "AUX_PCM_RX_Voice Mixer"},
  3802. {"SEC_AUX_PCM_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3803. {"SEC_AUX_PCM_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3804. {"SEC_AUX_PCM_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3805. {"SEC_AUX_PCM_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3806. {"SEC_AUX_PCM_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3807. {"SEC_AUX_PCM_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3808. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  3809. {"SEC_AUX_PCM_RX_Voice Mixer", "Voice Stub", "VOICE_STUB_DL"},
  3810. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING*/
  3811. {"SEC_AUX_PCM_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3812. {"SEC_AUX_PCM_RX", NULL, "SEC_AUX_PCM_RX_Voice Mixer"},
  3813. {"HDMI_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3814. {"HDMI_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3815. {"HDMI_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3816. {"HDMI_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3817. {"HDMI_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3818. {"HDMI_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3819. {"HDMI_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3820. {"HDMI", NULL, "HDMI_RX_Voice Mixer"},
  3821. {"HDMI", NULL, "HDMI_DL_HL"},
  3822. {"MI2S_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3823. {"MI2S_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3824. {"MI2S_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3825. {"MI2S_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3826. {"MI2S_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3827. {"MI2S_RX_Voice Mixer", "Voice Stub", "VOICE_STUB_DL"},
  3828. {"MI2S_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3829. {"MI2S_RX", NULL, "MI2S_RX_Voice Mixer"},
  3830. {"VOC_EXT_EC MUX", "PRI_MI2S_TX" , "PRI_MI2S_TX"},
  3831. {"VOC_EXT_EC MUX", "SEC_MI2S_TX" , "SEC_MI2S_TX"},
  3832. {"VOC_EXT_EC MUX", "TERT_MI2S_TX" , "TERT_MI2S_TX"},
  3833. {"VOC_EXT_EC MUX", "QUAT_MI2S_TX" , "QUAT_MI2S_TX"},
  3834. {"CS-VOICE_UL1", NULL, "VOC_EXT_EC MUX"},
  3835. {"VOIP_UL", NULL, "VOC_EXT_EC MUX"},
  3836. {"VoLTE_UL", NULL, "VOC_EXT_EC MUX"},
  3837. {"VOICE2_UL", NULL, "VOC_EXT_EC MUX"},
  3838. {"AUDIO_REF_EC_UL1 MUX", "PRI_MI2S_TX" , "PRI_MI2S_TX"},
  3839. {"AUDIO_REF_EC_UL1 MUX", "SEC_MI2S_TX" , "SEC_MI2S_TX"},
  3840. {"AUDIO_REF_EC_UL1 MUX", "TERT_MI2S_TX" , "TERT_MI2S_TX"},
  3841. {"AUDIO_REF_EC_UL1 MUX", "QUAT_MI2S_TX" , "QUAT_MI2S_TX"},
  3842. {"AUDIO_REF_EC_UL2 MUX", "PRI_MI2S_TX" , "PRI_MI2S_TX"},
  3843. {"AUDIO_REF_EC_UL2 MUX", "SEC_MI2S_TX" , "SEC_MI2S_TX"},
  3844. {"AUDIO_REF_EC_UL2 MUX", "TERT_MI2S_TX" , "TERT_MI2S_TX"},
  3845. {"AUDIO_REF_EC_UL2 MUX", "QUAT_MI2S_TX" , "QUAT_MI2S_TX"},
  3846. {"AUDIO_REF_EC_UL4 MUX", "PRI_MI2S_TX" , "PRI_MI2S_TX"},
  3847. {"AUDIO_REF_EC_UL4 MUX", "SEC_MI2S_TX" , "SEC_MI2S_TX"},
  3848. {"AUDIO_REF_EC_UL4 MUX", "TERT_MI2S_TX" , "TERT_MI2S_TX"},
  3849. {"AUDIO_REF_EC_UL4 MUX", "QUAT_MI2S_TX" , "QUAT_MI2S_TX"},
  3850. {"AUDIO_REF_EC_UL5 MUX", "PRI_MI2S_TX" , "PRI_MI2S_TX"},
  3851. {"AUDIO_REF_EC_UL5 MUX", "SEC_MI2S_TX" , "SEC_MI2S_TX"},
  3852. {"AUDIO_REF_EC_UL5 MUX", "TERT_MI2S_TX" , "TERT_MI2S_TX"},
  3853. {"AUDIO_REF_EC_UL5 MUX", "QUAT_MI2S_TX" , "QUAT_MI2S_TX"},
  3854. {"AUDIO_REF_EC_UL6 MUX", "PRI_MI2S_TX" , "PRI_MI2S_TX"},
  3855. {"AUDIO_REF_EC_UL6 MUX", "SEC_MI2S_TX" , "SEC_MI2S_TX"},
  3856. {"AUDIO_REF_EC_UL6 MUX", "TERT_MI2S_TX" , "TERT_MI2S_TX"},
  3857. {"AUDIO_REF_EC_UL6 MUX", "QUAT_MI2S_TX" , "QUAT_MI2S_TX"},
  3858. {"AUDIO_REF_EC_UL8 MUX", "PRI_MI2S_TX" , "PRI_MI2S_TX"},
  3859. {"AUDIO_REF_EC_UL8 MUX", "SEC_MI2S_TX" , "SEC_MI2S_TX"},
  3860. {"AUDIO_REF_EC_UL8 MUX", "TERT_MI2S_TX" , "TERT_MI2S_TX"},
  3861. {"AUDIO_REF_EC_UL8 MUX", "QUAT_MI2S_TX" , "QUAT_MI2S_TX"},
  3862. {"AUDIO_REF_EC_UL9 MUX", "PRI_MI2S_TX" , "PRI_MI2S_TX"},
  3863. {"AUDIO_REF_EC_UL9 MUX", "SEC_MI2S_TX" , "SEC_MI2S_TX"},
  3864. {"AUDIO_REF_EC_UL9 MUX", "TERT_MI2S_TX" , "TERT_MI2S_TX"},
  3865. {"AUDIO_REF_EC_UL9 MUX", "QUAT_MI2S_TX" , "QUAT_MI2S_TX"},
  3866. {"MM_UL1", NULL, "AUDIO_REF_EC_UL1 MUX"},
  3867. {"MM_UL2", NULL, "AUDIO_REF_EC_UL2 MUX"},
  3868. {"MM_UL4", NULL, "AUDIO_REF_EC_UL4 MUX"},
  3869. {"MM_UL5", NULL, "AUDIO_REF_EC_UL5 MUX"},
  3870. {"MM_UL6", NULL, "AUDIO_REF_EC_UL6 MUX"},
  3871. {"MM_UL8", NULL, "AUDIO_REF_EC_UL8 MUX"},
  3872. {"MM_UL9", NULL, "AUDIO_REF_EC_UL9 MUX"},
  3873. {"Voice_Tx Mixer", "PRI_TX_Voice", "PRI_I2S_TX"},
  3874. {"Voice_Tx Mixer", "PRI_MI2S_TX_Voice", "PRI_MI2S_TX"},
  3875. {"Voice_Tx Mixer", "MI2S_TX_Voice", "MI2S_TX"},
  3876. {"Voice_Tx Mixer", "SLIM_0_TX_Voice", "SLIMBUS_0_TX"},
  3877. {"Voice_Tx Mixer", "INTERNAL_BT_SCO_TX_Voice", "INT_BT_SCO_TX"},
  3878. {"Voice_Tx Mixer", "AFE_PCM_TX_Voice", "PCM_TX"},
  3879. {"Voice_Tx Mixer", "AUX_PCM_TX_Voice", "AUX_PCM_TX"},
  3880. {"Voice_Tx Mixer", "SEC_AUX_PCM_TX_Voice", "SEC_AUX_PCM_TX"},
  3881. {"CS-VOICE_UL1", NULL, "Voice_Tx Mixer"},
  3882. {"Voice2_Tx Mixer", "PRI_TX_Voice2", "PRI_I2S_TX"},
  3883. {"Voice2_Tx Mixer", "PRI_MI2S_TX_Voice2", "PRI_MI2S_TX"},
  3884. {"Voice2_Tx Mixer", "MI2S_TX_Voice2", "MI2S_TX"},
  3885. {"Voice2_Tx Mixer", "SLIM_0_TX_Voice2", "SLIMBUS_0_TX"},
  3886. {"Voice2_Tx Mixer", "INTERNAL_BT_SCO_TX_Voice2", "INT_BT_SCO_TX"},
  3887. {"Voice2_Tx Mixer", "AFE_PCM_TX_Voice2", "PCM_TX"},
  3888. {"Voice2_Tx Mixer", "AUX_PCM_TX_Voice2", "AUX_PCM_TX"},
  3889. {"Voice2_Tx Mixer", "SEC_AUX_PCM_TX_Voice2", "SEC_AUX_PCM_TX"},
  3890. {"VOICE2_UL", NULL, "Voice2_Tx Mixer"},
  3891. {"VoLTE_Tx Mixer", "PRI_TX_VoLTE", "PRI_I2S_TX"},
  3892. {"VoLTE_Tx Mixer", "SLIM_0_TX_VoLTE", "SLIMBUS_0_TX"},
  3893. {"VoLTE_Tx Mixer", "INTERNAL_BT_SCO_TX_VoLTE", "INT_BT_SCO_TX"},
  3894. {"VoLTE_Tx Mixer", "AFE_PCM_TX_VoLTE", "PCM_TX"},
  3895. {"VoLTE_Tx Mixer", "AUX_PCM_TX_VoLTE", "AUX_PCM_TX"},
  3896. {"VoLTE_Tx Mixer", "SEC_AUX_PCM_TX_VoLTE", "SEC_AUX_PCM_TX"},
  3897. {"VoLTE_Tx Mixer", "MI2S_TX_VoLTE", "MI2S_TX"},
  3898. {"VoLTE_UL", NULL, "VoLTE_Tx Mixer"},
  3899. {"VoWLAN_Tx Mixer", "PRI_TX_VoWLAN", "PRI_I2S_TX"},
  3900. {"VoWLAN_Tx Mixer", "SLIM_0_TX_VoWLAN", "SLIMBUS_0_TX"},
  3901. {"VoWLAN_Tx Mixer", "INTERNAL_BT_SCO_TX_VoWLAN", "INT_BT_SCO_TX"},
  3902. {"VoWLAN_Tx Mixer", "AFE_PCM_TX_VoWLAN", "PCM_TX"},
  3903. {"VoWLAN_Tx Mixer", "AUX_PCM_TX_VoWLAN", "AUX_PCM_TX"},
  3904. {"VoWLAN_Tx Mixer", "SEC_AUX_PCM_TX_VoWLAN", "SEC_AUX_PCM_TX"},
  3905. {"VoWLAN_Tx Mixer", "MI2S_TX_VoWLAN", "MI2S_TX"},
  3906. {"VoWLAN_UL", NULL, "VoWLAN_Tx Mixer"},
  3907. {"Voip_Tx Mixer", "PRI_TX_Voip", "PRI_I2S_TX"},
  3908. {"Voip_Tx Mixer", "MI2S_TX_Voip", "MI2S_TX"},
  3909. {"Voip_Tx Mixer", "SLIM_0_TX_Voip", "SLIMBUS_0_TX"},
  3910. {"Voip_Tx Mixer", "INTERNAL_BT_SCO_TX_Voip", "INT_BT_SCO_TX"},
  3911. {"Voip_Tx Mixer", "AFE_PCM_TX_Voip", "PCM_TX"},
  3912. {"Voip_Tx Mixer", "AUX_PCM_TX_Voip", "AUX_PCM_TX"},
  3913. {"Voip_Tx Mixer", "SEC_AUX_PCM_TX_Voip", "SEC_AUX_PCM_TX"},
  3914. {"Voip_Tx Mixer", "PRI_MI2S_TX_Voip", "PRI_MI2S_TX"},
  3915. {"VOIP_UL", NULL, "Voip_Tx Mixer"},
  3916. {"SLIMBUS_DL_HL", "Switch", "SLIM0_DL_HL"},
  3917. {"SLIMBUS_0_RX", NULL, "SLIMBUS_DL_HL"},
  3918. {"SLIMBUS1_DL_HL", "Switch", "SLIM1_DL_HL"},
  3919. {"SLIMBUS_1_RX", NULL, "SLIMBUS1_DL_HL"},
  3920. {"SLIMBUS3_DL_HL", "Switch", "SLIM3_DL_HL"},
  3921. {"SLIMBUS_3_RX", NULL, "SLIMBUS3_DL_HL"},
  3922. {"SLIMBUS4_DL_HL", "Switch", "SLIM4_DL_HL"},
  3923. {"SLIMBUS_4_RX", NULL, "SLIMBUS4_DL_HL"},
  3924. {"SLIM0_UL_HL", NULL, "SLIMBUS_0_TX"},
  3925. {"SLIM1_UL_HL", NULL, "SLIMBUS_1_TX"},
  3926. {"SLIM3_UL_HL", NULL, "SLIMBUS_3_TX"},
  3927. {"SLIM4_UL_HL", NULL, "SLIMBUS_4_TX"},
  3928. {"LSM1 MUX", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
  3929. {"LSM1 MUX", "SLIMBUS_1_TX", "SLIMBUS_1_TX"},
  3930. {"LSM1 MUX", "SLIMBUS_3_TX", "SLIMBUS_3_TX"},
  3931. {"LSM1 MUX", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
  3932. {"LSM1 MUX", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
  3933. {"LSM1_UL_HL", NULL, "LSM1 MUX"},
  3934. {"LSM2 MUX", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
  3935. {"LSM2 MUX", "SLIMBUS_1_TX", "SLIMBUS_1_TX"},
  3936. {"LSM2 MUX", "SLIMBUS_3_TX", "SLIMBUS_3_TX"},
  3937. {"LSM2 MUX", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
  3938. {"LSM2 MUX", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
  3939. {"LSM2_UL_HL", NULL, "LSM2 MUX"},
  3940. {"LSM3 MUX", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
  3941. {"LSM3 MUX", "SLIMBUS_1_TX", "SLIMBUS_1_TX"},
  3942. {"LSM3 MUX", "SLIMBUS_3_TX", "SLIMBUS_3_TX"},
  3943. {"LSM3 MUX", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
  3944. {"LSM3 MUX", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
  3945. {"LSM3_UL_HL", NULL, "LSM3 MUX"},
  3946. {"LSM4 MUX", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
  3947. {"LSM4 MUX", "SLIMBUS_1_TX", "SLIMBUS_1_TX"},
  3948. {"LSM4 MUX", "SLIMBUS_3_TX", "SLIMBUS_3_TX"},
  3949. {"LSM4 MUX", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
  3950. {"LSM4 MUX", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
  3951. {"LSM4_UL_HL", NULL, "LSM4 MUX"},
  3952. {"LSM5 MUX", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
  3953. {"LSM5 MUX", "SLIMBUS_1_TX", "SLIMBUS_1_TX"},
  3954. {"LSM5 MUX", "SLIMBUS_3_TX", "SLIMBUS_3_TX"},
  3955. {"LSM5 MUX", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
  3956. {"LSM5 MUX", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
  3957. {"LSM5_UL_HL", NULL, "LSM5 MUX"},
  3958. {"LSM6 MUX", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
  3959. {"LSM6 MUX", "SLIMBUS_1_TX", "SLIMBUS_1_TX"},
  3960. {"LSM6 MUX", "SLIMBUS_3_TX", "SLIMBUS_3_TX"},
  3961. {"LSM6 MUX", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
  3962. {"LSM6 MUX", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
  3963. {"LSM6_UL_HL", NULL, "LSM6 MUX"},
  3964. {"LSM7 MUX", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
  3965. {"LSM7 MUX", "SLIMBUS_1_TX", "SLIMBUS_1_TX"},
  3966. {"LSM7 MUX", "SLIMBUS_3_TX", "SLIMBUS_3_TX"},
  3967. {"LSM7 MUX", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
  3968. {"LSM7 MUX", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
  3969. {"LSM7_UL_HL", NULL, "LSM7 MUX"},
  3970. {"LSM8 MUX", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
  3971. {"LSM8 MUX", "SLIMBUS_1_TX", "SLIMBUS_1_TX"},
  3972. {"LSM8 MUX", "SLIMBUS_3_TX", "SLIMBUS_3_TX"},
  3973. {"LSM8 MUX", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
  3974. {"LSM8 MUX", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
  3975. {"LSM8_UL_HL", NULL, "LSM8 MUX"},
  3976. {"QCHAT_Tx Mixer", "PRI_TX_QCHAT", "PRI_I2S_TX"},
  3977. {"QCHAT_Tx Mixer", "SLIM_0_TX_QCHAT", "SLIMBUS_0_TX"},
  3978. {"QCHAT_Tx Mixer", "INTERNAL_BT_SCO_TX_QCHAT", "INT_BT_SCO_TX"},
  3979. {"QCHAT_Tx Mixer", "AFE_PCM_TX_QCHAT", "PCM_TX"},
  3980. {"QCHAT_Tx Mixer", "AUX_PCM_TX_QCHAT", "AUX_PCM_TX"},
  3981. {"QCHAT_Tx Mixer", "SEC_AUX_PCM_TX_QCHAT", "SEC_AUX_PCM_TX"},
  3982. {"QCHAT_Tx Mixer", "MI2S_TX_QCHAT", "MI2S_TX"},
  3983. {"QCHAT_Tx Mixer", "PRI_MI2S_TX_QCHAT", "PRI_MI2S_TX"},
  3984. {"QCHAT_UL", NULL, "QCHAT_Tx Mixer"},
  3985. {"INT_FM_RX", NULL, "INTFM_DL_HL"},
  3986. {"INTFM_UL_HL", NULL, "INT_FM_TX"},
  3987. {"INTHFP_UL_HL", NULL, "INT_BT_SCO_TX"},
  3988. {"INT_BT_SCO_RX", NULL, "MM_DL6"},
  3989. {"AUX_PCM_RX", NULL, "AUXPCM_DL_HL"},
  3990. {"AUXPCM_UL_HL", NULL, "AUX_PCM_TX"},
  3991. {"MI2S_RX", NULL, "MI2S_DL_HL"},
  3992. {"MI2S_UL_HL", NULL, "MI2S_TX"},
  3993. {"PCM_RX_DL_HL", "Switch", "SLIM0_DL_HL"},
  3994. {"PCM_RX", NULL, "PCM_RX_DL_HL"},
  3995. {"PRI_MI2S_RX_DL_HL", "Switch", "PRI_MI2S_DL_HL"},
  3996. {"PRI_MI2S_RX", NULL, "PRI_MI2S_RX_DL_HL"},
  3997. {"MI2S_UL_HL", NULL, "TERT_MI2S_TX"},
  3998. {"SEC_I2S_RX", NULL, "SEC_I2S_DL_HL"},
  3999. {"PRI_MI2S_UL_HL", NULL, "PRI_MI2S_TX"},
  4000. {"SEC_MI2S_RX", NULL, "SEC_MI2S_DL_HL"},
  4001. {"SLIMBUS_0_RX Port Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  4002. {"SLIMBUS_0_RX Port Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  4003. {"SLIMBUS_0_RX Port Mixer", "AUX_PCM_UL_TX", "AUX_PCM_TX"},
  4004. {"SLIMBUS_0_RX Port Mixer", "SEC_AUX_PCM_UL_TX", "SEC_AUX_PCM_TX"},
  4005. {"SLIMBUS_0_RX Port Mixer", "MI2S_TX", "MI2S_TX"},
  4006. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  4007. {"SLIMBUS_0_RX Port Mixer", "INTERNAL_BT_SCO_TX", "INT_BT_SCO_TX"},
  4008. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  4009. {"SLIMBUS_0_RX", NULL, "SLIMBUS_0_RX Port Mixer"},
  4010. {"AFE_PCM_RX Port Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  4011. {"PCM_RX", NULL, "AFE_PCM_RX Port Mixer"},
  4012. {"AUXPCM_RX Port Mixer", "AUX_PCM_UL_TX", "AUX_PCM_TX"},
  4013. {"AUXPCM_RX Port Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  4014. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  4015. {"AUXPCM_RX Port Mixer", "SEC_AUX_PCM_UL_TX", "SEC_AUX_PCM_TX"},
  4016. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  4017. {"AUX_PCM_RX", NULL, "AUXPCM_RX Port Mixer"},
  4018. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  4019. {"SEC_AUXPCM_RX Port Mixer", "AUX_PCM_UL_TX", "AUX_PCM_TX"},
  4020. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  4021. {"SEC_AUXPCM_RX Port Mixer", "SEC_AUX_PCM_UL_TX", "SEC_AUX_PCM_TX"},
  4022. {"SEC_AUXPCM_RX Port Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  4023. {"SEC_AUX_PCM_RX", NULL, "SEC_AUXPCM_RX Port Mixer"},
  4024. {"Voice Stub Tx Mixer", "STUB_TX_HL", "STUB_TX"},
  4025. {"Voice Stub Tx Mixer", "SLIM_1_TX", "SLIMBUS_1_TX"},
  4026. {"Voice Stub Tx Mixer", "INTERNAL_BT_SCO_TX", "INT_BT_SCO_TX"},
  4027. {"Voice Stub Tx Mixer", "STUB_1_TX_HL", "STUB_1_TX"},
  4028. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  4029. {"Voice Stub Tx Mixer", "AUX_PCM_UL_TX", "AUX_PCM_TX"},
  4030. {"Voice Stub Tx Mixer", "SEC_AUX_PCM_UL_TX", "SEC_AUX_PCM_TX"},
  4031. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  4032. {"Voice Stub Tx Mixer", "MI2S_TX", "MI2S_TX"},
  4033. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  4034. {"Voice Stub Tx Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  4035. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  4036. {"VOICE_STUB_UL", NULL, "Voice Stub Tx Mixer"},
  4037. {"STUB_RX Mixer", "Voice Stub", "VOICE_STUB_DL"},
  4038. {"STUB_RX", NULL, "STUB_RX Mixer"},
  4039. {"SLIMBUS_1_RX Mixer", "Voice Stub", "VOICE_STUB_DL"},
  4040. {"SLIMBUS_1_RX", NULL, "SLIMBUS_1_RX Mixer"},
  4041. {"INTERNAL_BT_SCO_RX_Voice Mixer", "Voice Stub", "VOICE_STUB_DL"},
  4042. {"SLIMBUS_3_RX_Voice Mixer", "Voice Stub", "VOICE_STUB_DL"},
  4043. {"SLIMBUS_3_RX", NULL, "SLIMBUS_3_RX_Voice Mixer"},
  4044. {"SLIMBUS_1_RX Port Mixer", "INTERNAL_BT_SCO_TX", "INT_BT_SCO_TX"},
  4045. {"SLIMBUS_1_RX", NULL, "SLIMBUS_1_RX Port Mixer"},
  4046. {"INTERNAL_BT_SCO_RX Port Mixer", "SLIM_1_TX", "SLIMBUS_1_TX"},
  4047. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  4048. {"INTERNAL_BT_SCO_RX Port Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  4049. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  4050. {"INT_BT_SCO_RX", NULL, "INTERNAL_BT_SCO_RX Port Mixer"},
  4051. {"SLIMBUS_3_RX Port Mixer", "INTERNAL_BT_SCO_RX", "INT_BT_SCO_RX"},
  4052. {"SLIMBUS_3_RX Port Mixer", "MI2S_TX", "MI2S_TX"},
  4053. {"SLIMBUS_3_RX", NULL, "SLIMBUS_3_RX Port Mixer"},
  4054. {"HDMI_RX Port Mixer", "MI2S_TX", "MI2S_TX"},
  4055. {"HDMI", NULL, "HDMI_RX Port Mixer"},
  4056. {"SEC_I2S_RX Port Mixer", "MI2S_TX", "MI2S_TX"},
  4057. {"SEC_I2S_RX", NULL, "SEC_I2S_RX Port Mixer"},
  4058. {"MI2S_RX Port Mixer", "SLIM_1_TX", "SLIMBUS_1_TX"},
  4059. {"MI2S_RX Port Mixer", "MI2S_TX", "MI2S_TX"},
  4060. {"MI2S_RX", NULL, "MI2S_RX Port Mixer"},
  4061. {"PRI_MI2S_RX Port Mixer", "SEC_MI2S_TX", "SEC_MI2S_TX"},
  4062. {"PRI_MI2S_RX", NULL, "PRI_MI2S_RX Port Mixer"},
  4063. /* Backend Enablement */
  4064. {"BE_OUT", NULL, "PRI_I2S_RX"},
  4065. {"BE_OUT", NULL, "SEC_I2S_RX"},
  4066. {"BE_OUT", NULL, "SLIMBUS_0_RX"},
  4067. {"BE_OUT", NULL, "SLIMBUS_1_RX"},
  4068. {"BE_OUT", NULL, "SLIMBUS_3_RX"},
  4069. {"BE_OUT", NULL, "SLIMBUS_4_RX"},
  4070. {"BE_OUT", NULL, "HDMI"},
  4071. {"BE_OUT", NULL, "MI2S_RX"},
  4072. {"BE_OUT", NULL, "QUAT_MI2S_RX"},
  4073. {"BE_OUT", NULL, "TERT_MI2S_RX"},
  4074. {"BE_OUT", NULL, "SEC_MI2S_RX"},
  4075. {"BE_OUT", NULL, "PRI_MI2S_RX"},
  4076. {"BE_OUT", NULL, "INT_BT_SCO_RX"},
  4077. {"BE_OUT", NULL, "INT_FM_RX"},
  4078. {"BE_OUT", NULL, "PCM_RX"},
  4079. {"BE_OUT", NULL, "SLIMBUS_3_RX"},
  4080. {"BE_OUT", NULL, "AUX_PCM_RX"},
  4081. {"BE_OUT", NULL, "SEC_AUX_PCM_RX"},
  4082. {"BE_OUT", NULL, "INT_BT_SCO_RX"},
  4083. {"BE_OUT", NULL, "INT_FM_RX"},
  4084. {"BE_OUT", NULL, "PCM_RX"},
  4085. {"BE_OUT", NULL, "SLIMBUS_3_RX"},
  4086. {"BE_OUT", NULL, "AUX_PCM_RX"},
  4087. {"BE_OUT", NULL, "SEC_AUX_PCM_RX"},
  4088. {"BE_OUT", NULL, "VOICE_PLAYBACK_TX"},
  4089. {"BE_OUT", NULL, "VOICE2_PLAYBACK_TX"},
  4090. {"PRI_I2S_TX", NULL, "BE_IN"},
  4091. {"MI2S_TX", NULL, "BE_IN"},
  4092. {"QUAT_MI2S_TX", NULL, "BE_IN"},
  4093. {"PRI_MI2S_TX", NULL, "BE_IN"},
  4094. {"TERT_MI2S_TX", NULL, "BE_IN"},
  4095. {"SEC_MI2S_TX", NULL, "BE_IN"},
  4096. {"SLIMBUS_0_TX", NULL, "BE_IN" },
  4097. {"SLIMBUS_1_TX", NULL, "BE_IN" },
  4098. {"SLIMBUS_3_TX", NULL, "BE_IN" },
  4099. {"SLIMBUS_4_TX", NULL, "BE_IN" },
  4100. {"SLIMBUS_5_TX", NULL, "BE_IN" },
  4101. {"INT_BT_SCO_TX", NULL, "BE_IN"},
  4102. {"INT_FM_TX", NULL, "BE_IN"},
  4103. {"PCM_TX", NULL, "BE_IN"},
  4104. {"AUX_PCM_TX", NULL, "BE_IN"},
  4105. {"SEC_AUX_PCM_TX", NULL, "BE_IN"},
  4106. {"INCALL_RECORD_TX", NULL, "BE_IN"},
  4107. {"INCALL_RECORD_RX", NULL, "BE_IN"},
  4108. {"SLIM0_RX_VI_FB_LCH_MUX", "SLIM4_TX", "SLIMBUS_4_TX"},
  4109. {"SLIMBUS_0_RX", NULL, "SLIM0_RX_VI_FB_LCH_MUX"},
  4110. };
  4111. static int msm_pcm_routing_hw_params(struct snd_pcm_substream *substream,
  4112. struct snd_pcm_hw_params *params)
  4113. {
  4114. struct snd_soc_pcm_runtime *rtd = substream->private_data;
  4115. unsigned int be_id = rtd->dai_link->be_id;
  4116. if (be_id >= MSM_BACKEND_DAI_MAX) {
  4117. pr_err("%s: unexpected be_id %d\n", __func__, be_id);
  4118. return -EINVAL;
  4119. }
  4120. mutex_lock(&routing_lock);
  4121. msm_bedais[be_id].sample_rate = params_rate(params);
  4122. msm_bedais[be_id].channel = params_channels(params);
  4123. msm_bedais[be_id].format = params_format(params);
  4124. mutex_unlock(&routing_lock);
  4125. return 0;
  4126. }
  4127. static int msm_pcm_routing_close(struct snd_pcm_substream *substream)
  4128. {
  4129. struct snd_soc_pcm_runtime *rtd = substream->private_data;
  4130. unsigned int be_id = rtd->dai_link->be_id;
  4131. int i, session_type, path_type, topology;
  4132. struct msm_pcm_routing_bdai_data *bedai;
  4133. if (be_id >= MSM_BACKEND_DAI_MAX) {
  4134. pr_err("%s: unexpected be_id %d\n", __func__, be_id);
  4135. return -EINVAL;
  4136. }
  4137. bedai = &msm_bedais[be_id];
  4138. session_type = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
  4139. 0 : 1);
  4140. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
  4141. path_type = ADM_PATH_PLAYBACK;
  4142. else
  4143. path_type = ADM_PATH_LIVE_REC;
  4144. mutex_lock(&routing_lock);
  4145. topology = get_topology(path_type);
  4146. for_each_set_bit(i, &bedai->fe_sessions, MSM_FRONTEND_DAI_MM_SIZE) {
  4147. if (fe_dai_map[i][session_type].strm_id != INVALID_SESSION) {
  4148. fe_dai_map[i][session_type].be_srate =
  4149. bedai->sample_rate;
  4150. adm_close(bedai->port_id,
  4151. fe_dai_perf_mode[i][session_type]);
  4152. srs_port_id = -1;
  4153. if ((DOLBY_ADM_COPP_TOPOLOGY_ID == topology) &&
  4154. (fe_dai_perf_mode[i][session_type] ==
  4155. LEGACY_PCM_MODE))
  4156. dolby_dap_deinit(bedai->port_id);
  4157. }
  4158. }
  4159. bedai->active = 0;
  4160. bedai->sample_rate = 0;
  4161. bedai->channel = 0;
  4162. mutex_unlock(&routing_lock);
  4163. return 0;
  4164. }
  4165. static int msm_pcm_routing_prepare(struct snd_pcm_substream *substream)
  4166. {
  4167. struct snd_soc_pcm_runtime *rtd = substream->private_data;
  4168. unsigned int be_id = rtd->dai_link->be_id;
  4169. int i, path_type, session_type, port_id, topology;
  4170. struct msm_pcm_routing_bdai_data *bedai;
  4171. u32 channels;
  4172. bool playback, capture;
  4173. uint16_t bits_per_sample = 16;
  4174. struct msm_pcm_routing_fdai_data *fdai;
  4175. if (be_id >= MSM_BACKEND_DAI_MAX) {
  4176. pr_err("%s: unexpected be_id %d\n", __func__, be_id);
  4177. return -EINVAL;
  4178. }
  4179. bedai = &msm_bedais[be_id];
  4180. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
  4181. path_type = ADM_PATH_PLAYBACK;
  4182. session_type = SESSION_TYPE_RX;
  4183. } else {
  4184. path_type = ADM_PATH_LIVE_REC;
  4185. session_type = SESSION_TYPE_TX;
  4186. }
  4187. mutex_lock(&routing_lock);
  4188. topology = get_topology(path_type);
  4189. if (bedai->active == 1)
  4190. goto done; /* Ignore prepare if back-end already active */
  4191. /* AFE port is not active at this point. However, still
  4192. * go ahead setting active flag under the notion that
  4193. * QDSP6 is able to handle ADM starting before AFE port
  4194. * is started.
  4195. */
  4196. bedai->active = 1;
  4197. playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
  4198. capture = substream->stream == SNDRV_PCM_STREAM_CAPTURE;
  4199. for_each_set_bit(i, &bedai->fe_sessions, MSM_FRONTEND_DAI_MM_SIZE) {
  4200. fdai = &fe_dai_map[i][session_type];
  4201. if (fdai->strm_id != INVALID_SESSION) {
  4202. if (session_type == SESSION_TYPE_TX &&
  4203. fdai->be_srate &&
  4204. (fdai->be_srate != bedai->sample_rate)) {
  4205. pr_debug("%s: flush strm %d diff BE rates\n",
  4206. __func__,
  4207. fdai->strm_id);
  4208. if (fdai->event_info.event_func)
  4209. fdai->event_info.event_func(
  4210. MSM_PCM_RT_EVT_BUF_RECFG,
  4211. fdai->event_info.priv_data);
  4212. fdai->be_srate = 0; /* might not need it */
  4213. }
  4214. channels = bedai->channel;
  4215. if (bedai->format == SNDRV_PCM_FORMAT_S24_LE)
  4216. bits_per_sample = 24;
  4217. if (bedai->port_id == VOICE_RECORD_RX ||
  4218. bedai->port_id == VOICE_RECORD_TX)
  4219. topology = DEFAULT_COPP_TOPOLOGY;
  4220. if ((playback) && (channels > 0)) {
  4221. adm_multi_ch_copp_open(bedai->port_id,
  4222. path_type,
  4223. bedai->sample_rate,
  4224. channels,
  4225. topology,
  4226. fe_dai_perf_mode[i][session_type],
  4227. bits_per_sample);
  4228. } else if (capture) {
  4229. adm_open(bedai->port_id,
  4230. path_type,
  4231. bedai->sample_rate,
  4232. channels,
  4233. topology, fe_dai_perf_mode[i][session_type],
  4234. bits_per_sample);
  4235. }
  4236. msm_pcm_routing_build_matrix(i,
  4237. fdai->strm_id, path_type,
  4238. fe_dai_perf_mode[i][session_type]);
  4239. port_id = srs_port_id = bedai->port_id;
  4240. srs_send_params(srs_port_id, 1, 0);
  4241. if ((DOLBY_ADM_COPP_TOPOLOGY_ID == topology) &&
  4242. (fe_dai_perf_mode[i][session_type] ==
  4243. LEGACY_PCM_MODE))
  4244. if (dolby_dap_init(port_id, channels) < 0)
  4245. pr_err("%s: Err init dolby dap\n",
  4246. __func__);
  4247. }
  4248. }
  4249. done:
  4250. mutex_unlock(&routing_lock);
  4251. return 0;
  4252. }
  4253. static struct snd_pcm_ops msm_routing_pcm_ops = {
  4254. .hw_params = msm_pcm_routing_hw_params,
  4255. .close = msm_pcm_routing_close,
  4256. .prepare = msm_pcm_routing_prepare,
  4257. };
  4258. static unsigned int msm_routing_read(struct snd_soc_platform *platform,
  4259. unsigned int reg)
  4260. {
  4261. dev_dbg(platform->dev, "reg %x\n", reg);
  4262. return 0;
  4263. }
  4264. /* Not used but frame seems to require it */
  4265. static int msm_routing_write(struct snd_soc_platform *platform,
  4266. unsigned int reg, unsigned int val)
  4267. {
  4268. dev_dbg(platform->dev, "reg %x val %x\n", reg, val);
  4269. return 0;
  4270. }
  4271. /* Not used but frame seems to require it */
  4272. static int msm_routing_probe(struct snd_soc_platform *platform)
  4273. {
  4274. snd_soc_dapm_new_controls(&platform->dapm, msm_qdsp6_widgets,
  4275. ARRAY_SIZE(msm_qdsp6_widgets));
  4276. snd_soc_dapm_add_routes(&platform->dapm, intercon,
  4277. ARRAY_SIZE(intercon));
  4278. snd_soc_dapm_new_widgets(&platform->dapm);
  4279. snd_soc_add_platform_controls(platform,
  4280. int_fm_vol_mixer_controls,
  4281. ARRAY_SIZE(int_fm_vol_mixer_controls));
  4282. snd_soc_add_platform_controls(platform,
  4283. int_hfp_vol_mixer_controls,
  4284. ARRAY_SIZE(int_hfp_vol_mixer_controls));
  4285. snd_soc_add_platform_controls(platform,
  4286. eq_enable_mixer_controls,
  4287. ARRAY_SIZE(eq_enable_mixer_controls));
  4288. snd_soc_add_platform_controls(platform,
  4289. eq_band_mixer_controls,
  4290. ARRAY_SIZE(eq_band_mixer_controls));
  4291. snd_soc_add_platform_controls(platform,
  4292. eq_coeff_mixer_controls,
  4293. ARRAY_SIZE(eq_coeff_mixer_controls));
  4294. snd_soc_add_platform_controls(platform,
  4295. multimedia2_vol_mixer_controls,
  4296. ARRAY_SIZE(multimedia2_vol_mixer_controls));
  4297. snd_soc_add_platform_controls(platform,
  4298. multimedia5_vol_mixer_controls,
  4299. ARRAY_SIZE(multimedia5_vol_mixer_controls));
  4300. snd_soc_add_platform_controls(platform,
  4301. lpa_SRS_trumedia_controls,
  4302. ARRAY_SIZE(lpa_SRS_trumedia_controls));
  4303. snd_soc_add_platform_controls(platform,
  4304. lpa_SRS_trumedia_controls_HDMI,
  4305. ARRAY_SIZE(lpa_SRS_trumedia_controls_HDMI));
  4306. snd_soc_add_platform_controls(platform,
  4307. lpa_SRS_trumedia_controls_I2S,
  4308. ARRAY_SIZE(lpa_SRS_trumedia_controls_I2S));
  4309. snd_soc_add_platform_controls(platform,
  4310. multi_ch_channel_map_mixer_controls,
  4311. ARRAY_SIZE(multi_ch_channel_map_mixer_controls));
  4312. snd_soc_add_platform_controls(platform, lsm_function,
  4313. ARRAY_SIZE(lsm_function));
  4314. snd_soc_add_platform_controls(platform,
  4315. ss_solution_mixer_controls,
  4316. ARRAY_SIZE(ss_solution_mixer_controls));
  4317. snd_soc_add_platform_controls(platform,
  4318. aanc_slim_0_rx_mux,
  4319. ARRAY_SIZE(aanc_slim_0_rx_mux));
  4320. snd_soc_add_platform_controls(platform,
  4321. dolby_security_controls,
  4322. ARRAY_SIZE(dolby_security_controls));
  4323. snd_soc_add_platform_controls(platform,
  4324. dolby_dap_param_to_set_controls,
  4325. ARRAY_SIZE(dolby_dap_param_to_set_controls));
  4326. snd_soc_add_platform_controls(platform,
  4327. dolby_dap_param_to_get_controls,
  4328. ARRAY_SIZE(dolby_dap_param_to_get_controls));
  4329. snd_soc_add_platform_controls(platform,
  4330. dolby_dap_param_visualizer_controls,
  4331. ARRAY_SIZE(dolby_dap_param_visualizer_controls));
  4332. snd_soc_add_platform_controls(platform,
  4333. dolby_dap_param_end_point_controls,
  4334. ARRAY_SIZE(dolby_dap_param_end_point_controls));
  4335. snd_soc_add_platform_controls(platform,
  4336. get_rms_controls,
  4337. ARRAY_SIZE(get_rms_controls));
  4338. snd_soc_add_platform_controls(platform, msm_voc_session_controls,
  4339. ARRAY_SIZE(msm_voc_session_controls));
  4340. return 0;
  4341. }
  4342. static struct snd_soc_platform_driver msm_soc_routing_platform = {
  4343. .ops = &msm_routing_pcm_ops,
  4344. .probe = msm_routing_probe,
  4345. .read = msm_routing_read,
  4346. .write = msm_routing_write,
  4347. };
  4348. static __devinit int msm_routing_pcm_probe(struct platform_device *pdev)
  4349. {
  4350. if (pdev->dev.of_node)
  4351. dev_set_name(&pdev->dev, "%s", "msm-pcm-routing");
  4352. dev_dbg(&pdev->dev, "dev name %s\n", dev_name(&pdev->dev));
  4353. return snd_soc_register_platform(&pdev->dev,
  4354. &msm_soc_routing_platform);
  4355. }
  4356. static int msm_routing_pcm_remove(struct platform_device *pdev)
  4357. {
  4358. snd_soc_unregister_platform(&pdev->dev);
  4359. return 0;
  4360. }
  4361. static const struct of_device_id msm_pcm_routing_dt_match[] = {
  4362. {.compatible = "qcom,msm-pcm-routing"},
  4363. {}
  4364. };
  4365. MODULE_DEVICE_TABLE(of, msm_pcm_routing_dt_match);
  4366. static struct platform_driver msm_routing_pcm_driver = {
  4367. .driver = {
  4368. .name = "msm-pcm-routing",
  4369. .owner = THIS_MODULE,
  4370. .of_match_table = msm_pcm_routing_dt_match,
  4371. },
  4372. .probe = msm_routing_pcm_probe,
  4373. .remove = __devexit_p(msm_routing_pcm_remove),
  4374. };
  4375. int msm_routing_check_backend_enabled(int fedai_id)
  4376. {
  4377. int i;
  4378. if (fedai_id >= MSM_FRONTEND_DAI_MM_MAX_ID) {
  4379. /* bad ID assigned in machine driver */
  4380. pr_err("%s: bad MM ID\n", __func__);
  4381. return 0;
  4382. }
  4383. for (i = 0; i < MSM_BACKEND_DAI_MAX; i++) {
  4384. if (test_bit(fedai_id, &msm_bedais[i].fe_sessions))
  4385. return msm_bedais[i].active;
  4386. }
  4387. return 0;
  4388. }
  4389. static int __init msm_soc_routing_platform_init(void)
  4390. {
  4391. mutex_init(&routing_lock);
  4392. return platform_driver_register(&msm_routing_pcm_driver);
  4393. }
  4394. module_init(msm_soc_routing_platform_init);
  4395. static void __exit msm_soc_routing_platform_exit(void)
  4396. {
  4397. platform_driver_unregister(&msm_routing_pcm_driver);
  4398. }
  4399. module_exit(msm_soc_routing_platform_exit);
  4400. MODULE_DESCRIPTION("MSM routing platform driver");
  4401. MODULE_LICENSE("GPL v2");