msm-pcm-routing-v2.c 183 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876
  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("Voip", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2302. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2303. msm_routing_put_voice_mixer),
  2304. SOC_SINGLE_EXT("Voice Stub", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2305. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2306. msm_routing_put_voice_stub_mixer),
  2307. SOC_SINGLE_EXT("VoLTE", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2308. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2309. msm_routing_put_voice_mixer),
  2310. SOC_SINGLE_EXT("VoWLAN", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2311. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2312. msm_routing_put_voice_mixer),
  2313. SOC_SINGLE_EXT("DTMF", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2314. MSM_FRONTEND_DAI_DTMF_RX, 1, 0, msm_routing_get_voice_mixer,
  2315. msm_routing_put_voice_mixer),
  2316. SOC_SINGLE_EXT("QCHAT", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2317. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2318. msm_routing_put_voice_mixer),
  2319. };
  2320. static const struct snd_kcontrol_new hdmi_rx_voice_mixer_controls[] = {
  2321. SOC_SINGLE_EXT("CSVoice", MSM_BACKEND_DAI_HDMI_RX,
  2322. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2323. msm_routing_put_voice_mixer),
  2324. SOC_SINGLE_EXT("Voice2", MSM_BACKEND_DAI_HDMI_RX,
  2325. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2326. msm_routing_put_voice_mixer),
  2327. SOC_SINGLE_EXT("Voip", MSM_BACKEND_DAI_HDMI_RX,
  2328. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2329. msm_routing_put_voice_mixer),
  2330. SOC_SINGLE_EXT("VoLTE", MSM_BACKEND_DAI_HDMI_RX,
  2331. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2332. msm_routing_put_voice_mixer),
  2333. SOC_SINGLE_EXT("VoWLAN", MSM_BACKEND_DAI_HDMI_RX,
  2334. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2335. msm_routing_put_voice_mixer),
  2336. SOC_SINGLE_EXT("Voice Stub", MSM_BACKEND_DAI_HDMI_RX,
  2337. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2338. msm_routing_put_voice_stub_mixer),
  2339. SOC_SINGLE_EXT("DTMF", MSM_BACKEND_DAI_HDMI_RX,
  2340. MSM_FRONTEND_DAI_DTMF_RX, 1, 0, msm_routing_get_voice_mixer,
  2341. msm_routing_put_voice_mixer),
  2342. SOC_SINGLE_EXT("QCHAT", MSM_BACKEND_DAI_HDMI_RX,
  2343. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2344. msm_routing_put_voice_mixer),
  2345. };
  2346. static const struct snd_kcontrol_new stub_rx_mixer_controls[] = {
  2347. SOC_SINGLE_EXT("Voice Stub", MSM_BACKEND_DAI_EXTPROC_RX,
  2348. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2349. msm_routing_put_voice_stub_mixer),
  2350. };
  2351. static const struct snd_kcontrol_new slimbus_1_rx_mixer_controls[] = {
  2352. SOC_SINGLE_EXT("Voice Stub", MSM_BACKEND_DAI_SLIMBUS_1_RX,
  2353. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2354. msm_routing_put_voice_stub_mixer),
  2355. };
  2356. static const struct snd_kcontrol_new slimbus_3_rx_mixer_controls[] = {
  2357. SOC_SINGLE_EXT("Voice Stub", MSM_BACKEND_DAI_SLIMBUS_3_RX,
  2358. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2359. msm_routing_put_voice_stub_mixer),
  2360. };
  2361. static const struct snd_kcontrol_new tx_voice_mixer_controls[] = {
  2362. SOC_SINGLE_EXT("PRI_TX_Voice", MSM_BACKEND_DAI_PRI_I2S_TX,
  2363. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2364. msm_routing_put_voice_mixer),
  2365. SOC_SINGLE_EXT("MI2S_TX_Voice", MSM_BACKEND_DAI_MI2S_TX,
  2366. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2367. msm_routing_put_voice_mixer),
  2368. SOC_SINGLE_EXT("SLIM_0_TX_Voice", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2369. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2370. msm_routing_put_voice_mixer),
  2371. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX_Voice",
  2372. MSM_BACKEND_DAI_INT_BT_SCO_TX, MSM_FRONTEND_DAI_CS_VOICE, 1, 0,
  2373. msm_routing_get_voice_mixer, msm_routing_put_voice_mixer),
  2374. SOC_SINGLE_EXT("AFE_PCM_TX_Voice", MSM_BACKEND_DAI_AFE_PCM_TX,
  2375. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2376. msm_routing_put_voice_mixer),
  2377. SOC_SINGLE_EXT("AUX_PCM_TX_Voice", MSM_BACKEND_DAI_AUXPCM_TX,
  2378. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2379. msm_routing_put_voice_mixer),
  2380. SOC_SINGLE_EXT("SEC_AUX_PCM_TX_Voice", MSM_BACKEND_DAI_SEC_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("PRI_MI2S_TX_Voice", MSM_BACKEND_DAI_PRI_MI2S_TX,
  2384. MSM_FRONTEND_DAI_CS_VOICE, 1, 0, msm_routing_get_voice_mixer,
  2385. msm_routing_put_voice_mixer),
  2386. };
  2387. static const struct snd_kcontrol_new tx_voice2_mixer_controls[] = {
  2388. SOC_SINGLE_EXT("PRI_TX_Voice2", MSM_BACKEND_DAI_PRI_I2S_TX,
  2389. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2390. msm_routing_put_voice_mixer),
  2391. SOC_SINGLE_EXT("MI2S_TX_Voice2", MSM_BACKEND_DAI_MI2S_TX,
  2392. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2393. msm_routing_put_voice_mixer),
  2394. SOC_SINGLE_EXT("SLIM_0_TX_Voice2", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2395. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2396. msm_routing_put_voice_mixer),
  2397. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX_Voice2",
  2398. MSM_BACKEND_DAI_INT_BT_SCO_TX, MSM_FRONTEND_DAI_VOICE2, 1, 0,
  2399. msm_routing_get_voice_mixer, msm_routing_put_voice_mixer),
  2400. SOC_SINGLE_EXT("AFE_PCM_TX_Voice2", MSM_BACKEND_DAI_AFE_PCM_TX,
  2401. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2402. msm_routing_put_voice_mixer),
  2403. SOC_SINGLE_EXT("AUX_PCM_TX_Voice2", MSM_BACKEND_DAI_AUXPCM_TX,
  2404. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2405. msm_routing_put_voice_mixer),
  2406. SOC_SINGLE_EXT("PRI_MI2S_TX_Voice2", MSM_BACKEND_DAI_PRI_MI2S_TX,
  2407. MSM_FRONTEND_DAI_VOICE2, 1, 0, msm_routing_get_voice_mixer,
  2408. msm_routing_put_voice_mixer),
  2409. };
  2410. static const struct snd_kcontrol_new tx_volte_mixer_controls[] = {
  2411. SOC_SINGLE_EXT("PRI_TX_VoLTE", MSM_BACKEND_DAI_PRI_I2S_TX,
  2412. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2413. msm_routing_put_voice_mixer),
  2414. SOC_SINGLE_EXT("SLIM_0_TX_VoLTE", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2415. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2416. msm_routing_put_voice_mixer),
  2417. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX_VoLTE",
  2418. MSM_BACKEND_DAI_INT_BT_SCO_TX, MSM_FRONTEND_DAI_VOLTE, 1, 0,
  2419. msm_routing_get_voice_mixer, msm_routing_put_voice_mixer),
  2420. SOC_SINGLE_EXT("AFE_PCM_TX_VoLTE", MSM_BACKEND_DAI_AFE_PCM_TX,
  2421. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2422. msm_routing_put_voice_mixer),
  2423. SOC_SINGLE_EXT("AUX_PCM_TX_VoLTE", MSM_BACKEND_DAI_AUXPCM_TX,
  2424. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2425. msm_routing_put_voice_mixer),
  2426. SOC_SINGLE_EXT("SEC_AUX_PCM_TX_VoLTE", MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  2427. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2428. msm_routing_put_voice_mixer),
  2429. SOC_SINGLE_EXT("MI2S_TX_VoLTE", MSM_BACKEND_DAI_MI2S_TX,
  2430. MSM_FRONTEND_DAI_VOLTE, 1, 0, msm_routing_get_voice_mixer,
  2431. msm_routing_put_voice_mixer),
  2432. };
  2433. static const struct snd_kcontrol_new tx_vowlan_mixer_controls[] = {
  2434. SOC_SINGLE_EXT("PRI_TX_VoWLAN", MSM_BACKEND_DAI_PRI_I2S_TX,
  2435. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2436. msm_routing_put_voice_mixer),
  2437. SOC_SINGLE_EXT("SLIM_0_TX_VoWLAN", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2438. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2439. msm_routing_put_voice_mixer),
  2440. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX_VoWLAN",
  2441. MSM_BACKEND_DAI_INT_BT_SCO_TX, MSM_FRONTEND_DAI_VOWLAN, 1, 0,
  2442. msm_routing_get_voice_mixer, msm_routing_put_voice_mixer),
  2443. SOC_SINGLE_EXT("AFE_PCM_TX_VoWLAN", MSM_BACKEND_DAI_AFE_PCM_TX,
  2444. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2445. msm_routing_put_voice_mixer),
  2446. SOC_SINGLE_EXT("AUX_PCM_TX_VoWLAN", MSM_BACKEND_DAI_AUXPCM_TX,
  2447. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2448. msm_routing_put_voice_mixer),
  2449. SOC_SINGLE_EXT("SEC_AUX_PCM_TX_VoWLAN", MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  2450. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2451. msm_routing_put_voice_mixer),
  2452. SOC_SINGLE_EXT("MI2S_TX_VoWLAN", MSM_BACKEND_DAI_MI2S_TX,
  2453. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2454. msm_routing_put_voice_mixer),
  2455. SOC_SINGLE_EXT("PRI_MI2S_TX_VoWLAN", MSM_BACKEND_DAI_PRI_MI2S_TX,
  2456. MSM_FRONTEND_DAI_VOWLAN, 1, 0, msm_routing_get_voice_mixer,
  2457. msm_routing_put_voice_mixer),
  2458. };
  2459. static const struct snd_kcontrol_new tx_voip_mixer_controls[] = {
  2460. SOC_SINGLE_EXT("PRI_TX_Voip", MSM_BACKEND_DAI_PRI_I2S_TX,
  2461. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2462. msm_routing_put_voice_mixer),
  2463. SOC_SINGLE_EXT("MI2S_TX_Voip", MSM_BACKEND_DAI_MI2S_TX,
  2464. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2465. msm_routing_put_voice_mixer),
  2466. SOC_SINGLE_EXT("SLIM_0_TX_Voip", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2467. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2468. msm_routing_put_voice_mixer),
  2469. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX_Voip", MSM_BACKEND_DAI_INT_BT_SCO_TX,
  2470. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2471. msm_routing_put_voice_mixer),
  2472. SOC_SINGLE_EXT("AFE_PCM_TX_Voip", MSM_BACKEND_DAI_AFE_PCM_TX,
  2473. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2474. msm_routing_put_voice_mixer),
  2475. SOC_SINGLE_EXT("AUX_PCM_TX_Voip", MSM_BACKEND_DAI_AUXPCM_TX,
  2476. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2477. msm_routing_put_voice_mixer),
  2478. SOC_SINGLE_EXT("SEC_AUX_PCM_TX_Voip", MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  2479. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2480. msm_routing_put_voice_mixer),
  2481. SOC_SINGLE_EXT("PRI_MI2S_TX_Voip", MSM_BACKEND_DAI_PRI_MI2S_TX,
  2482. MSM_FRONTEND_DAI_VOIP, 1, 0, msm_routing_get_voice_mixer,
  2483. msm_routing_put_voice_mixer),
  2484. };
  2485. static const struct snd_kcontrol_new tx_voice_stub_mixer_controls[] = {
  2486. SOC_SINGLE_EXT("STUB_TX_HL", MSM_BACKEND_DAI_EXTPROC_TX,
  2487. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2488. msm_routing_put_voice_stub_mixer),
  2489. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX", MSM_BACKEND_DAI_INT_BT_SCO_TX,
  2490. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2491. msm_routing_put_voice_stub_mixer),
  2492. SOC_SINGLE_EXT("SLIM_1_TX", MSM_BACKEND_DAI_SLIMBUS_1_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("STUB_1_TX_HL", MSM_BACKEND_DAI_EXTPROC_EC_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("MI2S_TX", MSM_BACKEND_DAI_MI2S_TX,
  2499. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2500. msm_routing_put_voice_stub_mixer),
  2501. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  2502. SOC_SINGLE_EXT("AUX_PCM_UL_TX", MSM_BACKEND_DAI_AUXPCM_TX,
  2503. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2504. msm_routing_put_voice_stub_mixer),
  2505. SOC_SINGLE_EXT("SEC_AUX_PCM_UL_TX", MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  2506. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2507. msm_routing_put_voice_stub_mixer),
  2508. SOC_SINGLE_EXT("SLIM_0_TX", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2509. MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
  2510. msm_routing_put_voice_stub_mixer),
  2511. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  2512. };
  2513. static const struct snd_kcontrol_new tx_qchat_mixer_controls[] = {
  2514. SOC_SINGLE_EXT("PRI_TX_QCHAT", MSM_BACKEND_DAI_PRI_I2S_TX,
  2515. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2516. msm_routing_put_voice_mixer),
  2517. SOC_SINGLE_EXT("SLIM_0_TX_QCHAT", MSM_BACKEND_DAI_SLIMBUS_0_TX,
  2518. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2519. msm_routing_put_voice_mixer),
  2520. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX_QCHAT",
  2521. MSM_BACKEND_DAI_INT_BT_SCO_TX, MSM_FRONTEND_DAI_QCHAT, 1, 0,
  2522. msm_routing_get_voice_mixer, msm_routing_put_voice_mixer),
  2523. SOC_SINGLE_EXT("AFE_PCM_TX_QCHAT", MSM_BACKEND_DAI_AFE_PCM_TX,
  2524. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2525. msm_routing_put_voice_mixer),
  2526. SOC_SINGLE_EXT("AUX_PCM_TX_QCHAT", MSM_BACKEND_DAI_AUXPCM_TX,
  2527. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2528. msm_routing_put_voice_mixer),
  2529. SOC_SINGLE_EXT("SEC_AUX_PCM_TX_QCHAT", MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  2530. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2531. msm_routing_put_voice_mixer),
  2532. SOC_SINGLE_EXT("MI2S_TX_QCHAT", MSM_BACKEND_DAI_MI2S_TX,
  2533. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2534. msm_routing_put_voice_mixer),
  2535. SOC_SINGLE_EXT("PRI_MI2S_TX_QCHAT", MSM_BACKEND_DAI_PRI_MI2S_TX,
  2536. MSM_FRONTEND_DAI_QCHAT, 1, 0, msm_routing_get_voice_mixer,
  2537. msm_routing_put_voice_mixer),
  2538. };
  2539. static const struct snd_kcontrol_new sbus_0_rx_port_mixer_controls[] = {
  2540. SOC_SINGLE_EXT("INTERNAL_FM_TX", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  2541. MSM_BACKEND_DAI_INT_FM_TX, 1, 0, msm_routing_get_port_mixer,
  2542. msm_routing_put_port_mixer),
  2543. SOC_SINGLE_EXT("SLIM_0_TX", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  2544. MSM_BACKEND_DAI_SLIMBUS_0_TX, 1, 0, msm_routing_get_port_mixer,
  2545. msm_routing_put_port_mixer),
  2546. SOC_SINGLE_EXT("AUX_PCM_UL_TX", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  2547. MSM_BACKEND_DAI_AUXPCM_TX, 1, 0, msm_routing_get_port_mixer,
  2548. msm_routing_put_port_mixer),
  2549. SOC_SINGLE_EXT("SEC_AUX_PCM_UL_TX", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  2550. MSM_BACKEND_DAI_SEC_AUXPCM_TX, 1, 0, msm_routing_get_port_mixer,
  2551. msm_routing_put_port_mixer),
  2552. SOC_SINGLE_EXT("MI2S_TX", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  2553. MSM_BACKEND_DAI_MI2S_TX, 1, 0, msm_routing_get_port_mixer,
  2554. msm_routing_put_port_mixer),
  2555. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  2556. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX", MSM_BACKEND_DAI_SLIMBUS_0_RX,
  2557. MSM_BACKEND_DAI_INT_BT_SCO_TX, 1, 0, msm_routing_get_port_mixer,
  2558. msm_routing_put_port_mixer),
  2559. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  2560. };
  2561. static const struct snd_kcontrol_new auxpcm_rx_port_mixer_controls[] = {
  2562. SOC_SINGLE_EXT("AUX_PCM_UL_TX", MSM_BACKEND_DAI_AUXPCM_RX,
  2563. MSM_BACKEND_DAI_AUXPCM_TX, 1, 0, msm_routing_get_port_mixer,
  2564. msm_routing_put_port_mixer),
  2565. SOC_SINGLE_EXT("SLIM_0_TX", MSM_BACKEND_DAI_AUXPCM_RX,
  2566. MSM_BACKEND_DAI_SLIMBUS_0_TX, 1, 0, msm_routing_get_port_mixer,
  2567. msm_routing_put_port_mixer),
  2568. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  2569. SOC_SINGLE_EXT("SEC_AUX_PCM_UL_TX", MSM_BACKEND_DAI_AUXPCM_RX,
  2570. MSM_BACKEND_DAI_SEC_AUXPCM_TX, 1, 0, msm_routing_get_port_mixer,
  2571. msm_routing_put_port_mixer),
  2572. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  2573. };
  2574. static const struct snd_kcontrol_new sec_auxpcm_rx_port_mixer_controls[] = {
  2575. SOC_SINGLE_EXT("SEC_AUX_PCM_UL_TX", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2576. MSM_BACKEND_DAI_SEC_AUXPCM_TX, 1, 0, msm_routing_get_port_mixer,
  2577. msm_routing_put_port_mixer),
  2578. SOC_SINGLE_EXT("SLIM_0_TX", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2579. MSM_BACKEND_DAI_SLIMBUS_0_TX, 1, 0, msm_routing_get_port_mixer,
  2580. msm_routing_put_port_mixer),
  2581. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  2582. SOC_SINGLE_EXT("AUX_PCM_UL_TX", MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  2583. MSM_BACKEND_DAI_AUXPCM_TX, 1, 0, msm_routing_get_port_mixer,
  2584. msm_routing_put_port_mixer),
  2585. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  2586. };
  2587. static const struct snd_kcontrol_new sbus_1_rx_port_mixer_controls[] = {
  2588. SOC_SINGLE_EXT("INTERNAL_BT_SCO_TX", MSM_BACKEND_DAI_SLIMBUS_1_RX,
  2589. MSM_BACKEND_DAI_INT_BT_SCO_TX, 1, 0, msm_routing_get_port_mixer,
  2590. msm_routing_put_port_mixer),
  2591. };
  2592. static const struct snd_kcontrol_new sbus_3_rx_port_mixer_controls[] = {
  2593. SOC_SINGLE_EXT("INTERNAL_BT_SCO_RX", MSM_BACKEND_DAI_SLIMBUS_3_RX,
  2594. MSM_BACKEND_DAI_INT_BT_SCO_RX, 1, 0, msm_routing_get_port_mixer,
  2595. msm_routing_put_port_mixer),
  2596. SOC_SINGLE_EXT("MI2S_TX", MSM_BACKEND_DAI_SLIMBUS_3_RX,
  2597. MSM_BACKEND_DAI_MI2S_TX, 1, 0, msm_routing_get_port_mixer,
  2598. msm_routing_put_port_mixer),
  2599. };
  2600. static const struct snd_kcontrol_new bt_sco_rx_port_mixer_controls[] = {
  2601. SOC_SINGLE_EXT("SLIM_1_TX", MSM_BACKEND_DAI_INT_BT_SCO_RX,
  2602. MSM_BACKEND_DAI_SLIMBUS_1_TX, 1, 0, msm_routing_get_port_mixer,
  2603. msm_routing_put_port_mixer),
  2604. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  2605. SOC_SINGLE_EXT("SLIM_0_TX", MSM_BACKEND_DAI_INT_BT_SCO_RX,
  2606. MSM_BACKEND_DAI_SLIMBUS_0_TX, 1, 0, msm_routing_get_port_mixer,
  2607. msm_routing_put_port_mixer),
  2608. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  2609. };
  2610. static const struct snd_kcontrol_new afe_pcm_rx_port_mixer_controls[] = {
  2611. SOC_SINGLE_EXT("INTERNAL_FM_TX", MSM_BACKEND_DAI_AFE_PCM_RX,
  2612. MSM_BACKEND_DAI_INT_FM_TX, 1, 0, msm_routing_get_port_mixer,
  2613. msm_routing_put_port_mixer),
  2614. };
  2615. static const struct snd_kcontrol_new hdmi_rx_port_mixer_controls[] = {
  2616. SOC_SINGLE_EXT("MI2S_TX", MSM_BACKEND_DAI_HDMI_RX,
  2617. MSM_BACKEND_DAI_MI2S_TX, 1, 0, msm_routing_get_port_mixer,
  2618. msm_routing_put_port_mixer),
  2619. };
  2620. static const struct snd_kcontrol_new sec_i2s_rx_port_mixer_controls[] = {
  2621. SOC_SINGLE_EXT("MI2S_TX", MSM_BACKEND_DAI_SEC_I2S_RX,
  2622. MSM_BACKEND_DAI_MI2S_TX, 1, 0, msm_routing_get_port_mixer,
  2623. msm_routing_put_port_mixer),
  2624. };
  2625. static const struct snd_kcontrol_new mi2s_rx_port_mixer_controls[] = {
  2626. SOC_SINGLE_EXT("SLIM_1_TX", MSM_BACKEND_DAI_MI2S_RX,
  2627. MSM_BACKEND_DAI_SLIMBUS_1_TX, 1, 0, msm_routing_get_port_mixer,
  2628. msm_routing_put_port_mixer),
  2629. SOC_SINGLE_EXT("MI2S_TX", MSM_BACKEND_DAI_MI2S_RX,
  2630. MSM_BACKEND_DAI_MI2S_TX, 1, 0, msm_routing_get_port_mixer,
  2631. msm_routing_put_port_mixer),
  2632. };
  2633. static const struct snd_kcontrol_new primary_mi2s_rx_port_mixer_controls[] = {
  2634. SOC_SINGLE_EXT("SEC_MI2S_TX", MSM_BACKEND_DAI_PRI_MI2S_RX,
  2635. MSM_BACKEND_DAI_SECONDARY_MI2S_TX, 1, 0, msm_routing_get_port_mixer,
  2636. msm_routing_put_port_mixer),
  2637. };
  2638. static const struct snd_kcontrol_new fm_switch_mixer_controls =
  2639. SOC_SINGLE_EXT("Switch", SND_SOC_NOPM,
  2640. 0, 1, 0, msm_routing_get_switch_mixer,
  2641. msm_routing_put_switch_mixer);
  2642. static const struct snd_kcontrol_new pcm_rx_switch_mixer_controls =
  2643. SOC_SINGLE_EXT("Switch", SND_SOC_NOPM,
  2644. 0, 1, 0, msm_routing_get_fm_pcmrx_switch_mixer,
  2645. msm_routing_put_fm_pcmrx_switch_mixer);
  2646. static const struct snd_kcontrol_new pri_mi2s_rx_switch_mixer_controls =
  2647. SOC_SINGLE_EXT("Switch", SND_SOC_NOPM,
  2648. 0, 1, 0, msm_routing_get_switch_mixer,
  2649. msm_routing_put_switch_mixer);
  2650. static const struct soc_enum lsm_mux_enum =
  2651. SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(mad_audio_mux_text), mad_audio_mux_text);
  2652. static const struct snd_kcontrol_new lsm1_mux =
  2653. SOC_DAPM_ENUM_EXT("LSM1 MUX", lsm_mux_enum,
  2654. msm_routing_lsm_mux_get,
  2655. msm_routing_lsm_mux_put);
  2656. static const struct snd_kcontrol_new lsm2_mux =
  2657. SOC_DAPM_ENUM_EXT("LSM2 MUX", lsm_mux_enum,
  2658. msm_routing_lsm_mux_get,
  2659. msm_routing_lsm_mux_put);
  2660. static const struct snd_kcontrol_new lsm3_mux =
  2661. SOC_DAPM_ENUM_EXT("LSM3 MUX", lsm_mux_enum,
  2662. msm_routing_lsm_mux_get,
  2663. msm_routing_lsm_mux_put);
  2664. static const struct snd_kcontrol_new lsm4_mux =
  2665. SOC_DAPM_ENUM_EXT("LSM4 MUX", lsm_mux_enum,
  2666. msm_routing_lsm_mux_get,
  2667. msm_routing_lsm_mux_put);
  2668. static const struct snd_kcontrol_new lsm5_mux =
  2669. SOC_DAPM_ENUM_EXT("LSM5 MUX", lsm_mux_enum,
  2670. msm_routing_lsm_mux_get,
  2671. msm_routing_lsm_mux_put);
  2672. static const struct snd_kcontrol_new lsm6_mux =
  2673. SOC_DAPM_ENUM_EXT("LSM6 MUX", lsm_mux_enum,
  2674. msm_routing_lsm_mux_get,
  2675. msm_routing_lsm_mux_put);
  2676. static const struct snd_kcontrol_new lsm7_mux =
  2677. SOC_DAPM_ENUM_EXT("LSM7 MUX", lsm_mux_enum,
  2678. msm_routing_lsm_mux_get,
  2679. msm_routing_lsm_mux_put);
  2680. static const struct snd_kcontrol_new lsm8_mux =
  2681. SOC_DAPM_ENUM_EXT("LSM8 MUX", lsm_mux_enum,
  2682. msm_routing_lsm_mux_get,
  2683. msm_routing_lsm_mux_put);
  2684. static const char * const lsm_func_text[] = {
  2685. "None", "AUDIO", "BEACON", "ULTRASOUND", "SWAUDIO",
  2686. };
  2687. static const struct soc_enum lsm_func_enum =
  2688. SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(lsm_func_text), lsm_func_text);
  2689. static const struct snd_kcontrol_new lsm_function[] = {
  2690. SOC_ENUM_EXT(SLIMBUS_0_TX_TEXT" "LSM_FUNCTION_TEXT, lsm_func_enum,
  2691. msm_routing_lsm_func_get, msm_routing_lsm_func_put),
  2692. SOC_ENUM_EXT(SLIMBUS_1_TX_TEXT" "LSM_FUNCTION_TEXT, lsm_func_enum,
  2693. msm_routing_lsm_func_get, msm_routing_lsm_func_put),
  2694. SOC_ENUM_EXT(SLIMBUS_2_TX_TEXT" "LSM_FUNCTION_TEXT, lsm_func_enum,
  2695. msm_routing_lsm_func_get, msm_routing_lsm_func_put),
  2696. SOC_ENUM_EXT(SLIMBUS_3_TX_TEXT" "LSM_FUNCTION_TEXT, lsm_func_enum,
  2697. msm_routing_lsm_func_get, msm_routing_lsm_func_put),
  2698. SOC_ENUM_EXT(SLIMBUS_4_TX_TEXT" "LSM_FUNCTION_TEXT, lsm_func_enum,
  2699. msm_routing_lsm_func_get, msm_routing_lsm_func_put),
  2700. SOC_ENUM_EXT(SLIMBUS_5_TX_TEXT" "LSM_FUNCTION_TEXT, lsm_func_enum,
  2701. msm_routing_lsm_func_get, msm_routing_lsm_func_put),
  2702. };
  2703. static const char * const aanc_slim_0_rx_text[] = {
  2704. "ZERO", "SLIMBUS_0_TX", "SLIMBUS_1_TX", "SLIMBUS_2_TX", "SLIMBUS_3_TX",
  2705. "SLIMBUS_4_TX", "SLIMBUS_5_TX", "SLIMBUS_6_TX"
  2706. };
  2707. static const struct soc_enum aanc_slim_0_rx_enum =
  2708. SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(aanc_slim_0_rx_text),
  2709. aanc_slim_0_rx_text);
  2710. static const struct snd_kcontrol_new aanc_slim_0_rx_mux[] = {
  2711. SOC_DAPM_ENUM_EXT("AANC_SLIM_0_RX MUX", aanc_slim_0_rx_enum,
  2712. msm_routing_slim_0_rx_aanc_mux_get,
  2713. msm_routing_slim_0_rx_aanc_mux_put)
  2714. };
  2715. static const struct snd_kcontrol_new int_fm_vol_mixer_controls[] = {
  2716. SOC_SINGLE_EXT_TLV("Internal FM RX Volume", SND_SOC_NOPM, 0,
  2717. INT_RX_VOL_GAIN, 0, msm_routing_get_fm_vol_mixer,
  2718. msm_routing_set_fm_vol_mixer, fm_rx_vol_gain),
  2719. };
  2720. static const struct snd_kcontrol_new int_hfp_vol_mixer_controls[] = {
  2721. SOC_SINGLE_EXT_TLV("Internal HFP RX Volume", SND_SOC_NOPM, 0,
  2722. INT_RX_VOL_GAIN, 0, msm_routing_get_hfp_vol_mixer,
  2723. msm_routing_set_hfp_vol_mixer, hfp_rx_vol_gain),
  2724. };
  2725. static const struct snd_kcontrol_new multimedia2_vol_mixer_controls[] = {
  2726. SOC_SINGLE_EXT_TLV("HIFI2 RX Volume", SND_SOC_NOPM, 0,
  2727. INT_RX_VOL_GAIN, 0, msm_routing_get_multimedia2_vol_mixer,
  2728. msm_routing_set_multimedia2_vol_mixer, multimedia2_rx_vol_gain),
  2729. };
  2730. static const struct snd_kcontrol_new multimedia5_vol_mixer_controls[] = {
  2731. SOC_SINGLE_EXT_TLV("HIFI3 RX Volume", SND_SOC_NOPM, 0,
  2732. INT_RX_VOL_GAIN, 0, msm_routing_get_multimedia5_vol_mixer,
  2733. msm_routing_set_multimedia5_vol_mixer, multimedia5_rx_vol_gain),
  2734. };
  2735. static const struct snd_kcontrol_new multi_ch_channel_map_mixer_controls[] = {
  2736. SOC_SINGLE_MULTI_EXT("Playback Channel Map", SND_SOC_NOPM, 0, 16,
  2737. 0, 8, msm_routing_get_channel_map_mixer,
  2738. msm_routing_put_channel_map_mixer),
  2739. };
  2740. static const struct snd_kcontrol_new lpa_SRS_trumedia_controls[] = {
  2741. {.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  2742. .name = "SRS TruMedia",
  2743. .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |
  2744. SNDRV_CTL_ELEM_ACCESS_READWRITE,
  2745. .info = snd_soc_info_volsw, \
  2746. .get = msm_routing_get_srs_trumedia_control,
  2747. .put = msm_routing_set_srs_trumedia_control,
  2748. .private_value = ((unsigned long)&(struct soc_mixer_control)
  2749. {.reg = SND_SOC_NOPM,
  2750. .rreg = SND_SOC_NOPM,
  2751. .shift = 0,
  2752. .rshift = 0,
  2753. .max = 0xFFFFFFFF,
  2754. .platform_max = 0xFFFFFFFF,
  2755. .invert = 0
  2756. })
  2757. }
  2758. };
  2759. static const struct snd_kcontrol_new lpa_SRS_trumedia_controls_HDMI[] = {
  2760. {.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  2761. .name = "SRS TruMedia HDMI",
  2762. .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |
  2763. SNDRV_CTL_ELEM_ACCESS_READWRITE,
  2764. .info = snd_soc_info_volsw, \
  2765. .get = msm_routing_get_srs_trumedia_control,
  2766. .put = msm_routing_set_srs_trumedia_control_HDMI,
  2767. .private_value = ((unsigned long)&(struct soc_mixer_control)
  2768. {.reg = SND_SOC_NOPM,
  2769. .rreg = SND_SOC_NOPM,
  2770. .shift = 0,
  2771. .rshift = 0,
  2772. .max = 0xFFFFFFFF,
  2773. .platform_max = 0xFFFFFFFF,
  2774. .invert = 0
  2775. })
  2776. }
  2777. };
  2778. static const struct snd_kcontrol_new lpa_SRS_trumedia_controls_I2S[] = {
  2779. {.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  2780. .name = "SRS TruMedia I2S",
  2781. .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |
  2782. SNDRV_CTL_ELEM_ACCESS_READWRITE,
  2783. .info = snd_soc_info_volsw, \
  2784. .get = msm_routing_get_srs_trumedia_control,
  2785. .put = msm_routing_set_srs_trumedia_control_I2S,
  2786. .private_value = ((unsigned long)&(struct soc_mixer_control)
  2787. {.reg = SND_SOC_NOPM,
  2788. .rreg = SND_SOC_NOPM,
  2789. .shift = 0,
  2790. .rshift = 0,
  2791. .max = 0xFFFFFFFF,
  2792. .platform_max = 0xFFFFFFFF,
  2793. .invert = 0
  2794. })
  2795. }
  2796. };
  2797. int msm_routing_get_dolby_security_control(
  2798. struct snd_kcontrol *kcontrol,
  2799. struct snd_ctl_elem_value *ucontrol) {
  2800. /* not used while setting the manfr id*/
  2801. return 0;
  2802. }
  2803. int msm_routing_put_dolby_security_control(
  2804. struct snd_kcontrol *kcontrol,
  2805. struct snd_ctl_elem_value *ucontrol) {
  2806. int manufacturer_id = ucontrol->value.integer.value[0];
  2807. core_set_dolby_manufacturer_id(manufacturer_id);
  2808. return 0;
  2809. }
  2810. static const struct snd_kcontrol_new dolby_security_controls[] = {
  2811. SOC_SINGLE_MULTI_EXT("DS1 Security", SND_SOC_NOPM, 0,
  2812. 0xFFFFFFFF, 0, 1, msm_routing_get_dolby_security_control,
  2813. msm_routing_put_dolby_security_control),
  2814. };
  2815. static const struct snd_kcontrol_new dolby_dap_param_to_set_controls[] = {
  2816. SOC_SINGLE_MULTI_EXT("DS1 DAP Set Param", SND_SOC_NOPM, 0, 0xFFFFFFFF,
  2817. 0, 128, msm_routing_get_dolby_dap_param_to_set_control,
  2818. msm_routing_put_dolby_dap_param_to_set_control),
  2819. };
  2820. static const struct snd_kcontrol_new dolby_dap_param_to_get_controls[] = {
  2821. SOC_SINGLE_MULTI_EXT("DS1 DAP Get Param", SND_SOC_NOPM, 0, 0xFFFFFFFF,
  2822. 0, 128, msm_routing_get_dolby_dap_param_to_get_control,
  2823. msm_routing_put_dolby_dap_param_to_get_control),
  2824. };
  2825. static const struct snd_kcontrol_new dolby_dap_param_visualizer_controls[] = {
  2826. SOC_SINGLE_MULTI_EXT("DS1 DAP Get Visualizer", SND_SOC_NOPM, 0,
  2827. 0xFFFFFFFF, 0, 41, msm_routing_get_dolby_dap_param_visualizer_control,
  2828. msm_routing_put_dolby_dap_param_visualizer_control),
  2829. };
  2830. static const struct snd_kcontrol_new dolby_dap_param_end_point_controls[] = {
  2831. SOC_SINGLE_MULTI_EXT("DS1 DAP Endpoint", SND_SOC_NOPM, 0,
  2832. 0xFFFFFFFF, 0, 1, msm_routing_get_dolby_dap_endpoint_control,
  2833. msm_routing_put_dolby_dap_endpoint_control),
  2834. };
  2835. int msm_routing_get_rms_value_control(struct snd_kcontrol *kcontrol,
  2836. struct snd_ctl_elem_value *ucontrol) {
  2837. int rc = 0;
  2838. int be_idx = 0;
  2839. char *param_value;
  2840. int *update_param_value;
  2841. uint32_t param_length = sizeof(uint32_t);
  2842. uint32_t param_payload_len = RMS_PAYLOAD_LEN * sizeof(uint32_t);
  2843. param_value = kzalloc(param_length, GFP_KERNEL);
  2844. if (!param_value) {
  2845. pr_err("%s, param memory alloc failed\n", __func__);
  2846. return -ENOMEM;
  2847. }
  2848. for (be_idx = 0; be_idx < MSM_BACKEND_DAI_MAX; be_idx++)
  2849. if (msm_bedais[be_idx].port_id == SLIMBUS_0_TX)
  2850. break;
  2851. if ((be_idx < MSM_BACKEND_DAI_MAX) && msm_bedais[be_idx].active) {
  2852. rc = adm_get_params(SLIMBUS_0_TX,
  2853. RMS_MODULEID_APPI_PASSTHRU,
  2854. RMS_PARAM_FIRST_SAMPLE,
  2855. param_length + param_payload_len,
  2856. param_value);
  2857. if (rc) {
  2858. pr_err("%s: get parameters failed\n", __func__);
  2859. kfree(param_value);
  2860. return -EINVAL;
  2861. }
  2862. update_param_value = (int *)param_value;
  2863. ucontrol->value.integer.value[0] = update_param_value[0];
  2864. pr_debug("%s: FROM DSP value[0] 0x%x\n",
  2865. __func__, update_param_value[0]);
  2866. }
  2867. kfree(param_value);
  2868. return 0;
  2869. }
  2870. int msm_routing_put_rms_value_control(struct snd_kcontrol *kcontrol,
  2871. struct snd_ctl_elem_value *ucontrol) {
  2872. /* not used */
  2873. return 0;
  2874. }
  2875. static const struct snd_kcontrol_new get_rms_controls[] = {
  2876. SOC_SINGLE_EXT("Get RMS", SND_SOC_NOPM, 0, 0xFFFFFFFF,
  2877. 0, msm_routing_get_rms_value_control,
  2878. msm_routing_put_rms_value_control),
  2879. };
  2880. static int msm_voc_session_id_put(struct snd_kcontrol *kcontrol,
  2881. struct snd_ctl_elem_value *ucontrol)
  2882. {
  2883. voc_session_id = ucontrol->value.integer.value[0];
  2884. pr_debug("%s: voc_session_id=%u\n", __func__, voc_session_id);
  2885. return 0;
  2886. }
  2887. static int msm_voc_session_id_get(struct snd_kcontrol *kcontrol,
  2888. struct snd_ctl_elem_value *ucontrol)
  2889. {
  2890. ucontrol->value.integer.value[0] = voc_session_id;
  2891. return 0;
  2892. }
  2893. static struct snd_kcontrol_new msm_voc_session_controls[] = {
  2894. SOC_SINGLE_MULTI_EXT("Voc VSID", SND_SOC_NOPM, 0,
  2895. 0xFFFFFFFF, 0, 1, msm_voc_session_id_get,
  2896. msm_voc_session_id_put),
  2897. };
  2898. static const struct snd_kcontrol_new eq_enable_mixer_controls[] = {
  2899. SOC_SINGLE_EXT("MultiMedia1 EQ Enable", SND_SOC_NOPM,
  2900. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_eq_enable_mixer,
  2901. msm_routing_put_eq_enable_mixer),
  2902. SOC_SINGLE_EXT("MultiMedia2 EQ Enable", SND_SOC_NOPM,
  2903. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_eq_enable_mixer,
  2904. msm_routing_put_eq_enable_mixer),
  2905. SOC_SINGLE_EXT("MultiMedia3 EQ Enable", SND_SOC_NOPM,
  2906. MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_eq_enable_mixer,
  2907. msm_routing_put_eq_enable_mixer),
  2908. };
  2909. static const struct snd_kcontrol_new eq_band_mixer_controls[] = {
  2910. SOC_SINGLE_EXT("MultiMedia1 EQ Band Count", SND_SOC_NOPM,
  2911. MSM_FRONTEND_DAI_MULTIMEDIA1, 11, 0,
  2912. msm_routing_get_eq_band_count_audio_mixer,
  2913. msm_routing_put_eq_band_count_audio_mixer),
  2914. SOC_SINGLE_EXT("MultiMedia2 EQ Band Count", SND_SOC_NOPM,
  2915. MSM_FRONTEND_DAI_MULTIMEDIA2, 11, 0,
  2916. msm_routing_get_eq_band_count_audio_mixer,
  2917. msm_routing_put_eq_band_count_audio_mixer),
  2918. SOC_SINGLE_EXT("MultiMedia3 EQ Band Count", SND_SOC_NOPM,
  2919. MSM_FRONTEND_DAI_MULTIMEDIA3, 11, 0,
  2920. msm_routing_get_eq_band_count_audio_mixer,
  2921. msm_routing_put_eq_band_count_audio_mixer),
  2922. };
  2923. static const struct snd_kcontrol_new eq_coeff_mixer_controls[] = {
  2924. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band1", EQ_BAND1,
  2925. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2926. msm_routing_get_eq_band_audio_mixer,
  2927. msm_routing_put_eq_band_audio_mixer),
  2928. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band2", EQ_BAND2,
  2929. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2930. msm_routing_get_eq_band_audio_mixer,
  2931. msm_routing_put_eq_band_audio_mixer),
  2932. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band3", EQ_BAND3,
  2933. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2934. msm_routing_get_eq_band_audio_mixer,
  2935. msm_routing_put_eq_band_audio_mixer),
  2936. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band4", EQ_BAND4,
  2937. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2938. msm_routing_get_eq_band_audio_mixer,
  2939. msm_routing_put_eq_band_audio_mixer),
  2940. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band5", EQ_BAND5,
  2941. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2942. msm_routing_get_eq_band_audio_mixer,
  2943. msm_routing_put_eq_band_audio_mixer),
  2944. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band6", EQ_BAND6,
  2945. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2946. msm_routing_get_eq_band_audio_mixer,
  2947. msm_routing_put_eq_band_audio_mixer),
  2948. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band7", EQ_BAND7,
  2949. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2950. msm_routing_get_eq_band_audio_mixer,
  2951. msm_routing_put_eq_band_audio_mixer),
  2952. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band8", EQ_BAND8,
  2953. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2954. msm_routing_get_eq_band_audio_mixer,
  2955. msm_routing_put_eq_band_audio_mixer),
  2956. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band9", EQ_BAND9,
  2957. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2958. msm_routing_get_eq_band_audio_mixer,
  2959. msm_routing_put_eq_band_audio_mixer),
  2960. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band10", EQ_BAND10,
  2961. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2962. msm_routing_get_eq_band_audio_mixer,
  2963. msm_routing_put_eq_band_audio_mixer),
  2964. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band11", EQ_BAND11,
  2965. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2966. msm_routing_get_eq_band_audio_mixer,
  2967. msm_routing_put_eq_band_audio_mixer),
  2968. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band12", EQ_BAND12,
  2969. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  2970. msm_routing_get_eq_band_audio_mixer,
  2971. msm_routing_put_eq_band_audio_mixer),
  2972. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band1", EQ_BAND1,
  2973. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  2974. msm_routing_get_eq_band_audio_mixer,
  2975. msm_routing_put_eq_band_audio_mixer),
  2976. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band2", EQ_BAND2,
  2977. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  2978. msm_routing_get_eq_band_audio_mixer,
  2979. msm_routing_put_eq_band_audio_mixer),
  2980. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band3", EQ_BAND3,
  2981. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  2982. msm_routing_get_eq_band_audio_mixer,
  2983. msm_routing_put_eq_band_audio_mixer),
  2984. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band4", EQ_BAND4,
  2985. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  2986. msm_routing_get_eq_band_audio_mixer,
  2987. msm_routing_put_eq_band_audio_mixer),
  2988. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band5", EQ_BAND5,
  2989. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  2990. msm_routing_get_eq_band_audio_mixer,
  2991. msm_routing_put_eq_band_audio_mixer),
  2992. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band6", EQ_BAND6,
  2993. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  2994. msm_routing_get_eq_band_audio_mixer,
  2995. msm_routing_put_eq_band_audio_mixer),
  2996. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band7", EQ_BAND7,
  2997. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  2998. msm_routing_get_eq_band_audio_mixer,
  2999. msm_routing_put_eq_band_audio_mixer),
  3000. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band8", EQ_BAND8,
  3001. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  3002. msm_routing_get_eq_band_audio_mixer,
  3003. msm_routing_put_eq_band_audio_mixer),
  3004. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band9", EQ_BAND9,
  3005. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  3006. msm_routing_get_eq_band_audio_mixer,
  3007. msm_routing_put_eq_band_audio_mixer),
  3008. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band10", EQ_BAND10,
  3009. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  3010. msm_routing_get_eq_band_audio_mixer,
  3011. msm_routing_put_eq_band_audio_mixer),
  3012. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band11", EQ_BAND11,
  3013. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  3014. msm_routing_get_eq_band_audio_mixer,
  3015. msm_routing_put_eq_band_audio_mixer),
  3016. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band12", EQ_BAND12,
  3017. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  3018. msm_routing_get_eq_band_audio_mixer,
  3019. msm_routing_put_eq_band_audio_mixer),
  3020. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band1", EQ_BAND1,
  3021. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3022. msm_routing_get_eq_band_audio_mixer,
  3023. msm_routing_put_eq_band_audio_mixer),
  3024. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band2", EQ_BAND2,
  3025. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3026. msm_routing_get_eq_band_audio_mixer,
  3027. msm_routing_put_eq_band_audio_mixer),
  3028. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band3", EQ_BAND3,
  3029. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3030. msm_routing_get_eq_band_audio_mixer,
  3031. msm_routing_put_eq_band_audio_mixer),
  3032. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band4", EQ_BAND4,
  3033. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3034. msm_routing_get_eq_band_audio_mixer,
  3035. msm_routing_put_eq_band_audio_mixer),
  3036. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band5", EQ_BAND5,
  3037. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3038. msm_routing_get_eq_band_audio_mixer,
  3039. msm_routing_put_eq_band_audio_mixer),
  3040. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band6", EQ_BAND6,
  3041. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3042. msm_routing_get_eq_band_audio_mixer,
  3043. msm_routing_put_eq_band_audio_mixer),
  3044. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band7", EQ_BAND7,
  3045. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3046. msm_routing_get_eq_band_audio_mixer,
  3047. msm_routing_put_eq_band_audio_mixer),
  3048. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band8", EQ_BAND8,
  3049. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3050. msm_routing_get_eq_band_audio_mixer,
  3051. msm_routing_put_eq_band_audio_mixer),
  3052. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band9", EQ_BAND9,
  3053. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3054. msm_routing_get_eq_band_audio_mixer,
  3055. msm_routing_put_eq_band_audio_mixer),
  3056. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band10", EQ_BAND10,
  3057. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3058. msm_routing_get_eq_band_audio_mixer,
  3059. msm_routing_put_eq_band_audio_mixer),
  3060. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band11", EQ_BAND11,
  3061. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3062. msm_routing_get_eq_band_audio_mixer,
  3063. msm_routing_put_eq_band_audio_mixer),
  3064. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band12", EQ_BAND12,
  3065. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  3066. msm_routing_get_eq_band_audio_mixer,
  3067. msm_routing_put_eq_band_audio_mixer),
  3068. };
  3069. static int spkr_prot_put_vi_lch_port(struct snd_kcontrol *kcontrol,
  3070. struct snd_ctl_elem_value *ucontrol)
  3071. {
  3072. int ret = 0;
  3073. int item;
  3074. struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
  3075. pr_debug("%s item is %d\n", __func__,
  3076. ucontrol->value.enumerated.item[0]);
  3077. mutex_lock(&routing_lock);
  3078. item = ucontrol->value.enumerated.item[0];
  3079. if (item < e->max) {
  3080. pr_debug("%s RX DAI ID %d TX DAI id %d\n",
  3081. __func__, e->shift_l , e->values[item]);
  3082. if (e->shift_l < MSM_BACKEND_DAI_MAX &&
  3083. e->values[item] < MSM_BACKEND_DAI_MAX)
  3084. /* Enable feedback TX path */
  3085. ret = afe_spk_prot_feed_back_cfg(
  3086. msm_bedais[e->values[item]].port_id,
  3087. msm_bedais[e->shift_l].port_id, 1, 0, 1);
  3088. else {
  3089. pr_debug("%s values are out of range item %d\n",
  3090. __func__, e->values[item]);
  3091. /* Disable feedback TX path */
  3092. if (e->values[item] == MSM_BACKEND_DAI_MAX)
  3093. ret = afe_spk_prot_feed_back_cfg(0, 0, 0, 0, 0);
  3094. else
  3095. ret = -EINVAL;
  3096. }
  3097. } else {
  3098. pr_err("%s item value is out of range item\n", __func__);
  3099. ret = -EINVAL;
  3100. }
  3101. mutex_unlock(&routing_lock);
  3102. return ret;
  3103. }
  3104. static int spkr_prot_get_vi_lch_port(struct snd_kcontrol *kcontrol,
  3105. struct snd_ctl_elem_value *ucontrol)
  3106. {
  3107. pr_debug("%s\n", __func__);
  3108. return 0;
  3109. }
  3110. static const char * const slim0_rx_vi_fb_tx_lch_mux_text[] = {
  3111. "ZERO", "SLIM4_TX"
  3112. };
  3113. static const int const slim0_rx_vi_fb_tx_lch_value[] = {
  3114. MSM_BACKEND_DAI_MAX, MSM_BACKEND_DAI_SLIMBUS_4_TX
  3115. };
  3116. static const struct soc_enum slim0_rx_vi_fb_lch_mux_enum =
  3117. SOC_VALUE_ENUM_DOUBLE(0, MSM_BACKEND_DAI_SLIMBUS_0_RX, 0, 0,
  3118. ARRAY_SIZE(slim0_rx_vi_fb_tx_lch_mux_text),
  3119. slim0_rx_vi_fb_tx_lch_mux_text, slim0_rx_vi_fb_tx_lch_value);
  3120. static const struct snd_kcontrol_new slim0_rx_vi_fb_lch_mux =
  3121. SOC_DAPM_ENUM_EXT("SLIM0_RX_VI_FB_LCH_MUX",
  3122. slim0_rx_vi_fb_lch_mux_enum, spkr_prot_get_vi_lch_port,
  3123. spkr_prot_put_vi_lch_port);
  3124. static const struct snd_kcontrol_new ss_solution_mixer_controls[] = {
  3125. SOC_SINGLE_MULTI_EXT("SA data", SND_SOC_NOPM, 0, 65535, 0, 19,
  3126. msm_sec_sa_get, msm_sec_sa_put),
  3127. SOC_SINGLE_MULTI_EXT("VSP data", SND_SOC_NOPM, 0, 65535, 0, 1,
  3128. msm_sec_vsp_get, msm_sec_vsp_put),
  3129. SOC_SINGLE_MULTI_EXT("Audio DHA data", SND_SOC_NOPM, 0, 65535, 0, 13,
  3130. msm_sec_dha_get, msm_sec_dha_put),
  3131. SOC_SINGLE_MULTI_EXT("LRSM data", SND_SOC_NOPM, 0, 65535, 0, 2,
  3132. msm_sec_lrsm_get, msm_sec_lrsm_put),
  3133. SOC_SINGLE_MULTI_EXT("SA_EP data", SND_SOC_NOPM, 0, 65535, 0, 2,
  3134. msm_sec_sa_ep_get, msm_sec_sa_ep_put),
  3135. SOC_SINGLE_MULTI_EXT("MSP data", SND_SOC_NOPM, 0, 65535, 0, 1,
  3136. msm_sec_msp_get, msm_sec_msp_put),
  3137. };
  3138. static const struct snd_soc_dapm_widget msm_qdsp6_widgets[] = {
  3139. /* Frontend AIF */
  3140. /* Widget name equals to Front-End DAI name<Need confirmation>,
  3141. * Stream name must contains substring of front-end dai name
  3142. */
  3143. SND_SOC_DAPM_AIF_IN("MM_DL1", "MultiMedia1 Playback", 0, 0, 0, 0),
  3144. SND_SOC_DAPM_AIF_IN("MM_DL2", "MultiMedia2 Playback", 0, 0, 0, 0),
  3145. SND_SOC_DAPM_AIF_IN("MM_DL3", "MultiMedia3 Playback", 0, 0, 0, 0),
  3146. SND_SOC_DAPM_AIF_IN("MM_DL4", "MultiMedia4 Playback", 0, 0, 0, 0),
  3147. SND_SOC_DAPM_AIF_IN("MM_DL5", "MultiMedia5 Playback", 0, 0, 0, 0),
  3148. SND_SOC_DAPM_AIF_IN("MM_DL6", "MultiMedia6 Playback", 0, 0, 0, 0),
  3149. SND_SOC_DAPM_AIF_IN("MM_DL7", "MultiMedia7 Playback", 0, 0, 0, 0),
  3150. SND_SOC_DAPM_AIF_IN("MM_DL8", "MultiMedia8 Playback", 0, 0, 0, 0),
  3151. SND_SOC_DAPM_AIF_IN("MM_DL9", "MultiMedia9 Playback", 0, 0, 0, 0),
  3152. #ifdef CONFIG_JACK_AUDIO
  3153. SND_SOC_DAPM_AIF_IN("MM_DL10", "MultiMedia10 Playback", 0, 0, 0, 0),
  3154. #endif
  3155. SND_SOC_DAPM_AIF_IN("VOIP_DL", "VoIP Playback", 0, 0, 0, 0),
  3156. SND_SOC_DAPM_AIF_OUT("MM_UL1", "MultiMedia1 Capture", 0, 0, 0, 0),
  3157. SND_SOC_DAPM_AIF_OUT("MM_UL2", "MultiMedia2 Capture", 0, 0, 0, 0),
  3158. SND_SOC_DAPM_AIF_OUT("MM_UL4", "MultiMedia4 Capture", 0, 0, 0, 0),
  3159. SND_SOC_DAPM_AIF_OUT("MM_UL5", "MultiMedia5 Capture", 0, 0, 0, 0),
  3160. SND_SOC_DAPM_AIF_OUT("MM_UL8", "MultiMedia8 Capture", 0, 0, 0, 0),
  3161. SND_SOC_DAPM_AIF_OUT("MM_UL6", "MultiMedia6 Capture", 0, 0, 0, 0),
  3162. SND_SOC_DAPM_AIF_OUT("MM_UL9", "MultiMedia9 Capture", 0, 0, 0, 0),
  3163. #ifdef CONFIG_JACK_AUDIO
  3164. SND_SOC_DAPM_AIF_OUT("MM_UL10", "MultiMedia10 Capture", 0, 0, 0, 0),
  3165. #endif
  3166. SND_SOC_DAPM_AIF_IN("CS-VOICE_DL1", "CS-VOICE Playback", 0, 0, 0, 0),
  3167. SND_SOC_DAPM_AIF_OUT("CS-VOICE_UL1", "CS-VOICE Capture", 0, 0, 0, 0),
  3168. SND_SOC_DAPM_AIF_IN("VOICE2_DL", "Voice2 Playback", 0, 0, 0, 0),
  3169. SND_SOC_DAPM_AIF_OUT("VOICE2_UL", "Voice2 Capture", 0, 0, 0, 0),
  3170. SND_SOC_DAPM_AIF_IN("VoLTE_DL", "VoLTE Playback", 0, 0, 0, 0),
  3171. SND_SOC_DAPM_AIF_OUT("VoLTE_UL", "VoLTE Capture", 0, 0, 0, 0),
  3172. SND_SOC_DAPM_AIF_IN("VoWLAN_DL", "VoWLAN Playback", 0, 0, 0, 0),
  3173. SND_SOC_DAPM_AIF_OUT("VoWLAN_UL", "VoWLAN Capture", 0, 0, 0, 0),
  3174. SND_SOC_DAPM_AIF_OUT("VOIP_UL", "VoIP Capture", 0, 0, 0, 0),
  3175. SND_SOC_DAPM_AIF_IN("SLIM0_DL_HL", "SLIMBUS0_HOSTLESS Playback",
  3176. 0, 0, 0, 0),
  3177. SND_SOC_DAPM_AIF_OUT("SLIM0_UL_HL", "SLIMBUS0_HOSTLESS Capture",
  3178. 0, 0, 0, 0),
  3179. SND_SOC_DAPM_AIF_IN("SLIM1_DL_HL", "SLIMBUS1_HOSTLESS Playback",
  3180. 0, 0, 0, 0),
  3181. SND_SOC_DAPM_AIF_OUT("SLIM1_UL_HL", "SLIMBUS1_HOSTLESS Capture",
  3182. 0, 0, 0, 0),
  3183. SND_SOC_DAPM_AIF_IN("SLIM3_DL_HL", "SLIMBUS3_HOSTLESS Playback",
  3184. 0, 0, 0, 0),
  3185. SND_SOC_DAPM_AIF_OUT("SLIM3_UL_HL", "SLIMBUS3_HOSTLESS Capture",
  3186. 0, 0, 0, 0),
  3187. SND_SOC_DAPM_AIF_IN("SLIM4_DL_HL", "SLIMBUS4_HOSTLESS Playback",
  3188. 0, 0, 0, 0),
  3189. SND_SOC_DAPM_AIF_OUT("SLIM4_UL_HL", "SLIMBUS4_HOSTLESS Capture",
  3190. 0, 0, 0, 0),
  3191. SND_SOC_DAPM_AIF_IN("INTFM_DL_HL", "INT_FM_HOSTLESS Playback",
  3192. 0, 0, 0, 0),
  3193. SND_SOC_DAPM_AIF_OUT("INTFM_UL_HL", "INT_FM_HOSTLESS Capture",
  3194. 0, 0, 0, 0),
  3195. SND_SOC_DAPM_AIF_IN("INTHFP_DL_HL", "INT_HFP_BT_HOSTLESS Playback",
  3196. 0, 0, 0, 0),
  3197. SND_SOC_DAPM_AIF_OUT("INTHFP_UL_HL", "INT_HFP_BT_HOSTLESS Capture",
  3198. 0, 0, 0, 0),
  3199. SND_SOC_DAPM_AIF_IN("HDMI_DL_HL", "HDMI_HOSTLESS Playback", 0, 0, 0, 0),
  3200. SND_SOC_DAPM_AIF_IN("SEC_I2S_DL_HL", "SEC_I2S_RX_HOSTLESS Playback",
  3201. 0, 0, 0, 0),
  3202. SND_SOC_DAPM_AIF_IN("SEC_MI2S_DL_HL",
  3203. "Secondary MI2S_RX Hostless Playback",
  3204. 0, 0, 0, 0),
  3205. SND_SOC_DAPM_AIF_IN("AUXPCM_DL_HL", "AUXPCM_HOSTLESS Playback",
  3206. 0, 0, 0, 0),
  3207. SND_SOC_DAPM_AIF_OUT("AUXPCM_UL_HL", "AUXPCM_HOSTLESS Capture",
  3208. 0, 0, 0, 0),
  3209. SND_SOC_DAPM_AIF_OUT("MI2S_UL_HL", "MI2S_TX_HOSTLESS Capture",
  3210. 0, 0, 0, 0),
  3211. SND_SOC_DAPM_AIF_OUT("PRI_MI2S_UL_HL",
  3212. "Primary MI2S_TX Hostless Capture",
  3213. 0, 0, 0, 0),
  3214. SND_SOC_DAPM_AIF_IN("PRI_MI2S_DL_HL",
  3215. "Primary MI2S_RX Hostless Playback",
  3216. 0, 0, 0, 0),
  3217. SND_SOC_DAPM_AIF_OUT("MI2S_DL_HL", "MI2S_RX_HOSTLESS Playback",
  3218. 0, 0, 0, 0),
  3219. SND_SOC_DAPM_AIF_IN("DTMF_DL_HL", "DTMF_RX_HOSTLESS Playback",
  3220. 0, 0, 0, 0),
  3221. /* LSM */
  3222. SND_SOC_DAPM_AIF_OUT("LSM1_UL_HL", "Listen 1 Audio Service Capture",
  3223. 0, 0, 0, 0),
  3224. SND_SOC_DAPM_AIF_OUT("LSM2_UL_HL", "Listen 2 Audio Service Capture",
  3225. 0, 0, 0, 0),
  3226. SND_SOC_DAPM_AIF_OUT("LSM3_UL_HL", "Listen 3 Audio Service Capture",
  3227. 0, 0, 0, 0),
  3228. SND_SOC_DAPM_AIF_OUT("LSM4_UL_HL", "Listen 4 Audio Service Capture",
  3229. 0, 0, 0, 0),
  3230. SND_SOC_DAPM_AIF_OUT("LSM5_UL_HL", "Listen 5 Audio Service Capture",
  3231. 0, 0, 0, 0),
  3232. SND_SOC_DAPM_AIF_OUT("LSM6_UL_HL", "Listen 6 Audio Service Capture",
  3233. 0, 0, 0, 0),
  3234. SND_SOC_DAPM_AIF_OUT("LSM7_UL_HL", "Listen 7 Audio Service Capture",
  3235. 0, 0, 0, 0),
  3236. SND_SOC_DAPM_AIF_OUT("LSM8_UL_HL", "Listen 8 Audio Service Capture",
  3237. 0, 0, 0, 0),
  3238. SND_SOC_DAPM_AIF_IN("QCHAT_DL", "QCHAT Playback", 0, 0, 0, 0),
  3239. SND_SOC_DAPM_AIF_OUT("QCHAT_UL", "QCHAT Capture", 0, 0, 0, 0),
  3240. /* Backend AIF */
  3241. /* Stream name equals to backend dai link stream name
  3242. */
  3243. SND_SOC_DAPM_AIF_OUT("PRI_I2S_RX", "Primary I2S Playback", 0, 0, 0, 0),
  3244. SND_SOC_DAPM_AIF_OUT("SEC_I2S_RX", "Secondary I2S Playback",
  3245. 0, 0, 0 , 0),
  3246. SND_SOC_DAPM_AIF_OUT("SLIMBUS_0_RX", "Slimbus Playback", 0, 0, 0, 0),
  3247. SND_SOC_DAPM_AIF_OUT("HDMI", "HDMI Playback", 0, 0, 0 , 0),
  3248. SND_SOC_DAPM_AIF_OUT("MI2S_RX", "MI2S Playback", 0, 0, 0, 0),
  3249. SND_SOC_DAPM_AIF_OUT("QUAT_MI2S_RX", "Quaternary MI2S Playback",
  3250. 0, 0, 0, 0),
  3251. SND_SOC_DAPM_AIF_OUT("TERT_MI2S_RX", "Tertiary MI2S Playback",
  3252. 0, 0, 0, 0),
  3253. SND_SOC_DAPM_AIF_OUT("SEC_MI2S_RX", "Secondary MI2S Playback",
  3254. 0, 0, 0, 0),
  3255. SND_SOC_DAPM_AIF_OUT("PRI_MI2S_RX", "Primary MI2S Playback",
  3256. 0, 0, 0, 0),
  3257. SND_SOC_DAPM_AIF_IN("PRI_I2S_TX", "Primary I2S Capture", 0, 0, 0, 0),
  3258. SND_SOC_DAPM_AIF_IN("MI2S_TX", "MI2S Capture", 0, 0, 0, 0),
  3259. SND_SOC_DAPM_AIF_IN("QUAT_MI2S_TX", "Quaternary MI2S Capture",
  3260. 0, 0, 0, 0),
  3261. SND_SOC_DAPM_AIF_IN("PRI_MI2S_TX", "Primary MI2S Capture",
  3262. 0, 0, 0, 0),
  3263. SND_SOC_DAPM_AIF_IN("TERT_MI2S_TX", "Tertiary MI2S Capture",
  3264. 0, 0, 0, 0),
  3265. SND_SOC_DAPM_AIF_IN("SEC_MI2S_TX", "Secondary MI2S Capture",
  3266. 0, 0, 0, 0),
  3267. SND_SOC_DAPM_AIF_IN("SLIMBUS_0_TX", "Slimbus Capture", 0, 0, 0, 0),
  3268. SND_SOC_DAPM_AIF_OUT("INT_BT_SCO_RX", "Internal BT-SCO Playback",
  3269. 0, 0, 0 , 0),
  3270. SND_SOC_DAPM_AIF_IN("INT_BT_SCO_TX", "Internal BT-SCO Capture",
  3271. 0, 0, 0, 0),
  3272. SND_SOC_DAPM_AIF_OUT("INT_FM_RX", "Internal FM Playback",
  3273. 0, 0, 0 , 0),
  3274. SND_SOC_DAPM_AIF_IN("INT_FM_TX", "Internal FM Capture",
  3275. 0, 0, 0, 0),
  3276. SND_SOC_DAPM_AIF_OUT("PCM_RX", "AFE Playback",
  3277. 0, 0, 0 , 0),
  3278. SND_SOC_DAPM_AIF_IN("PCM_TX", "AFE Capture",
  3279. 0, 0, 0 , 0),
  3280. /* incall */
  3281. SND_SOC_DAPM_AIF_OUT("VOICE_PLAYBACK_TX", "Voice Farend Playback",
  3282. 0, 0, 0 , 0),
  3283. SND_SOC_DAPM_AIF_OUT("VOICE2_PLAYBACK_TX", "Voice2 Farend Playback",
  3284. 0, 0, 0 , 0),
  3285. SND_SOC_DAPM_AIF_OUT("SLIMBUS_4_RX", "Slimbus4 Playback",
  3286. 0, 0, 0 , 0),
  3287. SND_SOC_DAPM_AIF_IN("INCALL_RECORD_TX", "Voice Uplink Capture",
  3288. 0, 0, 0, 0),
  3289. SND_SOC_DAPM_AIF_IN("INCALL_RECORD_RX", "Voice Downlink Capture",
  3290. 0, 0, 0, 0),
  3291. SND_SOC_DAPM_AIF_IN("SLIMBUS_4_TX", "Slimbus4 Capture",
  3292. 0, 0, 0, 0),
  3293. SND_SOC_DAPM_AIF_IN("SLIMBUS_5_TX", "Slimbus5 Capture", 0, 0, 0, 0),
  3294. SND_SOC_DAPM_AIF_OUT("AUX_PCM_RX", "AUX PCM Playback", 0, 0, 0, 0),
  3295. SND_SOC_DAPM_AIF_IN("AUX_PCM_TX", "AUX PCM Capture", 0, 0, 0, 0),
  3296. SND_SOC_DAPM_AIF_OUT("SEC_AUX_PCM_RX", "Sec AUX PCM Playback",
  3297. 0, 0, 0, 0),
  3298. SND_SOC_DAPM_AIF_IN("SEC_AUX_PCM_TX", "Sec AUX PCM Capture",
  3299. 0, 0, 0, 0),
  3300. SND_SOC_DAPM_AIF_IN("VOICE_STUB_DL", "VOICE_STUB Playback", 0, 0, 0, 0),
  3301. SND_SOC_DAPM_AIF_OUT("VOICE_STUB_UL", "VOICE_STUB Capture", 0, 0, 0, 0),
  3302. SND_SOC_DAPM_AIF_OUT("STUB_RX", "Stub Playback", 0, 0, 0, 0),
  3303. SND_SOC_DAPM_AIF_IN("STUB_TX", "Stub Capture", 0, 0, 0, 0),
  3304. SND_SOC_DAPM_AIF_OUT("SLIMBUS_1_RX", "Slimbus1 Playback", 0, 0, 0, 0),
  3305. SND_SOC_DAPM_AIF_IN("SLIMBUS_1_TX", "Slimbus1 Capture", 0, 0, 0, 0),
  3306. SND_SOC_DAPM_AIF_IN("STUB_1_TX", "Stub1 Capture", 0, 0, 0, 0),
  3307. SND_SOC_DAPM_AIF_OUT("SLIMBUS_3_RX", "Slimbus3 Playback", 0, 0, 0, 0),
  3308. SND_SOC_DAPM_AIF_IN("SLIMBUS_3_TX", "Slimbus3 Capture", 0, 0, 0, 0),
  3309. /* Switch Definitions */
  3310. SND_SOC_DAPM_SWITCH("SLIMBUS_DL_HL", SND_SOC_NOPM, 0, 0,
  3311. &fm_switch_mixer_controls),
  3312. SND_SOC_DAPM_SWITCH("SLIMBUS1_DL_HL", SND_SOC_NOPM, 0, 0,
  3313. &fm_switch_mixer_controls),
  3314. SND_SOC_DAPM_SWITCH("SLIMBUS3_DL_HL", SND_SOC_NOPM, 0, 0,
  3315. &fm_switch_mixer_controls),
  3316. SND_SOC_DAPM_SWITCH("SLIMBUS4_DL_HL", SND_SOC_NOPM, 0, 0,
  3317. &fm_switch_mixer_controls),
  3318. SND_SOC_DAPM_SWITCH("PCM_RX_DL_HL", SND_SOC_NOPM, 0, 0,
  3319. &pcm_rx_switch_mixer_controls),
  3320. SND_SOC_DAPM_SWITCH("PRI_MI2S_RX_DL_HL", SND_SOC_NOPM, 0, 0,
  3321. &pri_mi2s_rx_switch_mixer_controls),
  3322. /* Mux Definitions */
  3323. SND_SOC_DAPM_MUX("LSM1 MUX", SND_SOC_NOPM, 0, 0, &lsm1_mux),
  3324. SND_SOC_DAPM_MUX("LSM2 MUX", SND_SOC_NOPM, 0, 0, &lsm2_mux),
  3325. SND_SOC_DAPM_MUX("LSM3 MUX", SND_SOC_NOPM, 0, 0, &lsm3_mux),
  3326. SND_SOC_DAPM_MUX("LSM4 MUX", SND_SOC_NOPM, 0, 0, &lsm4_mux),
  3327. SND_SOC_DAPM_MUX("LSM5 MUX", SND_SOC_NOPM, 0, 0, &lsm5_mux),
  3328. SND_SOC_DAPM_MUX("LSM6 MUX", SND_SOC_NOPM, 0, 0, &lsm6_mux),
  3329. SND_SOC_DAPM_MUX("LSM7 MUX", SND_SOC_NOPM, 0, 0, &lsm7_mux),
  3330. SND_SOC_DAPM_MUX("LSM8 MUX", SND_SOC_NOPM, 0, 0, &lsm8_mux),
  3331. SND_SOC_DAPM_MUX("SLIM_0_RX AANC MUX", SND_SOC_NOPM, 0, 0,
  3332. aanc_slim_0_rx_mux),
  3333. /* Mixer definitions */
  3334. SND_SOC_DAPM_MIXER("PRI_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3335. pri_i2s_rx_mixer_controls, ARRAY_SIZE(pri_i2s_rx_mixer_controls)),
  3336. SND_SOC_DAPM_MIXER("SEC_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3337. sec_i2s_rx_mixer_controls, ARRAY_SIZE(sec_i2s_rx_mixer_controls)),
  3338. SND_SOC_DAPM_MIXER("SLIMBUS_0_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3339. slimbus_rx_mixer_controls, ARRAY_SIZE(slimbus_rx_mixer_controls)),
  3340. SND_SOC_DAPM_MIXER("HDMI Mixer", SND_SOC_NOPM, 0, 0,
  3341. hdmi_mixer_controls, ARRAY_SIZE(hdmi_mixer_controls)),
  3342. SND_SOC_DAPM_MIXER("MI2S_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3343. mi2s_rx_mixer_controls, ARRAY_SIZE(mi2s_rx_mixer_controls)),
  3344. SND_SOC_DAPM_MIXER("QUAT_MI2S_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3345. quaternary_mi2s_rx_mixer_controls,
  3346. ARRAY_SIZE(quaternary_mi2s_rx_mixer_controls)),
  3347. SND_SOC_DAPM_MIXER("TERT_MI2S_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3348. tertiary_mi2s_rx_mixer_controls,
  3349. ARRAY_SIZE(tertiary_mi2s_rx_mixer_controls)),
  3350. SND_SOC_DAPM_MIXER("SEC_MI2S_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3351. secondary_mi2s_rx_mixer_controls,
  3352. ARRAY_SIZE(secondary_mi2s_rx_mixer_controls)),
  3353. SND_SOC_DAPM_MIXER("SEC_MI2S_RX Port Mixer", SND_SOC_NOPM, 0, 0,
  3354. mi2s_hl_mixer_controls,
  3355. ARRAY_SIZE(mi2s_hl_mixer_controls)),
  3356. SND_SOC_DAPM_MIXER("PRI_MI2S_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3357. primary_mi2s_rx_mixer_controls,
  3358. ARRAY_SIZE(primary_mi2s_rx_mixer_controls)),
  3359. SND_SOC_DAPM_MIXER("MultiMedia1 Mixer", SND_SOC_NOPM, 0, 0,
  3360. mmul1_mixer_controls, ARRAY_SIZE(mmul1_mixer_controls)),
  3361. SND_SOC_DAPM_MIXER("MultiMedia2 Mixer", SND_SOC_NOPM, 0, 0,
  3362. mmul2_mixer_controls, ARRAY_SIZE(mmul2_mixer_controls)),
  3363. SND_SOC_DAPM_MIXER("MultiMedia4 Mixer", SND_SOC_NOPM, 0, 0,
  3364. mmul4_mixer_controls, ARRAY_SIZE(mmul4_mixer_controls)),
  3365. SND_SOC_DAPM_MIXER("MultiMedia5 Mixer", SND_SOC_NOPM, 0, 0,
  3366. mmul5_mixer_controls, ARRAY_SIZE(mmul5_mixer_controls)),
  3367. SND_SOC_DAPM_MIXER("MultiMedia8 Mixer", SND_SOC_NOPM, 0, 0,
  3368. mmul8_mixer_controls, ARRAY_SIZE(mmul8_mixer_controls)),
  3369. SND_SOC_DAPM_MIXER("MultiMedia6 Mixer", SND_SOC_NOPM, 0, 0,
  3370. mmul6_mixer_controls, ARRAY_SIZE(mmul6_mixer_controls)),
  3371. #ifdef CONFIG_JACK_AUDIO
  3372. SND_SOC_DAPM_MIXER("MultiMedia10 Mixer", SND_SOC_NOPM, 0, 0,
  3373. mmul10_mixer_controls, ARRAY_SIZE(mmul10_mixer_controls)),
  3374. #endif
  3375. SND_SOC_DAPM_MIXER("AUX_PCM_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3376. auxpcm_rx_mixer_controls, ARRAY_SIZE(auxpcm_rx_mixer_controls)),
  3377. SND_SOC_DAPM_MIXER("SEC_AUX_PCM_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3378. sec_auxpcm_rx_mixer_controls, ARRAY_SIZE(sec_auxpcm_rx_mixer_controls)),
  3379. /* incall */
  3380. SND_SOC_DAPM_MIXER("Incall_Music Audio Mixer", SND_SOC_NOPM, 0, 0,
  3381. incall_music_delivery_mixer_controls,
  3382. ARRAY_SIZE(incall_music_delivery_mixer_controls)),
  3383. SND_SOC_DAPM_MIXER("Incall_Music_2 Audio Mixer", SND_SOC_NOPM, 0, 0,
  3384. incall_music2_delivery_mixer_controls,
  3385. ARRAY_SIZE(incall_music2_delivery_mixer_controls)),
  3386. SND_SOC_DAPM_MIXER("SLIMBUS_4_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3387. slimbus_4_rx_mixer_controls,
  3388. ARRAY_SIZE(slimbus_4_rx_mixer_controls)),
  3389. /* Voice Mixer */
  3390. SND_SOC_DAPM_MIXER("PRI_RX_Voice Mixer",
  3391. SND_SOC_NOPM, 0, 0, pri_rx_voice_mixer_controls,
  3392. ARRAY_SIZE(pri_rx_voice_mixer_controls)),
  3393. SND_SOC_DAPM_MIXER("SEC_RX_Voice Mixer",
  3394. SND_SOC_NOPM, 0, 0,
  3395. sec_i2s_rx_voice_mixer_controls,
  3396. ARRAY_SIZE(sec_i2s_rx_voice_mixer_controls)),
  3397. SND_SOC_DAPM_MIXER("SEC_MI2S_RX_Voice Mixer",
  3398. SND_SOC_NOPM, 0, 0,
  3399. sec_mi2s_rx_voice_mixer_controls,
  3400. ARRAY_SIZE(sec_mi2s_rx_voice_mixer_controls)),
  3401. SND_SOC_DAPM_MIXER("SLIM_0_RX_Voice Mixer",
  3402. SND_SOC_NOPM, 0, 0,
  3403. slimbus_rx_voice_mixer_controls,
  3404. ARRAY_SIZE(slimbus_rx_voice_mixer_controls)),
  3405. SND_SOC_DAPM_MIXER("INTERNAL_BT_SCO_RX_Voice Mixer",
  3406. SND_SOC_NOPM, 0, 0,
  3407. bt_sco_rx_voice_mixer_controls,
  3408. ARRAY_SIZE(bt_sco_rx_voice_mixer_controls)),
  3409. SND_SOC_DAPM_MIXER("AFE_PCM_RX_Voice Mixer",
  3410. SND_SOC_NOPM, 0, 0,
  3411. afe_pcm_rx_voice_mixer_controls,
  3412. ARRAY_SIZE(afe_pcm_rx_voice_mixer_controls)),
  3413. SND_SOC_DAPM_MIXER("AUX_PCM_RX_Voice Mixer",
  3414. SND_SOC_NOPM, 0, 0,
  3415. aux_pcm_rx_voice_mixer_controls,
  3416. ARRAY_SIZE(aux_pcm_rx_voice_mixer_controls)),
  3417. SND_SOC_DAPM_MIXER("SEC_AUX_PCM_RX_Voice Mixer",
  3418. SND_SOC_NOPM, 0, 0,
  3419. sec_aux_pcm_rx_voice_mixer_controls,
  3420. ARRAY_SIZE(sec_aux_pcm_rx_voice_mixer_controls)),
  3421. SND_SOC_DAPM_MIXER("HDMI_RX_Voice Mixer",
  3422. SND_SOC_NOPM, 0, 0,
  3423. hdmi_rx_voice_mixer_controls,
  3424. ARRAY_SIZE(hdmi_rx_voice_mixer_controls)),
  3425. SND_SOC_DAPM_MIXER("MI2S_RX_Voice Mixer",
  3426. SND_SOC_NOPM, 0, 0,
  3427. mi2s_rx_voice_mixer_controls,
  3428. ARRAY_SIZE(mi2s_rx_voice_mixer_controls)),
  3429. SND_SOC_DAPM_MIXER("Voice_Tx Mixer",
  3430. SND_SOC_NOPM, 0, 0, tx_voice_mixer_controls,
  3431. ARRAY_SIZE(tx_voice_mixer_controls)),
  3432. SND_SOC_DAPM_MIXER("Voice2_Tx Mixer",
  3433. SND_SOC_NOPM, 0, 0, tx_voice2_mixer_controls,
  3434. ARRAY_SIZE(tx_voice2_mixer_controls)),
  3435. SND_SOC_DAPM_MIXER("Voip_Tx Mixer",
  3436. SND_SOC_NOPM, 0, 0, tx_voip_mixer_controls,
  3437. ARRAY_SIZE(tx_voip_mixer_controls)),
  3438. SND_SOC_DAPM_MIXER("VoLTE_Tx Mixer",
  3439. SND_SOC_NOPM, 0, 0, tx_volte_mixer_controls,
  3440. ARRAY_SIZE(tx_volte_mixer_controls)),
  3441. SND_SOC_DAPM_MIXER("VoWLAN_Tx Mixer",
  3442. SND_SOC_NOPM, 0, 0, tx_vowlan_mixer_controls,
  3443. ARRAY_SIZE(tx_vowlan_mixer_controls)),
  3444. SND_SOC_DAPM_MIXER("INTERNAL_BT_SCO_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3445. int_bt_sco_rx_mixer_controls, ARRAY_SIZE(int_bt_sco_rx_mixer_controls)),
  3446. SND_SOC_DAPM_MIXER("INTERNAL_FM_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3447. int_fm_rx_mixer_controls, ARRAY_SIZE(int_fm_rx_mixer_controls)),
  3448. SND_SOC_DAPM_MIXER("AFE_PCM_RX Audio Mixer", SND_SOC_NOPM, 0, 0,
  3449. afe_pcm_rx_mixer_controls, ARRAY_SIZE(afe_pcm_rx_mixer_controls)),
  3450. SND_SOC_DAPM_MIXER("Voice Stub Tx Mixer", SND_SOC_NOPM, 0, 0,
  3451. tx_voice_stub_mixer_controls, ARRAY_SIZE(tx_voice_stub_mixer_controls)),
  3452. SND_SOC_DAPM_MIXER("STUB_RX Mixer", SND_SOC_NOPM, 0, 0,
  3453. stub_rx_mixer_controls, ARRAY_SIZE(stub_rx_mixer_controls)),
  3454. SND_SOC_DAPM_MIXER("SLIMBUS_1_RX Mixer", SND_SOC_NOPM, 0, 0,
  3455. slimbus_1_rx_mixer_controls, ARRAY_SIZE(slimbus_1_rx_mixer_controls)),
  3456. SND_SOC_DAPM_MIXER("SLIMBUS_3_RX_Voice Mixer", SND_SOC_NOPM, 0, 0,
  3457. slimbus_3_rx_mixer_controls, ARRAY_SIZE(slimbus_3_rx_mixer_controls)),
  3458. SND_SOC_DAPM_MIXER("SLIMBUS_0_RX Port Mixer",
  3459. SND_SOC_NOPM, 0, 0, sbus_0_rx_port_mixer_controls,
  3460. ARRAY_SIZE(sbus_0_rx_port_mixer_controls)),
  3461. SND_SOC_DAPM_MIXER("AUXPCM_RX Port Mixer",
  3462. SND_SOC_NOPM, 0, 0, auxpcm_rx_port_mixer_controls,
  3463. ARRAY_SIZE(auxpcm_rx_port_mixer_controls)),
  3464. SND_SOC_DAPM_MIXER("SEC_AUXPCM_RX Port Mixer",
  3465. SND_SOC_NOPM, 0, 0, sec_auxpcm_rx_port_mixer_controls,
  3466. ARRAY_SIZE(sec_auxpcm_rx_port_mixer_controls)),
  3467. SND_SOC_DAPM_MIXER("SLIMBUS_1_RX Port Mixer", SND_SOC_NOPM, 0, 0,
  3468. sbus_1_rx_port_mixer_controls,
  3469. ARRAY_SIZE(sbus_1_rx_port_mixer_controls)),
  3470. SND_SOC_DAPM_MIXER("INTERNAL_BT_SCO_RX Port Mixer", SND_SOC_NOPM, 0, 0,
  3471. bt_sco_rx_port_mixer_controls,
  3472. ARRAY_SIZE(bt_sco_rx_port_mixer_controls)),
  3473. SND_SOC_DAPM_MIXER("AFE_PCM_RX Port Mixer",
  3474. SND_SOC_NOPM, 0, 0, afe_pcm_rx_port_mixer_controls,
  3475. ARRAY_SIZE(afe_pcm_rx_port_mixer_controls)),
  3476. SND_SOC_DAPM_MIXER("HDMI_RX Port Mixer",
  3477. SND_SOC_NOPM, 0, 0, hdmi_rx_port_mixer_controls,
  3478. ARRAY_SIZE(hdmi_rx_port_mixer_controls)),
  3479. SND_SOC_DAPM_MIXER("SEC_I2S_RX Port Mixer",
  3480. SND_SOC_NOPM, 0, 0, sec_i2s_rx_port_mixer_controls,
  3481. ARRAY_SIZE(sec_i2s_rx_port_mixer_controls)),
  3482. SND_SOC_DAPM_MIXER("SLIMBUS_3_RX Port Mixer",
  3483. SND_SOC_NOPM, 0, 0, sbus_3_rx_port_mixer_controls,
  3484. ARRAY_SIZE(sbus_3_rx_port_mixer_controls)),
  3485. SND_SOC_DAPM_MIXER("MI2S_RX Port Mixer", SND_SOC_NOPM, 0, 0,
  3486. mi2s_rx_port_mixer_controls, ARRAY_SIZE(mi2s_rx_port_mixer_controls)),
  3487. SND_SOC_DAPM_MIXER("PRI_MI2S_RX Port Mixer", SND_SOC_NOPM, 0, 0,
  3488. primary_mi2s_rx_port_mixer_controls,
  3489. ARRAY_SIZE(primary_mi2s_rx_port_mixer_controls)),
  3490. SND_SOC_DAPM_MIXER("QCHAT_Tx Mixer",
  3491. SND_SOC_NOPM, 0, 0, tx_qchat_mixer_controls,
  3492. ARRAY_SIZE(tx_qchat_mixer_controls)),
  3493. /* Virtual Pins to force backends ON atm */
  3494. SND_SOC_DAPM_OUTPUT("BE_OUT"),
  3495. SND_SOC_DAPM_INPUT("BE_IN"),
  3496. SND_SOC_DAPM_MUX("SLIM0_RX_VI_FB_LCH_MUX", SND_SOC_NOPM, 0, 0,
  3497. &slim0_rx_vi_fb_lch_mux),
  3498. SND_SOC_DAPM_MUX("VOC_EXT_EC MUX", SND_SOC_NOPM, 0, 0,
  3499. &voc_ext_ec_mux),
  3500. SND_SOC_DAPM_MUX("AUDIO_REF_EC_UL1 MUX", SND_SOC_NOPM, 0, 0,
  3501. &ext_ec_ref_mux_ul1),
  3502. SND_SOC_DAPM_MUX("AUDIO_REF_EC_UL2 MUX", SND_SOC_NOPM, 0, 0,
  3503. &ext_ec_ref_mux_ul2),
  3504. SND_SOC_DAPM_MUX("AUDIO_REF_EC_UL4 MUX", SND_SOC_NOPM, 0, 0,
  3505. &ext_ec_ref_mux_ul4),
  3506. SND_SOC_DAPM_MUX("AUDIO_REF_EC_UL5 MUX", SND_SOC_NOPM, 0, 0,
  3507. &ext_ec_ref_mux_ul5),
  3508. SND_SOC_DAPM_MUX("AUDIO_REF_EC_UL6 MUX", SND_SOC_NOPM, 0, 0,
  3509. &ext_ec_ref_mux_ul6),
  3510. SND_SOC_DAPM_MUX("AUDIO_REF_EC_UL8 MUX", SND_SOC_NOPM, 0, 0,
  3511. &ext_ec_ref_mux_ul8),
  3512. SND_SOC_DAPM_MUX("AUDIO_REF_EC_UL9 MUX", SND_SOC_NOPM, 0, 0,
  3513. &ext_ec_ref_mux_ul9),
  3514. };
  3515. static const struct snd_soc_dapm_route intercon[] = {
  3516. {"PRI_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3517. {"PRI_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3518. {"PRI_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3519. {"PRI_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3520. {"PRI_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3521. {"PRI_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3522. {"PRI_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3523. {"PRI_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3524. {"PRI_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3525. {"PRI_I2S_RX", NULL, "PRI_RX Audio Mixer"},
  3526. {"SEC_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3527. {"SEC_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3528. {"SEC_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3529. {"SEC_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3530. {"SEC_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3531. {"SEC_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3532. {"SEC_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3533. {"SEC_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3534. {"SEC_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3535. {"SEC_I2S_RX", NULL, "SEC_RX Audio Mixer"},
  3536. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3537. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3538. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3539. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3540. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3541. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3542. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3543. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3544. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3545. #ifdef CONFIG_JACK_AUDIO
  3546. {"SLIMBUS_0_RX Audio Mixer", "MultiMedia10", "MM_DL10"},
  3547. #endif
  3548. {"SLIMBUS_0_RX", NULL, "SLIMBUS_0_RX Audio Mixer"},
  3549. {"HDMI Mixer", "MultiMedia1", "MM_DL1"},
  3550. {"HDMI Mixer", "MultiMedia2", "MM_DL2"},
  3551. {"HDMI Mixer", "MultiMedia3", "MM_DL3"},
  3552. {"HDMI Mixer", "MultiMedia4", "MM_DL4"},
  3553. {"HDMI Mixer", "MultiMedia5", "MM_DL5"},
  3554. {"HDMI Mixer", "MultiMedia6", "MM_DL6"},
  3555. {"HDMI Mixer", "MultiMedia7", "MM_DL7"},
  3556. {"HDMI Mixer", "MultiMedia8", "MM_DL8"},
  3557. {"HDMI Mixer", "MultiMedia9", "MM_DL9"},
  3558. {"HDMI", NULL, "HDMI Mixer"},
  3559. /* incall */
  3560. {"Incall_Music Audio Mixer", "MultiMedia1", "MM_DL1"},
  3561. {"Incall_Music Audio Mixer", "MultiMedia2", "MM_DL2"},
  3562. {"Incall_Music Audio Mixer", "MultiMedia5", "MM_DL5"},
  3563. {"Incall_Music Audio Mixer", "MultiMedia9", "MM_DL9"},
  3564. {"VOICE_PLAYBACK_TX", NULL, "Incall_Music Audio Mixer"},
  3565. {"Incall_Music_2 Audio Mixer", "MultiMedia1", "MM_DL1"},
  3566. {"Incall_Music_2 Audio Mixer", "MultiMedia2", "MM_DL2"},
  3567. {"Incall_Music_2 Audio Mixer", "MultiMedia5", "MM_DL5"},
  3568. {"Incall_Music_2 Audio Mixer", "MultiMedia9", "MM_DL9"},
  3569. {"VOICE2_PLAYBACK_TX", NULL, "Incall_Music_2 Audio Mixer"},
  3570. {"SLIMBUS_4_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3571. {"SLIMBUS_4_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3572. {"SLIMBUS_4_RX", NULL, "SLIMBUS_4_RX Audio Mixer"},
  3573. {"MultiMedia1 Mixer", "VOC_REC_UL", "INCALL_RECORD_TX"},
  3574. {"MultiMedia4 Mixer", "VOC_REC_UL", "INCALL_RECORD_TX"},
  3575. {"MultiMedia8 Mixer", "VOC_REC_UL", "INCALL_RECORD_TX"},
  3576. {"MultiMedia1 Mixer", "VOC_REC_DL", "INCALL_RECORD_RX"},
  3577. {"MultiMedia4 Mixer", "VOC_REC_DL", "INCALL_RECORD_RX"},
  3578. {"MultiMedia8 Mixer", "VOC_REC_DL", "INCALL_RECORD_RX"},
  3579. {"MultiMedia1 Mixer", "SLIM_4_TX", "SLIMBUS_4_TX"},
  3580. {"MultiMedia4 Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  3581. {"MultiMedia8 Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  3582. {"MultiMedia4 Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
  3583. {"MultiMedia8 Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
  3584. {"MultiMedia5 Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  3585. #ifdef CONFIG_JACK_AUDIO
  3586. {"MultiMedia10 Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  3587. #endif
  3588. {"MI2S_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3589. {"MI2S_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3590. {"MI2S_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3591. {"MI2S_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3592. {"MI2S_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3593. {"MI2S_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3594. {"MI2S_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3595. {"MI2S_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3596. {"MI2S_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3597. {"MI2S_RX", NULL, "MI2S_RX Audio Mixer"},
  3598. {"QUAT_MI2S_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3599. {"QUAT_MI2S_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3600. {"QUAT_MI2S_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3601. {"QUAT_MI2S_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3602. {"QUAT_MI2S_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3603. {"QUAT_MI2S_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3604. {"QUAT_MI2S_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3605. {"QUAT_MI2S_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3606. {"QUAT_MI2S_RX", NULL, "QUAT_MI2S_RX Audio Mixer"},
  3607. {"TERT_MI2S_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3608. {"TERT_MI2S_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3609. {"TERT_MI2S_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3610. {"TERT_MI2S_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3611. {"TERT_MI2S_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3612. {"TERT_MI2S_RX", NULL, "TERT_MI2S_RX Audio Mixer"},
  3613. {"SEC_MI2S_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3614. {"SEC_MI2S_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3615. {"SEC_MI2S_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3616. {"SEC_MI2S_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3617. {"SEC_MI2S_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3618. {"SEC_MI2S_RX", NULL, "SEC_MI2S_RX Audio Mixer"},
  3619. {"SEC_MI2S_RX Port Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
  3620. {"SEC_MI2S_RX Port Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  3621. {"PRI_MI2S_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3622. {"PRI_MI2S_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3623. {"PRI_MI2S_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3624. {"PRI_MI2S_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3625. {"PRI_MI2S_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3626. {"PRI_MI2S_RX", NULL, "PRI_MI2S_RX Audio Mixer"},
  3627. {"MultiMedia1 Mixer", "PRI_TX", "PRI_I2S_TX"},
  3628. {"MultiMedia1 Mixer", "MI2S_TX", "MI2S_TX"},
  3629. {"MultiMedia2 Mixer", "MI2S_TX", "MI2S_TX"},
  3630. {"MultiMedia5 Mixer", "MI2S_TX", "MI2S_TX"},
  3631. {"MultiMedia1 Mixer", "QUAT_MI2S_TX", "QUAT_MI2S_TX"},
  3632. {"MultiMedia1 Mixer", "TERT_MI2S_TX", "TERT_MI2S_TX"},
  3633. {"MultiMedia1 Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  3634. {"MultiMedia1 Mixer", "AUX_PCM_UL_TX", "AUX_PCM_TX"},
  3635. {"MultiMedia5 Mixer", "AUX_PCM_TX", "AUX_PCM_TX"},
  3636. #ifdef CONFIG_JACK_AUDIO
  3637. {"MultiMedia10 Mixer", "AUX_PCM_TX", "AUX_PCM_TX"},
  3638. #endif
  3639. {"MultiMedia1 Mixer", "SEC_AUX_PCM_UL_TX", "SEC_AUX_PCM_TX"},
  3640. {"MultiMedia5 Mixer", "SEC_AUX_PCM_TX", "SEC_AUX_PCM_TX"},
  3641. {"MultiMedia2 Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  3642. {"MultiMedia1 Mixer", "SEC_MI2S_TX", "SEC_MI2S_TX"},
  3643. {"MultiMedia1 Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
  3644. {"MultiMedia6 Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  3645. #ifdef CONFIG_TERT_MI2S_ENABLE
  3646. {"MultiMedia2 Mixer", "TERT_MI2S_TX", "TERT_MI2S_TX"},
  3647. #elif defined(CONFIG_SND_SOC_MAX98504) || defined(CONFIG_SND_SOC_MAX98506)
  3648. {"MultiMedia2 Mixer", "SEC_MI2S_TX", "SEC_MI2S_TX"},
  3649. #endif
  3650. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3651. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3652. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3653. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3654. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3655. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3656. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3657. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3658. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3659. {"INTERNAL_BT_SCO_RX Audio Mixer", "MultiMedia6", "MM_UL6"},
  3660. {"INT_BT_SCO_RX", NULL, "INTERNAL_BT_SCO_RX Audio Mixer"},
  3661. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3662. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3663. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3664. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3665. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3666. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3667. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3668. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3669. {"INTERNAL_FM_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3670. {"INT_FM_RX", NULL, "INTERNAL_FM_RX Audio Mixer"},
  3671. {"AFE_PCM_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3672. {"AFE_PCM_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3673. {"AFE_PCM_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3674. {"AFE_PCM_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3675. {"AFE_PCM_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3676. {"AFE_PCM_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3677. {"AFE_PCM_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3678. {"AFE_PCM_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3679. {"AFE_PCM_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3680. {"PCM_RX", NULL, "AFE_PCM_RX Audio Mixer"},
  3681. {"MultiMedia1 Mixer", "INTERNAL_BT_SCO_TX", "INT_BT_SCO_TX"},
  3682. {"MultiMedia4 Mixer", "INTERNAL_BT_SCO_TX", "INT_BT_SCO_TX"},
  3683. {"MultiMedia5 Mixer", "INTERNAL_BT_SCO_TX", "INT_BT_SCO_TX"},
  3684. {"MultiMedia8 Mixer", "INTERNAL_BT_SCO_TX", "INT_BT_SCO_TX"},
  3685. {"MultiMedia1 Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  3686. {"MultiMedia4 Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  3687. {"MultiMedia5 Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  3688. {"MultiMedia8 Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  3689. {"MultiMedia6 Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  3690. {"MultiMedia1 Mixer", "AFE_PCM_TX", "PCM_TX"},
  3691. {"MultiMedia4 Mixer", "AFE_PCM_TX", "PCM_TX"},
  3692. {"MultiMedia5 Mixer", "AFE_PCM_TX", "PCM_TX"},
  3693. {"MultiMedia8 Mixer", "AFE_PCM_TX", "PCM_TX"},
  3694. {"MM_UL1", NULL, "MultiMedia1 Mixer"},
  3695. {"MultiMedia2 Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  3696. {"MM_UL2", NULL, "MultiMedia2 Mixer"},
  3697. {"MM_UL4", NULL, "MultiMedia4 Mixer"},
  3698. {"MM_UL5", NULL, "MultiMedia5 Mixer"},
  3699. {"MM_UL8", NULL, "MultiMedia8 Mixer"},
  3700. {"MM_UL6", NULL, "MultiMedia6 Mixer"},
  3701. #ifdef CONFIG_JACK_AUDIO
  3702. {"MM_UL10", NULL, "MultiMedia10 Mixer"},
  3703. #endif
  3704. {"AUX_PCM_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3705. {"AUX_PCM_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3706. {"AUX_PCM_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3707. {"AUX_PCM_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3708. {"AUX_PCM_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3709. {"AUX_PCM_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3710. {"AUX_PCM_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3711. {"AUX_PCM_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3712. {"AUX_PCM_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3713. #ifdef CONFIG_JACK_AUDIO
  3714. {"AUX_PCM_RX Audio Mixer", "MultiMedia10", "MM_DL10"},
  3715. #endif
  3716. {"AUX_PCM_RX", NULL, "AUX_PCM_RX Audio Mixer"},
  3717. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia1", "MM_DL1"},
  3718. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia2", "MM_DL2"},
  3719. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia3", "MM_DL3"},
  3720. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia4", "MM_DL4"},
  3721. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia5", "MM_DL5"},
  3722. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia6", "MM_DL6"},
  3723. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia7", "MM_DL7"},
  3724. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia8", "MM_DL8"},
  3725. {"SEC_AUX_PCM_RX Audio Mixer", "MultiMedia9", "MM_DL9"},
  3726. {"SEC_AUX_PCM_RX", NULL, "SEC_AUX_PCM_RX Audio Mixer"},
  3727. {"MI2S_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3728. {"MI2S_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3729. {"MI2S_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3730. {"MI2S_RX_Voice Mixer", "Voice Stub", "VOICE_STUB_DL"},
  3731. {"MI2S_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3732. {"MI2S_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3733. {"MI2S_RX", NULL, "MI2S_RX_Voice Mixer"},
  3734. {"PRI_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3735. {"PRI_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3736. {"PRI_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3737. {"PRI_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3738. {"PRI_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3739. {"PRI_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3740. {"PRI_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3741. {"PRI_I2S_RX", NULL, "PRI_RX_Voice Mixer"},
  3742. {"SEC_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3743. {"SEC_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3744. {"SEC_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3745. {"SEC_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3746. {"SEC_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3747. {"SEC_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3748. {"SEC_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3749. {"SEC_I2S_RX", NULL, "SEC_RX_Voice Mixer"},
  3750. {"SEC_MI2S_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3751. {"SEC_MI2S_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3752. {"SEC_MI2S_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3753. {"SEC_MI2S_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3754. {"SEC_MI2S_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3755. {"SEC_MI2S_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3756. {"SEC_MI2S_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3757. {"SEC_MI2S_RX", NULL, "SEC_MI2S_RX_Voice Mixer"},
  3758. {"SLIM_0_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3759. {"SLIM_0_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3760. {"SLIM_0_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3761. {"SLIM_0_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3762. {"SLIM_0_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3763. {"SLIM_0_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3764. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  3765. {"SLIM_0_RX_Voice Mixer", "Voice Stub", "VOICE_STUB_DL"},
  3766. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  3767. {"SLIM_0_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3768. {"SLIMBUS_0_RX", NULL, "SLIM_0_RX_Voice Mixer"},
  3769. {"INTERNAL_BT_SCO_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3770. {"INTERNAL_BT_SCO_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3771. {"INTERNAL_BT_SCO_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3772. {"INTERNAL_BT_SCO_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3773. {"INTERNAL_BT_SCO_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3774. {"INTERNAL_BT_SCO_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3775. {"INTERNAL_BT_SCO_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3776. {"INT_BT_SCO_RX", NULL, "INTERNAL_BT_SCO_RX_Voice Mixer"},
  3777. {"AFE_PCM_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3778. {"AFE_PCM_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3779. {"AFE_PCM_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3780. {"AFE_PCM_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3781. {"AFE_PCM_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3782. {"AFE_PCM_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3783. {"AFE_PCM_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3784. {"PCM_RX", NULL, "AFE_PCM_RX_Voice Mixer"},
  3785. {"AUX_PCM_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3786. {"AUX_PCM_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3787. {"AUX_PCM_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3788. {"AUX_PCM_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3789. {"AUX_PCM_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3790. {"AUX_PCM_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3791. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  3792. {"AUX_PCM_RX_Voice Mixer", "Voice Stub", "VOICE_STUB_DL"},
  3793. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING*/
  3794. {"AUX_PCM_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3795. {"AUX_PCM_RX", NULL, "AUX_PCM_RX_Voice Mixer"},
  3796. {"SEC_AUX_PCM_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3797. {"SEC_AUX_PCM_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3798. {"SEC_AUX_PCM_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3799. {"SEC_AUX_PCM_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3800. {"SEC_AUX_PCM_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3801. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  3802. {"SEC_AUX_PCM_RX_Voice Mixer", "Voice Stub", "VOICE_STUB_DL"},
  3803. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING*/
  3804. {"SEC_AUX_PCM_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3805. {"SEC_AUX_PCM_RX", NULL, "SEC_AUX_PCM_RX_Voice Mixer"},
  3806. {"HDMI_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3807. {"HDMI_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3808. {"HDMI_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3809. {"HDMI_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3810. {"HDMI_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3811. {"HDMI_RX_Voice Mixer", "DTMF", "DTMF_DL_HL"},
  3812. {"HDMI_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3813. {"HDMI", NULL, "HDMI_RX_Voice Mixer"},
  3814. {"HDMI", NULL, "HDMI_DL_HL"},
  3815. {"MI2S_RX_Voice Mixer", "CSVoice", "CS-VOICE_DL1"},
  3816. {"MI2S_RX_Voice Mixer", "Voice2", "VOICE2_DL"},
  3817. {"MI2S_RX_Voice Mixer", "Voip", "VOIP_DL"},
  3818. {"MI2S_RX_Voice Mixer", "VoLTE", "VoLTE_DL"},
  3819. {"MI2S_RX_Voice Mixer", "VoWLAN", "VoWLAN_DL"},
  3820. {"MI2S_RX_Voice Mixer", "Voice Stub", "VOICE_STUB_DL"},
  3821. {"MI2S_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
  3822. {"MI2S_RX", NULL, "MI2S_RX_Voice Mixer"},
  3823. {"VOC_EXT_EC MUX", "PRI_MI2S_TX" , "PRI_MI2S_TX"},
  3824. {"VOC_EXT_EC MUX", "SEC_MI2S_TX" , "SEC_MI2S_TX"},
  3825. {"VOC_EXT_EC MUX", "TERT_MI2S_TX" , "TERT_MI2S_TX"},
  3826. {"VOC_EXT_EC MUX", "QUAT_MI2S_TX" , "QUAT_MI2S_TX"},
  3827. {"CS-VOICE_UL1", NULL, "VOC_EXT_EC MUX"},
  3828. {"VOIP_UL", NULL, "VOC_EXT_EC MUX"},
  3829. {"VoLTE_UL", NULL, "VOC_EXT_EC MUX"},
  3830. {"VOICE2_UL", NULL, "VOC_EXT_EC MUX"},
  3831. {"AUDIO_REF_EC_UL1 MUX", "PRI_MI2S_TX" , "PRI_MI2S_TX"},
  3832. {"AUDIO_REF_EC_UL1 MUX", "SEC_MI2S_TX" , "SEC_MI2S_TX"},
  3833. {"AUDIO_REF_EC_UL1 MUX", "TERT_MI2S_TX" , "TERT_MI2S_TX"},
  3834. {"AUDIO_REF_EC_UL1 MUX", "QUAT_MI2S_TX" , "QUAT_MI2S_TX"},
  3835. {"AUDIO_REF_EC_UL2 MUX", "PRI_MI2S_TX" , "PRI_MI2S_TX"},
  3836. {"AUDIO_REF_EC_UL2 MUX", "SEC_MI2S_TX" , "SEC_MI2S_TX"},
  3837. {"AUDIO_REF_EC_UL2 MUX", "TERT_MI2S_TX" , "TERT_MI2S_TX"},
  3838. {"AUDIO_REF_EC_UL2 MUX", "QUAT_MI2S_TX" , "QUAT_MI2S_TX"},
  3839. {"AUDIO_REF_EC_UL4 MUX", "PRI_MI2S_TX" , "PRI_MI2S_TX"},
  3840. {"AUDIO_REF_EC_UL4 MUX", "SEC_MI2S_TX" , "SEC_MI2S_TX"},
  3841. {"AUDIO_REF_EC_UL4 MUX", "TERT_MI2S_TX" , "TERT_MI2S_TX"},
  3842. {"AUDIO_REF_EC_UL4 MUX", "QUAT_MI2S_TX" , "QUAT_MI2S_TX"},
  3843. {"AUDIO_REF_EC_UL5 MUX", "PRI_MI2S_TX" , "PRI_MI2S_TX"},
  3844. {"AUDIO_REF_EC_UL5 MUX", "SEC_MI2S_TX" , "SEC_MI2S_TX"},
  3845. {"AUDIO_REF_EC_UL5 MUX", "TERT_MI2S_TX" , "TERT_MI2S_TX"},
  3846. {"AUDIO_REF_EC_UL5 MUX", "QUAT_MI2S_TX" , "QUAT_MI2S_TX"},
  3847. {"AUDIO_REF_EC_UL6 MUX", "PRI_MI2S_TX" , "PRI_MI2S_TX"},
  3848. {"AUDIO_REF_EC_UL6 MUX", "SEC_MI2S_TX" , "SEC_MI2S_TX"},
  3849. {"AUDIO_REF_EC_UL6 MUX", "TERT_MI2S_TX" , "TERT_MI2S_TX"},
  3850. {"AUDIO_REF_EC_UL6 MUX", "QUAT_MI2S_TX" , "QUAT_MI2S_TX"},
  3851. {"AUDIO_REF_EC_UL8 MUX", "PRI_MI2S_TX" , "PRI_MI2S_TX"},
  3852. {"AUDIO_REF_EC_UL8 MUX", "SEC_MI2S_TX" , "SEC_MI2S_TX"},
  3853. {"AUDIO_REF_EC_UL8 MUX", "TERT_MI2S_TX" , "TERT_MI2S_TX"},
  3854. {"AUDIO_REF_EC_UL8 MUX", "QUAT_MI2S_TX" , "QUAT_MI2S_TX"},
  3855. {"AUDIO_REF_EC_UL9 MUX", "PRI_MI2S_TX" , "PRI_MI2S_TX"},
  3856. {"AUDIO_REF_EC_UL9 MUX", "SEC_MI2S_TX" , "SEC_MI2S_TX"},
  3857. {"AUDIO_REF_EC_UL9 MUX", "TERT_MI2S_TX" , "TERT_MI2S_TX"},
  3858. {"AUDIO_REF_EC_UL9 MUX", "QUAT_MI2S_TX" , "QUAT_MI2S_TX"},
  3859. {"MM_UL1", NULL, "AUDIO_REF_EC_UL1 MUX"},
  3860. {"MM_UL2", NULL, "AUDIO_REF_EC_UL2 MUX"},
  3861. {"MM_UL4", NULL, "AUDIO_REF_EC_UL4 MUX"},
  3862. {"MM_UL5", NULL, "AUDIO_REF_EC_UL5 MUX"},
  3863. {"MM_UL6", NULL, "AUDIO_REF_EC_UL6 MUX"},
  3864. {"MM_UL8", NULL, "AUDIO_REF_EC_UL8 MUX"},
  3865. {"MM_UL9", NULL, "AUDIO_REF_EC_UL9 MUX"},
  3866. {"Voice_Tx Mixer", "PRI_TX_Voice", "PRI_I2S_TX"},
  3867. {"Voice_Tx Mixer", "PRI_MI2S_TX_Voice", "PRI_MI2S_TX"},
  3868. {"Voice_Tx Mixer", "MI2S_TX_Voice", "MI2S_TX"},
  3869. {"Voice_Tx Mixer", "SLIM_0_TX_Voice", "SLIMBUS_0_TX"},
  3870. {"Voice_Tx Mixer", "INTERNAL_BT_SCO_TX_Voice", "INT_BT_SCO_TX"},
  3871. {"Voice_Tx Mixer", "AFE_PCM_TX_Voice", "PCM_TX"},
  3872. {"Voice_Tx Mixer", "AUX_PCM_TX_Voice", "AUX_PCM_TX"},
  3873. {"Voice_Tx Mixer", "SEC_AUX_PCM_TX_Voice", "SEC_AUX_PCM_TX"},
  3874. {"CS-VOICE_UL1", NULL, "Voice_Tx Mixer"},
  3875. {"Voice2_Tx Mixer", "PRI_TX_Voice2", "PRI_I2S_TX"},
  3876. {"Voice2_Tx Mixer", "PRI_MI2S_TX_Voice2", "PRI_MI2S_TX"},
  3877. {"Voice2_Tx Mixer", "MI2S_TX_Voice2", "MI2S_TX"},
  3878. {"Voice2_Tx Mixer", "SLIM_0_TX_Voice2", "SLIMBUS_0_TX"},
  3879. {"Voice2_Tx Mixer", "INTERNAL_BT_SCO_TX_Voice2", "INT_BT_SCO_TX"},
  3880. {"Voice2_Tx Mixer", "AFE_PCM_TX_Voice2", "PCM_TX"},
  3881. {"Voice2_Tx Mixer", "AUX_PCM_TX_Voice2", "AUX_PCM_TX"},
  3882. {"VOICE2_UL", NULL, "Voice2_Tx Mixer"},
  3883. {"VoLTE_Tx Mixer", "PRI_TX_VoLTE", "PRI_I2S_TX"},
  3884. {"VoLTE_Tx Mixer", "SLIM_0_TX_VoLTE", "SLIMBUS_0_TX"},
  3885. {"VoLTE_Tx Mixer", "INTERNAL_BT_SCO_TX_VoLTE", "INT_BT_SCO_TX"},
  3886. {"VoLTE_Tx Mixer", "AFE_PCM_TX_VoLTE", "PCM_TX"},
  3887. {"VoLTE_Tx Mixer", "AUX_PCM_TX_VoLTE", "AUX_PCM_TX"},
  3888. {"VoLTE_Tx Mixer", "SEC_AUX_PCM_TX_VoLTE", "SEC_AUX_PCM_TX"},
  3889. {"VoLTE_Tx Mixer", "MI2S_TX_VoLTE", "MI2S_TX"},
  3890. {"VoLTE_UL", NULL, "VoLTE_Tx Mixer"},
  3891. {"VoWLAN_Tx Mixer", "PRI_TX_VoWLAN", "PRI_I2S_TX"},
  3892. {"VoWLAN_Tx Mixer", "SLIM_0_TX_VoWLAN", "SLIMBUS_0_TX"},
  3893. {"VoWLAN_Tx Mixer", "INTERNAL_BT_SCO_TX_VoWLAN", "INT_BT_SCO_TX"},
  3894. {"VoWLAN_Tx Mixer", "AFE_PCM_TX_VoWLAN", "PCM_TX"},
  3895. {"VoWLAN_Tx Mixer", "AUX_PCM_TX_VoWLAN", "AUX_PCM_TX"},
  3896. {"VoWLAN_Tx Mixer", "SEC_AUX_PCM_TX_VoWLAN", "SEC_AUX_PCM_TX"},
  3897. {"VoWLAN_Tx Mixer", "MI2S_TX_VoWLAN", "MI2S_TX"},
  3898. {"VoWLAN_UL", NULL, "VoWLAN_Tx Mixer"},
  3899. {"Voip_Tx Mixer", "PRI_TX_Voip", "PRI_I2S_TX"},
  3900. {"Voip_Tx Mixer", "MI2S_TX_Voip", "MI2S_TX"},
  3901. {"Voip_Tx Mixer", "SLIM_0_TX_Voip", "SLIMBUS_0_TX"},
  3902. {"Voip_Tx Mixer", "INTERNAL_BT_SCO_TX_Voip", "INT_BT_SCO_TX"},
  3903. {"Voip_Tx Mixer", "AFE_PCM_TX_Voip", "PCM_TX"},
  3904. {"Voip_Tx Mixer", "AUX_PCM_TX_Voip", "AUX_PCM_TX"},
  3905. {"Voip_Tx Mixer", "SEC_AUX_PCM_TX_Voip", "SEC_AUX_PCM_TX"},
  3906. {"Voip_Tx Mixer", "PRI_MI2S_TX_Voip", "PRI_MI2S_TX"},
  3907. {"VOIP_UL", NULL, "Voip_Tx Mixer"},
  3908. {"SLIMBUS_DL_HL", "Switch", "SLIM0_DL_HL"},
  3909. {"SLIMBUS_0_RX", NULL, "SLIMBUS_DL_HL"},
  3910. {"SLIMBUS1_DL_HL", "Switch", "SLIM1_DL_HL"},
  3911. {"SLIMBUS_1_RX", NULL, "SLIMBUS1_DL_HL"},
  3912. {"SLIMBUS3_DL_HL", "Switch", "SLIM3_DL_HL"},
  3913. {"SLIMBUS_3_RX", NULL, "SLIMBUS3_DL_HL"},
  3914. {"SLIMBUS4_DL_HL", "Switch", "SLIM4_DL_HL"},
  3915. {"SLIMBUS_4_RX", NULL, "SLIMBUS4_DL_HL"},
  3916. {"SLIM0_UL_HL", NULL, "SLIMBUS_0_TX"},
  3917. {"SLIM1_UL_HL", NULL, "SLIMBUS_1_TX"},
  3918. {"SLIM3_UL_HL", NULL, "SLIMBUS_3_TX"},
  3919. {"SLIM4_UL_HL", NULL, "SLIMBUS_4_TX"},
  3920. {"LSM1 MUX", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
  3921. {"LSM1 MUX", "SLIMBUS_1_TX", "SLIMBUS_1_TX"},
  3922. {"LSM1 MUX", "SLIMBUS_3_TX", "SLIMBUS_3_TX"},
  3923. {"LSM1 MUX", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
  3924. {"LSM1 MUX", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
  3925. {"LSM1_UL_HL", NULL, "LSM1 MUX"},
  3926. {"LSM2 MUX", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
  3927. {"LSM2 MUX", "SLIMBUS_1_TX", "SLIMBUS_1_TX"},
  3928. {"LSM2 MUX", "SLIMBUS_3_TX", "SLIMBUS_3_TX"},
  3929. {"LSM2 MUX", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
  3930. {"LSM2 MUX", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
  3931. {"LSM2_UL_HL", NULL, "LSM2 MUX"},
  3932. {"LSM3 MUX", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
  3933. {"LSM3 MUX", "SLIMBUS_1_TX", "SLIMBUS_1_TX"},
  3934. {"LSM3 MUX", "SLIMBUS_3_TX", "SLIMBUS_3_TX"},
  3935. {"LSM3 MUX", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
  3936. {"LSM3 MUX", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
  3937. {"LSM3_UL_HL", NULL, "LSM3 MUX"},
  3938. {"LSM4 MUX", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
  3939. {"LSM4 MUX", "SLIMBUS_1_TX", "SLIMBUS_1_TX"},
  3940. {"LSM4 MUX", "SLIMBUS_3_TX", "SLIMBUS_3_TX"},
  3941. {"LSM4 MUX", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
  3942. {"LSM4 MUX", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
  3943. {"LSM4_UL_HL", NULL, "LSM4 MUX"},
  3944. {"LSM5 MUX", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
  3945. {"LSM5 MUX", "SLIMBUS_1_TX", "SLIMBUS_1_TX"},
  3946. {"LSM5 MUX", "SLIMBUS_3_TX", "SLIMBUS_3_TX"},
  3947. {"LSM5 MUX", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
  3948. {"LSM5 MUX", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
  3949. {"LSM5_UL_HL", NULL, "LSM5 MUX"},
  3950. {"LSM6 MUX", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
  3951. {"LSM6 MUX", "SLIMBUS_1_TX", "SLIMBUS_1_TX"},
  3952. {"LSM6 MUX", "SLIMBUS_3_TX", "SLIMBUS_3_TX"},
  3953. {"LSM6 MUX", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
  3954. {"LSM6 MUX", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
  3955. {"LSM6_UL_HL", NULL, "LSM6 MUX"},
  3956. {"LSM7 MUX", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
  3957. {"LSM7 MUX", "SLIMBUS_1_TX", "SLIMBUS_1_TX"},
  3958. {"LSM7 MUX", "SLIMBUS_3_TX", "SLIMBUS_3_TX"},
  3959. {"LSM7 MUX", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
  3960. {"LSM7 MUX", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
  3961. {"LSM7_UL_HL", NULL, "LSM7 MUX"},
  3962. {"LSM8 MUX", "SLIMBUS_0_TX", "SLIMBUS_0_TX"},
  3963. {"LSM8 MUX", "SLIMBUS_1_TX", "SLIMBUS_1_TX"},
  3964. {"LSM8 MUX", "SLIMBUS_3_TX", "SLIMBUS_3_TX"},
  3965. {"LSM8 MUX", "SLIMBUS_4_TX", "SLIMBUS_4_TX"},
  3966. {"LSM8 MUX", "SLIMBUS_5_TX", "SLIMBUS_5_TX"},
  3967. {"LSM8_UL_HL", NULL, "LSM8 MUX"},
  3968. {"QCHAT_Tx Mixer", "PRI_TX_QCHAT", "PRI_I2S_TX"},
  3969. {"QCHAT_Tx Mixer", "SLIM_0_TX_QCHAT", "SLIMBUS_0_TX"},
  3970. {"QCHAT_Tx Mixer", "INTERNAL_BT_SCO_TX_QCHAT", "INT_BT_SCO_TX"},
  3971. {"QCHAT_Tx Mixer", "AFE_PCM_TX_QCHAT", "PCM_TX"},
  3972. {"QCHAT_Tx Mixer", "AUX_PCM_TX_QCHAT", "AUX_PCM_TX"},
  3973. {"QCHAT_Tx Mixer", "SEC_AUX_PCM_TX_QCHAT", "SEC_AUX_PCM_TX"},
  3974. {"QCHAT_Tx Mixer", "MI2S_TX_QCHAT", "MI2S_TX"},
  3975. {"QCHAT_Tx Mixer", "PRI_MI2S_TX_QCHAT", "PRI_MI2S_TX"},
  3976. {"QCHAT_UL", NULL, "QCHAT_Tx Mixer"},
  3977. {"INT_FM_RX", NULL, "INTFM_DL_HL"},
  3978. {"INTFM_UL_HL", NULL, "INT_FM_TX"},
  3979. {"INTHFP_UL_HL", NULL, "INT_BT_SCO_TX"},
  3980. {"INT_BT_SCO_RX", NULL, "MM_DL6"},
  3981. {"AUX_PCM_RX", NULL, "AUXPCM_DL_HL"},
  3982. {"AUXPCM_UL_HL", NULL, "AUX_PCM_TX"},
  3983. {"MI2S_RX", NULL, "MI2S_DL_HL"},
  3984. {"MI2S_UL_HL", NULL, "MI2S_TX"},
  3985. {"PCM_RX_DL_HL", "Switch", "SLIM0_DL_HL"},
  3986. {"PCM_RX", NULL, "PCM_RX_DL_HL"},
  3987. {"PRI_MI2S_RX_DL_HL", "Switch", "PRI_MI2S_DL_HL"},
  3988. {"PRI_MI2S_RX", NULL, "PRI_MI2S_RX_DL_HL"},
  3989. {"MI2S_UL_HL", NULL, "TERT_MI2S_TX"},
  3990. {"SEC_I2S_RX", NULL, "SEC_I2S_DL_HL"},
  3991. {"PRI_MI2S_UL_HL", NULL, "PRI_MI2S_TX"},
  3992. {"SEC_MI2S_RX", NULL, "SEC_MI2S_DL_HL"},
  3993. {"SLIMBUS_0_RX Port Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  3994. {"SLIMBUS_0_RX Port Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  3995. {"SLIMBUS_0_RX Port Mixer", "AUX_PCM_UL_TX", "AUX_PCM_TX"},
  3996. {"SLIMBUS_0_RX Port Mixer", "SEC_AUX_PCM_UL_TX", "SEC_AUX_PCM_TX"},
  3997. {"SLIMBUS_0_RX Port Mixer", "MI2S_TX", "MI2S_TX"},
  3998. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  3999. {"SLIMBUS_0_RX Port Mixer", "INTERNAL_BT_SCO_TX", "INT_BT_SCO_TX"},
  4000. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  4001. {"SLIMBUS_0_RX", NULL, "SLIMBUS_0_RX Port Mixer"},
  4002. {"AFE_PCM_RX Port Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
  4003. {"PCM_RX", NULL, "AFE_PCM_RX Port Mixer"},
  4004. {"AUXPCM_RX Port Mixer", "AUX_PCM_UL_TX", "AUX_PCM_TX"},
  4005. {"AUXPCM_RX Port Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  4006. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  4007. {"AUXPCM_RX Port Mixer", "SEC_AUX_PCM_UL_TX", "SEC_AUX_PCM_TX"},
  4008. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  4009. {"AUX_PCM_RX", NULL, "AUXPCM_RX Port Mixer"},
  4010. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  4011. {"SEC_AUXPCM_RX Port Mixer", "AUX_PCM_UL_TX", "AUX_PCM_TX"},
  4012. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  4013. {"SEC_AUXPCM_RX Port Mixer", "SEC_AUX_PCM_UL_TX", "SEC_AUX_PCM_TX"},
  4014. {"SEC_AUXPCM_RX Port Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  4015. {"SEC_AUX_PCM_RX", NULL, "SEC_AUXPCM_RX Port Mixer"},
  4016. {"Voice Stub Tx Mixer", "STUB_TX_HL", "STUB_TX"},
  4017. {"Voice Stub Tx Mixer", "SLIM_1_TX", "SLIMBUS_1_TX"},
  4018. {"Voice Stub Tx Mixer", "INTERNAL_BT_SCO_TX", "INT_BT_SCO_TX"},
  4019. {"Voice Stub Tx Mixer", "STUB_1_TX_HL", "STUB_1_TX"},
  4020. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  4021. {"Voice Stub Tx Mixer", "AUX_PCM_UL_TX", "AUX_PCM_TX"},
  4022. {"Voice Stub Tx Mixer", "SEC_AUX_PCM_UL_TX", "SEC_AUX_PCM_TX"},
  4023. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  4024. {"Voice Stub Tx Mixer", "MI2S_TX", "MI2S_TX"},
  4025. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  4026. {"Voice Stub Tx Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  4027. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  4028. {"VOICE_STUB_UL", NULL, "Voice Stub Tx Mixer"},
  4029. {"STUB_RX Mixer", "Voice Stub", "VOICE_STUB_DL"},
  4030. {"STUB_RX", NULL, "STUB_RX Mixer"},
  4031. {"SLIMBUS_1_RX Mixer", "Voice Stub", "VOICE_STUB_DL"},
  4032. {"SLIMBUS_1_RX", NULL, "SLIMBUS_1_RX Mixer"},
  4033. {"INTERNAL_BT_SCO_RX_Voice Mixer", "Voice Stub", "VOICE_STUB_DL"},
  4034. {"SLIMBUS_3_RX_Voice Mixer", "Voice Stub", "VOICE_STUB_DL"},
  4035. {"SLIMBUS_3_RX", NULL, "SLIMBUS_3_RX_Voice Mixer"},
  4036. {"SLIMBUS_1_RX Port Mixer", "INTERNAL_BT_SCO_TX", "INT_BT_SCO_TX"},
  4037. {"SLIMBUS_1_RX", NULL, "SLIMBUS_1_RX Port Mixer"},
  4038. {"INTERNAL_BT_SCO_RX Port Mixer", "SLIM_1_TX", "SLIMBUS_1_TX"},
  4039. #if defined( CONFIG_PCM_ROUTE_VOICE_STUB ) || defined(CONFIG_BT_CALL_FORWARDING)
  4040. {"INTERNAL_BT_SCO_RX Port Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
  4041. #endif /* CONFIG_PCM_ROUTE_VOICE_STUB || CONFIG_BT_CALL_FORWARDING */
  4042. {"INT_BT_SCO_RX", NULL, "INTERNAL_BT_SCO_RX Port Mixer"},
  4043. {"SLIMBUS_3_RX Port Mixer", "INTERNAL_BT_SCO_RX", "INT_BT_SCO_RX"},
  4044. {"SLIMBUS_3_RX Port Mixer", "MI2S_TX", "MI2S_TX"},
  4045. {"SLIMBUS_3_RX", NULL, "SLIMBUS_3_RX Port Mixer"},
  4046. {"HDMI_RX Port Mixer", "MI2S_TX", "MI2S_TX"},
  4047. {"HDMI", NULL, "HDMI_RX Port Mixer"},
  4048. {"SEC_I2S_RX Port Mixer", "MI2S_TX", "MI2S_TX"},
  4049. {"SEC_I2S_RX", NULL, "SEC_I2S_RX Port Mixer"},
  4050. {"MI2S_RX Port Mixer", "SLIM_1_TX", "SLIMBUS_1_TX"},
  4051. {"MI2S_RX Port Mixer", "MI2S_TX", "MI2S_TX"},
  4052. {"MI2S_RX", NULL, "MI2S_RX Port Mixer"},
  4053. {"PRI_MI2S_RX Port Mixer", "SEC_MI2S_TX", "SEC_MI2S_TX"},
  4054. {"PRI_MI2S_RX", NULL, "PRI_MI2S_RX Port Mixer"},
  4055. /* Backend Enablement */
  4056. {"BE_OUT", NULL, "PRI_I2S_RX"},
  4057. {"BE_OUT", NULL, "SEC_I2S_RX"},
  4058. {"BE_OUT", NULL, "SLIMBUS_0_RX"},
  4059. {"BE_OUT", NULL, "SLIMBUS_1_RX"},
  4060. {"BE_OUT", NULL, "SLIMBUS_3_RX"},
  4061. {"BE_OUT", NULL, "SLIMBUS_4_RX"},
  4062. {"BE_OUT", NULL, "HDMI"},
  4063. {"BE_OUT", NULL, "MI2S_RX"},
  4064. {"BE_OUT", NULL, "QUAT_MI2S_RX"},
  4065. {"BE_OUT", NULL, "TERT_MI2S_RX"},
  4066. {"BE_OUT", NULL, "SEC_MI2S_RX"},
  4067. {"BE_OUT", NULL, "PRI_MI2S_RX"},
  4068. {"BE_OUT", NULL, "INT_BT_SCO_RX"},
  4069. {"BE_OUT", NULL, "INT_FM_RX"},
  4070. {"BE_OUT", NULL, "PCM_RX"},
  4071. {"BE_OUT", NULL, "SLIMBUS_3_RX"},
  4072. {"BE_OUT", NULL, "AUX_PCM_RX"},
  4073. {"BE_OUT", NULL, "SEC_AUX_PCM_RX"},
  4074. {"BE_OUT", NULL, "INT_BT_SCO_RX"},
  4075. {"BE_OUT", NULL, "INT_FM_RX"},
  4076. {"BE_OUT", NULL, "PCM_RX"},
  4077. {"BE_OUT", NULL, "SLIMBUS_3_RX"},
  4078. {"BE_OUT", NULL, "AUX_PCM_RX"},
  4079. {"BE_OUT", NULL, "SEC_AUX_PCM_RX"},
  4080. {"BE_OUT", NULL, "VOICE_PLAYBACK_TX"},
  4081. {"BE_OUT", NULL, "VOICE2_PLAYBACK_TX"},
  4082. {"PRI_I2S_TX", NULL, "BE_IN"},
  4083. {"MI2S_TX", NULL, "BE_IN"},
  4084. {"QUAT_MI2S_TX", NULL, "BE_IN"},
  4085. {"PRI_MI2S_TX", NULL, "BE_IN"},
  4086. {"TERT_MI2S_TX", NULL, "BE_IN"},
  4087. {"SEC_MI2S_TX", NULL, "BE_IN"},
  4088. {"SLIMBUS_0_TX", NULL, "BE_IN" },
  4089. {"SLIMBUS_1_TX", NULL, "BE_IN" },
  4090. {"SLIMBUS_3_TX", NULL, "BE_IN" },
  4091. {"SLIMBUS_4_TX", NULL, "BE_IN" },
  4092. {"SLIMBUS_5_TX", NULL, "BE_IN" },
  4093. {"INT_BT_SCO_TX", NULL, "BE_IN"},
  4094. {"INT_FM_TX", NULL, "BE_IN"},
  4095. {"PCM_TX", NULL, "BE_IN"},
  4096. {"AUX_PCM_TX", NULL, "BE_IN"},
  4097. {"SEC_AUX_PCM_TX", NULL, "BE_IN"},
  4098. {"INCALL_RECORD_TX", NULL, "BE_IN"},
  4099. {"INCALL_RECORD_RX", NULL, "BE_IN"},
  4100. {"SLIM0_RX_VI_FB_LCH_MUX", "SLIM4_TX", "SLIMBUS_4_TX"},
  4101. {"SLIMBUS_0_RX", NULL, "SLIM0_RX_VI_FB_LCH_MUX"},
  4102. };
  4103. static int msm_pcm_routing_hw_params(struct snd_pcm_substream *substream,
  4104. struct snd_pcm_hw_params *params)
  4105. {
  4106. struct snd_soc_pcm_runtime *rtd = substream->private_data;
  4107. unsigned int be_id = rtd->dai_link->be_id;
  4108. if (be_id >= MSM_BACKEND_DAI_MAX) {
  4109. pr_err("%s: unexpected be_id %d\n", __func__, be_id);
  4110. return -EINVAL;
  4111. }
  4112. mutex_lock(&routing_lock);
  4113. msm_bedais[be_id].sample_rate = params_rate(params);
  4114. msm_bedais[be_id].channel = params_channels(params);
  4115. msm_bedais[be_id].format = params_format(params);
  4116. mutex_unlock(&routing_lock);
  4117. return 0;
  4118. }
  4119. static int msm_pcm_routing_close(struct snd_pcm_substream *substream)
  4120. {
  4121. struct snd_soc_pcm_runtime *rtd = substream->private_data;
  4122. unsigned int be_id = rtd->dai_link->be_id;
  4123. int i, session_type, path_type, topology;
  4124. struct msm_pcm_routing_bdai_data *bedai;
  4125. if (be_id >= MSM_BACKEND_DAI_MAX) {
  4126. pr_err("%s: unexpected be_id %d\n", __func__, be_id);
  4127. return -EINVAL;
  4128. }
  4129. bedai = &msm_bedais[be_id];
  4130. session_type = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
  4131. 0 : 1);
  4132. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
  4133. path_type = ADM_PATH_PLAYBACK;
  4134. else
  4135. path_type = ADM_PATH_LIVE_REC;
  4136. mutex_lock(&routing_lock);
  4137. topology = get_topology(path_type);
  4138. for_each_set_bit(i, &bedai->fe_sessions, MSM_FRONTEND_DAI_MM_SIZE) {
  4139. if (fe_dai_map[i][session_type].strm_id != INVALID_SESSION) {
  4140. fe_dai_map[i][session_type].be_srate =
  4141. bedai->sample_rate;
  4142. adm_close(bedai->port_id,
  4143. fe_dai_perf_mode[i][session_type]);
  4144. srs_port_id = -1;
  4145. if ((DOLBY_ADM_COPP_TOPOLOGY_ID == topology) &&
  4146. (fe_dai_perf_mode[i][session_type] ==
  4147. LEGACY_PCM_MODE))
  4148. dolby_dap_deinit(bedai->port_id);
  4149. }
  4150. }
  4151. bedai->active = 0;
  4152. bedai->sample_rate = 0;
  4153. bedai->channel = 0;
  4154. mutex_unlock(&routing_lock);
  4155. return 0;
  4156. }
  4157. static int msm_pcm_routing_prepare(struct snd_pcm_substream *substream)
  4158. {
  4159. struct snd_soc_pcm_runtime *rtd = substream->private_data;
  4160. unsigned int be_id = rtd->dai_link->be_id;
  4161. int i, path_type, session_type, port_id, topology;
  4162. struct msm_pcm_routing_bdai_data *bedai;
  4163. u32 channels;
  4164. bool playback, capture;
  4165. uint16_t bits_per_sample = 16;
  4166. struct msm_pcm_routing_fdai_data *fdai;
  4167. if (be_id >= MSM_BACKEND_DAI_MAX) {
  4168. pr_err("%s: unexpected be_id %d\n", __func__, be_id);
  4169. return -EINVAL;
  4170. }
  4171. bedai = &msm_bedais[be_id];
  4172. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
  4173. path_type = ADM_PATH_PLAYBACK;
  4174. session_type = SESSION_TYPE_RX;
  4175. } else {
  4176. path_type = ADM_PATH_LIVE_REC;
  4177. session_type = SESSION_TYPE_TX;
  4178. }
  4179. mutex_lock(&routing_lock);
  4180. topology = get_topology(path_type);
  4181. if (bedai->active == 1)
  4182. goto done; /* Ignore prepare if back-end already active */
  4183. /* AFE port is not active at this point. However, still
  4184. * go ahead setting active flag under the notion that
  4185. * QDSP6 is able to handle ADM starting before AFE port
  4186. * is started.
  4187. */
  4188. bedai->active = 1;
  4189. playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
  4190. capture = substream->stream == SNDRV_PCM_STREAM_CAPTURE;
  4191. for_each_set_bit(i, &bedai->fe_sessions, MSM_FRONTEND_DAI_MM_SIZE) {
  4192. fdai = &fe_dai_map[i][session_type];
  4193. if (fdai->strm_id != INVALID_SESSION) {
  4194. if (session_type == SESSION_TYPE_TX &&
  4195. fdai->be_srate &&
  4196. (fdai->be_srate != bedai->sample_rate)) {
  4197. pr_debug("%s: flush strm %d diff BE rates\n",
  4198. __func__,
  4199. fdai->strm_id);
  4200. if (fdai->event_info.event_func)
  4201. fdai->event_info.event_func(
  4202. MSM_PCM_RT_EVT_BUF_RECFG,
  4203. fdai->event_info.priv_data);
  4204. fdai->be_srate = 0; /* might not need it */
  4205. }
  4206. channels = bedai->channel;
  4207. if (bedai->format == SNDRV_PCM_FORMAT_S24_LE)
  4208. bits_per_sample = 24;
  4209. if (bedai->port_id == VOICE_RECORD_RX ||
  4210. bedai->port_id == VOICE_RECORD_TX)
  4211. topology = DEFAULT_COPP_TOPOLOGY;
  4212. if ((playback) && (channels > 0)) {
  4213. adm_multi_ch_copp_open(bedai->port_id,
  4214. path_type,
  4215. bedai->sample_rate,
  4216. channels,
  4217. topology,
  4218. fe_dai_perf_mode[i][session_type],
  4219. bits_per_sample);
  4220. } else if (capture) {
  4221. adm_open(bedai->port_id,
  4222. path_type,
  4223. bedai->sample_rate,
  4224. channels,
  4225. topology, fe_dai_perf_mode[i][session_type],
  4226. bits_per_sample);
  4227. }
  4228. msm_pcm_routing_build_matrix(i,
  4229. fdai->strm_id, path_type,
  4230. fe_dai_perf_mode[i][session_type]);
  4231. port_id = srs_port_id = bedai->port_id;
  4232. srs_send_params(srs_port_id, 1, 0);
  4233. if ((DOLBY_ADM_COPP_TOPOLOGY_ID == topology) &&
  4234. (fe_dai_perf_mode[i][session_type] ==
  4235. LEGACY_PCM_MODE))
  4236. if (dolby_dap_init(port_id, channels) < 0)
  4237. pr_err("%s: Err init dolby dap\n",
  4238. __func__);
  4239. }
  4240. }
  4241. done:
  4242. mutex_unlock(&routing_lock);
  4243. return 0;
  4244. }
  4245. static struct snd_pcm_ops msm_routing_pcm_ops = {
  4246. .hw_params = msm_pcm_routing_hw_params,
  4247. .close = msm_pcm_routing_close,
  4248. .prepare = msm_pcm_routing_prepare,
  4249. };
  4250. static unsigned int msm_routing_read(struct snd_soc_platform *platform,
  4251. unsigned int reg)
  4252. {
  4253. dev_dbg(platform->dev, "reg %x\n", reg);
  4254. return 0;
  4255. }
  4256. /* Not used but frame seems to require it */
  4257. static int msm_routing_write(struct snd_soc_platform *platform,
  4258. unsigned int reg, unsigned int val)
  4259. {
  4260. dev_dbg(platform->dev, "reg %x val %x\n", reg, val);
  4261. return 0;
  4262. }
  4263. /* Not used but frame seems to require it */
  4264. static int msm_routing_probe(struct snd_soc_platform *platform)
  4265. {
  4266. snd_soc_dapm_new_controls(&platform->dapm, msm_qdsp6_widgets,
  4267. ARRAY_SIZE(msm_qdsp6_widgets));
  4268. snd_soc_dapm_add_routes(&platform->dapm, intercon,
  4269. ARRAY_SIZE(intercon));
  4270. snd_soc_dapm_new_widgets(&platform->dapm);
  4271. snd_soc_add_platform_controls(platform,
  4272. int_fm_vol_mixer_controls,
  4273. ARRAY_SIZE(int_fm_vol_mixer_controls));
  4274. snd_soc_add_platform_controls(platform,
  4275. int_hfp_vol_mixer_controls,
  4276. ARRAY_SIZE(int_hfp_vol_mixer_controls));
  4277. snd_soc_add_platform_controls(platform,
  4278. eq_enable_mixer_controls,
  4279. ARRAY_SIZE(eq_enable_mixer_controls));
  4280. snd_soc_add_platform_controls(platform,
  4281. eq_band_mixer_controls,
  4282. ARRAY_SIZE(eq_band_mixer_controls));
  4283. snd_soc_add_platform_controls(platform,
  4284. eq_coeff_mixer_controls,
  4285. ARRAY_SIZE(eq_coeff_mixer_controls));
  4286. snd_soc_add_platform_controls(platform,
  4287. multimedia2_vol_mixer_controls,
  4288. ARRAY_SIZE(multimedia2_vol_mixer_controls));
  4289. snd_soc_add_platform_controls(platform,
  4290. multimedia5_vol_mixer_controls,
  4291. ARRAY_SIZE(multimedia5_vol_mixer_controls));
  4292. snd_soc_add_platform_controls(platform,
  4293. lpa_SRS_trumedia_controls,
  4294. ARRAY_SIZE(lpa_SRS_trumedia_controls));
  4295. snd_soc_add_platform_controls(platform,
  4296. lpa_SRS_trumedia_controls_HDMI,
  4297. ARRAY_SIZE(lpa_SRS_trumedia_controls_HDMI));
  4298. snd_soc_add_platform_controls(platform,
  4299. lpa_SRS_trumedia_controls_I2S,
  4300. ARRAY_SIZE(lpa_SRS_trumedia_controls_I2S));
  4301. snd_soc_add_platform_controls(platform,
  4302. multi_ch_channel_map_mixer_controls,
  4303. ARRAY_SIZE(multi_ch_channel_map_mixer_controls));
  4304. snd_soc_add_platform_controls(platform, lsm_function,
  4305. ARRAY_SIZE(lsm_function));
  4306. snd_soc_add_platform_controls(platform,
  4307. ss_solution_mixer_controls,
  4308. ARRAY_SIZE(ss_solution_mixer_controls));
  4309. snd_soc_add_platform_controls(platform,
  4310. aanc_slim_0_rx_mux,
  4311. ARRAY_SIZE(aanc_slim_0_rx_mux));
  4312. snd_soc_add_platform_controls(platform,
  4313. dolby_security_controls,
  4314. ARRAY_SIZE(dolby_security_controls));
  4315. snd_soc_add_platform_controls(platform,
  4316. dolby_dap_param_to_set_controls,
  4317. ARRAY_SIZE(dolby_dap_param_to_set_controls));
  4318. snd_soc_add_platform_controls(platform,
  4319. dolby_dap_param_to_get_controls,
  4320. ARRAY_SIZE(dolby_dap_param_to_get_controls));
  4321. snd_soc_add_platform_controls(platform,
  4322. dolby_dap_param_visualizer_controls,
  4323. ARRAY_SIZE(dolby_dap_param_visualizer_controls));
  4324. snd_soc_add_platform_controls(platform,
  4325. dolby_dap_param_end_point_controls,
  4326. ARRAY_SIZE(dolby_dap_param_end_point_controls));
  4327. snd_soc_add_platform_controls(platform,
  4328. get_rms_controls,
  4329. ARRAY_SIZE(get_rms_controls));
  4330. snd_soc_add_platform_controls(platform, msm_voc_session_controls,
  4331. ARRAY_SIZE(msm_voc_session_controls));
  4332. return 0;
  4333. }
  4334. static struct snd_soc_platform_driver msm_soc_routing_platform = {
  4335. .ops = &msm_routing_pcm_ops,
  4336. .probe = msm_routing_probe,
  4337. .read = msm_routing_read,
  4338. .write = msm_routing_write,
  4339. };
  4340. static __devinit int msm_routing_pcm_probe(struct platform_device *pdev)
  4341. {
  4342. if (pdev->dev.of_node)
  4343. dev_set_name(&pdev->dev, "%s", "msm-pcm-routing");
  4344. dev_dbg(&pdev->dev, "dev name %s\n", dev_name(&pdev->dev));
  4345. return snd_soc_register_platform(&pdev->dev,
  4346. &msm_soc_routing_platform);
  4347. }
  4348. static int msm_routing_pcm_remove(struct platform_device *pdev)
  4349. {
  4350. snd_soc_unregister_platform(&pdev->dev);
  4351. return 0;
  4352. }
  4353. static const struct of_device_id msm_pcm_routing_dt_match[] = {
  4354. {.compatible = "qcom,msm-pcm-routing"},
  4355. {}
  4356. };
  4357. MODULE_DEVICE_TABLE(of, msm_pcm_routing_dt_match);
  4358. static struct platform_driver msm_routing_pcm_driver = {
  4359. .driver = {
  4360. .name = "msm-pcm-routing",
  4361. .owner = THIS_MODULE,
  4362. .of_match_table = msm_pcm_routing_dt_match,
  4363. },
  4364. .probe = msm_routing_pcm_probe,
  4365. .remove = __devexit_p(msm_routing_pcm_remove),
  4366. };
  4367. int msm_routing_check_backend_enabled(int fedai_id)
  4368. {
  4369. int i;
  4370. if (fedai_id >= MSM_FRONTEND_DAI_MM_MAX_ID) {
  4371. /* bad ID assigned in machine driver */
  4372. pr_err("%s: bad MM ID\n", __func__);
  4373. return 0;
  4374. }
  4375. for (i = 0; i < MSM_BACKEND_DAI_MAX; i++) {
  4376. if (test_bit(fedai_id, &msm_bedais[i].fe_sessions))
  4377. return msm_bedais[i].active;
  4378. }
  4379. return 0;
  4380. }
  4381. static int __init msm_soc_routing_platform_init(void)
  4382. {
  4383. mutex_init(&routing_lock);
  4384. return platform_driver_register(&msm_routing_pcm_driver);
  4385. }
  4386. module_init(msm_soc_routing_platform_init);
  4387. static void __exit msm_soc_routing_platform_exit(void)
  4388. {
  4389. platform_driver_unregister(&msm_routing_pcm_driver);
  4390. }
  4391. module_exit(msm_soc_routing_platform_exit);
  4392. MODULE_DESCRIPTION("MSM routing platform driver");
  4393. MODULE_LICENSE("GPL v2");