apr_audio-v2.h 325 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914
  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. #ifndef _APR_AUDIO_V2_H_
  13. #define _APR_AUDIO_V2_H_
  14. #include <ipc/apr.h>
  15. #include <linux/msm_audio.h>
  16. /* size of header needed for passing data out of band */
  17. #define APR_CMD_OB_HDR_SZ 12
  18. /* size of header needed for getting data */
  19. #define APR_CMD_GET_HDR_SZ 16
  20. struct param_outband {
  21. size_t size;
  22. void *kvaddr;
  23. phys_addr_t paddr;
  24. };
  25. #define ADSP_ADM_VERSION 0x00070000
  26. #define ADM_CMD_SHARED_MEM_MAP_REGIONS 0x00010322
  27. #define ADM_CMDRSP_SHARED_MEM_MAP_REGIONS 0x00010323
  28. #define ADM_CMD_SHARED_MEM_UNMAP_REGIONS 0x00010324
  29. #define ADM_CMD_MATRIX_MAP_ROUTINGS_V5 0x00010325
  30. #define ADM_CMD_STREAM_DEVICE_MAP_ROUTINGS_V5 0x0001033D
  31. /* Enumeration for an audio Rx matrix ID.*/
  32. #define ADM_MATRIX_ID_AUDIO_RX 0
  33. #define ADM_MATRIX_ID_AUDIO_TX 1
  34. #define ADM_MATRIX_ID_COMPRESSED_AUDIO_RX 2
  35. #define ADM_MATRIX_ID_COMPRESSED_AUDIO_TX 3
  36. #define ADM_MATRIX_ID_LISTEN_TX 4
  37. /* Enumeration for an audio Tx matrix ID.*/
  38. #define ADM_MATRIX_ID_AUDIOX 1
  39. #define ADM_MAX_COPPS 5
  40. /* make sure this matches with msm_audio_calibration */
  41. #define SP_V2_NUM_MAX_SPKR 2
  42. /* Session map node structure.
  43. * Immediately following this structure are num_copps
  44. * entries of COPP IDs. The COPP IDs are 16 bits, so
  45. * there might be a padding 16-bit field if num_copps
  46. * is odd.
  47. */
  48. struct adm_session_map_node_v5 {
  49. u16 session_id;
  50. /* Handle of the ASM session to be routed. Supported values: 1
  51. * to 8.
  52. */
  53. u16 num_copps;
  54. /* Number of COPPs to which this session is to be routed.
  55. * Supported values: 0 < num_copps <= ADM_MAX_COPPS.
  56. */
  57. } __packed;
  58. /* Payload of the #ADM_CMD_MATRIX_MAP_ROUTINGS_V5 command.
  59. * Immediately following this structure are num_sessions of the session map
  60. * node payload (adm_session_map_node_v5).
  61. */
  62. struct adm_cmd_matrix_map_routings_v5 {
  63. struct apr_hdr hdr;
  64. u32 matrix_id;
  65. /* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx
  66. * (1). Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX
  67. * macros to set this field.
  68. */
  69. u32 num_sessions;
  70. /* Number of sessions being updated by this command (optional). */
  71. } __packed;
  72. /* This command allows a client to open a COPP/Voice Proc. TX module
  73. * and sets up the device session: Matrix -> COPP -> AFE on the RX
  74. * and AFE -> COPP -> Matrix on the TX. This enables PCM data to
  75. * be transferred to/from the endpoint (AFEPortID).
  76. *
  77. * @return
  78. * #ADM_CMDRSP_DEVICE_OPEN_V5 with the resulting status and COPP ID.
  79. */
  80. #define ADM_CMD_DEVICE_OPEN_V5 0x00010326
  81. /* This command allows a client to open a COPP/Voice Proc the
  82. * way as ADM_CMD_DEVICE_OPEN_V5 but supports multiple endpoint2
  83. * channels.
  84. *
  85. * @return
  86. * #ADM_CMDRSP_DEVICE_OPEN_V6 with the resulting status and
  87. * COPP ID.
  88. */
  89. #define ADM_CMD_DEVICE_OPEN_V6 0x00010356
  90. /* Definition for a low latency stream session. */
  91. #define ADM_LOW_LATENCY_DEVICE_SESSION 0x2000
  92. /* Definition for a ultra low latency stream session. */
  93. #define ADM_ULTRA_LOW_LATENCY_DEVICE_SESSION 0x4000
  94. /* Definition for a ultra low latency with Post Processing stream session. */
  95. #define ADM_ULL_POST_PROCESSING_DEVICE_SESSION 0x8000
  96. /* Definition for a legacy device session. */
  97. #define ADM_LEGACY_DEVICE_SESSION 0
  98. /* Indicates that endpoint_id_2 is to be ignored.*/
  99. #define ADM_CMD_COPP_OPEN_END_POINT_ID_2_IGNORE 0xFFFF
  100. #define ADM_CMD_COPP_OPEN_MODE_OF_OPERATION_RX_PATH_COPP 1
  101. #define ADM_CMD_COPP_OPEN_MODE_OF_OPERATIONX_PATH_LIVE_COPP 2
  102. #define ADM_CMD_COPP_OPEN_MODE_OF_OPERATIONX_PATH_NON_LIVE_COPP 3
  103. /* Indicates that an audio COPP is to send/receive a mono PCM
  104. * stream to/from
  105. * END_POINT_ID_1.
  106. */
  107. #define ADM_CMD_COPP_OPEN_CHANNEL_CONFIG_MONO 1
  108. /* Indicates that an audio COPP is to send/receive a
  109. * stereo PCM stream to/from END_POINT_ID_1.
  110. */
  111. #define ADM_CMD_COPP_OPEN_CHANNEL_CONFIG_STEREO 2
  112. /* Sample rate is 8000 Hz.*/
  113. #define ADM_CMD_COPP_OPEN_SAMPLE_RATE_8K 8000
  114. /* Sample rate is 16000 Hz.*/
  115. #define ADM_CMD_COPP_OPEN_SAMPLE_RATE_16K 16000
  116. /* Sample rate is 48000 Hz.*/
  117. #define ADM_CMD_COPP_OPEN_SAMPLE_RATE_48K 48000
  118. /* Definition for a COPP live input flag bitmask.*/
  119. #define ADM_BIT_MASK_COPP_LIVE_INPUT_FLAG (0x0001U)
  120. /* Definition for a COPP live shift value bitmask.*/
  121. #define ADM_SHIFT_COPP_LIVE_INPUT_FLAG 0
  122. /* Definition for the COPP ID bitmask.*/
  123. #define ADM_BIT_MASK_COPP_ID (0x0000FFFFUL)
  124. /* Definition for the COPP ID shift value.*/
  125. #define ADM_SHIFT_COPP_ID 0
  126. /* Definition for the service ID bitmask.*/
  127. #define ADM_BIT_MASK_SERVICE_ID (0x00FF0000UL)
  128. /* Definition for the service ID shift value.*/
  129. #define ADM_SHIFT_SERVICE_ID 16
  130. /* Definition for the domain ID bitmask.*/
  131. #define ADM_BIT_MASK_DOMAIN_ID (0xFF000000UL)
  132. /* Definition for the domain ID shift value.*/
  133. #define ADM_SHIFT_DOMAIN_ID 24
  134. /* ADM device open command payload of the
  135. * #ADM_CMD_DEVICE_OPEN_V5 command.
  136. */
  137. struct adm_cmd_device_open_v5 {
  138. struct apr_hdr hdr;
  139. u16 flags;
  140. /* Reserved for future use. Clients must set this field
  141. * to zero.
  142. */
  143. u16 mode_of_operation;
  144. /* Specifies whether the COPP must be opened on the Tx or Rx
  145. * path. Use the ADM_CMD_COPP_OPEN_MODE_OF_OPERATION_* macros for
  146. * supported values and interpretation.
  147. * Supported values:
  148. * - 0x1 -- Rx path COPP
  149. * - 0x2 -- Tx path live COPP
  150. * - 0x3 -- Tx path nonlive COPP
  151. * Live connections cause sample discarding in the Tx device
  152. * matrix if the destination output ports do not pull them
  153. * fast enough. Nonlive connections queue the samples
  154. * indefinitely.
  155. */
  156. u16 endpoint_id_1;
  157. /* Logical and physical endpoint ID of the audio path.
  158. * If the ID is a voice processor Tx block, it receives near
  159. * samples. Supported values: Any pseudoport, AFE Rx port,
  160. * or AFE Tx port For a list of valid IDs, refer to
  161. * @xhyperref{Q4,[Q4]}.
  162. * Q4 = Hexagon Multimedia: AFE Interface Specification
  163. */
  164. u16 endpoint_id_2;
  165. /* Logical and physical endpoint ID 2 for a voice processor
  166. * Tx block.
  167. * This is not applicable to audio COPP.
  168. * Supported values:
  169. * - AFE Rx port
  170. * - 0xFFFF -- Endpoint 2 is unavailable and the voice
  171. * processor Tx
  172. * block ignores this endpoint
  173. * When the voice processor Tx block is created on the audio
  174. * record path,
  175. * it can receive far-end samples from an AFE Rx port if the
  176. * voice call
  177. * is active. The ID of the AFE port is provided in this
  178. * field.
  179. * For a list of valid IDs, refer @xhyperref{Q4,[Q4]}.
  180. */
  181. u32 topology_id;
  182. /* Audio COPP topology ID; 32-bit GUID. */
  183. u16 dev_num_channel;
  184. /* Number of channels the audio COPP sends to/receives from
  185. * the endpoint.
  186. * Supported values: 1 to 8.
  187. * The value is ignored for the voice processor Tx block,
  188. * where channel
  189. * configuration is derived from the topology ID.
  190. */
  191. u16 bit_width;
  192. /* Bit width (in bits) that the audio COPP sends to/receives
  193. * from the
  194. * endpoint. The value is ignored for the voice processing
  195. * Tx block,
  196. * where the PCM width is 16 bits.
  197. */
  198. u32 sample_rate;
  199. /* Sampling rate at which the audio COPP/voice processor
  200. * Tx block
  201. * interfaces with the endpoint.
  202. * Supported values for voice processor Tx: 8000, 16000,
  203. * 48000 Hz
  204. * Supported values for audio COPP: >0 and <=192 kHz
  205. */
  206. u8 dev_channel_mapping[8];
  207. /* Array of channel mapping of buffers that the audio COPP
  208. * sends to the endpoint. Channel[i] mapping describes channel
  209. * I inside the buffer, where 0 < i < dev_num_channel.
  210. * This value is relevant only for an audio Rx COPP.
  211. * For the voice processor block and Tx audio block, this field
  212. * is set to zero and is ignored.
  213. */
  214. } __packed;
  215. /* ADM device open command payload of the
  216. * #ADM_CMD_DEVICE_OPEN_V6 command.
  217. */
  218. struct adm_cmd_device_open_v6 {
  219. struct apr_hdr hdr;
  220. u16 flags;
  221. /* Reserved for future use. Clients must set this field
  222. * to zero.
  223. */
  224. u16 mode_of_operation;
  225. /* Specifies whether the COPP must be opened on the Tx or Rx
  226. * path. Use the ADM_CMD_COPP_OPEN_MODE_OF_OPERATION_* macros for
  227. * supported values and interpretation.
  228. * Supported values:
  229. * - 0x1 -- Rx path COPP
  230. * - 0x2 -- Tx path live COPP
  231. * - 0x3 -- Tx path nonlive COPP
  232. * Live connections cause sample discarding in the Tx device
  233. * matrix if the destination output ports do not pull them
  234. * fast enough. Nonlive connections queue the samples
  235. * indefinitely.
  236. */
  237. u16 endpoint_id_1;
  238. /* Logical and physical endpoint ID of the audio path.
  239. * If the ID is a voice processor Tx block, it receives near
  240. * samples. Supported values: Any pseudoport, AFE Rx port,
  241. * or AFE Tx port For a list of valid IDs, refer to
  242. * @xhyperref{Q4,[Q4]}.
  243. * Q4 = Hexagon Multimedia: AFE Interface Specification
  244. */
  245. u16 endpoint_id_2;
  246. /* Logical and physical endpoint ID 2 for a voice processor
  247. * Tx block.
  248. * This is not applicable to audio COPP.
  249. * Supported values:
  250. * - AFE Rx port
  251. * - 0xFFFF -- Endpoint 2 is unavailable and the voice
  252. * processor Tx
  253. * block ignores this endpoint
  254. * When the voice processor Tx block is created on the audio
  255. * record path,
  256. * it can receive far-end samples from an AFE Rx port if the
  257. * voice call
  258. * is active. The ID of the AFE port is provided in this
  259. * field.
  260. * For a list of valid IDs, refer @xhyperref{Q4,[Q4]}.
  261. */
  262. u32 topology_id;
  263. /* Audio COPP topology ID; 32-bit GUID. */
  264. u16 dev_num_channel;
  265. /* Number of channels the audio COPP sends to/receives from
  266. * the endpoint.
  267. * Supported values: 1 to 8.
  268. * The value is ignored for the voice processor Tx block,
  269. * where channel
  270. * configuration is derived from the topology ID.
  271. */
  272. u16 bit_width;
  273. /* Bit width (in bits) that the audio COPP sends to/receives
  274. * from the
  275. * endpoint. The value is ignored for the voice processing
  276. * Tx block,
  277. * where the PCM width is 16 bits.
  278. */
  279. u32 sample_rate;
  280. /* Sampling rate at which the audio COPP/voice processor
  281. * Tx block
  282. * interfaces with the endpoint.
  283. * Supported values for voice processor Tx: 8000, 16000,
  284. * 48000 Hz
  285. * Supported values for audio COPP: >0 and <=192 kHz
  286. */
  287. u8 dev_channel_mapping[8];
  288. /* Array of channel mapping of buffers that the audio COPP
  289. * sends to the endpoint. Channel[i] mapping describes channel
  290. * I inside the buffer, where 0 < i < dev_num_channel.
  291. * This value is relevant only for an audio Rx COPP.
  292. * For the voice processor block and Tx audio block, this field
  293. * is set to zero and is ignored.
  294. */
  295. u16 dev_num_channel_eid2;
  296. /* Number of channels the voice processor block sends
  297. * to/receives from the endpoint2.
  298. * Supported values: 1 to 8.
  299. * The value is ignored for audio COPP or if endpoint_id_2 is
  300. * set to 0xFFFF.
  301. */
  302. u16 bit_width_eid2;
  303. /* Bit width (in bits) that the voice processor sends
  304. * to/receives from the endpoint2.
  305. * Supported values: 16 and 24.
  306. * The value is ignored for audio COPP or if endpoint_id_2 is
  307. * set to 0xFFFF.
  308. */
  309. u32 sample_rate_eid2;
  310. /* Sampling rate at which the voice processor Tx block
  311. * interfaces with the endpoint2.
  312. * Supported values for Tx voice processor: >0 and <=384 kHz
  313. * The value is ignored for audio COPP or if endpoint_id_2 is
  314. * set to 0xFFFF.
  315. */
  316. u8 dev_channel_mapping_eid2[8];
  317. /* Array of channel mapping of buffers that the voice processor
  318. * sends to the endpoint. Channel[i] mapping describes channel
  319. * I inside the buffer, where 0 < i < dev_num_channel.
  320. * This value is relevant only for the Tx voice processor.
  321. * The values are ignored for audio COPP or if endpoint_id_2 is
  322. * set to 0xFFFF.
  323. */
  324. } __packed;
  325. /*
  326. * This command allows the client to close a COPP and disconnect
  327. * the device session.
  328. */
  329. #define ADM_CMD_DEVICE_CLOSE_V5 0x00010327
  330. /* Sets one or more parameters to a COPP. */
  331. #define ADM_CMD_SET_PP_PARAMS_V5 0x00010328
  332. /* Payload of the #ADM_CMD_SET_PP_PARAMS_V5 command.
  333. * If the data_payload_addr_lsw and data_payload_addr_msw element
  334. * are NULL, a series of adm_param_datastructures immediately
  335. * follows, whose total size is data_payload_size bytes.
  336. */
  337. struct adm_cmd_set_pp_params_v5 {
  338. struct apr_hdr hdr;
  339. u32 payload_addr_lsw;
  340. /* LSW of parameter data payload address. */
  341. u32 payload_addr_msw;
  342. /* MSW of parameter data payload address. */
  343. u32 mem_map_handle;
  344. /* Memory map handle returned by ADM_CMD_SHARED_MEM_MAP_REGIONS
  345. * command
  346. *
  347. * If mem_map_handle is zero implies the message is in
  348. * the payload
  349. */
  350. u32 payload_size;
  351. /* Size in bytes of the variable payload accompanying this
  352. * message or
  353. * in shared memory. This is used for parsing the parameter
  354. * payload.
  355. */
  356. } __packed;
  357. /* Payload format for COPP parameter data.
  358. * Immediately following this structure are param_size bytes
  359. * of parameter
  360. * data.
  361. */
  362. struct adm_param_data_v5 {
  363. u32 module_id;
  364. /* Unique ID of the module. */
  365. u32 param_id;
  366. /* Unique ID of the parameter. */
  367. u16 param_size;
  368. /* Data size of the param_id/module_id combination.
  369. * This value is a
  370. * multiple of 4 bytes.
  371. */
  372. u16 reserved;
  373. /* Reserved for future enhancements.
  374. * This field must be set to zero.
  375. */
  376. } __packed;
  377. #define ASM_STREAM_CMD_REGISTER_PP_EVENTS 0x00013213
  378. #define ASM_STREAM_PP_EVENT 0x00013214
  379. #define ASM_STREAM_CMD_REGISTER_IEC_61937_FMT_UPDATE 0x13333
  380. #define ASM_IEC_61937_MEDIA_FMT_EVENT 0x13334
  381. #define DSP_STREAM_CMD "ADSP Stream Cmd"
  382. #define DSP_STREAM_CALLBACK "ADSP Stream Callback Event"
  383. #define DSP_STREAM_CALLBACK_QUEUE_SIZE 1024
  384. struct dsp_stream_callback_list {
  385. struct list_head list;
  386. struct msm_adsp_event_data event;
  387. };
  388. struct dsp_stream_callback_prtd {
  389. uint16_t event_count;
  390. struct list_head event_queue;
  391. spinlock_t prtd_spin_lock;
  392. };
  393. /* set customized mixing on matrix mixer */
  394. #define ADM_CMD_SET_PSPD_MTMX_STRTR_PARAMS_V5 0x00010344
  395. struct adm_cmd_set_pspd_mtmx_strtr_params_v5 {
  396. struct apr_hdr hdr;
  397. /* LSW of parameter data payload address.*/
  398. u32 payload_addr_lsw;
  399. /* MSW of parameter data payload address.*/
  400. u32 payload_addr_msw;
  401. /* Memory map handle returned by ADM_CMD_SHARED_MEM_MAP_REGIONS */
  402. /* command. If mem_map_handle is zero implies the message is in */
  403. /* the payload */
  404. u32 mem_map_handle;
  405. /* Size in bytes of the variable payload accompanying this */
  406. /* message or in shared memory. This is used for parsing the */
  407. /* parameter payload. */
  408. u32 payload_size;
  409. u16 direction;
  410. u16 sessionid;
  411. u16 deviceid;
  412. u16 reserved;
  413. } __packed;
  414. /* Defined specifically for in-band use, includes params */
  415. struct adm_cmd_set_pp_params_inband_v5 {
  416. struct apr_hdr hdr;
  417. /* LSW of parameter data payload address.*/
  418. u32 payload_addr_lsw;
  419. /* MSW of parameter data payload address.*/
  420. u32 payload_addr_msw;
  421. /* Memory map handle returned by ADM_CMD_SHARED_MEM_MAP_REGIONS */
  422. /* command. If mem_map_handle is zero implies the message is in */
  423. /* the payload */
  424. u32 mem_map_handle;
  425. /* Size in bytes of the variable payload accompanying this */
  426. /* message or in shared memory. This is used for parsing the */
  427. /* parameter payload. */
  428. u32 payload_size;
  429. /* Parameters passed for in band payload */
  430. struct adm_param_data_v5 params;
  431. } __packed;
  432. /* Returns the status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V5 command.
  433. */
  434. #define ADM_CMDRSP_DEVICE_OPEN_V5 0x00010329
  435. /* Payload of the #ADM_CMDRSP_DEVICE_OPEN_V5 message,
  436. * which returns the
  437. * status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V5 command.
  438. */
  439. struct adm_cmd_rsp_device_open_v5 {
  440. u32 status;
  441. /* Status message (error code).*/
  442. u16 copp_id;
  443. /* COPP ID: Supported values: 0 <= copp_id < ADM_MAX_COPPS*/
  444. u16 reserved;
  445. /* Reserved. This field must be set to zero.*/
  446. } __packed;
  447. /* Returns the status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V6 command. */
  448. #define ADM_CMDRSP_DEVICE_OPEN_V6 0x00010357
  449. /* Payload of the #ADM_CMDRSP_DEVICE_OPEN_V6 message,
  450. * which returns the
  451. * status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V6 command
  452. * is the exact same as ADM_CMDRSP_DEVICE_OPEN_V5.
  453. */
  454. /* This command allows a query of one COPP parameter. */
  455. #define ADM_CMD_GET_PP_PARAMS_V5 0x0001032A
  456. /* Payload an #ADM_CMD_GET_PP_PARAMS_V5 command. */
  457. struct adm_cmd_get_pp_params_v5 {
  458. struct apr_hdr hdr;
  459. u32 data_payload_addr_lsw;
  460. /* LSW of parameter data payload address.*/
  461. u32 data_payload_addr_msw;
  462. /* MSW of parameter data payload address.*/
  463. /* If the mem_map_handle is non zero,
  464. * on ACK, the ParamData payloads begin at
  465. * the address specified (out-of-band).
  466. */
  467. u32 mem_map_handle;
  468. /* Memory map handle returned
  469. * by ADM_CMD_SHARED_MEM_MAP_REGIONS command.
  470. * If the mem_map_handle is 0, it implies that
  471. * the ACK's payload will contain the ParamData (in-band).
  472. */
  473. u32 module_id;
  474. /* Unique ID of the module. */
  475. u32 param_id;
  476. /* Unique ID of the parameter. */
  477. u16 param_max_size;
  478. /* Maximum data size of the parameter
  479. *ID/module ID combination. This
  480. * field is a multiple of 4 bytes.
  481. */
  482. u16 reserved;
  483. /* Reserved for future enhancements.
  484. * This field must be set to zero.
  485. */
  486. } __packed;
  487. /* Returns parameter values
  488. * in response to an #ADM_CMD_GET_PP_PARAMS_V5 command.
  489. */
  490. #define ADM_CMDRSP_GET_PP_PARAMS_V5 0x0001032B
  491. /* Payload of the #ADM_CMDRSP_GET_PP_PARAMS_V5 message,
  492. * which returns parameter values in response
  493. * to an #ADM_CMD_GET_PP_PARAMS_V5 command.
  494. * Immediately following this
  495. * structure is the adm_param_data_v5
  496. * structure containing the pre/postprocessing
  497. * parameter data. For an in-band
  498. * scenario, the variable payload depends
  499. * on the size of the parameter.
  500. */
  501. struct adm_cmd_rsp_get_pp_params_v5 {
  502. u32 status;
  503. /* Status message (error code).*/
  504. } __packed;
  505. /* Structure for holding soft stepping volume parameters. */
  506. /*
  507. * Payload of the #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
  508. * parameters used by the Volume Control module.
  509. */
  510. struct audproc_softvolume_params {
  511. u32 period;
  512. u32 step;
  513. u32 rampingcurve;
  514. } __packed;
  515. /*
  516. * ID of the Media Format Converter (MFC) module.
  517. * This module supports the following parameter IDs:
  518. * #AUDPROC_PARAM_ID_MFC_OUTPUT_MEDIA_FORMAT
  519. * #AUDPROC_CHMIXER_PARAM_ID_COEFF
  520. */
  521. #define AUDPROC_MODULE_ID_MFC 0x00010912
  522. /* ID of the Output Media Format parameters used by AUDPROC_MODULE_ID_MFC.
  523. *
  524. */
  525. #define AUDPROC_PARAM_ID_MFC_OUTPUT_MEDIA_FORMAT 0x00010913
  526. /* Param ID of Channel Mixer used by AUDPROC_MODULE_ID_MFC */
  527. #define AUDPROC_CHMIXER_PARAM_ID_COEFF 0x00010342
  528. struct audproc_mfc_output_media_fmt {
  529. struct adm_cmd_set_pp_params_v5 params;
  530. struct adm_param_data_v5 data;
  531. uint32_t sampling_rate;
  532. uint16_t bits_per_sample;
  533. uint16_t num_channels;
  534. uint16_t channel_type[8];
  535. } __packed;
  536. struct audproc_volume_ctrl_master_gain {
  537. struct adm_cmd_set_pp_params_v5 params;
  538. struct adm_param_data_v5 data;
  539. /* Linear gain in Q13 format. */
  540. uint16_t master_gain;
  541. /* Clients must set this field to zero. */
  542. uint16_t reserved;
  543. } __packed;
  544. struct audproc_soft_step_volume_params {
  545. struct adm_cmd_set_pp_params_v5 params;
  546. struct adm_param_data_v5 data;
  547. /*
  548. * Period in milliseconds.
  549. * Supported values: 0 to 15000
  550. */
  551. uint32_t period;
  552. /*
  553. * Step in microseconds.
  554. * Supported values: 0 to 15000000
  555. */
  556. uint32_t step;
  557. /*
  558. * Ramping curve type.
  559. * Supported values:
  560. * - #AUDPROC_PARAM_SVC_RAMPINGCURVE_LINEAR
  561. * - #AUDPROC_PARAM_SVC_RAMPINGCURVE_EXP
  562. * - #AUDPROC_PARAM_SVC_RAMPINGCURVE_LOG
  563. */
  564. uint32_t ramping_curve;
  565. } __packed;
  566. struct audproc_enable_param_t {
  567. struct adm_cmd_set_pp_params_inband_v5 pp_params;
  568. /*
  569. * Specifies whether the Audio processing module is enabled.
  570. * This parameter is generic/common parameter to configure or
  571. * determine the state of any audio processing module.
  572. * @values 0 : Disable 1: Enable
  573. */
  574. uint32_t enable;
  575. };
  576. /*
  577. * Allows a client to control the gains on various session-to-COPP paths.
  578. */
  579. #define ADM_CMD_MATRIX_RAMP_GAINS_V5 0x0001032C
  580. /* Indicates that the target gain in the
  581. * current adm_session_copp_gain_v5
  582. * structure is to be applied to all
  583. * the session-to-COPP paths that exist for
  584. * the specified session.
  585. */
  586. #define ADM_CMD_MATRIX_RAMP_GAINS_COPP_ID_ALL_CONNECTED_COPPS 0xFFFF
  587. /* Indicates that the target gain is
  588. * to be immediately applied to the
  589. * specified session-to-COPP path,
  590. * without a ramping fashion.
  591. */
  592. #define ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE 0x0000
  593. /* Enumeration for a linear ramping curve.*/
  594. #define ADM_CMD_MATRIX_RAMP_GAINS_RAMP_CURVE_LINEAR 0x0000
  595. /* Payload of the #ADM_CMD_MATRIX_RAMP_GAINS_V5 command.
  596. * Immediately following this structure are num_gains of the
  597. * adm_session_copp_gain_v5structure.
  598. */
  599. struct adm_cmd_matrix_ramp_gains_v5 {
  600. u32 matrix_id;
  601. /* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx (1).
  602. * Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX
  603. * macros to set this field.
  604. */
  605. u16 num_gains;
  606. /* Number of gains being applied. */
  607. u16 reserved_for_align;
  608. /* Reserved. This field must be set to zero.*/
  609. } __packed;
  610. /* Session-to-COPP path gain structure, used by the
  611. * #ADM_CMD_MATRIX_RAMP_GAINS_V5 command.
  612. * This structure specifies the target
  613. * gain (per channel) that must be applied
  614. * to a particular session-to-COPP path in
  615. * the audio matrix. The structure can
  616. * also be used to apply the gain globally
  617. * to all session-to-COPP paths that
  618. * exist for the given session.
  619. * The aDSP uses device channel mapping to
  620. * determine which channel gains to
  621. * use from this command. For example,
  622. * if the device is configured as stereo,
  623. * the aDSP uses only target_gain_ch_1 and
  624. * target_gain_ch_2, and it ignores
  625. * the others.
  626. */
  627. struct adm_session_copp_gain_v5 {
  628. u16 session_id;
  629. /* Handle of the ASM session.
  630. * Supported values: 1 to 8.
  631. */
  632. u16 copp_id;
  633. /* Handle of the COPP. Gain will be applied on the Session ID
  634. * COPP ID path.
  635. */
  636. u16 ramp_duration;
  637. /* Duration (in milliseconds) of the ramp over
  638. * which target gains are
  639. * to be applied. Use
  640. * #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE
  641. * to indicate that gain must be applied immediately.
  642. */
  643. u16 step_duration;
  644. /* Duration (in milliseconds) of each step in the ramp.
  645. * This parameter is ignored if ramp_duration is equal to
  646. * #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE.
  647. * Supported value: 1
  648. */
  649. u16 ramp_curve;
  650. /* Type of ramping curve.
  651. * Supported value: #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_CURVE_LINEAR
  652. */
  653. u16 reserved_for_align;
  654. /* Reserved. This field must be set to zero. */
  655. u16 target_gain_ch_1;
  656. /* Target linear gain for channel 1 in Q13 format; */
  657. u16 target_gain_ch_2;
  658. /* Target linear gain for channel 2 in Q13 format; */
  659. u16 target_gain_ch_3;
  660. /* Target linear gain for channel 3 in Q13 format; */
  661. u16 target_gain_ch_4;
  662. /* Target linear gain for channel 4 in Q13 format; */
  663. u16 target_gain_ch_5;
  664. /* Target linear gain for channel 5 in Q13 format; */
  665. u16 target_gain_ch_6;
  666. /* Target linear gain for channel 6 in Q13 format; */
  667. u16 target_gain_ch_7;
  668. /* Target linear gain for channel 7 in Q13 format; */
  669. u16 target_gain_ch_8;
  670. /* Target linear gain for channel 8 in Q13 format; */
  671. } __packed;
  672. /* Allows to set mute/unmute on various session-to-COPP paths.
  673. * For every session-to-COPP path (stream-device interconnection),
  674. * mute/unmute can be set individually on the output channels.
  675. */
  676. #define ADM_CMD_MATRIX_MUTE_V5 0x0001032D
  677. /* Indicates that mute/unmute in the
  678. * current adm_session_copp_mute_v5structure
  679. * is to be applied to all the session-to-COPP
  680. * paths that exist for the specified session.
  681. */
  682. #define ADM_CMD_MATRIX_MUTE_COPP_ID_ALL_CONNECTED_COPPS 0xFFFF
  683. /* Payload of the #ADM_CMD_MATRIX_MUTE_V5 command*/
  684. struct adm_cmd_matrix_mute_v5 {
  685. u32 matrix_id;
  686. /* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx (1).
  687. * Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX
  688. * macros to set this field.
  689. */
  690. u16 session_id;
  691. /* Handle of the ASM session.
  692. * Supported values: 1 to 8.
  693. */
  694. u16 copp_id;
  695. /* Handle of the COPP.
  696. * Use ADM_CMD_MATRIX_MUTE_COPP_ID_ALL_CONNECTED_COPPS
  697. * to indicate that mute/unmute must be applied to
  698. * all the COPPs connected to session_id.
  699. * Supported values:
  700. * - 0xFFFF -- Apply mute/unmute to all connected COPPs
  701. * - Other values -- Valid COPP ID
  702. */
  703. u8 mute_flag_ch_1;
  704. /* Mute flag for channel 1 is set to unmute (0) or mute (1). */
  705. u8 mute_flag_ch_2;
  706. /* Mute flag for channel 2 is set to unmute (0) or mute (1). */
  707. u8 mute_flag_ch_3;
  708. /* Mute flag for channel 3 is set to unmute (0) or mute (1). */
  709. u8 mute_flag_ch_4;
  710. /* Mute flag for channel 4 is set to unmute (0) or mute (1). */
  711. u8 mute_flag_ch_5;
  712. /* Mute flag for channel 5 is set to unmute (0) or mute (1). */
  713. u8 mute_flag_ch_6;
  714. /* Mute flag for channel 6 is set to unmute (0) or mute (1). */
  715. u8 mute_flag_ch_7;
  716. /* Mute flag for channel 7 is set to unmute (0) or mute (1). */
  717. u8 mute_flag_ch_8;
  718. /* Mute flag for channel 8 is set to unmute (0) or mute (1). */
  719. u16 ramp_duration;
  720. /* Period (in milliseconds) over which the soft mute/unmute will be
  721. * applied.
  722. * Supported values: 0 (Default) to 0xFFFF
  723. * The default of 0 means mute/unmute will be applied immediately.
  724. */
  725. u16 reserved_for_align;
  726. /* Clients must set this field to zero.*/
  727. } __packed;
  728. #define ASM_PARAM_ID_AAC_STEREO_MIX_COEFF_SELECTION_FLAG_V2 (0x00010DD8)
  729. struct asm_aac_stereo_mix_coeff_selection_param_v2 {
  730. struct apr_hdr hdr;
  731. u32 param_id;
  732. u32 param_size;
  733. u32 aac_stereo_mix_coeff_flag;
  734. } __packed;
  735. /* Allows a client to connect the desired stream to
  736. * the desired AFE port through the stream router
  737. *
  738. * This command allows the client to connect specified session to
  739. * specified AFE port. This is used for compressed streams only
  740. * opened using the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED or
  741. * #ASM_STREAM_CMD_OPEN_READ_COMPRESSED command.
  742. *
  743. * @prerequisites
  744. * Session ID and AFE Port ID must be valid.
  745. * #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED or
  746. * #ASM_STREAM_CMD_OPEN_READ_COMPRESSED
  747. * must have been called on this session.
  748. */
  749. #define ADM_CMD_CONNECT_AFE_PORT_V5 0x0001032E
  750. #define ADM_CMD_DISCONNECT_AFE_PORT_V5 0x0001032F
  751. /* Enumeration for the Rx stream router ID.*/
  752. #define ADM_STRTR_ID_RX 0
  753. /* Enumeration for the Tx stream router ID.*/
  754. #define ADM_STRTR_IDX 1
  755. /* Payload of the #ADM_CMD_CONNECT_AFE_PORT_V5 command.*/
  756. struct adm_cmd_connect_afe_port_v5 {
  757. struct apr_hdr hdr;
  758. u8 mode;
  759. /* ID of the stream router (RX/TX). Use the
  760. * ADM_STRTR_ID_RX or ADM_STRTR_IDX macros
  761. * to set this field.
  762. */
  763. u8 session_id;
  764. /* Session ID of the stream to connect */
  765. u16 afe_port_id;
  766. /* Port ID of the AFE port to connect to.*/
  767. u32 num_channels;
  768. /* Number of device channels
  769. * Supported values: 2(Audio Sample Packet),
  770. * 8 (HBR Audio Stream Sample Packet)
  771. */
  772. u32 sampling_rate;
  773. /* Device sampling rate
  774. * Supported values: Any
  775. */
  776. } __packed;
  777. /* adsp_adm_api.h */
  778. /* Port ID. Update afe_get_port_index
  779. * when a new port is added here.
  780. */
  781. #define PRIMARY_I2S_RX 0
  782. #define PRIMARY_I2S_TX 1
  783. #define SECONDARY_I2S_RX 4
  784. #define SECONDARY_I2S_TX 5
  785. #define MI2S_RX 6
  786. #define MI2S_TX 7
  787. #define HDMI_RX 8
  788. #define RSVD_2 9
  789. #define RSVD_3 10
  790. #define DIGI_MIC_TX 11
  791. #define VOICE2_PLAYBACK_TX 0x8002
  792. #define VOICE_RECORD_RX 0x8003
  793. #define VOICE_RECORD_TX 0x8004
  794. #define VOICE_PLAYBACK_TX 0x8005
  795. /* Slimbus Multi channel port id pool */
  796. #define SLIMBUS_0_RX 0x4000
  797. #define SLIMBUS_0_TX 0x4001
  798. #define SLIMBUS_1_RX 0x4002
  799. #define SLIMBUS_1_TX 0x4003
  800. #define SLIMBUS_2_RX 0x4004
  801. #define SLIMBUS_2_TX 0x4005
  802. #define SLIMBUS_3_RX 0x4006
  803. #define SLIMBUS_3_TX 0x4007
  804. #define SLIMBUS_4_RX 0x4008
  805. #define SLIMBUS_4_TX 0x4009
  806. #define SLIMBUS_5_RX 0x400a
  807. #define SLIMBUS_5_TX 0x400b
  808. #define SLIMBUS_6_RX 0x400c
  809. #define SLIMBUS_6_TX 0x400d
  810. #define SLIMBUS_7_RX 0x400e
  811. #define SLIMBUS_7_TX 0x400f
  812. #define SLIMBUS_8_RX 0x4010
  813. #define SLIMBUS_8_TX 0x4011
  814. #define SLIMBUS_PORT_LAST SLIMBUS_8_TX
  815. #define INT_BT_SCO_RX 0x3000
  816. #define INT_BT_SCO_TX 0x3001
  817. #define INT_BT_A2DP_RX 0x3002
  818. #define INT_FM_RX 0x3004
  819. #define INT_FM_TX 0x3005
  820. #define RT_PROXY_PORT_001_RX 0x2000
  821. #define RT_PROXY_PORT_001_TX 0x2001
  822. #define DISPLAY_PORT_RX 0x6020
  823. #define AFE_PORT_INVALID 0xFFFF
  824. #define SLIMBUS_INVALID AFE_PORT_INVALID
  825. #define AFE_PORT_CMD_START 0x000100ca
  826. #define AFE_EVENT_RTPORT_START 0
  827. #define AFE_EVENT_RTPORT_STOP 1
  828. #define AFE_EVENT_RTPORT_LOW_WM 2
  829. #define AFE_EVENT_RTPORT_HI_WM 3
  830. #define ADSP_AFE_VERSION 0x00200000
  831. /* Size of the range of port IDs for the audio interface. */
  832. #define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_SIZE 0xF
  833. /* Size of the range of port IDs for internal BT-FM ports. */
  834. #define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_SIZE 0x6
  835. /* Size of the range of port IDs for SLIMbus<sup>&reg;
  836. * </sup> multichannel
  837. * ports.
  838. */
  839. #define AFE_PORT_ID_SLIMBUS_RANGE_SIZE 0xA
  840. /* Size of the range of port IDs for real-time proxy ports. */
  841. #define AFE_PORT_ID_RT_PROXY_PORT_RANGE_SIZE 0x2
  842. /* Size of the range of port IDs for pseudoports. */
  843. #define AFE_PORT_ID_PSEUDOPORT_RANGE_SIZE 0x5
  844. /* Start of the range of port IDs for the audio interface. */
  845. #define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_START 0x1000
  846. /* End of the range of port IDs for the audio interface. */
  847. #define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_END \
  848. (AFE_PORT_ID_AUDIO_IF_PORT_RANGE_START +\
  849. AFE_PORT_ID_AUDIO_IF_PORT_RANGE_SIZE - 1)
  850. /* Start of the range of port IDs for real-time proxy ports. */
  851. #define AFE_PORT_ID_RT_PROXY_PORT_RANGE_START 0x2000
  852. /* End of the range of port IDs for real-time proxy ports. */
  853. #define AFE_PORT_ID_RT_PROXY_PORT_RANGE_END \
  854. (AFE_PORT_ID_RT_PROXY_PORT_RANGE_START +\
  855. AFE_PORT_ID_RT_PROXY_PORT_RANGE_SIZE-1)
  856. /* Start of the range of port IDs for internal BT-FM devices. */
  857. #define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_START 0x3000
  858. /* End of the range of port IDs for internal BT-FM devices. */
  859. #define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_END \
  860. (AFE_PORT_ID_INTERNAL_BT_FM_RANGE_START +\
  861. AFE_PORT_ID_INTERNAL_BT_FM_RANGE_SIZE-1)
  862. /* Start of the range of port IDs for SLIMbus devices. */
  863. #define AFE_PORT_ID_SLIMBUS_RANGE_START 0x4000
  864. /* End of the range of port IDs for SLIMbus devices. */
  865. #define AFE_PORT_ID_SLIMBUS_RANGE_END \
  866. (AFE_PORT_ID_SLIMBUS_RANGE_START +\
  867. AFE_PORT_ID_SLIMBUS_RANGE_SIZE-1)
  868. /* Start of the range of port IDs for pseudoports. */
  869. #define AFE_PORT_ID_PSEUDOPORT_RANGE_START 0x8001
  870. /* End of the range of port IDs for pseudoports. */
  871. #define AFE_PORT_ID_PSEUDOPORT_RANGE_END \
  872. (AFE_PORT_ID_PSEUDOPORT_RANGE_START +\
  873. AFE_PORT_ID_PSEUDOPORT_RANGE_SIZE-1)
  874. /* Start of the range of port IDs for TDM devices. */
  875. #define AFE_PORT_ID_TDM_PORT_RANGE_START 0x9000
  876. /* End of the range of port IDs for TDM devices. */
  877. #define AFE_PORT_ID_TDM_PORT_RANGE_END \
  878. (AFE_PORT_ID_TDM_PORT_RANGE_START+0x50-1)
  879. /* Size of the range of port IDs for TDM ports. */
  880. #define AFE_PORT_ID_TDM_PORT_RANGE_SIZE \
  881. (AFE_PORT_ID_TDM_PORT_RANGE_END - \
  882. AFE_PORT_ID_TDM_PORT_RANGE_START+1)
  883. #define AFE_PORT_ID_PRIMARY_MI2S_RX 0x1000
  884. #define AFE_PORT_ID_PRIMARY_MI2S_TX 0x1001
  885. #define AFE_PORT_ID_SECONDARY_MI2S_RX 0x1002
  886. #define AFE_PORT_ID_SECONDARY_MI2S_TX 0x1003
  887. #define AFE_PORT_ID_TERTIARY_MI2S_RX 0x1004
  888. #define AFE_PORT_ID_TERTIARY_MI2S_TX 0x1005
  889. #define AFE_PORT_ID_QUATERNARY_MI2S_RX 0x1006
  890. #define AFE_PORT_ID_QUATERNARY_MI2S_TX 0x1007
  891. #define AUDIO_PORT_ID_I2S_RX 0x1008
  892. #define AFE_PORT_ID_DIGITAL_MIC_TX 0x1009
  893. #define AFE_PORT_ID_PRIMARY_PCM_RX 0x100A
  894. #define AFE_PORT_ID_PRIMARY_PCM_TX 0x100B
  895. #define AFE_PORT_ID_SECONDARY_PCM_RX 0x100C
  896. #define AFE_PORT_ID_SECONDARY_PCM_TX 0x100D
  897. #define AFE_PORT_ID_MULTICHAN_HDMI_RX 0x100E
  898. #define AFE_PORT_ID_SECONDARY_MI2S_RX_SD1 0x1010
  899. #define AFE_PORT_ID_TERTIARY_PCM_RX 0x1012
  900. #define AFE_PORT_ID_TERTIARY_PCM_TX 0x1013
  901. #define AFE_PORT_ID_QUATERNARY_PCM_RX 0x1014
  902. #define AFE_PORT_ID_QUATERNARY_PCM_TX 0x1015
  903. #define AFE_PORT_ID_QUINARY_MI2S_RX 0x1016
  904. #define AFE_PORT_ID_QUINARY_MI2S_TX 0x1017
  905. /* ID of the senary MI2S Rx port. */
  906. #define AFE_PORT_ID_SENARY_MI2S_RX 0x1018
  907. /* ID of the senary MI2S Tx port. */
  908. #define AFE_PORT_ID_SENARY_MI2S_TX 0x1019
  909. /* ID of the Internal 0 MI2S Rx port */
  910. #define AFE_PORT_ID_INT0_MI2S_RX 0x102E
  911. /* ID of the Internal 0 MI2S Tx port */
  912. #define AFE_PORT_ID_INT0_MI2S_TX 0x102F
  913. /* ID of the Internal 1 MI2S Rx port */
  914. #define AFE_PORT_ID_INT1_MI2S_RX 0x1030
  915. /* ID of the Internal 1 MI2S Tx port */
  916. #define AFE_PORT_ID_INT1_MI2S_TX 0x1031
  917. /* ID of the Internal 2 MI2S Rx port */
  918. #define AFE_PORT_ID_INT2_MI2S_RX 0x1032
  919. /* ID of the Internal 2 MI2S Tx port */
  920. #define AFE_PORT_ID_INT2_MI2S_TX 0x1033
  921. /* ID of the Internal 3 MI2S Rx port */
  922. #define AFE_PORT_ID_INT3_MI2S_RX 0x1034
  923. /* ID of the Internal 3 MI2S Tx port */
  924. #define AFE_PORT_ID_INT3_MI2S_TX 0x1035
  925. /* ID of the Internal 4 MI2S Rx port */
  926. #define AFE_PORT_ID_INT4_MI2S_RX 0x1036
  927. /* ID of the Internal 4 MI2S Tx port */
  928. #define AFE_PORT_ID_INT4_MI2S_TX 0x1037
  929. /* ID of the Internal 5 MI2S Rx port */
  930. #define AFE_PORT_ID_INT5_MI2S_RX 0x1038
  931. /* ID of the Internal 5 MI2S Tx port */
  932. #define AFE_PORT_ID_INT5_MI2S_TX 0x1039
  933. /* ID of the Internal 6 MI2S Rx port */
  934. #define AFE_PORT_ID_INT6_MI2S_RX 0x103A
  935. /* ID of the Internal 6 MI2S Tx port */
  936. #define AFE_PORT_ID_INT6_MI2S_TX 0x103B
  937. #define AFE_PORT_ID_QUINARY_PCM_RX 0x103C
  938. #define AFE_PORT_ID_QUINARY_PCM_TX 0x103D
  939. #define AFE_PORT_ID_SPDIF_RX 0x5000
  940. #define AFE_PORT_ID_RT_PROXY_PORT_001_RX 0x2000
  941. #define AFE_PORT_ID_RT_PROXY_PORT_001_TX 0x2001
  942. #define AFE_PORT_ID_INTERNAL_BT_SCO_RX 0x3000
  943. #define AFE_PORT_ID_INTERNAL_BT_SCO_TX 0x3001
  944. #define AFE_PORT_ID_INTERNAL_BT_A2DP_RX 0x3002
  945. #define AFE_PORT_ID_INTERNAL_FM_RX 0x3004
  946. #define AFE_PORT_ID_INTERNAL_FM_TX 0x3005
  947. /* SLIMbus Rx port on channel 0. */
  948. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_RX 0x4000
  949. /* SLIMbus Tx port on channel 0. */
  950. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_TX 0x4001
  951. /* SLIMbus Rx port on channel 1. */
  952. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_RX 0x4002
  953. /* SLIMbus Tx port on channel 1. */
  954. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_TX 0x4003
  955. /* SLIMbus Rx port on channel 2. */
  956. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_RX 0x4004
  957. /* SLIMbus Tx port on channel 2. */
  958. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_TX 0x4005
  959. /* SLIMbus Rx port on channel 3. */
  960. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_RX 0x4006
  961. /* SLIMbus Tx port on channel 3. */
  962. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_TX 0x4007
  963. /* SLIMbus Rx port on channel 4. */
  964. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_RX 0x4008
  965. /* SLIMbus Tx port on channel 4. */
  966. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_TX 0x4009
  967. /* SLIMbus Rx port on channel 5. */
  968. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_5_RX 0x400a
  969. /* SLIMbus Tx port on channel 5. */
  970. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_5_TX 0x400b
  971. /* SLIMbus Rx port on channel 6. */
  972. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_6_RX 0x400c
  973. /* SLIMbus Tx port on channel 6. */
  974. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_6_TX 0x400d
  975. /* SLIMbus Rx port on channel 7. */
  976. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_7_RX 0x400e
  977. /* SLIMbus Tx port on channel 7. */
  978. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_7_TX 0x400f
  979. /* SLIMbus Rx port on channel 8. */
  980. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_8_RX 0x4010
  981. /* SLIMbus Tx port on channel 8. */
  982. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_8_TX 0x4011
  983. /* AFE Rx port for audio over Display port */
  984. #define AFE_PORT_ID_HDMI_OVER_DP_RX 0x6020
  985. /*USB AFE port */
  986. #define AFE_PORT_ID_USB_RX 0x7000
  987. #define AFE_PORT_ID_USB_TX 0x7001
  988. /* Generic pseudoport 1. */
  989. #define AFE_PORT_ID_PSEUDOPORT_01 0x8001
  990. /* Generic pseudoport 2. */
  991. #define AFE_PORT_ID_PSEUDOPORT_02 0x8002
  992. /* @xreflabel{hdr:AfePortIdPrimaryAuxPcmTx}
  993. * Primary Aux PCM Tx port ID.
  994. */
  995. #define AFE_PORT_ID_PRIMARY_PCM_TX 0x100B
  996. /* Pseudoport that corresponds to the voice Rx path.
  997. * For recording, the voice Rx path samples are written to this
  998. * port and consumed by the audio path.
  999. */
  1000. #define AFE_PORT_ID_VOICE_RECORD_RX 0x8003
  1001. /* Pseudoport that corresponds to the voice Tx path.
  1002. * For recording, the voice Tx path samples are written to this
  1003. * port and consumed by the audio path.
  1004. */
  1005. #define AFE_PORT_ID_VOICE_RECORD_TX 0x8004
  1006. /* Pseudoport that corresponds to in-call voice delivery samples.
  1007. * During in-call audio delivery, the audio path delivers samples
  1008. * to this port from where the voice path delivers them on the
  1009. * Rx path.
  1010. */
  1011. #define AFE_PORT_ID_VOICE2_PLAYBACK_TX 0x8002
  1012. #define AFE_PORT_ID_VOICE_PLAYBACK_TX 0x8005
  1013. #define AFE_PORT_ID_PRIMARY_TDM_RX \
  1014. (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x00)
  1015. #define AFE_PORT_ID_PRIMARY_TDM_RX_1 \
  1016. (AFE_PORT_ID_PRIMARY_TDM_RX + 0x02)
  1017. #define AFE_PORT_ID_PRIMARY_TDM_RX_2 \
  1018. (AFE_PORT_ID_PRIMARY_TDM_RX + 0x04)
  1019. #define AFE_PORT_ID_PRIMARY_TDM_RX_3 \
  1020. (AFE_PORT_ID_PRIMARY_TDM_RX + 0x06)
  1021. #define AFE_PORT_ID_PRIMARY_TDM_RX_4 \
  1022. (AFE_PORT_ID_PRIMARY_TDM_RX + 0x08)
  1023. #define AFE_PORT_ID_PRIMARY_TDM_RX_5 \
  1024. (AFE_PORT_ID_PRIMARY_TDM_RX + 0x0A)
  1025. #define AFE_PORT_ID_PRIMARY_TDM_RX_6 \
  1026. (AFE_PORT_ID_PRIMARY_TDM_RX + 0x0C)
  1027. #define AFE_PORT_ID_PRIMARY_TDM_RX_7 \
  1028. (AFE_PORT_ID_PRIMARY_TDM_RX + 0x0E)
  1029. #define AFE_PORT_ID_PRIMARY_TDM_TX \
  1030. (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x01)
  1031. #define AFE_PORT_ID_PRIMARY_TDM_TX_1 \
  1032. (AFE_PORT_ID_PRIMARY_TDM_TX + 0x02)
  1033. #define AFE_PORT_ID_PRIMARY_TDM_TX_2 \
  1034. (AFE_PORT_ID_PRIMARY_TDM_TX + 0x04)
  1035. #define AFE_PORT_ID_PRIMARY_TDM_TX_3 \
  1036. (AFE_PORT_ID_PRIMARY_TDM_TX + 0x06)
  1037. #define AFE_PORT_ID_PRIMARY_TDM_TX_4 \
  1038. (AFE_PORT_ID_PRIMARY_TDM_TX + 0x08)
  1039. #define AFE_PORT_ID_PRIMARY_TDM_TX_5 \
  1040. (AFE_PORT_ID_PRIMARY_TDM_TX + 0x0A)
  1041. #define AFE_PORT_ID_PRIMARY_TDM_TX_6 \
  1042. (AFE_PORT_ID_PRIMARY_TDM_TX + 0x0C)
  1043. #define AFE_PORT_ID_PRIMARY_TDM_TX_7 \
  1044. (AFE_PORT_ID_PRIMARY_TDM_TX + 0x0E)
  1045. #define AFE_PORT_ID_SECONDARY_TDM_RX \
  1046. (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x10)
  1047. #define AFE_PORT_ID_SECONDARY_TDM_RX_1 \
  1048. (AFE_PORT_ID_SECONDARY_TDM_RX + 0x02)
  1049. #define AFE_PORT_ID_SECONDARY_TDM_RX_2 \
  1050. (AFE_PORT_ID_SECONDARY_TDM_RX + 0x04)
  1051. #define AFE_PORT_ID_SECONDARY_TDM_RX_3 \
  1052. (AFE_PORT_ID_SECONDARY_TDM_RX + 0x06)
  1053. #define AFE_PORT_ID_SECONDARY_TDM_RX_4 \
  1054. (AFE_PORT_ID_SECONDARY_TDM_RX + 0x08)
  1055. #define AFE_PORT_ID_SECONDARY_TDM_RX_5 \
  1056. (AFE_PORT_ID_SECONDARY_TDM_RX + 0x0A)
  1057. #define AFE_PORT_ID_SECONDARY_TDM_RX_6 \
  1058. (AFE_PORT_ID_SECONDARY_TDM_RX + 0x0C)
  1059. #define AFE_PORT_ID_SECONDARY_TDM_RX_7 \
  1060. (AFE_PORT_ID_SECONDARY_TDM_RX + 0x0E)
  1061. #define AFE_PORT_ID_SECONDARY_TDM_TX \
  1062. (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x11)
  1063. #define AFE_PORT_ID_SECONDARY_TDM_TX_1 \
  1064. (AFE_PORT_ID_SECONDARY_TDM_TX + 0x02)
  1065. #define AFE_PORT_ID_SECONDARY_TDM_TX_2 \
  1066. (AFE_PORT_ID_SECONDARY_TDM_TX + 0x04)
  1067. #define AFE_PORT_ID_SECONDARY_TDM_TX_3 \
  1068. (AFE_PORT_ID_SECONDARY_TDM_TX + 0x06)
  1069. #define AFE_PORT_ID_SECONDARY_TDM_TX_4 \
  1070. (AFE_PORT_ID_SECONDARY_TDM_TX + 0x08)
  1071. #define AFE_PORT_ID_SECONDARY_TDM_TX_5 \
  1072. (AFE_PORT_ID_SECONDARY_TDM_TX + 0x0A)
  1073. #define AFE_PORT_ID_SECONDARY_TDM_TX_6 \
  1074. (AFE_PORT_ID_SECONDARY_TDM_TX + 0x0C)
  1075. #define AFE_PORT_ID_SECONDARY_TDM_TX_7 \
  1076. (AFE_PORT_ID_SECONDARY_TDM_TX + 0x0E)
  1077. #define AFE_PORT_ID_TERTIARY_TDM_RX \
  1078. (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x20)
  1079. #define AFE_PORT_ID_TERTIARY_TDM_RX_1 \
  1080. (AFE_PORT_ID_TERTIARY_TDM_RX + 0x02)
  1081. #define AFE_PORT_ID_TERTIARY_TDM_RX_2 \
  1082. (AFE_PORT_ID_TERTIARY_TDM_RX + 0x04)
  1083. #define AFE_PORT_ID_TERTIARY_TDM_RX_3 \
  1084. (AFE_PORT_ID_TERTIARY_TDM_RX + 0x06)
  1085. #define AFE_PORT_ID_TERTIARY_TDM_RX_4 \
  1086. (AFE_PORT_ID_TERTIARY_TDM_RX + 0x08)
  1087. #define AFE_PORT_ID_TERTIARY_TDM_RX_5 \
  1088. (AFE_PORT_ID_TERTIARY_TDM_RX + 0x0A)
  1089. #define AFE_PORT_ID_TERTIARY_TDM_RX_6 \
  1090. (AFE_PORT_ID_TERTIARY_TDM_RX + 0x0C)
  1091. #define AFE_PORT_ID_TERTIARY_TDM_RX_7 \
  1092. (AFE_PORT_ID_TERTIARY_TDM_RX + 0x0E)
  1093. #define AFE_PORT_ID_TERTIARY_TDM_TX \
  1094. (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x21)
  1095. #define AFE_PORT_ID_TERTIARY_TDM_TX_1 \
  1096. (AFE_PORT_ID_TERTIARY_TDM_TX + 0x02)
  1097. #define AFE_PORT_ID_TERTIARY_TDM_TX_2 \
  1098. (AFE_PORT_ID_TERTIARY_TDM_TX + 0x04)
  1099. #define AFE_PORT_ID_TERTIARY_TDM_TX_3 \
  1100. (AFE_PORT_ID_TERTIARY_TDM_TX + 0x06)
  1101. #define AFE_PORT_ID_TERTIARY_TDM_TX_4 \
  1102. (AFE_PORT_ID_TERTIARY_TDM_TX + 0x08)
  1103. #define AFE_PORT_ID_TERTIARY_TDM_TX_5 \
  1104. (AFE_PORT_ID_TERTIARY_TDM_TX + 0x0A)
  1105. #define AFE_PORT_ID_TERTIARY_TDM_TX_6 \
  1106. (AFE_PORT_ID_TERTIARY_TDM_TX + 0x0C)
  1107. #define AFE_PORT_ID_TERTIARY_TDM_TX_7 \
  1108. (AFE_PORT_ID_TERTIARY_TDM_TX + 0x0E)
  1109. #define AFE_PORT_ID_QUATERNARY_TDM_RX \
  1110. (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x30)
  1111. #define AFE_PORT_ID_QUATERNARY_TDM_RX_1 \
  1112. (AFE_PORT_ID_QUATERNARY_TDM_RX + 0x02)
  1113. #define AFE_PORT_ID_QUATERNARY_TDM_RX_2 \
  1114. (AFE_PORT_ID_QUATERNARY_TDM_RX + 0x04)
  1115. #define AFE_PORT_ID_QUATERNARY_TDM_RX_3 \
  1116. (AFE_PORT_ID_QUATERNARY_TDM_RX + 0x06)
  1117. #define AFE_PORT_ID_QUATERNARY_TDM_RX_4 \
  1118. (AFE_PORT_ID_QUATERNARY_TDM_RX + 0x08)
  1119. #define AFE_PORT_ID_QUATERNARY_TDM_RX_5 \
  1120. (AFE_PORT_ID_QUATERNARY_TDM_RX + 0x0A)
  1121. #define AFE_PORT_ID_QUATERNARY_TDM_RX_6 \
  1122. (AFE_PORT_ID_QUATERNARY_TDM_RX + 0x0C)
  1123. #define AFE_PORT_ID_QUATERNARY_TDM_RX_7 \
  1124. (AFE_PORT_ID_QUATERNARY_TDM_RX + 0x0E)
  1125. #define AFE_PORT_ID_QUATERNARY_TDM_TX \
  1126. (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x31)
  1127. #define AFE_PORT_ID_QUATERNARY_TDM_TX_1 \
  1128. (AFE_PORT_ID_QUATERNARY_TDM_TX + 0x02)
  1129. #define AFE_PORT_ID_QUATERNARY_TDM_TX_2 \
  1130. (AFE_PORT_ID_QUATERNARY_TDM_TX + 0x04)
  1131. #define AFE_PORT_ID_QUATERNARY_TDM_TX_3 \
  1132. (AFE_PORT_ID_QUATERNARY_TDM_TX + 0x06)
  1133. #define AFE_PORT_ID_QUATERNARY_TDM_TX_4 \
  1134. (AFE_PORT_ID_QUATERNARY_TDM_TX + 0x08)
  1135. #define AFE_PORT_ID_QUATERNARY_TDM_TX_5 \
  1136. (AFE_PORT_ID_QUATERNARY_TDM_TX + 0x0A)
  1137. #define AFE_PORT_ID_QUATERNARY_TDM_TX_6 \
  1138. (AFE_PORT_ID_QUATERNARY_TDM_TX + 0x0C)
  1139. #define AFE_PORT_ID_QUATERNARY_TDM_TX_7 \
  1140. (AFE_PORT_ID_QUATERNARY_TDM_TX + 0x0E)
  1141. #define AFE_PORT_ID_QUINARY_TDM_RX \
  1142. (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x40)
  1143. #define AFE_PORT_ID_QUINARY_TDM_RX_1 \
  1144. (AFE_PORT_ID_QUINARY_TDM_RX + 0x02)
  1145. #define AFE_PORT_ID_QUINARY_TDM_RX_2 \
  1146. (AFE_PORT_ID_QUINARY_TDM_RX + 0x04)
  1147. #define AFE_PORT_ID_QUINARY_TDM_RX_3 \
  1148. (AFE_PORT_ID_QUINARY_TDM_RX + 0x06)
  1149. #define AFE_PORT_ID_QUINARY_TDM_RX_4 \
  1150. (AFE_PORT_ID_QUINARY_TDM_RX + 0x08)
  1151. #define AFE_PORT_ID_QUINARY_TDM_RX_5 \
  1152. (AFE_PORT_ID_QUINARY_TDM_RX + 0x0A)
  1153. #define AFE_PORT_ID_QUINARY_TDM_RX_6 \
  1154. (AFE_PORT_ID_QUINARY_TDM_RX + 0x0C)
  1155. #define AFE_PORT_ID_QUINARY_TDM_RX_7 \
  1156. (AFE_PORT_ID_QUINARY_TDM_RX + 0x0E)
  1157. #define AFE_PORT_ID_QUINARY_TDM_TX \
  1158. (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x41)
  1159. #define AFE_PORT_ID_QUINARY_TDM_TX_1 \
  1160. (AFE_PORT_ID_QUINARY_TDM_TX + 0x02)
  1161. #define AFE_PORT_ID_QUINARY_TDM_TX_2 \
  1162. (AFE_PORT_ID_QUINARY_TDM_TX + 0x04)
  1163. #define AFE_PORT_ID_QUINARY_TDM_TX_3 \
  1164. (AFE_PORT_ID_QUINARY_TDM_TX + 0x06)
  1165. #define AFE_PORT_ID_QUINARY_TDM_TX_4 \
  1166. (AFE_PORT_ID_QUINARY_TDM_TX + 0x08)
  1167. #define AFE_PORT_ID_QUINARY_TDM_TX_5 \
  1168. (AFE_PORT_ID_QUINARY_TDM_TX + 0x0A)
  1169. #define AFE_PORT_ID_QUINARY_TDM_TX_6 \
  1170. (AFE_PORT_ID_QUINARY_TDM_TX + 0x0C)
  1171. #define AFE_PORT_ID_QUINARY_TDM_TX_7 \
  1172. (AFE_PORT_ID_QUINARY_TDM_TX + 0x0E)
  1173. #define AFE_PORT_ID_INVALID 0xFFFF
  1174. #define AAC_ENC_MODE_AAC_LC 0x02
  1175. #define AAC_ENC_MODE_AAC_P 0x05
  1176. #define AAC_ENC_MODE_EAAC_P 0x1D
  1177. #define AFE_PSEUDOPORT_CMD_START 0x000100cf
  1178. struct afe_pseudoport_start_command {
  1179. struct apr_hdr hdr;
  1180. u16 port_id; /* Pseudo Port 1 = 0x8000 */
  1181. /* Pseudo Port 2 = 0x8001 */
  1182. /* Pseudo Port 3 = 0x8002 */
  1183. u16 timing; /* FTRT = 0 , AVTimer = 1, */
  1184. } __packed;
  1185. #define AFE_PSEUDOPORT_CMD_STOP 0x000100d0
  1186. struct afe_pseudoport_stop_command {
  1187. struct apr_hdr hdr;
  1188. u16 port_id; /* Pseudo Port 1 = 0x8000 */
  1189. /* Pseudo Port 2 = 0x8001 */
  1190. /* Pseudo Port 3 = 0x8002 */
  1191. u16 reserved;
  1192. } __packed;
  1193. #define AFE_MODULE_SIDETONE_IIR_FILTER 0x00010202
  1194. #define AFE_PARAM_ID_ENABLE 0x00010203
  1195. /* Payload of the #AFE_PARAM_ID_ENABLE
  1196. * parameter, which enables or
  1197. * disables any module.
  1198. * The fixed size of this structure is four bytes.
  1199. */
  1200. struct afe_mod_enable_param {
  1201. u16 enable;
  1202. /* Enables (1) or disables (0) the module. */
  1203. u16 reserved;
  1204. /* This field must be set to zero. */
  1205. } __packed;
  1206. /* ID of the configuration parameter used by the
  1207. * #AFE_MODULE_SIDETONE_IIR_FILTER module.
  1208. */
  1209. #define AFE_PARAM_ID_SIDETONE_IIR_FILTER_CONFIG 0x00010204
  1210. #define MAX_SIDETONE_IIR_DATA_SIZE 224
  1211. #define MAX_NO_IIR_FILTER_STAGE 10
  1212. struct afe_sidetone_iir_filter_config_params {
  1213. u16 num_biquad_stages;
  1214. /* Number of stages.
  1215. * Supported values: Minimum of 5 and maximum of 10
  1216. */
  1217. u16 pregain;
  1218. /* Pregain for the compensating filter response.
  1219. * Supported values: Any number in Q13 format
  1220. */
  1221. uint8_t iir_config[MAX_SIDETONE_IIR_DATA_SIZE];
  1222. } __packed;
  1223. #define AFE_MODULE_LOOPBACK 0x00010205
  1224. #define AFE_PARAM_ID_LOOPBACK_GAIN_PER_PATH 0x00010206
  1225. /* Payload of the #AFE_PARAM_ID_LOOPBACK_GAIN_PER_PATH parameter,
  1226. * which gets/sets loopback gain of a port to an Rx port.
  1227. * The Tx port ID of the loopback is part of the set_param command.
  1228. */
  1229. /* Payload of the #AFE_PORT_CMD_SET_PARAM_V2 command's
  1230. * configuration/calibration settings for the AFE port.
  1231. */
  1232. struct afe_port_cmd_set_param_v2 {
  1233. u16 port_id;
  1234. /* Port interface and direction (Rx or Tx) to start. */
  1235. u16 payload_size;
  1236. /* Actual size of the payload in bytes.
  1237. * This is used for parsing the parameter payload.
  1238. * Supported values: > 0
  1239. */
  1240. u32 payload_address_lsw;
  1241. /* LSW of 64 bit Payload address.
  1242. * Address should be 32-byte,
  1243. * 4kbyte aligned and must be contiguous memory.
  1244. */
  1245. u32 payload_address_msw;
  1246. /* MSW of 64 bit Payload address.
  1247. * In case of 32-bit shared memory address,
  1248. * this field must be set to zero.
  1249. * In case of 36-bit shared memory address,
  1250. * bit-4 to bit-31 must be set to zero.
  1251. * Address should be 32-byte, 4kbyte aligned
  1252. * and must be contiguous memory.
  1253. */
  1254. u32 mem_map_handle;
  1255. /* Memory map handle returned by
  1256. * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands.
  1257. * Supported Values:
  1258. * - NULL -- Message. The parameter data is in-band.
  1259. * - Non-NULL -- The parameter data is Out-band.Pointer to
  1260. * the physical address
  1261. * in shared memory of the payload data.
  1262. * An optional field is available if parameter
  1263. * data is in-band:
  1264. * afe_param_data_v2 param_data[...].
  1265. * For detailed payload content, see the
  1266. * afe_port_param_data_v2 structure.
  1267. */
  1268. } __packed;
  1269. #define AFE_PORT_CMD_SET_PARAM_V2 0x000100EF
  1270. struct afe_port_param_data_v2 {
  1271. u32 module_id;
  1272. /* ID of the module to be configured.
  1273. * Supported values: Valid module ID
  1274. */
  1275. u32 param_id;
  1276. /* ID of the parameter corresponding to the supported parameters
  1277. * for the module ID.
  1278. * Supported values: Valid parameter ID
  1279. */
  1280. u16 param_size;
  1281. /* Actual size of the data for the
  1282. * module_id/param_id pair. The size is a
  1283. * multiple of four bytes.
  1284. * Supported values: > 0
  1285. */
  1286. u16 reserved;
  1287. /* This field must be set to zero.
  1288. */
  1289. } __packed;
  1290. struct afe_loopback_gain_per_path_param {
  1291. struct apr_hdr hdr;
  1292. struct afe_port_cmd_set_param_v2 param;
  1293. struct afe_port_param_data_v2 pdata;
  1294. u16 rx_port_id;
  1295. /* Rx port of the loopback. */
  1296. u16 gain;
  1297. /* Loopback gain per path of the port.
  1298. * Supported values: Any number in Q13 format
  1299. */
  1300. } __packed;
  1301. /* Parameter ID used to configure and enable/disable the
  1302. * loopback path. The difference with respect to the existing
  1303. * API, AFE_PORT_CMD_LOOPBACK, is that it allows Rx port to be
  1304. * configured as source port in loopback path. Port-id in
  1305. * AFE_PORT_CMD_SET_PARAM cmd is the source port which can be
  1306. * Tx or Rx port. In addition, we can configure the type of
  1307. * routing mode to handle different use cases.
  1308. */
  1309. #define AFE_PARAM_ID_LOOPBACK_CONFIG 0x0001020B
  1310. #define AFE_API_VERSION_LOOPBACK_CONFIG 0x1
  1311. enum afe_loopback_routing_mode {
  1312. LB_MODE_DEFAULT = 1,
  1313. /* Regular loopback from source to destination port */
  1314. LB_MODE_SIDETONE,
  1315. /* Sidetone feed from Tx source to Rx destination port */
  1316. LB_MODE_EC_REF_VOICE_AUDIO,
  1317. /* Echo canceller reference, voice + audio + DTMF */
  1318. LB_MODE_EC_REF_VOICE
  1319. /* Echo canceller reference, voice alone */
  1320. } __packed;
  1321. /* Payload of the #AFE_PARAM_ID_LOOPBACK_CONFIG ,
  1322. * which enables/disables one AFE loopback.
  1323. */
  1324. struct afe_loopback_cfg_v1 {
  1325. struct apr_hdr hdr;
  1326. struct afe_port_cmd_set_param_v2 param;
  1327. struct afe_port_param_data_v2 pdata;
  1328. u32 loopback_cfg_minor_version;
  1329. /* Minor version used for tracking the version of the RMC module
  1330. * configuration interface.
  1331. * Supported values: #AFE_API_VERSION_LOOPBACK_CONFIG
  1332. */
  1333. u16 dst_port_id;
  1334. /* Destination Port Id. */
  1335. u16 routing_mode;
  1336. /* Specifies data path type from src to dest port.
  1337. * Supported values:
  1338. * #LB_MODE_DEFAULT
  1339. * #LB_MODE_SIDETONE
  1340. * #LB_MODE_EC_REF_VOICE_AUDIO
  1341. * #LB_MODE_EC_REF_VOICE_A
  1342. * #LB_MODE_EC_REF_VOICE
  1343. */
  1344. u16 enable;
  1345. /* Specifies whether to enable (1) or
  1346. * disable (0) an AFE loopback.
  1347. */
  1348. u16 reserved;
  1349. /* Reserved for 32-bit alignment. This field must be set to 0.
  1350. */
  1351. } __packed;
  1352. struct afe_loopback_sidetone_gain {
  1353. u16 rx_port_id;
  1354. u16 gain;
  1355. } __packed;
  1356. struct loopback_cfg_data {
  1357. u32 loopback_cfg_minor_version;
  1358. /* Minor version used for tracking the version of the RMC module
  1359. * configuration interface.
  1360. * Supported values: #AFE_API_VERSION_LOOPBACK_CONFIG
  1361. */
  1362. u16 dst_port_id;
  1363. /* Destination Port Id. */
  1364. u16 routing_mode;
  1365. /* Specifies data path type from src to dest port.
  1366. * Supported values:
  1367. * #LB_MODE_DEFAULT
  1368. * #LB_MODE_SIDETONE
  1369. * #LB_MODE_EC_REF_VOICE_AUDIO
  1370. * #LB_MODE_EC_REF_VOICE_A
  1371. * #LB_MODE_EC_REF_VOICE
  1372. */
  1373. u16 enable;
  1374. /* Specifies whether to enable (1) or
  1375. * disable (0) an AFE loopback.
  1376. */
  1377. u16 reserved;
  1378. /* Reserved for 32-bit alignment. This field must be set to 0.
  1379. */
  1380. } __packed;
  1381. struct afe_st_loopback_cfg_v1 {
  1382. struct apr_hdr hdr;
  1383. struct afe_port_cmd_set_param_v2 param;
  1384. struct afe_port_param_data_v2 gain_pdata;
  1385. struct afe_loopback_sidetone_gain gain_data;
  1386. struct afe_port_param_data_v2 cfg_pdata;
  1387. struct loopback_cfg_data cfg_data;
  1388. } __packed;
  1389. struct afe_loopback_iir_cfg_v2 {
  1390. struct apr_hdr hdr;
  1391. struct afe_port_cmd_set_param_v2 param;
  1392. struct afe_port_param_data_v2 st_iir_enable_pdata;
  1393. struct afe_mod_enable_param st_iir_mode_enable_data;
  1394. struct afe_port_param_data_v2 st_iir_filter_config_pdata;
  1395. struct afe_sidetone_iir_filter_config_params st_iir_filter_config_data;
  1396. } __packed;
  1397. #define AFE_MODULE_SPEAKER_PROTECTION 0x00010209
  1398. #define AFE_PARAM_ID_SPKR_PROT_CONFIG 0x0001020a
  1399. #define AFE_API_VERSION_SPKR_PROT_CONFIG 0x1
  1400. #define AFE_SPKR_PROT_EXCURSIONF_LEN 512
  1401. struct afe_spkr_prot_cfg_param_v1 {
  1402. u32 spkr_prot_minor_version;
  1403. /*
  1404. * Minor version used for tracking the version of the
  1405. * speaker protection module configuration interface.
  1406. * Supported values: #AFE_API_VERSION_SPKR_PROT_CONFIG
  1407. */
  1408. int16_t win_size;
  1409. /* Analysis and synthesis window size (nWinSize).
  1410. * Supported values: 1024, 512, 256 samples
  1411. */
  1412. int16_t margin;
  1413. /* Allowable margin for excursion prediction,
  1414. * in L16Q15 format. This is a
  1415. * control parameter to allow
  1416. * for overestimation of peak excursion.
  1417. */
  1418. int16_t spkr_exc_limit;
  1419. /* Speaker excursion limit, in L16Q15 format.*/
  1420. int16_t spkr_resonance_freq;
  1421. /* Resonance frequency of the speaker; used
  1422. * to define a frequency range
  1423. * for signal modification.
  1424. *
  1425. * Supported values: 0 to 2000 Hz
  1426. */
  1427. int16_t limhresh;
  1428. /* Threshold of the hard limiter; used to
  1429. * prevent overshooting beyond a
  1430. * signal level that was set by the limiter
  1431. * prior to speaker protection.
  1432. * Supported values: 0 to 32767
  1433. */
  1434. int16_t hpf_cut_off_freq;
  1435. /* High pass filter cutoff frequency.
  1436. * Supported values: 100, 200, 300 Hz
  1437. */
  1438. int16_t hpf_enable;
  1439. /* Specifies whether the high pass filter
  1440. * is enabled (0) or disabled (1).
  1441. */
  1442. int16_t reserved;
  1443. /* This field must be set to zero. */
  1444. int32_t amp_gain;
  1445. /* Amplifier gain in L32Q15 format.
  1446. * This is the RMS voltage at the
  1447. * loudspeaker when a 0dBFS tone
  1448. * is played in the digital domain.
  1449. */
  1450. int16_t excursionf[AFE_SPKR_PROT_EXCURSIONF_LEN];
  1451. /* Array of the excursion transfer function.
  1452. * The peak excursion of the
  1453. * loudspeaker diaphragm is
  1454. * measured in millimeters for 1 Vrms Sine
  1455. * tone at all FFT bin frequencies.
  1456. * Supported values: Q15 format
  1457. */
  1458. } __packed;
  1459. #define AFE_SERVICE_CMD_REGISTER_RT_PORT_DRIVER 0x000100E0
  1460. /* Payload of the #AFE_SERVICE_CMD_REGISTER_RT_PORT_DRIVER
  1461. * command, which registers a real-time port driver
  1462. * with the AFE service.
  1463. */
  1464. struct afe_service_cmd_register_rt_port_driver {
  1465. struct apr_hdr hdr;
  1466. u16 port_id;
  1467. /* Port ID with which the real-time driver exchanges data
  1468. * (registers for events).
  1469. * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
  1470. * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
  1471. */
  1472. u16 reserved;
  1473. /* This field must be set to zero. */
  1474. } __packed;
  1475. #define AFE_SERVICE_CMD_UNREGISTER_RT_PORT_DRIVER 0x000100E1
  1476. /* Payload of the #AFE_SERVICE_CMD_UNREGISTER_RT_PORT_DRIVER
  1477. * command, which unregisters a real-time port driver from
  1478. * the AFE service.
  1479. */
  1480. struct afe_service_cmd_unregister_rt_port_driver {
  1481. struct apr_hdr hdr;
  1482. u16 port_id;
  1483. /* Port ID from which the real-time
  1484. * driver unregisters for events.
  1485. * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
  1486. * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
  1487. */
  1488. u16 reserved;
  1489. /* This field must be set to zero. */
  1490. } __packed;
  1491. #define AFE_EVENT_RT_PROXY_PORT_STATUS 0x00010105
  1492. #define AFE_EVENTYPE_RT_PROXY_PORT_START 0
  1493. #define AFE_EVENTYPE_RT_PROXY_PORT_STOP 1
  1494. #define AFE_EVENTYPE_RT_PROXY_PORT_LOW_WATER_MARK 2
  1495. #define AFE_EVENTYPE_RT_PROXY_PORT_HIGH_WATER_MARK 3
  1496. #define AFE_EVENTYPE_RT_PROXY_PORT_INVALID 0xFFFF
  1497. /* Payload of the #AFE_EVENT_RT_PROXY_PORT_STATUS
  1498. * message, which sends an event from the AFE service
  1499. * to a registered client.
  1500. */
  1501. struct afe_event_rt_proxy_port_status {
  1502. u16 port_id;
  1503. /* Port ID to which the event is sent.
  1504. * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
  1505. * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
  1506. */
  1507. u16 eventype;
  1508. /* Type of event.
  1509. * Supported values:
  1510. * - #AFE_EVENTYPE_RT_PROXY_PORT_START
  1511. * - #AFE_EVENTYPE_RT_PROXY_PORT_STOP
  1512. * - #AFE_EVENTYPE_RT_PROXY_PORT_LOW_WATER_MARK
  1513. * - #AFE_EVENTYPE_RT_PROXY_PORT_HIGH_WATER_MARK
  1514. */
  1515. } __packed;
  1516. #define AFE_PORT_DATA_CMD_RT_PROXY_PORT_WRITE_V2 0x000100ED
  1517. struct afe_port_data_cmd_rt_proxy_port_write_v2 {
  1518. struct apr_hdr hdr;
  1519. u16 port_id;
  1520. /* Tx (mic) proxy port ID with which the real-time
  1521. * driver exchanges data.
  1522. * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
  1523. * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
  1524. */
  1525. u16 reserved;
  1526. /* This field must be set to zero. */
  1527. u32 buffer_address_lsw;
  1528. /* LSW Address of the buffer containing the
  1529. * data from the real-time source
  1530. * device on a client.
  1531. */
  1532. u32 buffer_address_msw;
  1533. /* MSW Address of the buffer containing the
  1534. * data from the real-time source
  1535. * device on a client.
  1536. */
  1537. u32 mem_map_handle;
  1538. /* A memory map handle encapsulating shared memory
  1539. * attributes is returned if
  1540. * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS
  1541. * command is successful.
  1542. * Supported Values:
  1543. * - Any 32 bit value
  1544. */
  1545. u32 available_bytes;
  1546. /* Number of valid bytes available
  1547. * in the buffer (including all
  1548. * channels: number of bytes per
  1549. * channel = availableBytesumChannels).
  1550. * Supported values: > 0
  1551. *
  1552. * This field must be equal to the frame
  1553. * size specified in the #AFE_PORT_AUDIO_IF_CONFIG
  1554. * command that was sent to configure this
  1555. * port.
  1556. */
  1557. } __packed;
  1558. #define AFE_PORT_DATA_CMD_RT_PROXY_PORT_READ_V2 0x000100EE
  1559. /* Payload of the
  1560. * #AFE_PORT_DATA_CMD_RT_PROXY_PORT_READ_V2 command, which
  1561. * delivers an empty buffer to the AFE service. On
  1562. * acknowledgment, data is filled in the buffer.
  1563. */
  1564. struct afe_port_data_cmd_rt_proxy_port_read_v2 {
  1565. struct apr_hdr hdr;
  1566. u16 port_id;
  1567. /* Rx proxy port ID with which the real-time
  1568. * driver exchanges data.
  1569. * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
  1570. * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
  1571. * (This must be an Rx (speaker) port.)
  1572. */
  1573. u16 reserved;
  1574. /* This field must be set to zero. */
  1575. u32 buffer_address_lsw;
  1576. /* LSW Address of the buffer containing the data sent from the AFE
  1577. * service to a real-time sink device on the client.
  1578. */
  1579. u32 buffer_address_msw;
  1580. /* MSW Address of the buffer containing the data sent from the AFE
  1581. * service to a real-time sink device on the client.
  1582. */
  1583. u32 mem_map_handle;
  1584. /* A memory map handle encapsulating shared memory attributes is
  1585. * returned if AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS command is
  1586. * successful.
  1587. * Supported Values:
  1588. * - Any 32 bit value
  1589. */
  1590. u32 available_bytes;
  1591. /* Number of valid bytes available in the buffer (including all
  1592. * channels).
  1593. * Supported values: > 0
  1594. * This field must be equal to the frame size specified in the
  1595. * #AFE_PORT_AUDIO_IF_CONFIG command that was sent to configure
  1596. * this port.
  1597. */
  1598. } __packed;
  1599. /* This module ID is related to device configuring like I2S,PCM,
  1600. * HDMI, SLIMBus etc. This module supports following parameter ids.
  1601. * - #AFE_PARAM_ID_I2S_CONFIG
  1602. * - #AFE_PARAM_ID_PCM_CONFIG
  1603. * - #AFE_PARAM_ID_DIGI_MIC_CONFIG
  1604. * - #AFE_PARAM_ID_HDMI_CONFIG
  1605. * - #AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG
  1606. * - #AFE_PARAM_ID_SLIMBUS_CONFIG
  1607. * - #AFE_PARAM_ID_RT_PROXY_CONFIG
  1608. */
  1609. #define AFE_MODULE_AUDIO_DEV_INTERFACE 0x0001020C
  1610. #define AFE_PORT_SAMPLE_RATE_8K 8000
  1611. #define AFE_PORT_SAMPLE_RATE_16K 16000
  1612. #define AFE_PORT_SAMPLE_RATE_48K 48000
  1613. #define AFE_PORT_SAMPLE_RATE_96K 96000
  1614. #define AFE_PORT_SAMPLE_RATE_176P4K 176400
  1615. #define AFE_PORT_SAMPLE_RATE_192K 192000
  1616. #define AFE_PORT_SAMPLE_RATE_352P8K 352800
  1617. #define AFE_LINEAR_PCM_DATA 0x0
  1618. #define AFE_NON_LINEAR_DATA 0x1
  1619. #define AFE_LINEAR_PCM_DATA_PACKED_60958 0x2
  1620. #define AFE_NON_LINEAR_DATA_PACKED_60958 0x3
  1621. #define AFE_GENERIC_COMPRESSED 0x8
  1622. /* This param id is used to configure I2S interface */
  1623. #define AFE_PARAM_ID_I2S_CONFIG 0x0001020D
  1624. #define AFE_API_VERSION_I2S_CONFIG 0x1
  1625. /* Enumeration for setting the I2S configuration
  1626. * channel_mode parameter to
  1627. * serial data wire number 1-3 (SD3).
  1628. */
  1629. #define AFE_PORT_I2S_SD0 0x1
  1630. #define AFE_PORT_I2S_SD1 0x2
  1631. #define AFE_PORT_I2S_SD2 0x3
  1632. #define AFE_PORT_I2S_SD3 0x4
  1633. #define AFE_PORT_I2S_QUAD01 0x5
  1634. #define AFE_PORT_I2S_QUAD23 0x6
  1635. #define AFE_PORT_I2S_6CHS 0x7
  1636. #define AFE_PORT_I2S_8CHS 0x8
  1637. #define AFE_PORT_I2S_MONO 0x0
  1638. #define AFE_PORT_I2S_STEREO 0x1
  1639. #define AFE_PORT_CONFIG_I2S_WS_SRC_EXTERNAL 0x0
  1640. #define AFE_PORT_CONFIG_I2S_WS_SRC_INTERNAL 0x1
  1641. /* Payload of the #AFE_PARAM_ID_I2S_CONFIG
  1642. * command's (I2S configuration
  1643. * parameter).
  1644. */
  1645. struct afe_param_id_i2s_cfg {
  1646. u32 i2s_cfg_minor_version;
  1647. /* Minor version used for tracking the version of the I2S
  1648. * configuration interface.
  1649. * Supported values: #AFE_API_VERSION_I2S_CONFIG
  1650. */
  1651. u16 bit_width;
  1652. /* Bit width of the sample.
  1653. * Supported values: 16, 24
  1654. */
  1655. u16 channel_mode;
  1656. /* I2S lines and multichannel operation.
  1657. * Supported values:
  1658. * - #AFE_PORT_I2S_SD0
  1659. * - #AFE_PORT_I2S_SD1
  1660. * - #AFE_PORT_I2S_SD2
  1661. * - #AFE_PORT_I2S_SD3
  1662. * - #AFE_PORT_I2S_QUAD01
  1663. * - #AFE_PORT_I2S_QUAD23
  1664. * - #AFE_PORT_I2S_6CHS
  1665. * - #AFE_PORT_I2S_8CHS
  1666. */
  1667. u16 mono_stereo;
  1668. /* Specifies mono or stereo. This applies only when
  1669. * a single I2S line is used.
  1670. * Supported values:
  1671. * - #AFE_PORT_I2S_MONO
  1672. * - #AFE_PORT_I2S_STEREO
  1673. */
  1674. u16 ws_src;
  1675. /* Word select source: internal or external.
  1676. * Supported values:
  1677. * - #AFE_PORT_CONFIG_I2S_WS_SRC_EXTERNAL
  1678. * - #AFE_PORT_CONFIG_I2S_WS_SRC_INTERNAL
  1679. */
  1680. u32 sample_rate;
  1681. /* Sampling rate of the port.
  1682. * Supported values:
  1683. * - #AFE_PORT_SAMPLE_RATE_8K
  1684. * - #AFE_PORT_SAMPLE_RATE_16K
  1685. * - #AFE_PORT_SAMPLE_RATE_48K
  1686. * - #AFE_PORT_SAMPLE_RATE_96K
  1687. * - #AFE_PORT_SAMPLE_RATE_192K
  1688. */
  1689. u16 data_format;
  1690. /* data format
  1691. * Supported values:
  1692. * - #LINEAR_PCM_DATA
  1693. * - #NON_LINEAR_DATA
  1694. * - #LINEAR_PCM_DATA_PACKED_IN_60958
  1695. * - #NON_LINEAR_DATA_PACKED_IN_60958
  1696. */
  1697. u16 reserved;
  1698. /* This field must be set to zero. */
  1699. } __packed;
  1700. /*
  1701. * This param id is used to configure PCM interface
  1702. */
  1703. #define AFE_API_VERSION_SPDIF_CONFIG 0x1
  1704. #define AFE_API_VERSION_SPDIF_CH_STATUS_CONFIG 0x1
  1705. #define AFE_API_VERSION_SPDIF_CLK_CONFIG 0x1
  1706. #define AFE_CH_STATUS_A 1
  1707. #define AFE_CH_STATUS_B 2
  1708. #define AFE_PARAM_ID_SPDIF_CONFIG 0x00010244
  1709. #define AFE_PARAM_ID_CH_STATUS_CONFIG 0x00010245
  1710. #define AFE_PARAM_ID_SPDIF_CLK_CONFIG 0x00010246
  1711. #define AFE_PORT_CLK_ROOT_LPAPLL 0x3
  1712. #define AFE_PORT_CLK_ROOT_LPAQ6PLL 0x4
  1713. struct afe_param_id_spdif_cfg {
  1714. /* Minor version used for tracking the version of the SPDIF
  1715. * configuration interface.
  1716. * Supported values: #AFE_API_VERSION_SPDIF_CONFIG
  1717. */
  1718. u32 spdif_cfg_minor_version;
  1719. /* Sampling rate of the port.
  1720. * Supported values:
  1721. * - #AFE_PORT_SAMPLE_RATE_22_05K
  1722. * - #AFE_PORT_SAMPLE_RATE_32K
  1723. * - #AFE_PORT_SAMPLE_RATE_44_1K
  1724. * - #AFE_PORT_SAMPLE_RATE_48K
  1725. * - #AFE_PORT_SAMPLE_RATE_96K
  1726. * - #AFE_PORT_SAMPLE_RATE_176_4K
  1727. * - #AFE_PORT_SAMPLE_RATE_192K
  1728. */
  1729. u32 sample_rate;
  1730. /* data format
  1731. * Supported values:
  1732. * - #AFE_LINEAR_PCM_DATA
  1733. * - #AFE_NON_LINEAR_DATA
  1734. */
  1735. u16 data_format;
  1736. /* Number of channels supported by the port
  1737. * - PCM - 1, Compressed Case - 2
  1738. */
  1739. u16 num_channels;
  1740. /* Bit width of the sample.
  1741. * Supported values: 16, 24
  1742. */
  1743. u16 bit_width;
  1744. /* This field must be set to zero. */
  1745. u16 reserved;
  1746. } __packed;
  1747. struct afe_param_id_spdif_ch_status_cfg {
  1748. u32 ch_status_cfg_minor_version;
  1749. /* Minor version used for tracking the version of channel
  1750. * status configuration. Current supported version is 1
  1751. */
  1752. u32 status_type;
  1753. /* Indicate if the channel status is for channel A or B
  1754. * Supported values:
  1755. * - #AFE_CH_STATUS_A
  1756. * - #AFE_CH_STATUS_B
  1757. */
  1758. u8 status_bits[24];
  1759. /* Channel status - 192 bits for channel
  1760. * Byte ordering as defined by IEC60958-3
  1761. */
  1762. u8 status_mask[24];
  1763. /* Channel status with mask bits 1 will be applied.
  1764. * Byte ordering as defined by IEC60958-3
  1765. */
  1766. } __packed;
  1767. struct afe_param_id_spdif_clk_cfg {
  1768. u32 clk_cfg_minor_version;
  1769. /* Minor version used for tracking the version of SPDIF
  1770. * interface clock configuration. Current supported version
  1771. * is 1
  1772. */
  1773. u32 clk_value;
  1774. /* Specifies the clock frequency in Hz to set
  1775. * Supported values:
  1776. * 0 - Disable the clock
  1777. * 2 (byphase) * 32 (60958 subframe size) * sampling rate * 2
  1778. * (channels A and B)
  1779. */
  1780. u32 clk_root;
  1781. /* Specifies SPDIF root clk source
  1782. * Supported Values:
  1783. * - #AFE_PORT_CLK_ROOT_LPAPLL
  1784. * - #AFE_PORT_CLK_ROOT_LPAQ6PLL
  1785. */
  1786. } __packed;
  1787. struct afe_spdif_clk_config_command {
  1788. struct apr_hdr hdr;
  1789. struct afe_port_cmd_set_param_v2 param;
  1790. struct afe_port_param_data_v2 pdata;
  1791. struct afe_param_id_spdif_clk_cfg clk_cfg;
  1792. } __packed;
  1793. struct afe_spdif_chstatus_config_command {
  1794. struct apr_hdr hdr;
  1795. struct afe_port_cmd_set_param_v2 param;
  1796. struct afe_port_param_data_v2 pdata;
  1797. struct afe_param_id_spdif_ch_status_cfg ch_status;
  1798. } __packed;
  1799. struct afe_spdif_port_config {
  1800. struct afe_param_id_spdif_cfg cfg;
  1801. struct afe_param_id_spdif_ch_status_cfg ch_status;
  1802. } __packed;
  1803. #define AFE_PARAM_ID_PCM_CONFIG 0x0001020E
  1804. #define AFE_API_VERSION_PCM_CONFIG 0x1
  1805. /* Enumeration for the auxiliary PCM synchronization signal
  1806. * provided by an external source.
  1807. */
  1808. #define AFE_PORT_PCM_SYNC_SRC_EXTERNAL 0x0
  1809. /* Enumeration for the auxiliary PCM synchronization signal
  1810. * provided by an internal source.
  1811. */
  1812. #define AFE_PORT_PCM_SYNC_SRC_INTERNAL 0x1
  1813. /* Enumeration for the PCM configuration aux_mode parameter,
  1814. * which configures the auxiliary PCM interface to use
  1815. * short synchronization.
  1816. */
  1817. #define AFE_PORT_PCM_AUX_MODE_PCM 0x0
  1818. /*
  1819. * Enumeration for the PCM configuration aux_mode parameter,
  1820. * which configures the auxiliary PCM interface to use long
  1821. * synchronization.
  1822. */
  1823. #define AFE_PORT_PCM_AUX_MODE_AUX 0x1
  1824. /*
  1825. * Enumeration for setting the PCM configuration frame to 8.
  1826. */
  1827. #define AFE_PORT_PCM_BITS_PER_FRAME_8 0x0
  1828. /*
  1829. * Enumeration for setting the PCM configuration frame to 16.
  1830. */
  1831. #define AFE_PORT_PCM_BITS_PER_FRAME_16 0x1
  1832. /* Enumeration for setting the PCM configuration frame to 32.*/
  1833. #define AFE_PORT_PCM_BITS_PER_FRAME_32 0x2
  1834. /* Enumeration for setting the PCM configuration frame to 64.*/
  1835. #define AFE_PORT_PCM_BITS_PER_FRAME_64 0x3
  1836. /* Enumeration for setting the PCM configuration frame to 128.*/
  1837. #define AFE_PORT_PCM_BITS_PER_FRAME_128 0x4
  1838. /* Enumeration for setting the PCM configuration frame to 256.*/
  1839. #define AFE_PORT_PCM_BITS_PER_FRAME_256 0x5
  1840. /* Enumeration for setting the PCM configuration
  1841. * quantype parameter to A-law with no padding.
  1842. */
  1843. #define AFE_PORT_PCM_ALAW_NOPADDING 0x0
  1844. /* Enumeration for setting the PCM configuration quantype
  1845. * parameter to mu-law with no padding.
  1846. */
  1847. #define AFE_PORT_PCM_MULAW_NOPADDING 0x1
  1848. /* Enumeration for setting the PCM configuration quantype
  1849. * parameter to linear with no padding.
  1850. */
  1851. #define AFE_PORT_PCM_LINEAR_NOPADDING 0x2
  1852. /* Enumeration for setting the PCM configuration quantype
  1853. * parameter to A-law with padding.
  1854. */
  1855. #define AFE_PORT_PCM_ALAW_PADDING 0x3
  1856. /* Enumeration for setting the PCM configuration quantype
  1857. * parameter to mu-law with padding.
  1858. */
  1859. #define AFE_PORT_PCM_MULAW_PADDING 0x4
  1860. /* Enumeration for setting the PCM configuration quantype
  1861. * parameter to linear with padding.
  1862. */
  1863. #define AFE_PORT_PCM_LINEAR_PADDING 0x5
  1864. /* Enumeration for disabling the PCM configuration
  1865. * ctrl_data_out_enable parameter.
  1866. * The PCM block is the only master.
  1867. */
  1868. #define AFE_PORT_PCM_CTRL_DATA_OE_DISABLE 0x0
  1869. /*
  1870. * Enumeration for enabling the PCM configuration
  1871. * ctrl_data_out_enable parameter. The PCM block shares
  1872. * the signal with other masters.
  1873. */
  1874. #define AFE_PORT_PCM_CTRL_DATA_OE_ENABLE 0x1
  1875. /* Payload of the #AFE_PARAM_ID_PCM_CONFIG command's
  1876. * (PCM configuration parameter).
  1877. */
  1878. struct afe_param_id_pcm_cfg {
  1879. u32 pcm_cfg_minor_version;
  1880. /* Minor version used for tracking the version of the AUX PCM
  1881. * configuration interface.
  1882. * Supported values: #AFE_API_VERSION_PCM_CONFIG
  1883. */
  1884. u16 aux_mode;
  1885. /* PCM synchronization setting.
  1886. * Supported values:
  1887. * - #AFE_PORT_PCM_AUX_MODE_PCM
  1888. * - #AFE_PORT_PCM_AUX_MODE_AUX
  1889. */
  1890. u16 sync_src;
  1891. /* Synchronization source.
  1892. * Supported values:
  1893. * - #AFE_PORT_PCM_SYNC_SRC_EXTERNAL
  1894. * - #AFE_PORT_PCM_SYNC_SRC_INTERNAL
  1895. */
  1896. u16 frame_setting;
  1897. /* Number of bits per frame.
  1898. * Supported values:
  1899. * - #AFE_PORT_PCM_BITS_PER_FRAME_8
  1900. * - #AFE_PORT_PCM_BITS_PER_FRAME_16
  1901. * - #AFE_PORT_PCM_BITS_PER_FRAME_32
  1902. * - #AFE_PORT_PCM_BITS_PER_FRAME_64
  1903. * - #AFE_PORT_PCM_BITS_PER_FRAME_128
  1904. * - #AFE_PORT_PCM_BITS_PER_FRAME_256
  1905. */
  1906. u16 quantype;
  1907. /* PCM quantization type.
  1908. * Supported values:
  1909. * - #AFE_PORT_PCM_ALAW_NOPADDING
  1910. * - #AFE_PORT_PCM_MULAW_NOPADDING
  1911. * - #AFE_PORT_PCM_LINEAR_NOPADDING
  1912. * - #AFE_PORT_PCM_ALAW_PADDING
  1913. * - #AFE_PORT_PCM_MULAW_PADDING
  1914. * - #AFE_PORT_PCM_LINEAR_PADDING
  1915. */
  1916. u16 ctrl_data_out_enable;
  1917. /* Specifies whether the PCM block shares the data-out
  1918. * signal to the drive with other masters.
  1919. * Supported values:
  1920. * - #AFE_PORT_PCM_CTRL_DATA_OE_DISABLE
  1921. * - #AFE_PORT_PCM_CTRL_DATA_OE_ENABLE
  1922. */
  1923. u16 reserved;
  1924. /* This field must be set to zero. */
  1925. u32 sample_rate;
  1926. /* Sampling rate of the port.
  1927. * Supported values:
  1928. * - #AFE_PORT_SAMPLE_RATE_8K
  1929. * - #AFE_PORT_SAMPLE_RATE_16K
  1930. */
  1931. u16 bit_width;
  1932. /* Bit width of the sample.
  1933. * Supported values: 16
  1934. */
  1935. u16 num_channels;
  1936. /* Number of channels.
  1937. * Supported values: 1 to 4
  1938. */
  1939. u16 slot_number_mapping[4];
  1940. /* Specifies the slot number for the each channel in
  1941. * multi channel scenario.
  1942. * Supported values: 1 to 32
  1943. */
  1944. } __packed;
  1945. /*
  1946. * This param id is used to configure DIGI MIC interface
  1947. */
  1948. #define AFE_PARAM_ID_DIGI_MIC_CONFIG 0x0001020F
  1949. /* This version information is used to handle the new
  1950. * additions to the config interface in future in backward
  1951. * compatible manner.
  1952. */
  1953. #define AFE_API_VERSION_DIGI_MIC_CONFIG 0x1
  1954. /* Enumeration for setting the digital mic configuration
  1955. * channel_mode parameter to left 0.
  1956. */
  1957. #define AFE_PORT_DIGI_MIC_MODE_LEFT0 0x1
  1958. /*Enumeration for setting the digital mic configuration
  1959. * channel_mode parameter to right 0.
  1960. */
  1961. #define AFE_PORT_DIGI_MIC_MODE_RIGHT0 0x2
  1962. /* Enumeration for setting the digital mic configuration
  1963. * channel_mode parameter to left 1.
  1964. */
  1965. #define AFE_PORT_DIGI_MIC_MODE_LEFT1 0x3
  1966. /* Enumeration for setting the digital mic configuration
  1967. * channel_mode parameter to right 1.
  1968. */
  1969. #define AFE_PORT_DIGI_MIC_MODE_RIGHT1 0x4
  1970. /* Enumeration for setting the digital mic configuration
  1971. * channel_mode parameter to stereo 0.
  1972. */
  1973. #define AFE_PORT_DIGI_MIC_MODE_STEREO0 0x5
  1974. /* Enumeration for setting the digital mic configuration
  1975. * channel_mode parameter to stereo 1.
  1976. */
  1977. #define AFE_PORT_DIGI_MIC_MODE_STEREO1 0x6
  1978. /* Enumeration for setting the digital mic configuration
  1979. * channel_mode parameter to quad.
  1980. */
  1981. #define AFE_PORT_DIGI_MIC_MODE_QUAD 0x7
  1982. /* Payload of the #AFE_PARAM_ID_DIGI_MIC_CONFIG command's
  1983. * (DIGI MIC configuration
  1984. * parameter).
  1985. */
  1986. struct afe_param_id_digi_mic_cfg {
  1987. u32 digi_mic_cfg_minor_version;
  1988. /* Minor version used for tracking the version of the DIGI Mic
  1989. * configuration interface.
  1990. * Supported values: #AFE_API_VERSION_DIGI_MIC_CONFIG
  1991. */
  1992. u16 bit_width;
  1993. /* Bit width of the sample.
  1994. * Supported values: 16
  1995. */
  1996. u16 channel_mode;
  1997. /* Digital mic and multichannel operation.
  1998. * Supported values:
  1999. * - #AFE_PORT_DIGI_MIC_MODE_LEFT0
  2000. * - #AFE_PORT_DIGI_MIC_MODE_RIGHT0
  2001. * - #AFE_PORT_DIGI_MIC_MODE_LEFT1
  2002. * - #AFE_PORT_DIGI_MIC_MODE_RIGHT1
  2003. * - #AFE_PORT_DIGI_MIC_MODE_STEREO0
  2004. * - #AFE_PORT_DIGI_MIC_MODE_STEREO1
  2005. * - #AFE_PORT_DIGI_MIC_MODE_QUAD
  2006. */
  2007. u32 sample_rate;
  2008. /* Sampling rate of the port.
  2009. * Supported values:
  2010. * - #AFE_PORT_SAMPLE_RATE_8K
  2011. * - #AFE_PORT_SAMPLE_RATE_16K
  2012. * - #AFE_PORT_SAMPLE_RATE_48K
  2013. */
  2014. } __packed;
  2015. /* This param id is used to configure HDMI interface */
  2016. #define AFE_PARAM_ID_HDMI_CONFIG 0x00010210
  2017. /* This version information is used to handle the new
  2018. * additions to the config interface in future in backward
  2019. * compatible manner.
  2020. */
  2021. #define AFE_API_VERSION_HDMI_CONFIG 0x1
  2022. /* Payload of the #AFE_PARAM_ID_HDMI_CONFIG command,
  2023. * which configures a multichannel HDMI audio interface.
  2024. */
  2025. struct afe_param_id_hdmi_multi_chan_audio_cfg {
  2026. u32 hdmi_cfg_minor_version;
  2027. /* Minor version used for tracking the version of the HDMI
  2028. * configuration interface.
  2029. * Supported values: #AFE_API_VERSION_HDMI_CONFIG
  2030. */
  2031. u16 datatype;
  2032. /* data type
  2033. * Supported values:
  2034. * - #LINEAR_PCM_DATA
  2035. * - #NON_LINEAR_DATA
  2036. * - #LINEAR_PCM_DATA_PACKED_IN_60958
  2037. * - #NON_LINEAR_DATA_PACKED_IN_60958
  2038. */
  2039. u16 channel_allocation;
  2040. /* HDMI channel allocation information for programming an HDMI
  2041. * frame. The default is 0 (Stereo).
  2042. *
  2043. * This information is defined in the HDMI standard, CEA 861-D
  2044. * (refer to @xhyperref{S1,[S1]}). The number of channels is also
  2045. * inferred from this parameter.
  2046. */
  2047. u32 sample_rate;
  2048. /* Sampling rate of the port.
  2049. * Supported values:
  2050. * - #AFE_PORT_SAMPLE_RATE_8K
  2051. * - #AFE_PORT_SAMPLE_RATE_16K
  2052. * - #AFE_PORT_SAMPLE_RATE_48K
  2053. * - #AFE_PORT_SAMPLE_RATE_96K
  2054. * - 22050, 44100, 176400 for compressed streams
  2055. */
  2056. u16 bit_width;
  2057. /* Bit width of the sample.
  2058. * Supported values: 16, 24
  2059. */
  2060. u16 reserved;
  2061. /* This field must be set to zero. */
  2062. } __packed;
  2063. /* This param id is used to configure BT or FM(RIVA) interface */
  2064. #define AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG 0x00010211
  2065. /* This version information is used to handle the new
  2066. * additions to the config interface in future in backward
  2067. * compatible manner.
  2068. */
  2069. #define AFE_API_VERSION_INTERNAL_BT_FM_CONFIG 0x1
  2070. /* Payload of the #AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG
  2071. * command's BT voice/BT audio/FM configuration parameter.
  2072. */
  2073. struct afe_param_id_internal_bt_fm_cfg {
  2074. u32 bt_fm_cfg_minor_version;
  2075. /* Minor version used for tracking the version of the BT and FM
  2076. * configuration interface.
  2077. * Supported values: #AFE_API_VERSION_INTERNAL_BT_FM_CONFIG
  2078. */
  2079. u16 num_channels;
  2080. /* Number of channels.
  2081. * Supported values: 1 to 2
  2082. */
  2083. u16 bit_width;
  2084. /* Bit width of the sample.
  2085. * Supported values: 16
  2086. */
  2087. u32 sample_rate;
  2088. /* Sampling rate of the port.
  2089. * Supported values:
  2090. * - #AFE_PORT_SAMPLE_RATE_8K (only for BTSCO)
  2091. * - #AFE_PORT_SAMPLE_RATE_16K (only for BTSCO)
  2092. * - #AFE_PORT_SAMPLE_RATE_48K (FM and A2DP)
  2093. */
  2094. } __packed;
  2095. /* This param id is used to configure SLIMBUS interface using
  2096. * shared channel approach.
  2097. */
  2098. #define AFE_PARAM_ID_SLIMBUS_CONFIG 0x00010212
  2099. /* This version information is used to handle the new
  2100. * additions to the config interface in future in backward
  2101. * compatible manner.
  2102. */
  2103. #define AFE_API_VERSION_SLIMBUS_CONFIG 0x1
  2104. /* Enumeration for setting SLIMbus device ID 1. */
  2105. #define AFE_SLIMBUS_DEVICE_1 0x0
  2106. /* Enumeration for setting SLIMbus device ID 2. */
  2107. #define AFE_SLIMBUS_DEVICE_2 0x1
  2108. /* Enumeration for setting the SLIMbus data formats. */
  2109. #define AFE_SB_DATA_FORMAT_NOT_INDICATED 0x0
  2110. /* Enumeration for setting the maximum number of streams per
  2111. * device.
  2112. */
  2113. #define AFE_PORT_MAX_AUDIO_CHAN_CNT 0x8
  2114. /* Payload of the #AFE_PORT_CMD_SLIMBUS_CONFIG command's SLIMbus
  2115. * port configuration parameter.
  2116. */
  2117. struct afe_param_id_slimbus_cfg {
  2118. u32 sb_cfg_minor_version;
  2119. /* Minor version used for tracking the version of the SLIMBUS
  2120. * configuration interface.
  2121. * Supported values: #AFE_API_VERSION_SLIMBUS_CONFIG
  2122. */
  2123. u16 slimbus_dev_id;
  2124. /* SLIMbus hardware device ID, which is required to handle
  2125. * multiple SLIMbus hardware blocks.
  2126. * Supported values: - #AFE_SLIMBUS_DEVICE_1 - #AFE_SLIMBUS_DEVICE_2
  2127. */
  2128. u16 bit_width;
  2129. /* Bit width of the sample.
  2130. * Supported values: 16, 24
  2131. */
  2132. u16 data_format;
  2133. /* Data format supported by the SLIMbus hardware. The default is
  2134. * 0 (#AFE_SB_DATA_FORMAT_NOT_INDICATED), which indicates the
  2135. * hardware does not perform any format conversions before the data
  2136. * transfer.
  2137. */
  2138. u16 num_channels;
  2139. /* Number of channels.
  2140. * Supported values: 1 to #AFE_PORT_MAX_AUDIO_CHAN_CNT
  2141. */
  2142. u8 shared_ch_mapping[AFE_PORT_MAX_AUDIO_CHAN_CNT];
  2143. /* Mapping of shared channel IDs (128 to 255) to which the
  2144. * master port is to be connected.
  2145. * Shared_channel_mapping[i] represents the shared channel assigned
  2146. * for audio channel i in multichannel audio data.
  2147. */
  2148. u32 sample_rate;
  2149. /* Sampling rate of the port.
  2150. * Supported values:
  2151. * - #AFE_PORT_SAMPLE_RATE_8K
  2152. * - #AFE_PORT_SAMPLE_RATE_16K
  2153. * - #AFE_PORT_SAMPLE_RATE_48K
  2154. * - #AFE_PORT_SAMPLE_RATE_96K
  2155. * - #AFE_PORT_SAMPLE_RATE_192K
  2156. */
  2157. } __packed;
  2158. /* ID of the parameter used by AFE_PARAM_ID_USB_AUDIO_DEV_PARAMS to configure
  2159. * USB audio device parameter. It should be used with
  2160. * AFE_MODULE_AUDIO_DEV_INTERFACE
  2161. */
  2162. #define AFE_PARAM_ID_USB_AUDIO_DEV_PARAMS 0x000102A5
  2163. /* ID of the parameter used to set the endianness value for the
  2164. * USB audio device. It should be used with
  2165. * AFE_MODULE_AUDIO_DEV_INTERFACE
  2166. */
  2167. #define AFE_PARAM_ID_USB_AUDIO_DEV_LPCM_FMT 0x000102AA
  2168. /* Minor version used for tracking USB audio configuration */
  2169. #define AFE_API_MINIOR_VERSION_USB_AUDIO_CONFIG 0x1
  2170. /* Payload of the AFE_PARAM_ID_USB_AUDIO_DEV_PARAMS parameter used by
  2171. * AFE_MODULE_AUDIO_DEV_INTERFACE.
  2172. */
  2173. struct afe_param_id_usb_audio_dev_params {
  2174. /* Minor version used for tracking USB audio device parameter.
  2175. * Supported values: AFE_API_MINIOR_VERSION_USB_AUDIO_CONFIG
  2176. */
  2177. u32 cfg_minor_version;
  2178. /* Token of actual end USB aduio device */
  2179. u32 dev_token;
  2180. } __packed;
  2181. struct afe_param_id_usb_audio_dev_lpcm_fmt {
  2182. /* Minor version used for tracking USB audio device parameter.
  2183. * Supported values: AFE_API_MINIOR_VERSION_USB_AUDIO_CONFIG
  2184. */
  2185. u32 cfg_minor_version;
  2186. /* Endianness of actual end USB audio device */
  2187. u32 endian;
  2188. } __packed;
  2189. /* ID of the parameter used by AFE_PARAM_ID_USB_AUDIO_CONFIG to configure
  2190. * USB audio interface. It should be used with AFE_MODULE_AUDIO_DEV_INTERFACE
  2191. */
  2192. #define AFE_PARAM_ID_USB_AUDIO_CONFIG 0x000102A4
  2193. /* Payload of the AFE_PARAM_ID_USB_AUDIO_CONFIG parameter used by
  2194. * AFE_MODULE_AUDIO_DEV_INTERFACE.
  2195. */
  2196. struct afe_param_id_usb_audio_cfg {
  2197. /* Minor version used for tracking USB audio device configuration.
  2198. * Supported values: AFE_API_MINIOR_VERSION_USB_AUDIO_CONFIG
  2199. */
  2200. u32 cfg_minor_version;
  2201. /* Sampling rate of the port.
  2202. * Supported values:
  2203. * - AFE_PORT_SAMPLE_RATE_8K
  2204. * - AFE_PORT_SAMPLE_RATE_11025
  2205. * - AFE_PORT_SAMPLE_RATE_12K
  2206. * - AFE_PORT_SAMPLE_RATE_16K
  2207. * - AFE_PORT_SAMPLE_RATE_22050
  2208. * - AFE_PORT_SAMPLE_RATE_24K
  2209. * - AFE_PORT_SAMPLE_RATE_32K
  2210. * - AFE_PORT_SAMPLE_RATE_44P1K
  2211. * - AFE_PORT_SAMPLE_RATE_48K
  2212. * - AFE_PORT_SAMPLE_RATE_96K
  2213. * - AFE_PORT_SAMPLE_RATE_192K
  2214. */
  2215. u32 sample_rate;
  2216. /* Bit width of the sample.
  2217. * Supported values: 16, 24
  2218. */
  2219. u16 bit_width;
  2220. /* Number of channels.
  2221. * Supported values: 1 and 2
  2222. */
  2223. u16 num_channels;
  2224. /* Data format supported by the USB. The supported value is
  2225. * 0 (#AFE_USB_AUDIO_DATA_FORMAT_LINEAR_PCM).
  2226. */
  2227. u16 data_format;
  2228. /* this field must be 0 */
  2229. u16 reserved;
  2230. /* device token of actual end USB aduio device */
  2231. u32 dev_token;
  2232. /* endianness of this interface */
  2233. u32 endian;
  2234. } __packed;
  2235. struct afe_usb_audio_dev_param_command {
  2236. struct apr_hdr hdr;
  2237. struct afe_port_cmd_set_param_v2 param;
  2238. struct afe_port_param_data_v2 pdata;
  2239. union {
  2240. struct afe_param_id_usb_audio_dev_params usb_dev;
  2241. struct afe_param_id_usb_audio_dev_lpcm_fmt lpcm_fmt;
  2242. };
  2243. } __packed;
  2244. /* This param id is used to configure Real Time Proxy interface. */
  2245. #define AFE_PARAM_ID_RT_PROXY_CONFIG 0x00010213
  2246. /* This version information is used to handle the new
  2247. * additions to the config interface in future in backward
  2248. * compatible manner.
  2249. */
  2250. #define AFE_API_VERSION_RT_PROXY_CONFIG 0x1
  2251. /* Payload of the #AFE_PARAM_ID_RT_PROXY_CONFIG
  2252. * command (real-time proxy port configuration parameter).
  2253. */
  2254. struct afe_param_id_rt_proxy_port_cfg {
  2255. u32 rt_proxy_cfg_minor_version;
  2256. /* Minor version used for tracking the version of rt-proxy
  2257. * config interface.
  2258. */
  2259. u16 bit_width;
  2260. /* Bit width of the sample.
  2261. * Supported values: 16
  2262. */
  2263. u16 interleaved;
  2264. /* Specifies whether the data exchanged between the AFE
  2265. * interface and real-time port is interleaved.
  2266. * Supported values: - 0 -- Non-interleaved (samples from each
  2267. * channel are contiguous in the buffer) - 1 -- Interleaved
  2268. * (corresponding samples from each input channel are interleaved
  2269. * within the buffer)
  2270. */
  2271. u16 frame_size;
  2272. /* Size of the frames that are used for PCM exchanges with this
  2273. * port.
  2274. * Supported values: > 0, in bytes
  2275. * For example, 5 ms buffers of 16 bits and 16 kHz stereo samples
  2276. * is 5 ms * 16 samples/ms * 2 bytes/sample * 2 channels = 320
  2277. * bytes.
  2278. */
  2279. u16 jitter_allowance;
  2280. /* Configures the amount of jitter that the port will allow.
  2281. * Supported values: > 0
  2282. * For example, if +/-10 ms of jitter is anticipated in the timing
  2283. * of sending frames to the port, and the configuration is 16 kHz
  2284. * mono with 16-bit samples, this field is 10 ms * 16 samples/ms * 2
  2285. * bytes/sample = 320.
  2286. */
  2287. u16 low_water_mark;
  2288. /* Low watermark in bytes (including all channels).
  2289. * Supported values:
  2290. * - 0 -- Do not send any low watermark events
  2291. * - > 0 -- Low watermark for triggering an event
  2292. * If the number of bytes in an internal circular buffer is lower
  2293. * than this low_water_mark parameter, a LOW_WATER_MARK event is
  2294. * sent to applications (via the #AFE_EVENT_RT_PROXY_PORT_STATUS
  2295. * event).
  2296. * Use of watermark events is optional for debugging purposes.
  2297. */
  2298. u16 high_water_mark;
  2299. /* High watermark in bytes (including all channels).
  2300. * Supported values:
  2301. * - 0 -- Do not send any high watermark events
  2302. * - > 0 -- High watermark for triggering an event
  2303. * If the number of bytes in an internal circular buffer exceeds
  2304. * TOTAL_CIRC_BUF_SIZE minus high_water_mark, a high watermark event
  2305. * is sent to applications (via the #AFE_EVENT_RT_PROXY_PORT_STATUS
  2306. * event).
  2307. * The use of watermark events is optional and for debugging
  2308. * purposes.
  2309. */
  2310. u32 sample_rate;
  2311. /* Sampling rate of the port.
  2312. * Supported values:
  2313. * - #AFE_PORT_SAMPLE_RATE_8K
  2314. * - #AFE_PORT_SAMPLE_RATE_16K
  2315. * - #AFE_PORT_SAMPLE_RATE_48K
  2316. */
  2317. u16 num_channels;
  2318. /* Number of channels.
  2319. * Supported values: 1 to #AFE_PORT_MAX_AUDIO_CHAN_CNT
  2320. */
  2321. u16 reserved;
  2322. /* For 32 bit alignment. */
  2323. } __packed;
  2324. /* This param id is used to configure the Pseudoport interface */
  2325. #define AFE_PARAM_ID_PSEUDO_PORT_CONFIG 0x00010219
  2326. /* Version information used to handle future additions to the configuration
  2327. * interface (for backward compatibility).
  2328. */
  2329. #define AFE_API_VERSION_PSEUDO_PORT_CONFIG 0x1
  2330. /* Enumeration for setting the timing_mode parameter to faster than real
  2331. * time.
  2332. */
  2333. #define AFE_PSEUDOPORT_TIMING_MODE_FTRT 0x0
  2334. /* Enumeration for setting the timing_mode parameter to real time using
  2335. * timers.
  2336. */
  2337. #define AFE_PSEUDOPORT_TIMING_MODE_TIMER 0x1
  2338. /* Payload of the AFE_PARAM_ID_PSEUDO_PORT_CONFIG parameter used by
  2339. * AFE_MODULE_AUDIO_DEV_INTERFACE.
  2340. */
  2341. struct afe_param_id_pseudo_port_cfg {
  2342. u32 pseud_port_cfg_minor_version;
  2343. /*
  2344. * Minor version used for tracking the version of the pseudoport
  2345. * configuration interface.
  2346. */
  2347. u16 bit_width;
  2348. /* Bit width of the sample at values 16, 24 */
  2349. u16 num_channels;
  2350. /* Number of channels at values 1 to 8 */
  2351. u16 data_format;
  2352. /* Non-linear data format supported by the pseudoport (for future use).
  2353. * At values #AFE_LINEAR_PCM_DATA
  2354. */
  2355. u16 timing_mode;
  2356. /* Indicates whether the pseudoport synchronizes to the clock or
  2357. * operates faster than real time.
  2358. * at values
  2359. * - #AFE_PSEUDOPORT_TIMING_MODE_FTRT
  2360. * - #AFE_PSEUDOPORT_TIMING_MODE_TIMER @tablebulletend
  2361. */
  2362. u32 sample_rate;
  2363. /* Sample rate at which the pseudoport will run.
  2364. * at values
  2365. * - #AFE_PORT_SAMPLE_RATE_8K
  2366. * - #AFE_PORT_SAMPLE_RATE_32K
  2367. * - #AFE_PORT_SAMPLE_RATE_48K
  2368. * - #AFE_PORT_SAMPLE_RATE_96K
  2369. * - #AFE_PORT_SAMPLE_RATE_192K @tablebulletend
  2370. */
  2371. } __packed;
  2372. #define AFE_PARAM_ID_TDM_CONFIG 0x0001029D
  2373. #define AFE_API_VERSION_TDM_CONFIG 1
  2374. #define AFE_PORT_TDM_SHORT_SYNC_BIT_MODE 0
  2375. #define AFE_PORT_TDM_LONG_SYNC_MODE 1
  2376. #define AFE_PORT_TDM_SHORT_SYNC_SLOT_MODE 2
  2377. #define AFE_PORT_TDM_SYNC_SRC_EXTERNAL 0
  2378. #define AFE_PORT_TDM_SYNC_SRC_INTERNAL 1
  2379. #define AFE_PORT_TDM_CTRL_DATA_OE_DISABLE 0
  2380. #define AFE_PORT_TDM_CTRL_DATA_OE_ENABLE 1
  2381. #define AFE_PORT_TDM_SYNC_NORMAL 0
  2382. #define AFE_PORT_TDM_SYNC_INVERT 1
  2383. #define AFE_PORT_TDM_DATA_DELAY_0_BCLK_CYCLE 0
  2384. #define AFE_PORT_TDM_DATA_DELAY_1_BCLK_CYCLE 1
  2385. #define AFE_PORT_TDM_DATA_DELAY_2_BCLK_CYCLE 2
  2386. /* Payload of the AFE_PARAM_ID_TDM_CONFIG parameter used by
  2387. * AFE_MODULE_AUDIO_DEV_INTERFACE.
  2388. */
  2389. struct afe_param_id_tdm_cfg {
  2390. u32 tdm_cfg_minor_version;
  2391. /* < Minor version used to track TDM configuration.
  2392. * @values #AFE_API_VERSION_TDM_CONFIG
  2393. */
  2394. u32 num_channels;
  2395. /* < Number of enabled slots for TDM frame.
  2396. * @values 1 to 8
  2397. */
  2398. u32 sample_rate;
  2399. /* < Sampling rate of the port.
  2400. * @values
  2401. * - #AFE_PORT_SAMPLE_RATE_8K
  2402. * - #AFE_PORT_SAMPLE_RATE_16K
  2403. * - #AFE_PORT_SAMPLE_RATE_24K
  2404. * - #AFE_PORT_SAMPLE_RATE_32K
  2405. * - #AFE_PORT_SAMPLE_RATE_48K
  2406. * - #AFE_PORT_SAMPLE_RATE_176P4K
  2407. * - #AFE_PORT_SAMPLE_RATE_352P8K @tablebulletend
  2408. */
  2409. u32 bit_width;
  2410. /* < Bit width of the sample.
  2411. * @values 16, 24
  2412. */
  2413. u16 data_format;
  2414. /* < Data format: linear ,compressed, generic compresssed
  2415. * @values
  2416. * - #AFE_LINEAR_PCM_DATA
  2417. * - #AFE_NON_LINEAR_DATA
  2418. * - #AFE_GENERIC_COMPRESSED
  2419. */
  2420. u16 sync_mode;
  2421. /* < TDM synchronization setting.
  2422. * @values (short, long, slot) sync mode
  2423. * - #AFE_PORT_TDM_SHORT_SYNC_BIT_MODE
  2424. * - #AFE_PORT_TDM_LONG_SYNC_MODE
  2425. * - #AFE_PORT_TDM_SHORT_SYNC_SLOT_MODE @tablebulletend
  2426. */
  2427. u16 sync_src;
  2428. /* < Synchronization source.
  2429. * @values
  2430. * - #AFE_PORT_TDM_SYNC_SRC_EXTERNAL
  2431. * - #AFE_PORT_TDM_SYNC_SRC_INTERNAL @tablebulletend
  2432. */
  2433. u16 nslots_per_frame;
  2434. /* < Number of slots per frame. Typical : 1, 2, 4, 8, 16, 32.
  2435. * @values 1 - 32
  2436. */
  2437. u16 ctrl_data_out_enable;
  2438. /* < Specifies whether the TDM block shares the data-out signal to the
  2439. * drive with other masters.
  2440. * @values
  2441. * - #AFE_PORT_TDM_CTRL_DATA_OE_DISABLE
  2442. * - #AFE_PORT_TDM_CTRL_DATA_OE_ENABLE @tablebulletend
  2443. */
  2444. u16 ctrl_invert_sync_pulse;
  2445. /* < Specifies whether to invert the sync or not.
  2446. * @values
  2447. * - #AFE_PORT_TDM_SYNC_NORMAL
  2448. * - #AFE_PORT_TDM_SYNC_INVERT @tablebulletend
  2449. */
  2450. u16 ctrl_sync_data_delay;
  2451. /* < Specifies the number of bit clock to delay data with respect to
  2452. * sync edge.
  2453. * @values
  2454. * - #AFE_PORT_TDM_DATA_DELAY_0_BCLK_CYCLE
  2455. * - #AFE_PORT_TDM_DATA_DELAY_1_BCLK_CYCLE
  2456. * - #AFE_PORT_TDM_DATA_DELAY_2_BCLK_CYCLE @tablebulletend
  2457. */
  2458. u16 slot_width;
  2459. /* < Slot width of the slot in a TDM frame. (slot_width >= bit_width)
  2460. * have to be satisfied.
  2461. * @values 16, 24, 32
  2462. */
  2463. u32 slot_mask;
  2464. /* < Position of active slots. When that bit is set,
  2465. * that paricular slot is active.
  2466. * Number of active slots can be inferred by number of
  2467. * bits set in the mask. Only 8 individual bits can be enabled.
  2468. * Bits 0..31 corresponding to slot 0..31
  2469. * @values 1 to 2^32 - 1
  2470. */
  2471. } __packed;
  2472. /* ID of Time Divsion Multiplexing (TDM) module,
  2473. * which is used for configuring the AFE TDM.
  2474. *
  2475. * This module supports following parameter IDs:
  2476. * - #AFE_PORT_TDM_SLOT_CONFIG
  2477. *
  2478. * To configure the TDM interface, the client must use the
  2479. * #AFE_PORT_CMD_SET_PARAM command, and fill the module ID with the
  2480. * respective parameter IDs as listed above.
  2481. */
  2482. #define AFE_MODULE_TDM 0x0001028A
  2483. /* ID of the parameter used by #AFE_MODULE_TDM to configure
  2484. * the TDM slot mapping. #AFE_PORT_CMD_SET_PARAM can use this parameter ID.
  2485. */
  2486. #define AFE_PARAM_ID_PORT_SLOT_MAPPING_CONFIG 0x00010297
  2487. /* Version information used to handle future additions to slot mapping
  2488. * configuration (for backward compatibility).
  2489. */
  2490. #define AFE_API_VERSION_SLOT_MAPPING_CONFIG 0x1
  2491. /* Data align type */
  2492. #define AFE_SLOT_MAPPING_DATA_ALIGN_MSB 0
  2493. #define AFE_SLOT_MAPPING_DATA_ALIGN_LSB 1
  2494. #define AFE_SLOT_MAPPING_OFFSET_INVALID 0xFFFF
  2495. /* Payload of the AFE_PARAM_ID_PORT_SLOT_MAPPING_CONFIG
  2496. * command's TDM configuration parameter.
  2497. */
  2498. struct afe_param_id_slot_mapping_cfg {
  2499. u32 minor_version;
  2500. /* < Minor version used for tracking TDM slot configuration.
  2501. * @values #AFE_API_VERSION_TDM_SLOT_CONFIG
  2502. */
  2503. u16 num_channel;
  2504. /* < number of channel of the audio sample.
  2505. * @values 1, 2, 4, 6, 8 @tablebulletend
  2506. */
  2507. u16 bitwidth;
  2508. /* < Slot bit width for each channel
  2509. * @values 16, 24, 32
  2510. */
  2511. u32 data_align_type;
  2512. /* < indicate how data packed from slot_offset for 32 slot bit width
  2513. * in case of sample bit width is 24.
  2514. * @values
  2515. * #AFE_SLOT_MAPPING_DATA_ALIGN_MSB
  2516. * #AFE_SLOT_MAPPING_DATA_ALIGN_LSB
  2517. */
  2518. u16 offset[AFE_PORT_MAX_AUDIO_CHAN_CNT];
  2519. /* < Array of the slot mapping start offset in bytes for this frame.
  2520. * The bytes is counted from 0. The 0 is mapped to the 1st byte
  2521. * in or out of the digital serial data line this sub-frame belong to.
  2522. * slot_offset[] setting is per-channel based.
  2523. * The max num of channel supported is 8.
  2524. * The valid offset value must always be continuly placed in from
  2525. * index 0.
  2526. * Set offset as AFE_SLOT_MAPPING_OFFSET_INVALID for not used arrays.
  2527. * If "slot_bitwidth_per_channel" is 32 and "sample_bitwidth" is 24,
  2528. * "data_align_type" is used to indicate how 24 bit sample data in
  2529. * aligning with 32 bit slot width per-channel.
  2530. * @values, in byte
  2531. */
  2532. } __packed;
  2533. /* ID of the parameter used by #AFE_MODULE_TDM to configure
  2534. * the customer TDM header. #AFE_PORT_CMD_SET_PARAM can use this parameter ID.
  2535. */
  2536. #define AFE_PARAM_ID_CUSTOM_TDM_HEADER_CONFIG 0x00010298
  2537. /* Version information used to handle future additions to custom TDM header
  2538. * configuration (for backward compatibility).
  2539. */
  2540. #define AFE_API_VERSION_CUSTOM_TDM_HEADER_CONFIG 0x1
  2541. #define AFE_CUSTOM_TDM_HEADER_TYPE_INVALID 0x0
  2542. #define AFE_CUSTOM_TDM_HEADER_TYPE_DEFAULT 0x1
  2543. #define AFE_CUSTOM_TDM_HEADER_TYPE_ENTERTAINMENT_MOST 0x2
  2544. #define AFE_CUSTOM_TDM_HEADER_MAX_CNT 0x8
  2545. /* Payload of the AFE_PARAM_ID_CUSTOM_TDM_HEADER_CONFIG parameter ID */
  2546. struct afe_param_id_custom_tdm_header_cfg {
  2547. u32 minor_version;
  2548. /* < Minor version used for tracking custom TDM header configuration.
  2549. * @values #AFE_API_VERSION_CUSTOM_TDM_HEADER_CONFIG
  2550. */
  2551. u16 start_offset;
  2552. /* < the slot mapping start offset in bytes from this sub-frame
  2553. * The bytes is counted from 0. The 0 is mapped to the 1st byte in or
  2554. * out of the digital serial data line this sub-frame belong to.
  2555. * @values, in byte,
  2556. * supported values are 0, 4, 8
  2557. */
  2558. u16 header_width;
  2559. /* < the header width per-frame followed.
  2560. * 2 bytes for MOST/TDM case
  2561. * @values, in byte
  2562. * supported value is 2
  2563. */
  2564. u16 header_type;
  2565. /* < Indicate what kind of custom TDM header it is.
  2566. * @values #AFE_CUSTOM_TDM_HEADER_TYPE_INVALID = 0
  2567. * #AFE_CUSTOM_TDM_HEADER_TYPE_DEFAULT = 1 (for AAN channel per MOST)
  2568. * #AFE_CUSTOM_TDM_HEADER_TYPE_ENTERTAINMENT_MOST = 2
  2569. * (for entertainment channel, which will overwrite
  2570. * AFE_API_VERSION_TDM_SAD_HEADER_TYPE_DEFAULT per MOST)
  2571. */
  2572. u16 num_frame_repeat;
  2573. /* < num of header followed.
  2574. * @values, supported value is 8
  2575. */
  2576. u16 header[AFE_CUSTOM_TDM_HEADER_MAX_CNT];
  2577. /* < SAD header for MOST/TDM case is followed as payload as below.
  2578. * The size of followed SAD header in bytes is num_of_frame_repeat *
  2579. * header_width_per_frame, which is 2 * 8 = 16 bytes here.
  2580. * the supported payload format is in uint16_t as below
  2581. * uint16_t header0; SyncHi 0x3C Info[4] - CodecType -> 0x3C00
  2582. * uint16_t header1; SyncLo 0xB2 Info[5] - SampleWidth -> 0xB218
  2583. * uint16_t header2; DTCP Info Info[6] - unused -> 0x0
  2584. * uint16_t header3; Extension Info[7] - ASAD-Value -> 0xC0
  2585. * uint16_t header4; Reserved Info[0] - Num of bytes following -> 0x7
  2586. * uint16_t header5; Reserved Info[1] - Media Type -> 0x0
  2587. * uint16_t header6; Reserved Info[2] - Bitrate[kbps] - High Byte -> 0x0
  2588. * uint16_t header7; Reserved Info[3] - Bitrate[kbps] - Low Byte -> 0x0
  2589. */
  2590. } __packed;
  2591. struct afe_slot_mapping_config_command {
  2592. struct apr_hdr hdr;
  2593. struct afe_port_cmd_set_param_v2 param;
  2594. struct afe_port_param_data_v2 pdata;
  2595. struct afe_param_id_slot_mapping_cfg slot_mapping;
  2596. } __packed;
  2597. struct afe_custom_tdm_header_config_command {
  2598. struct apr_hdr hdr;
  2599. struct afe_port_cmd_set_param_v2 param;
  2600. struct afe_port_param_data_v2 pdata;
  2601. struct afe_param_id_custom_tdm_header_cfg custom_tdm_header;
  2602. } __packed;
  2603. struct afe_tdm_port_config {
  2604. struct afe_param_id_tdm_cfg tdm;
  2605. struct afe_param_id_slot_mapping_cfg slot_mapping;
  2606. struct afe_param_id_custom_tdm_header_cfg custom_tdm_header;
  2607. } __packed;
  2608. #define AFE_PARAM_ID_DEVICE_HW_DELAY 0x00010243
  2609. #define AFE_API_VERSION_DEVICE_HW_DELAY 0x1
  2610. struct afe_param_id_device_hw_delay_cfg {
  2611. uint32_t device_hw_delay_minor_version;
  2612. uint32_t delay_in_us;
  2613. } __packed;
  2614. #define AFE_PARAM_ID_SET_TOPOLOGY 0x0001025A
  2615. #define AFE_API_VERSION_TOPOLOGY_V1 0x1
  2616. struct afe_param_id_set_topology_cfg {
  2617. /*
  2618. * Minor version used for tracking afe topology id configuration.
  2619. * @values #AFE_API_VERSION_TOPOLOGY_V1
  2620. */
  2621. u32 minor_version;
  2622. /*
  2623. * Id of the topology for the afe session.
  2624. * @values Any valid AFE topology ID
  2625. */
  2626. u32 topology_id;
  2627. } __packed;
  2628. #define AFE_PARAM_ID_APTX_SYNC_MODE 0x00013205
  2629. struct afe_param_id_aptx_sync_mode {
  2630. /*
  2631. * sync mode: 0x0 = stereo sync mode (default)
  2632. * 0x01 = dual mono sync mode
  2633. * 0x02 = dual mono with no sync on either L or R
  2634. */
  2635. uint32_t sync_mode;
  2636. } __packed;
  2637. /*
  2638. * Generic encoder module ID.
  2639. * This module supports the following parameter IDs:
  2640. * #AVS_ENCODER_PARAM_ID_ENC_FMT_ID (cannot be set run time)
  2641. * #AVS_ENCODER_PARAM_ID_ENC_CFG_BLK (may be set run time)
  2642. * #AVS_ENCODER_PARAM_ID_ENC_BITRATE (may be set run time)
  2643. * #AVS_ENCODER_PARAM_ID_PACKETIZER_ID (cannot be set run time)
  2644. * Opcode - AVS_MODULE_ID_ENCODER
  2645. * AFE Command AFE_PORT_CMD_SET_PARAM_V2 supports this module ID.
  2646. */
  2647. #define AFE_MODULE_ID_ENCODER 0x00013229
  2648. /* Macro for defining the packetizer ID: COP. */
  2649. #define AFE_MODULE_ID_PACKETIZER_COP 0x0001322A
  2650. /*
  2651. * Packetizer type parameter for the #AVS_MODULE_ID_ENCODER module.
  2652. * This parameter cannot be set runtime.
  2653. */
  2654. #define AFE_ENCODER_PARAM_ID_PACKETIZER_ID 0x0001322E
  2655. /*
  2656. * Encoder config block parameter for the #AVS_MODULE_ID_ENCODER module.
  2657. * This parameter may be set runtime.
  2658. */
  2659. #define AFE_ENCODER_PARAM_ID_ENC_CFG_BLK 0x0001322C
  2660. /*
  2661. * Encoder format ID parameter for the #AVS_MODULE_ID_ENCODER module.
  2662. * This parameter cannot be set runtime.
  2663. */
  2664. #define AFE_ENCODER_PARAM_ID_ENC_FMT_ID 0x0001322B
  2665. /*
  2666. * Encoder scrambler parameter for the #AVS_MODULE_ID_ENCODER module.
  2667. * This parameter cannot be set runtime.
  2668. */
  2669. #define AFE_ENCODER_PARAM_ID_ENABLE_SCRAMBLING 0x0001323C
  2670. /*
  2671. * Data format to send compressed data
  2672. * is transmitted/received over Slimbus lines.
  2673. */
  2674. #define AFE_SB_DATA_FORMAT_GENERIC_COMPRESSED 0x3
  2675. /*
  2676. * ID for AFE port module. This will be used to define port properties.
  2677. * This module supports following parameter IDs:
  2678. * #AFE_PARAM_ID_PORT_MEDIA_TYPE
  2679. * To configure the port property, the client must use the
  2680. * #AFE_PORT_CMD_SET_PARAM_V2 command,
  2681. * and fill the module ID with the respective parameter IDs as listed above.
  2682. * @apr_hdr_fields
  2683. * Opcode -- AFE_MODULE_PORT
  2684. */
  2685. #define AFE_MODULE_PORT 0x000102a6
  2686. /*
  2687. * ID of the parameter used by #AFE_MODULE_PORT to set the port media type.
  2688. * parameter ID is currently supported using#AFE_PORT_CMD_SET_PARAM_V2 command.
  2689. */
  2690. #define AFE_PARAM_ID_PORT_MEDIA_TYPE 0x000102a7
  2691. /*
  2692. * Macros for defining the "data_format" field in the
  2693. * #AFE_PARAM_ID_PORT_MEDIA_TYPE
  2694. */
  2695. #define AFE_PORT_DATA_FORMAT_PCM 0x0
  2696. #define AFE_PORT_DATA_FORMAT_GENERIC_COMPRESSED 0x1
  2697. /*
  2698. * Macro for defining the "minor_version" field in the
  2699. * #AFE_PARAM_ID_PORT_MEDIA_TYPE
  2700. */
  2701. #define AFE_API_VERSION_PORT_MEDIA_TYPE 0x1
  2702. #define ASM_MEDIA_FMT_NONE 0x0
  2703. /*
  2704. * Media format ID for SBC encode configuration.
  2705. * @par SBC encode configuration (asm_sbc_enc_cfg_t)
  2706. * @table{weak__asm__sbc__enc__cfg__t}
  2707. */
  2708. #define ASM_MEDIA_FMT_SBC 0x00010BF2
  2709. /* SBC channel Mono mode.*/
  2710. #define ASM_MEDIA_FMT_SBC_CHANNEL_MODE_MONO 1
  2711. /* SBC channel Stereo mode. */
  2712. #define ASM_MEDIA_FMT_SBC_CHANNEL_MODE_STEREO 2
  2713. /* SBC channel Dual Mono mode. */
  2714. #define ASM_MEDIA_FMT_SBC_CHANNEL_MODE_DUAL_MONO 8
  2715. /* SBC channel Joint Stereo mode. */
  2716. #define ASM_MEDIA_FMT_SBC_CHANNEL_MODE_JOINT_STEREO 9
  2717. /* SBC bit allocation method = loudness. */
  2718. #define ASM_MEDIA_FMT_SBC_ALLOCATION_METHOD_LOUDNESS 0
  2719. /* SBC bit allocation method = SNR. */
  2720. #define ASM_MEDIA_FMT_SBC_ALLOCATION_METHOD_SNR 1
  2721. /*
  2722. * Payload of the SBC encoder configuration parameters in the
  2723. * #ASM_MEDIA_FMT_SBC media format.
  2724. */
  2725. struct asm_sbc_enc_cfg_t {
  2726. /*
  2727. * Number of subbands.
  2728. * @values 4, 8
  2729. */
  2730. uint32_t num_subbands;
  2731. /*
  2732. * Size of the encoded block in samples.
  2733. * @values 4, 8, 12, 16
  2734. */
  2735. uint32_t blk_len;
  2736. /*
  2737. * Mode used to allocate bits between channels.
  2738. * @values
  2739. * 0 (Native mode)
  2740. * #ASM_MEDIA_FMT_SBC_CHANNEL_MODE_MONO
  2741. * #ASM_MEDIA_FMT_SBC_CHANNEL_MODE_STEREO
  2742. * #ASM_MEDIA_FMT_SBC_CHANNEL_MODE_DUAL_MONO
  2743. * #ASM_MEDIA_FMT_SBC_CHANNEL_MODE_JOINT_STEREO
  2744. * Native mode indicates that encoding must be performed with the number
  2745. * of channels at the input.
  2746. * If postprocessing outputs one-channel data, Mono mode is used. If
  2747. * postprocessing outputs two-channel data, Stereo mode is used.
  2748. * The number of channels must not change during encoding.
  2749. */
  2750. uint32_t channel_mode;
  2751. /*
  2752. * Encoder bit allocation method.
  2753. * @values
  2754. * #ASM_MEDIA_FMT_SBC_ALLOCATION_METHOD_LOUDNESS
  2755. * #ASM_MEDIA_FMT_SBC_ALLOCATION_METHOD_SNR @tablebulletend
  2756. */
  2757. uint32_t alloc_method;
  2758. /*
  2759. * Number of encoded bits per second.
  2760. * @values
  2761. * Mono channel -- Maximum of 320 kbps
  2762. * Stereo channel -- Maximum of 512 kbps @tablebulletend
  2763. */
  2764. uint32_t bit_rate;
  2765. /*
  2766. * Number of samples per second.
  2767. * @values 0 (Native mode), 16000, 32000, 44100, 48000&nbsp;Hz
  2768. * Native mode indicates that encoding must be performed with the
  2769. * sampling rate at the input.
  2770. * The sampling rate must not change during encoding.
  2771. */
  2772. uint32_t sample_rate;
  2773. };
  2774. #define ASM_MEDIA_FMT_AAC_AOT_LC 2
  2775. #define ASM_MEDIA_FMT_AAC_AOT_SBR 5
  2776. #define ASM_MEDIA_FMT_AAC_AOT_PS 29
  2777. #define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS 0
  2778. #define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW 3
  2779. struct asm_aac_enc_cfg_v2_t {
  2780. /* Encoding rate in bits per second.*/
  2781. uint32_t bit_rate;
  2782. /*
  2783. * Encoding mode.
  2784. * Supported values:
  2785. * #ASM_MEDIA_FMT_AAC_AOT_LC
  2786. * #ASM_MEDIA_FMT_AAC_AOT_SBR
  2787. * #ASM_MEDIA_FMT_AAC_AOT_PS
  2788. */
  2789. uint32_t enc_mode;
  2790. /*
  2791. * AAC format flag.
  2792. * Supported values:
  2793. * #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
  2794. * #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
  2795. */
  2796. uint16_t aac_fmt_flag;
  2797. /*
  2798. * Number of channels to encode.
  2799. * Supported values:
  2800. * 0 - Native mode
  2801. * 1 - Mono
  2802. * 2 - Stereo
  2803. * Other values are not supported.
  2804. * @note1hang The eAAC+ encoder mode supports only stereo.
  2805. * Native mode indicates that encoding must be performed with the
  2806. * number of channels at the input.
  2807. * The number of channels must not change during encoding.
  2808. */
  2809. uint16_t channel_cfg;
  2810. /*
  2811. * Number of samples per second.
  2812. * Supported values: - 0 -- Native mode - For other values,
  2813. * Native mode indicates that encoding must be performed with the
  2814. * sampling rate at the input.
  2815. * The sampling rate must not change during encoding.
  2816. */
  2817. uint32_t sample_rate;
  2818. } __packed;
  2819. /* FMT ID for apt-X Classic */
  2820. #define ASM_MEDIA_FMT_APTX 0x000131ff
  2821. /* FMT ID for apt-X HD */
  2822. #define ASM_MEDIA_FMT_APTX_HD 0x00013200
  2823. #define PCM_CHANNEL_L 1
  2824. #define PCM_CHANNEL_R 2
  2825. #define PCM_CHANNEL_C 3
  2826. struct asm_custom_enc_cfg_t {
  2827. uint32_t sample_rate;
  2828. /* Mono or stereo */
  2829. uint16_t num_channels;
  2830. uint16_t reserved;
  2831. /* num_ch == 1, then PCM_CHANNEL_C,
  2832. * num_ch == 2, then {PCM_CHANNEL_L, PCM_CHANNEL_R}
  2833. */
  2834. uint8_t channel_mapping[8];
  2835. uint32_t custom_size;
  2836. } __packed;
  2837. struct asm_aptx_v2_enc_cfg_ext_t {
  2838. /*
  2839. * sync mode: 0x0 = stereo sync mode (default)
  2840. * 0x01 = dual mono sync mode
  2841. * 0x02 = dual mono with no sync on either L or R
  2842. */
  2843. uint32_t sync_mode;
  2844. } __packed;
  2845. struct asm_aptx_enc_cfg_t {
  2846. struct asm_custom_enc_cfg_t custom_cfg;
  2847. struct asm_aptx_v2_enc_cfg_ext_t aptx_v2_cfg;
  2848. } __packed;
  2849. #define ASM_MEDIA_FMT_CELT 0x00013221
  2850. struct asm_celt_specific_enc_cfg_t {
  2851. /*
  2852. * Bit rate used for encoding.
  2853. * This is used to calculate the upper threshold
  2854. * for bytes per frame if vbr_flag is 1.
  2855. * Or else, this will be used as a regular constant
  2856. * bit rate for encoder output.
  2857. * @Range : 32000 to 1536000
  2858. * @Default: 128
  2859. */
  2860. uint32_t bit_rate;
  2861. /*
  2862. * Frame size used for encoding.
  2863. * @Range : 64, 128, 256, 512
  2864. * @Default: 256
  2865. */
  2866. uint16_t frame_size;
  2867. /*
  2868. * complexity of algorithm.
  2869. * @Range : 0-10
  2870. * @Default: 3
  2871. */
  2872. uint16_t complexity;
  2873. /*
  2874. * Switch variable for prediction feature.
  2875. * Used to choose between the level of interframe
  2876. * predictions allowed while encoding.
  2877. * @Range:
  2878. * 0: Independent Frames.
  2879. * 1: Short Term interframe prediction allowed.
  2880. * 2: Long term prediction allowed.
  2881. * @Default: 2
  2882. */
  2883. uint16_t prediction_mode;
  2884. /*
  2885. * Variable Bit Rate flag.
  2886. * @Default: 0
  2887. */
  2888. uint16_t vbr_flag;
  2889. } __packed;
  2890. struct asm_celt_enc_cfg_t {
  2891. struct asm_custom_enc_cfg_t custom_config;
  2892. struct asm_celt_specific_enc_cfg_t celt_specific_config;
  2893. } __packed;
  2894. struct afe_enc_fmt_id_param_t {
  2895. /*
  2896. * Supported values:
  2897. * #ASM_MEDIA_FMT_SBC
  2898. * #ASM_MEDIA_FMT_AAC_V2
  2899. * Any OpenDSP supported values
  2900. */
  2901. uint32_t fmt_id;
  2902. } __packed;
  2903. struct afe_port_media_type_t {
  2904. /*
  2905. * Minor version
  2906. * @values #AFE_API_VERSION_PORT_MEDIA_TYPE.
  2907. */
  2908. uint32_t minor_version;
  2909. /*
  2910. * Sampling rate of the port.
  2911. * @values
  2912. * #AFE_PORT_SAMPLE_RATE_8K
  2913. * #AFE_PORT_SAMPLE_RATE_11_025K
  2914. * #AFE_PORT_SAMPLE_RATE_12K
  2915. * #AFE_PORT_SAMPLE_RATE_16K
  2916. * #AFE_PORT_SAMPLE_RATE_22_05K
  2917. * #AFE_PORT_SAMPLE_RATE_24K
  2918. * #AFE_PORT_SAMPLE_RATE_32K
  2919. * #AFE_PORT_SAMPLE_RATE_44_1K
  2920. * #AFE_PORT_SAMPLE_RATE_48K
  2921. * #AFE_PORT_SAMPLE_RATE_88_2K
  2922. * #AFE_PORT_SAMPLE_RATE_96K
  2923. * #AFE_PORT_SAMPLE_RATE_176_4K
  2924. * #AFE_PORT_SAMPLE_RATE_192K
  2925. * #AFE_PORT_SAMPLE_RATE_352_8K
  2926. * #AFE_PORT_SAMPLE_RATE_384K
  2927. */
  2928. uint32_t sample_rate;
  2929. /*
  2930. * Bit width of the sample.
  2931. * @values 16, 24
  2932. */
  2933. uint16_t bit_width;
  2934. /*
  2935. * Number of channels.
  2936. * @values 1 to #AFE_PORT_MAX_AUDIO_CHAN_CNT
  2937. */
  2938. uint16_t num_channels;
  2939. /*
  2940. * Data format supported by this port.
  2941. * If the port media type and device media type are different,
  2942. * it signifies a encoding/decoding use case
  2943. * @values
  2944. * #AFE_PORT_DATA_FORMAT_PCM
  2945. * #AFE_PORT_DATA_FORMAT_GENERIC_COMPRESSED
  2946. */
  2947. uint16_t data_format;
  2948. /*This field must be set to zero.*/
  2949. uint16_t reserved;
  2950. } __packed;
  2951. union afe_enc_config_data {
  2952. struct asm_sbc_enc_cfg_t sbc_config;
  2953. struct asm_aac_enc_cfg_v2_t aac_config;
  2954. struct asm_custom_enc_cfg_t custom_config;
  2955. struct asm_celt_enc_cfg_t celt_config;
  2956. struct asm_aptx_enc_cfg_t aptx_config;
  2957. };
  2958. struct afe_enc_config {
  2959. u32 format;
  2960. u32 scrambler_mode;
  2961. union afe_enc_config_data data;
  2962. };
  2963. struct afe_enc_cfg_blk_param_t {
  2964. uint32_t enc_cfg_blk_size;
  2965. /*
  2966. *Size of the encoder configuration block that follows this member
  2967. */
  2968. union afe_enc_config_data enc_blk_config;
  2969. };
  2970. /*
  2971. * Payload of the AVS_ENCODER_PARAM_ID_PACKETIZER_ID parameter.
  2972. */
  2973. struct avs_enc_packetizer_id_param_t {
  2974. /*
  2975. * Supported values:
  2976. * #AVS_MODULE_ID_PACKETIZER_COP
  2977. * Any OpenDSP supported values
  2978. */
  2979. uint32_t enc_packetizer_id;
  2980. };
  2981. /*
  2982. * Payload of the AVS_ENCODER_PARAM_ID_ENABLE_SCRAMBLING parameter.
  2983. */
  2984. struct avs_enc_set_scrambler_param_t {
  2985. /*
  2986. * Supported values:
  2987. * 1 : enable scrambler
  2988. * 0 : disable scrambler
  2989. */
  2990. uint32_t enable_scrambler;
  2991. };
  2992. union afe_port_config {
  2993. struct afe_param_id_pcm_cfg pcm;
  2994. struct afe_param_id_i2s_cfg i2s;
  2995. struct afe_param_id_hdmi_multi_chan_audio_cfg hdmi_multi_ch;
  2996. struct afe_param_id_slimbus_cfg slim_sch;
  2997. struct afe_param_id_rt_proxy_port_cfg rtproxy;
  2998. struct afe_param_id_internal_bt_fm_cfg int_bt_fm;
  2999. struct afe_param_id_pseudo_port_cfg pseudo_port;
  3000. struct afe_param_id_device_hw_delay_cfg hw_delay;
  3001. struct afe_param_id_spdif_cfg spdif;
  3002. struct afe_param_id_set_topology_cfg topology;
  3003. struct afe_param_id_tdm_cfg tdm;
  3004. struct afe_param_id_usb_audio_cfg usb_audio;
  3005. struct afe_param_id_aptx_sync_mode sync_mode_param;
  3006. struct afe_enc_fmt_id_param_t enc_fmt;
  3007. struct afe_port_media_type_t media_type;
  3008. struct afe_enc_cfg_blk_param_t enc_blk_param;
  3009. struct avs_enc_packetizer_id_param_t enc_pkt_id_param;
  3010. struct avs_enc_set_scrambler_param_t enc_set_scrambler_param;
  3011. } __packed;
  3012. struct afe_audioif_config_command_no_payload {
  3013. struct apr_hdr hdr;
  3014. struct afe_port_cmd_set_param_v2 param;
  3015. } __packed;
  3016. struct afe_audioif_config_command {
  3017. struct apr_hdr hdr;
  3018. struct afe_port_cmd_set_param_v2 param;
  3019. struct afe_port_param_data_v2 pdata;
  3020. union afe_port_config port;
  3021. } __packed;
  3022. #define AFE_PORT_CMD_DEVICE_START 0x000100E5
  3023. /* Payload of the #AFE_PORT_CMD_DEVICE_START.*/
  3024. struct afe_port_cmd_device_start {
  3025. struct apr_hdr hdr;
  3026. u16 port_id;
  3027. /* Port interface and direction (Rx or Tx) to start. An even
  3028. * number represents the Rx direction, and an odd number represents
  3029. * the Tx direction.
  3030. */
  3031. u16 reserved;
  3032. /* Reserved for 32-bit alignment. This field must be set to 0.*/
  3033. } __packed;
  3034. #define AFE_PORT_CMD_DEVICE_STOP 0x000100E6
  3035. /* Payload of the #AFE_PORT_CMD_DEVICE_STOP. */
  3036. struct afe_port_cmd_device_stop {
  3037. struct apr_hdr hdr;
  3038. u16 port_id;
  3039. /* Port interface and direction (Rx or Tx) to start. An even
  3040. * number represents the Rx direction, and an odd number represents
  3041. * the Tx direction.
  3042. */
  3043. u16 reserved;
  3044. /* Reserved for 32-bit alignment. This field must be set to 0.*/
  3045. } __packed;
  3046. #define AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS 0x000100EA
  3047. /* Memory map regions command payload used by the
  3048. * #AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS .
  3049. * This structure allows clients to map multiple shared memory
  3050. * regions in a single command. Following this structure are
  3051. * num_regions of afe_service_shared_map_region_payload.
  3052. */
  3053. struct afe_service_cmd_shared_mem_map_regions {
  3054. struct apr_hdr hdr;
  3055. u16 mem_pool_id;
  3056. /* Type of memory on which this memory region is mapped.
  3057. * Supported values:
  3058. * - #ADSP_MEMORY_MAP_EBI_POOL
  3059. * - #ADSP_MEMORY_MAP_SMI_POOL
  3060. * - #ADSP_MEMORY_MAP_SHMEM8_4K_POOL
  3061. * - Other values are reserved
  3062. *
  3063. * The memory pool ID implicitly defines the characteristics of the
  3064. * memory. Characteristics may include alignment type, permissions,
  3065. * etc.
  3066. *
  3067. * ADSP_MEMORY_MAP_EBI_POOL is External Buffer Interface type memory
  3068. * ADSP_MEMORY_MAP_SMI_POOL is Shared Memory Interface type memory
  3069. * ADSP_MEMORY_MAP_SHMEM8_4K_POOL is shared memory, byte
  3070. * addressable, and 4 KB aligned.
  3071. */
  3072. u16 num_regions;
  3073. /* Number of regions to map.
  3074. * Supported values:
  3075. * - Any value greater than zero
  3076. */
  3077. u32 property_flag;
  3078. /* Configures one common property for all the regions in the
  3079. * payload.
  3080. *
  3081. * Supported values: - 0x00000000 to 0x00000001
  3082. *
  3083. * b0 - bit 0 indicates physical or virtual mapping 0 Shared memory
  3084. * address provided in afe_service_shared_map_region_payloadis a
  3085. * physical address. The shared memory needs to be mapped( hardware
  3086. * TLB entry) and a software entry needs to be added for internal
  3087. * book keeping.
  3088. *
  3089. * 1 Shared memory address provided in
  3090. * afe_service_shared_map_region_payloadis a virtual address. The
  3091. * shared memory must not be mapped (since hardware TLB entry is
  3092. * already available) but a software entry needs to be added for
  3093. * internal book keeping. This can be useful if two services with in
  3094. * ADSP is communicating via APR. They can now directly communicate
  3095. * via the Virtual address instead of Physical address. The virtual
  3096. * regions must be contiguous. num_regions must be 1 in this case.
  3097. *
  3098. * b31-b1 - reserved bits. must be set to zero
  3099. */
  3100. } __packed;
  3101. /* Map region payload used by the
  3102. * afe_service_shared_map_region_payloadstructure.
  3103. */
  3104. struct afe_service_shared_map_region_payload {
  3105. u32 shm_addr_lsw;
  3106. /* least significant word of starting address in the memory
  3107. * region to map. It must be contiguous memory, and it must be 4 KB
  3108. * aligned.
  3109. * Supported values: - Any 32 bit value
  3110. */
  3111. u32 shm_addr_msw;
  3112. /* most significant word of startng address in the memory region
  3113. * to map. For 32 bit shared memory address, this field must be set
  3114. * to zero. For 36 bit shared memory address, bit31 to bit 4 must be
  3115. * set to zero
  3116. *
  3117. * Supported values: - For 32 bit shared memory address, this field
  3118. * must be set to zero. - For 36 bit shared memory address, bit31 to
  3119. * bit 4 must be set to zero - For 64 bit shared memory address, any
  3120. * 32 bit value
  3121. */
  3122. u32 mem_size_bytes;
  3123. /* Number of bytes in the region. The aDSP will always map the
  3124. * regions as virtual contiguous memory, but the memory size must be
  3125. * in multiples of 4 KB to avoid gaps in the virtually contiguous
  3126. * mapped memory.
  3127. *
  3128. * Supported values: - multiples of 4KB
  3129. */
  3130. } __packed;
  3131. #define AFE_SERVICE_CMDRSP_SHARED_MEM_MAP_REGIONS 0x000100EB
  3132. struct afe_service_cmdrsp_shared_mem_map_regions {
  3133. u32 mem_map_handle;
  3134. /* A memory map handle encapsulating shared memory attributes is
  3135. * returned iff AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS command is
  3136. * successful. In the case of failure , a generic APR error response
  3137. * is returned to the client.
  3138. *
  3139. * Supported Values: - Any 32 bit value
  3140. */
  3141. } __packed;
  3142. #define AFE_SERVICE_CMD_SHARED_MEM_UNMAP_REGIONS 0x000100EC
  3143. /* Memory unmap regions command payload used by the
  3144. * #AFE_SERVICE_CMD_SHARED_MEM_UNMAP_REGIONS
  3145. *
  3146. * This structure allows clients to unmap multiple shared memory
  3147. * regions in a single command.
  3148. */
  3149. struct afe_service_cmd_shared_mem_unmap_regions {
  3150. struct apr_hdr hdr;
  3151. u32 mem_map_handle;
  3152. /* memory map handle returned by
  3153. * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands
  3154. *
  3155. * Supported Values:
  3156. * - Any 32 bit value
  3157. */
  3158. } __packed;
  3159. #define AFE_PORT_CMD_GET_PARAM_V2 0x000100F0
  3160. /* Payload of the #AFE_PORT_CMD_GET_PARAM_V2 command,
  3161. * which queries for one post/preprocessing parameter of a
  3162. * stream.
  3163. */
  3164. struct afe_port_cmd_get_param_v2 {
  3165. u16 port_id;
  3166. /* Port interface and direction (Rx or Tx) to start. */
  3167. u16 payload_size;
  3168. /* Maximum data size of the parameter ID/module ID combination.
  3169. * This is a multiple of four bytes
  3170. * Supported values: > 0
  3171. */
  3172. u32 payload_address_lsw;
  3173. /* LSW of 64 bit Payload address. Address should be 32-byte,
  3174. * 4kbyte aligned and must be contig memory.
  3175. */
  3176. u32 payload_address_msw;
  3177. /* MSW of 64 bit Payload address. In case of 32-bit shared
  3178. * memory address, this field must be set to zero. In case of 36-bit
  3179. * shared memory address, bit-4 to bit-31 must be set to zero.
  3180. * Address should be 32-byte, 4kbyte aligned and must be contiguous
  3181. * memory.
  3182. */
  3183. u32 mem_map_handle;
  3184. /* Memory map handle returned by
  3185. * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands.
  3186. * Supported Values: - NULL -- Message. The parameter data is
  3187. * in-band. - Non-NULL -- The parameter data is Out-band.Pointer to
  3188. * - the physical address in shared memory of the payload data.
  3189. * For detailed payload content, see the afe_port_param_data_v2
  3190. * structure
  3191. */
  3192. u32 module_id;
  3193. /* ID of the module to be queried.
  3194. * Supported values: Valid module ID
  3195. */
  3196. u32 param_id;
  3197. /* ID of the parameter to be queried.
  3198. * Supported values: Valid parameter ID
  3199. */
  3200. } __packed;
  3201. #define AFE_PORT_CMDRSP_GET_PARAM_V2 0x00010106
  3202. /* Payload of the #AFE_PORT_CMDRSP_GET_PARAM_V2 message, which
  3203. * responds to an #AFE_PORT_CMD_GET_PARAM_V2 command.
  3204. *
  3205. * Immediately following this structure is the parameters structure
  3206. * (afe_port_param_data) containing the response(acknowledgment)
  3207. * parameter payload. This payload is included for an in-band
  3208. * scenario. For an address/shared memory-based set parameter, this
  3209. * payload is not needed.
  3210. */
  3211. struct afe_port_cmdrsp_get_param_v2 {
  3212. u32 status;
  3213. } __packed;
  3214. #define AFE_PARAM_ID_LPASS_CORE_SHARED_CLOCK_CONFIG 0x0001028C
  3215. #define AFE_API_VERSION_LPASS_CORE_SHARED_CLK_CONFIG 0x1
  3216. /* Payload of the AFE_PARAM_ID_LPASS_CORE_SHARED_CLOCK_CONFIG parameter used by
  3217. * AFE_MODULE_AUDIO_DEV_INTERFACE.
  3218. */
  3219. struct afe_param_id_lpass_core_shared_clk_cfg {
  3220. u32 lpass_core_shared_clk_cfg_minor_version;
  3221. /*
  3222. * Minor version used for lpass core shared clock configuration
  3223. * Supported value: AFE_API_VERSION_LPASS_CORE_SHARED_CLK_CONFIG
  3224. */
  3225. u32 enable;
  3226. /*
  3227. * Specifies whether the lpass core shared clock is
  3228. * enabled (1) or disabled (0).
  3229. */
  3230. } __packed;
  3231. struct afe_lpass_core_shared_clk_config_command {
  3232. struct apr_hdr hdr;
  3233. struct afe_port_cmd_set_param_v2 param;
  3234. struct afe_port_param_data_v2 pdata;
  3235. struct afe_param_id_lpass_core_shared_clk_cfg clk_cfg;
  3236. } __packed;
  3237. /* adsp_afe_service_commands.h */
  3238. #define ADSP_MEMORY_MAP_EBI_POOL 0
  3239. #define ADSP_MEMORY_MAP_SMI_POOL 1
  3240. #define ADSP_MEMORY_MAP_IMEM_POOL 2
  3241. #define ADSP_MEMORY_MAP_SHMEM8_4K_POOL 3
  3242. /* Definition of virtual memory flag */
  3243. #define ADSP_MEMORY_MAP_VIRTUAL_MEMORY 1
  3244. /* Definition of physical memory flag */
  3245. #define ADSP_MEMORY_MAP_PHYSICAL_MEMORY 0
  3246. #define NULL_POPP_TOPOLOGY 0x00010C68
  3247. #define NULL_COPP_TOPOLOGY 0x00010312
  3248. #define DEFAULT_COPP_TOPOLOGY 0x00010314
  3249. #define DEFAULT_POPP_TOPOLOGY 0x00010BE4
  3250. #define COMPRESSED_PASSTHROUGH_DEFAULT_TOPOLOGY 0x0001076B
  3251. #define COMPRESSED_PASSTHROUGH_NONE_TOPOLOGY 0x00010774
  3252. #define VPM_TX_SM_ECNS_V2_COPP_TOPOLOGY 0x00010F89
  3253. #define VPM_TX_DM_FLUENCE_COPP_TOPOLOGY 0x00010F72
  3254. #define VPM_TX_QMIC_FLUENCE_COPP_TOPOLOGY 0x00010F75
  3255. #define VPM_TX_DM_RFECNS_COPP_TOPOLOGY 0x00010F86
  3256. #define ADM_CMD_COPP_OPEN_TOPOLOGY_ID_DTS_HPX 0x10015002
  3257. #define ADM_CMD_COPP_OPEN_TOPOLOGY_ID_AUDIOSPHERE 0x10028000
  3258. /* Memory map regions command payload used by the
  3259. * #ASM_CMD_SHARED_MEM_MAP_REGIONS ,#ADM_CMD_SHARED_MEM_MAP_REGIONS
  3260. * commands.
  3261. *
  3262. * This structure allows clients to map multiple shared memory
  3263. * regions in a single command. Following this structure are
  3264. * num_regions of avs_shared_map_region_payload.
  3265. */
  3266. struct avs_cmd_shared_mem_map_regions {
  3267. struct apr_hdr hdr;
  3268. u16 mem_pool_id;
  3269. /* Type of memory on which this memory region is mapped.
  3270. *
  3271. * Supported values: - #ADSP_MEMORY_MAP_EBI_POOL -
  3272. * #ADSP_MEMORY_MAP_SMI_POOL - #ADSP_MEMORY_MAP_IMEM_POOL
  3273. * (unsupported) - #ADSP_MEMORY_MAP_SHMEM8_4K_POOL - Other values
  3274. * are reserved
  3275. *
  3276. * The memory ID implicitly defines the characteristics of the
  3277. * memory. Characteristics may include alignment type, permissions,
  3278. * etc.
  3279. *
  3280. * SHMEM8_4K is shared memory, byte addressable, and 4 KB aligned.
  3281. */
  3282. u16 num_regions;
  3283. /* Number of regions to map.*/
  3284. u32 property_flag;
  3285. /* Configures one common property for all the regions in the
  3286. * payload. No two regions in the same memory map regions cmd can
  3287. * have differnt property. Supported values: - 0x00000000 to
  3288. * 0x00000001
  3289. *
  3290. * b0 - bit 0 indicates physical or virtual mapping 0 shared memory
  3291. * address provided in avs_shared_map_regions_payload is physical
  3292. * address. The shared memory needs to be mapped( hardware TLB
  3293. * entry)
  3294. *
  3295. * and a software entry needs to be added for internal book keeping.
  3296. *
  3297. * 1 Shared memory address provided in MayPayload[usRegions] is
  3298. * virtual address. The shared memory must not be mapped (since
  3299. * hardware TLB entry is already available) but a software entry
  3300. * needs to be added for internal book keeping. This can be useful
  3301. * if two services with in ADSP is communicating via APR. They can
  3302. * now directly communicate via the Virtual address instead of
  3303. * Physical address. The virtual regions must be contiguous.
  3304. *
  3305. * b31-b1 - reserved bits. must be set to zero
  3306. */
  3307. } __packed;
  3308. struct avs_shared_map_region_payload {
  3309. u32 shm_addr_lsw;
  3310. /* least significant word of shared memory address of the memory
  3311. * region to map. It must be contiguous memory, and it must be 4 KB
  3312. * aligned.
  3313. */
  3314. u32 shm_addr_msw;
  3315. /* most significant word of shared memory address of the memory
  3316. * region to map. For 32 bit shared memory address, this field must
  3317. * tbe set to zero. For 36 bit shared memory address, bit31 to bit 4
  3318. * must be set to zero
  3319. */
  3320. u32 mem_size_bytes;
  3321. /* Number of bytes in the region.
  3322. *
  3323. * The aDSP will always map the regions as virtual contiguous
  3324. * memory, but the memory size must be in multiples of 4 KB to avoid
  3325. * gaps in the virtually contiguous mapped memory.
  3326. */
  3327. } __packed;
  3328. struct avs_cmd_shared_mem_unmap_regions {
  3329. struct apr_hdr hdr;
  3330. u32 mem_map_handle;
  3331. /* memory map handle returned by ASM_CMD_SHARED_MEM_MAP_REGIONS
  3332. * , ADM_CMD_SHARED_MEM_MAP_REGIONS, commands
  3333. */
  3334. } __packed;
  3335. /* Memory map command response payload used by the
  3336. * #ASM_CMDRSP_SHARED_MEM_MAP_REGIONS
  3337. * ,#ADM_CMDRSP_SHARED_MEM_MAP_REGIONS
  3338. */
  3339. struct avs_cmdrsp_shared_mem_map_regions {
  3340. u32 mem_map_handle;
  3341. /* A memory map handle encapsulating shared memory attributes is
  3342. * returned
  3343. */
  3344. } __packed;
  3345. /*adsp_audio_memmap_api.h*/
  3346. /* ASM related data structures */
  3347. struct asm_wma_cfg {
  3348. u16 format_tag;
  3349. u16 ch_cfg;
  3350. u32 sample_rate;
  3351. u32 avg_bytes_per_sec;
  3352. u16 block_align;
  3353. u16 valid_bits_per_sample;
  3354. u32 ch_mask;
  3355. u16 encode_opt;
  3356. u16 adv_encode_opt;
  3357. u32 adv_encode_opt2;
  3358. u32 drc_peak_ref;
  3359. u32 drc_peak_target;
  3360. u32 drc_ave_ref;
  3361. u32 drc_ave_target;
  3362. } __packed;
  3363. struct asm_wmapro_cfg {
  3364. u16 format_tag;
  3365. u16 ch_cfg;
  3366. u32 sample_rate;
  3367. u32 avg_bytes_per_sec;
  3368. u16 block_align;
  3369. u16 valid_bits_per_sample;
  3370. u32 ch_mask;
  3371. u16 encode_opt;
  3372. u16 adv_encode_opt;
  3373. u32 adv_encode_opt2;
  3374. u32 drc_peak_ref;
  3375. u32 drc_peak_target;
  3376. u32 drc_ave_ref;
  3377. u32 drc_ave_target;
  3378. } __packed;
  3379. struct asm_aac_cfg {
  3380. u16 format;
  3381. u16 aot;
  3382. u16 ep_config;
  3383. u16 section_data_resilience;
  3384. u16 scalefactor_data_resilience;
  3385. u16 spectral_data_resilience;
  3386. u16 ch_cfg;
  3387. u16 reserved;
  3388. u32 sample_rate;
  3389. } __packed;
  3390. struct asm_amrwbplus_cfg {
  3391. u32 size_bytes;
  3392. u32 version;
  3393. u32 num_channels;
  3394. u32 amr_band_mode;
  3395. u32 amr_dtx_mode;
  3396. u32 amr_frame_fmt;
  3397. u32 amr_lsf_idx;
  3398. } __packed;
  3399. struct asm_flac_cfg {
  3400. u32 sample_rate;
  3401. u32 ext_sample_rate;
  3402. u32 min_frame_size;
  3403. u32 max_frame_size;
  3404. u16 stream_info_present;
  3405. u16 min_blk_size;
  3406. u16 max_blk_size;
  3407. u16 ch_cfg;
  3408. u16 sample_size;
  3409. u16 md5_sum;
  3410. };
  3411. struct asm_alac_cfg {
  3412. u32 frame_length;
  3413. u8 compatible_version;
  3414. u8 bit_depth;
  3415. u8 pb;
  3416. u8 mb;
  3417. u8 kb;
  3418. u8 num_channels;
  3419. u16 max_run;
  3420. u32 max_frame_bytes;
  3421. u32 avg_bit_rate;
  3422. u32 sample_rate;
  3423. u32 channel_layout_tag;
  3424. };
  3425. struct asm_g711_dec_cfg {
  3426. u32 sample_rate;
  3427. };
  3428. struct asm_vorbis_cfg {
  3429. u32 bit_stream_fmt;
  3430. };
  3431. struct asm_ape_cfg {
  3432. u16 compatible_version;
  3433. u16 compression_level;
  3434. u32 format_flags;
  3435. u32 blocks_per_frame;
  3436. u32 final_frame_blocks;
  3437. u32 total_frames;
  3438. u16 bits_per_sample;
  3439. u16 num_channels;
  3440. u32 sample_rate;
  3441. u32 seek_table_present;
  3442. };
  3443. struct asm_dsd_cfg {
  3444. u16 num_version;
  3445. u16 is_bitwise_big_endian;
  3446. u16 dsd_channel_block_size;
  3447. u16 num_channels;
  3448. u8 channel_mapping[8];
  3449. u32 dsd_data_rate;
  3450. };
  3451. struct asm_softpause_params {
  3452. u32 enable;
  3453. u32 period;
  3454. u32 step;
  3455. u32 rampingcurve;
  3456. } __packed;
  3457. struct asm_softvolume_params {
  3458. u32 period;
  3459. u32 step;
  3460. u32 rampingcurve;
  3461. } __packed;
  3462. #define ASM_END_POINT_DEVICE_MATRIX 0
  3463. #define PCM_CHANNEL_NULL 0
  3464. /* Front left channel. */
  3465. #define PCM_CHANNEL_FL 1
  3466. /* Front right channel. */
  3467. #define PCM_CHANNEL_FR 2
  3468. /* Front center channel. */
  3469. #define PCM_CHANNEL_FC 3
  3470. /* Left surround channel.*/
  3471. #define PCM_CHANNEL_LS 4
  3472. /* Right surround channel.*/
  3473. #define PCM_CHANNEL_RS 5
  3474. /* Low frequency effect channel. */
  3475. #define PCM_CHANNEL_LFE 6
  3476. /* Center surround channel; Rear center channel. */
  3477. #define PCM_CHANNEL_CS 7
  3478. /* Left back channel; Rear left channel. */
  3479. #define PCM_CHANNEL_LB 8
  3480. /* Right back channel; Rear right channel. */
  3481. #define PCM_CHANNEL_RB 9
  3482. /* Top surround channel. */
  3483. #define PCM_CHANNELS 10
  3484. /* Center vertical height channel.*/
  3485. #define PCM_CHANNEL_CVH 11
  3486. /* Mono surround channel.*/
  3487. #define PCM_CHANNEL_MS 12
  3488. /* Front left of center. */
  3489. #define PCM_CHANNEL_FLC 13
  3490. /* Front right of center. */
  3491. #define PCM_CHANNEL_FRC 14
  3492. /* Rear left of center. */
  3493. #define PCM_CHANNEL_RLC 15
  3494. /* Rear right of center. */
  3495. #define PCM_CHANNEL_RRC 16
  3496. #define PCM_FORMAT_MAX_NUM_CHANNEL 8
  3497. #define ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2 0x00010DA5
  3498. #define ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V3 0x00010DDC
  3499. #define ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V4 0x0001320C
  3500. #define ASM_MEDIA_FMT_EVRCB_FS 0x00010BEF
  3501. #define ASM_MEDIA_FMT_EVRCWB_FS 0x00010BF0
  3502. #define ASM_MEDIA_FMT_GENERIC_COMPRESSED 0x00013212
  3503. #define ASM_MAX_EQ_BANDS 12
  3504. #define ASM_DATA_CMD_MEDIA_FMT_UPDATE_V2 0x00010D98
  3505. struct asm_data_cmd_media_fmt_update_v2 {
  3506. u32 fmt_blk_size;
  3507. /* Media format block size in bytes.*/
  3508. } __packed;
  3509. struct asm_generic_compressed_fmt_blk_t {
  3510. struct apr_hdr hdr;
  3511. struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
  3512. /*
  3513. * Channel mapping array of bitstream output.
  3514. * Channel[i] mapping describes channel i inside the buffer, where
  3515. * i < num_channels. All valid used channels must be
  3516. * present at the beginning of the array.
  3517. */
  3518. uint8_t channel_mapping[8];
  3519. /*
  3520. * Number of channels of the incoming bitstream.
  3521. * Supported values: 1,2,3,4,5,6,7,8
  3522. */
  3523. uint16_t num_channels;
  3524. /*
  3525. * Nominal bits per sample value of the incoming bitstream.
  3526. * Supported values: 16, 32
  3527. */
  3528. uint16_t bits_per_sample;
  3529. /*
  3530. * Nominal sampling rate of the incoming bitstream.
  3531. * Supported values: 8000, 11025, 16000, 22050, 24000, 32000,
  3532. * 44100, 48000, 88200, 96000, 176400, 192000,
  3533. * 352800, 384000
  3534. */
  3535. uint32_t sampling_rate;
  3536. } __packed;
  3537. /* Command to send sample rate & channels for IEC61937 (compressed) or IEC60958
  3538. * (pcm) streams. Both audio standards use the same format and are used for
  3539. * HDMI or SPDIF.
  3540. */
  3541. #define ASM_DATA_CMD_IEC_60958_MEDIA_FMT 0x0001321E
  3542. struct asm_iec_compressed_fmt_blk_t {
  3543. struct apr_hdr hdr;
  3544. /*
  3545. * Nominal sampling rate of the incoming bitstream.
  3546. * Supported values: 8000, 11025, 16000, 22050, 24000, 32000,
  3547. * 44100, 48000, 88200, 96000, 176400, 192000,
  3548. * 352800, 384000
  3549. */
  3550. uint32_t sampling_rate;
  3551. /*
  3552. * Number of channels of the incoming bitstream.
  3553. * Supported values: 1,2,3,4,5,6,7,8
  3554. */
  3555. uint32_t num_channels;
  3556. } __packed;
  3557. struct asm_multi_channel_pcm_fmt_blk_v2 {
  3558. struct apr_hdr hdr;
  3559. struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
  3560. u16 num_channels;
  3561. /* Number of channels. Supported values: 1 to 8 */
  3562. u16 bits_per_sample;
  3563. /* Number of bits per sample per channel. * Supported values:
  3564. * 16, 24 * When used for playback, the client must send 24-bit
  3565. * samples packed in 32-bit words. The 24-bit samples must be placed
  3566. * in the most significant 24 bits of the 32-bit word. When used for
  3567. * recording, the aDSP sends 24-bit samples packed in 32-bit words.
  3568. * The 24-bit samples are placed in the most significant 24 bits of
  3569. * the 32-bit word.
  3570. */
  3571. u32 sample_rate;
  3572. /* Number of samples per second (in Hertz).
  3573. * Supported values: 2000 to 48000
  3574. */
  3575. u16 is_signed;
  3576. /* Flag that indicates the samples are signed (1). */
  3577. u16 reserved;
  3578. /* reserved field for 32 bit alignment. must be set to zero. */
  3579. u8 channel_mapping[8];
  3580. /* Channel array of size 8.
  3581. * Supported values:
  3582. * - #PCM_CHANNEL_L
  3583. * - #PCM_CHANNEL_R
  3584. * - #PCM_CHANNEL_C
  3585. * - #PCM_CHANNEL_LS
  3586. * - #PCM_CHANNEL_RS
  3587. * - #PCM_CHANNEL_LFE
  3588. * - #PCM_CHANNEL_CS
  3589. * - #PCM_CHANNEL_LB
  3590. * - #PCM_CHANNEL_RB
  3591. * - #PCM_CHANNELS
  3592. * - #PCM_CHANNEL_CVH
  3593. * - #PCM_CHANNEL_MS
  3594. * - #PCM_CHANNEL_FLC
  3595. * - #PCM_CHANNEL_FRC
  3596. * - #PCM_CHANNEL_RLC
  3597. * - #PCM_CHANNEL_RRC
  3598. *
  3599. * Channel[i] mapping describes channel I. Each element i of the
  3600. * array describes channel I inside the buffer where 0 @le I <
  3601. * num_channels. An unused channel is set to zero.
  3602. */
  3603. } __packed;
  3604. struct asm_multi_channel_pcm_fmt_blk_v3 {
  3605. uint16_t num_channels;
  3606. /*
  3607. * Number of channels
  3608. * Supported values: 1 to 8
  3609. */
  3610. uint16_t bits_per_sample;
  3611. /*
  3612. * Number of bits per sample per channel
  3613. * Supported values: 16, 24
  3614. */
  3615. uint32_t sample_rate;
  3616. /*
  3617. * Number of samples per second
  3618. * Supported values: 2000 to 48000, 96000,192000 Hz
  3619. */
  3620. uint16_t is_signed;
  3621. /* Flag that indicates that PCM samples are signed (1) */
  3622. uint16_t sample_word_size;
  3623. /*
  3624. * Size in bits of the word that holds a sample of a channel.
  3625. * Supported values: 12,24,32
  3626. */
  3627. uint8_t channel_mapping[8];
  3628. /*
  3629. * Each element, i, in the array describes channel i inside the buffer where
  3630. * 0 <= i < num_channels. Unused channels are set to 0.
  3631. */
  3632. } __packed;
  3633. struct asm_multi_channel_pcm_fmt_blk_v4 {
  3634. uint16_t num_channels;
  3635. /*
  3636. * Number of channels
  3637. * Supported values: 1 to 8
  3638. */
  3639. uint16_t bits_per_sample;
  3640. /*
  3641. * Number of bits per sample per channel
  3642. * Supported values: 16, 24, 32
  3643. */
  3644. uint32_t sample_rate;
  3645. /*
  3646. * Number of samples per second
  3647. * Supported values: 2000 to 48000, 96000,192000 Hz
  3648. */
  3649. uint16_t is_signed;
  3650. /* Flag that indicates that PCM samples are signed (1) */
  3651. uint16_t sample_word_size;
  3652. /*
  3653. * Size in bits of the word that holds a sample of a channel.
  3654. * Supported values: 12,24,32
  3655. */
  3656. uint8_t channel_mapping[8];
  3657. /*
  3658. * Each element, i, in the array describes channel i inside the buffer where
  3659. * 0 <= i < num_channels. Unused channels are set to 0.
  3660. */
  3661. uint16_t endianness;
  3662. /*
  3663. * Flag to indicate the endianness of the pcm sample
  3664. * Supported values: 0 - Little endian (all other formats)
  3665. * 1 - Big endian (AIFF)
  3666. */
  3667. uint16_t mode;
  3668. /*
  3669. * Mode to provide additional info about the pcm input data.
  3670. * Supported values: 0 - Default QFs (Q15 for 16b, Q23 for packed 24b,
  3671. * Q31 for unpacked 24b or 32b)
  3672. * 15 - for 16 bit
  3673. * 23 - for 24b packed or 8.24 format
  3674. * 31 - for 24b unpacked or 32bit
  3675. */
  3676. } __packed;
  3677. /*
  3678. * Payload of the multichannel PCM configuration parameters in
  3679. * the ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V3 media format.
  3680. */
  3681. struct asm_multi_channel_pcm_fmt_blk_param_v3 {
  3682. struct apr_hdr hdr;
  3683. struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
  3684. struct asm_multi_channel_pcm_fmt_blk_v3 param;
  3685. } __packed;
  3686. /*
  3687. * Payload of the multichannel PCM configuration parameters in
  3688. * the ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V4 media format.
  3689. */
  3690. struct asm_multi_channel_pcm_fmt_blk_param_v4 {
  3691. struct apr_hdr hdr;
  3692. struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
  3693. struct asm_multi_channel_pcm_fmt_blk_v4 param;
  3694. } __packed;
  3695. struct asm_stream_cmd_set_encdec_param {
  3696. u32 param_id;
  3697. /* ID of the parameter. */
  3698. u32 param_size;
  3699. /* Data size of this parameter, in bytes. The size is a multiple
  3700. * of 4 bytes.
  3701. */
  3702. } __packed;
  3703. struct asm_enc_cfg_blk_param_v2 {
  3704. u32 frames_per_buf;
  3705. /* Number of encoded frames to pack into each buffer.
  3706. *
  3707. * @note1hang This is only guidance information for the aDSP. The
  3708. * number of encoded frames put into each buffer (specified by the
  3709. * client) is less than or equal to this number.
  3710. */
  3711. u32 enc_cfg_blk_size;
  3712. /* Size in bytes of the encoder configuration block that follows
  3713. * this member.
  3714. */
  3715. } __packed;
  3716. /* @brief Dolby Digital Plus end point configuration structure
  3717. */
  3718. struct asm_dec_ddp_endp_param_v2 {
  3719. struct apr_hdr hdr;
  3720. struct asm_stream_cmd_set_encdec_param encdec;
  3721. int endp_param_value;
  3722. } __packed;
  3723. /*
  3724. * Payload of the multichannel PCM encoder configuration parameters in
  3725. * the ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V4 media format.
  3726. */
  3727. struct asm_multi_channel_pcm_enc_cfg_v4 {
  3728. struct apr_hdr hdr;
  3729. struct asm_stream_cmd_set_encdec_param encdec;
  3730. struct asm_enc_cfg_blk_param_v2 encblk;
  3731. uint16_t num_channels;
  3732. /*
  3733. * Number of PCM channels.
  3734. * @values
  3735. * - 0 -- Native mode
  3736. * - 1 -- 8 channels
  3737. * Native mode indicates that encoding must be performed with the number
  3738. * of channels at the input.
  3739. */
  3740. uint16_t bits_per_sample;
  3741. /*
  3742. * Number of bits per sample per channel.
  3743. * @values 16, 24
  3744. */
  3745. uint32_t sample_rate;
  3746. /*
  3747. * Number of samples per second.
  3748. * @values 0, 8000 to 48000 Hz
  3749. * A value of 0 indicates the native sampling rate. Encoding is
  3750. * performed at the input sampling rate.
  3751. */
  3752. uint16_t is_signed;
  3753. /*
  3754. * Flag that indicates the PCM samples are signed (1). Currently, only
  3755. * signed PCM samples are supported.
  3756. */
  3757. uint16_t sample_word_size;
  3758. /*
  3759. * The size in bits of the word that holds a sample of a channel.
  3760. * @values 16, 24, 32
  3761. * 16-bit samples are always placed in 16-bit words:
  3762. * sample_word_size = 1.
  3763. * 24-bit samples can be placed in 32-bit words or in consecutive
  3764. * 24-bit words.
  3765. * - If sample_word_size = 32, 24-bit samples are placed in the
  3766. * most significant 24 bits of a 32-bit word.
  3767. * - If sample_word_size = 24, 24-bit samples are placed in
  3768. * 24-bit words. @tablebulletend
  3769. */
  3770. uint8_t channel_mapping[8];
  3771. /*
  3772. * Channel mapping array expected at the encoder output.
  3773. * Channel[i] mapping describes channel i inside the buffer, where
  3774. * 0 @le i < num_channels. All valid used channels must be present at
  3775. * the beginning of the array.
  3776. * If Native mode is set for the channels, this field is ignored.
  3777. * @values See Section @xref{dox:PcmChannelDefs}
  3778. */
  3779. uint16_t endianness;
  3780. /*
  3781. * Flag to indicate the endianness of the pcm sample
  3782. * Supported values: 0 - Little endian (all other formats)
  3783. * 1 - Big endian (AIFF)
  3784. */
  3785. uint16_t mode;
  3786. /*
  3787. * Mode to provide additional info about the pcm input data.
  3788. * Supported values: 0 - Default QFs (Q15 for 16b, Q23 for packed 24b,
  3789. * Q31 for unpacked 24b or 32b)
  3790. * 15 - for 16 bit
  3791. * 23 - for 24b packed or 8.24 format
  3792. * 31 - for 24b unpacked or 32bit
  3793. */
  3794. } __packed;
  3795. /*
  3796. * Payload of the multichannel PCM encoder configuration parameters in
  3797. * the ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V3 media format.
  3798. */
  3799. struct asm_multi_channel_pcm_enc_cfg_v3 {
  3800. struct apr_hdr hdr;
  3801. struct asm_stream_cmd_set_encdec_param encdec;
  3802. struct asm_enc_cfg_blk_param_v2 encblk;
  3803. uint16_t num_channels;
  3804. /*
  3805. * Number of PCM channels.
  3806. * @values
  3807. * - 0 -- Native mode
  3808. * - 1 -- 8 channels
  3809. * Native mode indicates that encoding must be performed with the number
  3810. * of channels at the input.
  3811. */
  3812. uint16_t bits_per_sample;
  3813. /*
  3814. * Number of bits per sample per channel.
  3815. * @values 16, 24
  3816. */
  3817. uint32_t sample_rate;
  3818. /*
  3819. * Number of samples per second.
  3820. * @values 0, 8000 to 48000 Hz
  3821. * A value of 0 indicates the native sampling rate. Encoding is
  3822. * performed at the input sampling rate.
  3823. */
  3824. uint16_t is_signed;
  3825. /*
  3826. * Flag that indicates the PCM samples are signed (1). Currently, only
  3827. * signed PCM samples are supported.
  3828. */
  3829. uint16_t sample_word_size;
  3830. /*
  3831. * The size in bits of the word that holds a sample of a channel.
  3832. * @values 16, 24, 32
  3833. * 16-bit samples are always placed in 16-bit words:
  3834. * sample_word_size = 1.
  3835. * 24-bit samples can be placed in 32-bit words or in consecutive
  3836. * 24-bit words.
  3837. * - If sample_word_size = 32, 24-bit samples are placed in the
  3838. * most significant 24 bits of a 32-bit word.
  3839. * - If sample_word_size = 24, 24-bit samples are placed in
  3840. * 24-bit words. @tablebulletend
  3841. */
  3842. uint8_t channel_mapping[8];
  3843. /*
  3844. * Channel mapping array expected at the encoder output.
  3845. * Channel[i] mapping describes channel i inside the buffer, where
  3846. * 0 @le i < num_channels. All valid used channels must be present at
  3847. * the beginning of the array.
  3848. * If Native mode is set for the channels, this field is ignored.
  3849. * @values See Section @xref{dox:PcmChannelDefs}
  3850. */
  3851. };
  3852. /* @brief Multichannel PCM encoder configuration structure used
  3853. * in the #ASM_PARAM_ID_ENCDEC_ENC_CFG_BLK_V2 command.
  3854. */
  3855. struct asm_multi_channel_pcm_enc_cfg_v2 {
  3856. struct apr_hdr hdr;
  3857. struct asm_stream_cmd_set_encdec_param encdec;
  3858. struct asm_enc_cfg_blk_param_v2 encblk;
  3859. uint16_t num_channels;
  3860. /*< Number of PCM channels.
  3861. *
  3862. * Supported values: - 0 -- Native mode - 1 -- 8 Native mode
  3863. * indicates that encoding must be performed with the number of
  3864. * channels at the input.
  3865. */
  3866. uint16_t bits_per_sample;
  3867. /*< Number of bits per sample per channel.
  3868. * Supported values: 16, 24
  3869. */
  3870. uint32_t sample_rate;
  3871. /*< Number of samples per second (in Hertz).
  3872. *
  3873. * Supported values: 0, 8000 to 48000 A value of 0 indicates the
  3874. * native sampling rate. Encoding is performed at the input sampling
  3875. * rate.
  3876. */
  3877. uint16_t is_signed;
  3878. /*< Specifies whether the samples are signed (1). Currently,
  3879. * only signed samples are supported.
  3880. */
  3881. uint16_t reserved;
  3882. /*< reserved field for 32 bit alignment. must be set to zero.*/
  3883. uint8_t channel_mapping[8];
  3884. } __packed;
  3885. #define ASM_MEDIA_FMT_MP3 0x00010BE9
  3886. #define ASM_MEDIA_FMT_AAC_V2 0x00010DA6
  3887. /* @xreflabel
  3888. * {hdr:AsmMediaFmtDolbyAac} Media format ID for the
  3889. * Dolby AAC decoder. This format ID is be used if the client wants
  3890. * to use the Dolby AAC decoder to decode MPEG2 and MPEG4 AAC
  3891. * contents.
  3892. */
  3893. #define ASM_MEDIA_FMT_DOLBY_AAC 0x00010D86
  3894. /* Enumeration for the audio data transport stream AAC format. */
  3895. #define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS 0
  3896. /* Enumeration for low overhead audio stream AAC format. */
  3897. #define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS 1
  3898. /* Enumeration for the audio data interchange format
  3899. * AAC format.
  3900. */
  3901. #define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF 2
  3902. /* Enumeration for the raw AAC format. */
  3903. #define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW 3
  3904. /* Enumeration for the AAC LATM format. */
  3905. #define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LATM 4
  3906. #define ASM_MEDIA_FMT_AAC_AOT_LC 2
  3907. #define ASM_MEDIA_FMT_AAC_AOT_SBR 5
  3908. #define ASM_MEDIA_FMT_AAC_AOT_PS 29
  3909. #define ASM_MEDIA_FMT_AAC_AOT_BSAC 22
  3910. struct asm_aac_fmt_blk_v2 {
  3911. struct apr_hdr hdr;
  3912. struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
  3913. u16 aac_fmt_flag;
  3914. /* Bitstream format option.
  3915. * Supported values:
  3916. * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
  3917. * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS
  3918. * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF
  3919. * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
  3920. */
  3921. u16 audio_objype;
  3922. /* Audio Object Type (AOT) present in the AAC stream.
  3923. * Supported values:
  3924. * - #ASM_MEDIA_FMT_AAC_AOT_LC
  3925. * - #ASM_MEDIA_FMT_AAC_AOT_SBR
  3926. * - #ASM_MEDIA_FMT_AAC_AOT_BSAC
  3927. * - #ASM_MEDIA_FMT_AAC_AOT_PS
  3928. * - Otherwise -- Not supported
  3929. */
  3930. u16 channel_config;
  3931. /* Number of channels present in the AAC stream.
  3932. * Supported values:
  3933. * - 1 -- Mono
  3934. * - 2 -- Stereo
  3935. * - 6 -- 5.1 content
  3936. */
  3937. u16 total_size_of_PCE_bits;
  3938. /* greater or equal to zero. * -In case of RAW formats and
  3939. * channel config = 0 (PCE), client can send * the bit stream
  3940. * containing PCE immediately following this structure * (in-band).
  3941. * -This number does not include bits included for 32 bit alignment.
  3942. * -If zero, then the PCE info is assumed to be available in the
  3943. * audio -bit stream & not in-band.
  3944. */
  3945. u32 sample_rate;
  3946. /* Number of samples per second (in Hertz).
  3947. *
  3948. * Supported values: 8000, 11025, 12000, 16000, 22050, 24000, 32000,
  3949. * 44100, 48000
  3950. *
  3951. * This field must be equal to the sample rate of the AAC-LC
  3952. * decoder's output. - For MP4 or 3GP containers, this is indicated
  3953. * by the samplingFrequencyIndex field in the AudioSpecificConfig
  3954. * element. - For ADTS format, this is indicated by the
  3955. * samplingFrequencyIndex in the ADTS fixed header. - For ADIF
  3956. * format, this is indicated by the samplingFrequencyIndex in the
  3957. * program_config_element present in the ADIF header.
  3958. */
  3959. } __packed;
  3960. struct asm_aac_enc_cfg_v2 {
  3961. struct apr_hdr hdr;
  3962. struct asm_stream_cmd_set_encdec_param encdec;
  3963. struct asm_enc_cfg_blk_param_v2 encblk;
  3964. u32 bit_rate;
  3965. /* Encoding rate in bits per second. */
  3966. u32 enc_mode;
  3967. /* Encoding mode.
  3968. * Supported values:
  3969. * - #ASM_MEDIA_FMT_AAC_AOT_LC
  3970. * - #ASM_MEDIA_FMT_AAC_AOT_SBR
  3971. * - #ASM_MEDIA_FMT_AAC_AOT_PS
  3972. */
  3973. u16 aac_fmt_flag;
  3974. /* AAC format flag.
  3975. * Supported values:
  3976. * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
  3977. * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
  3978. */
  3979. u16 channel_cfg;
  3980. /* Number of channels to encode.
  3981. * Supported values:
  3982. * - 0 -- Native mode
  3983. * - 1 -- Mono
  3984. * - 2 -- Stereo
  3985. * - Other values are not supported.
  3986. * @note1hang The eAAC+ encoder mode supports only stereo.
  3987. * Native mode indicates that encoding must be performed with the
  3988. * number of channels at the input.
  3989. * The number of channels must not change during encoding.
  3990. */
  3991. u32 sample_rate;
  3992. /* Number of samples per second.
  3993. * Supported values: - 0 -- Native mode - For other values,
  3994. * Native mode indicates that encoding must be performed with the
  3995. * sampling rate at the input.
  3996. * The sampling rate must not change during encoding.
  3997. */
  3998. } __packed;
  3999. #define ASM_MEDIA_FMT_G711_ALAW_FS 0x00010BF7
  4000. #define ASM_MEDIA_FMT_G711_MLAW_FS 0x00010C2E
  4001. struct asm_g711_enc_cfg_v2 {
  4002. struct apr_hdr hdr;
  4003. struct asm_stream_cmd_set_encdec_param encdec;
  4004. struct asm_enc_cfg_blk_param_v2 encblk;
  4005. u32 sample_rate;
  4006. /*
  4007. * Number of samples per second.
  4008. * Supported values: 8000, 16000 Hz
  4009. */
  4010. } __packed;
  4011. struct asm_vorbis_fmt_blk_v2 {
  4012. struct apr_hdr hdr;
  4013. struct asm_data_cmd_media_fmt_update_v2 fmtblk;
  4014. u32 bit_stream_fmt;
  4015. /* Bit stream format.
  4016. * Supported values:
  4017. * - 0 -- Raw bitstream
  4018. * - 1 -- Transcoded bitstream
  4019. *
  4020. * Transcoded bitstream containing the size of the frame as the first
  4021. * word in each frame.
  4022. */
  4023. } __packed;
  4024. struct asm_flac_fmt_blk_v2 {
  4025. struct apr_hdr hdr;
  4026. struct asm_data_cmd_media_fmt_update_v2 fmtblk;
  4027. u16 is_stream_info_present;
  4028. /* Specifies whether stream information is present in the FLAC format
  4029. * block.
  4030. *
  4031. * Supported values:
  4032. * - 0 -- Stream information is not present in this message
  4033. * - 1 -- Stream information is present in this message
  4034. *
  4035. * When set to 1, the FLAC bitstream was successfully parsed by the
  4036. * client, and other fields in the FLAC format block can be read by the
  4037. * decoder to get metadata stream information.
  4038. */
  4039. u16 num_channels;
  4040. /* Number of channels for decoding.
  4041. * Supported values: 1 to 2
  4042. */
  4043. u16 min_blk_size;
  4044. /* Minimum block size (in samples) used in the stream. It must be less
  4045. * than or equal to max_blk_size.
  4046. */
  4047. u16 max_blk_size;
  4048. /* Maximum block size (in samples) used in the stream. If the
  4049. * minimum block size equals the maximum block size, a fixed block
  4050. * size stream is implied.
  4051. */
  4052. u16 md5_sum[8];
  4053. /* MD5 signature array of the unencoded audio data. This allows the
  4054. * decoder to determine if an error exists in the audio data, even when
  4055. * the error does not result in an invalid bitstream.
  4056. */
  4057. u32 sample_rate;
  4058. /* Number of samples per second.
  4059. * Supported values: 8000 to 48000 Hz
  4060. */
  4061. u32 min_frame_size;
  4062. /* Minimum frame size used in the stream.
  4063. * Supported values:
  4064. * - > 0 bytes
  4065. * - 0 -- The value is unknown
  4066. */
  4067. u32 max_frame_size;
  4068. /* Maximum frame size used in the stream.
  4069. * Supported values:
  4070. * -- > 0 bytes
  4071. * -- 0 . The value is unknown
  4072. */
  4073. u16 sample_size;
  4074. /* Bits per sample.Supported values: 8, 16 */
  4075. u16 reserved;
  4076. /* Clients must set this field to zero
  4077. */
  4078. } __packed;
  4079. struct asm_alac_fmt_blk_v2 {
  4080. struct apr_hdr hdr;
  4081. struct asm_data_cmd_media_fmt_update_v2 fmtblk;
  4082. u32 frame_length;
  4083. u8 compatible_version;
  4084. u8 bit_depth;
  4085. u8 pb;
  4086. u8 mb;
  4087. u8 kb;
  4088. u8 num_channels;
  4089. u16 max_run;
  4090. u32 max_frame_bytes;
  4091. u32 avg_bit_rate;
  4092. u32 sample_rate;
  4093. u32 channel_layout_tag;
  4094. } __packed;
  4095. struct asm_g711_dec_fmt_blk_v2 {
  4096. struct apr_hdr hdr;
  4097. struct asm_data_cmd_media_fmt_update_v2 fmtblk;
  4098. u32 sample_rate;
  4099. } __packed;
  4100. struct asm_ape_fmt_blk_v2 {
  4101. struct apr_hdr hdr;
  4102. struct asm_data_cmd_media_fmt_update_v2 fmtblk;
  4103. u16 compatible_version;
  4104. u16 compression_level;
  4105. u32 format_flags;
  4106. u32 blocks_per_frame;
  4107. u32 final_frame_blocks;
  4108. u32 total_frames;
  4109. u16 bits_per_sample;
  4110. u16 num_channels;
  4111. u32 sample_rate;
  4112. u32 seek_table_present;
  4113. } __packed;
  4114. struct asm_dsd_fmt_blk_v2 {
  4115. struct apr_hdr hdr;
  4116. struct asm_data_cmd_media_fmt_update_v2 fmtblk;
  4117. u16 num_version;
  4118. u16 is_bitwise_big_endian;
  4119. u16 dsd_channel_block_size;
  4120. u16 num_channels;
  4121. u8 channel_mapping[8];
  4122. u32 dsd_data_rate;
  4123. } __packed;
  4124. #define ASM_MEDIA_FMT_AMRNB_FS 0x00010BEB
  4125. /* Enumeration for 4.75 kbps AMR-NB Encoding mode. */
  4126. #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR475 0
  4127. /* Enumeration for 5.15 kbps AMR-NB Encoding mode. */
  4128. #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR515 1
  4129. /* Enumeration for 5.90 kbps AMR-NB Encoding mode. */
  4130. #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR59 2
  4131. /* Enumeration for 6.70 kbps AMR-NB Encoding mode. */
  4132. #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR67 3
  4133. /* Enumeration for 7.40 kbps AMR-NB Encoding mode. */
  4134. #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR74 4
  4135. /* Enumeration for 7.95 kbps AMR-NB Encoding mode. */
  4136. #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR795 5
  4137. /* Enumeration for 10.20 kbps AMR-NB Encoding mode. */
  4138. #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR102 6
  4139. /* Enumeration for 12.20 kbps AMR-NB Encoding mode. */
  4140. #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR122 7
  4141. /* Enumeration for AMR-NB Discontinuous Transmission mode off. */
  4142. #define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF 0
  4143. /* Enumeration for AMR-NB DTX mode VAD1. */
  4144. #define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1 1
  4145. /* Enumeration for AMR-NB DTX mode VAD2. */
  4146. #define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD2 2
  4147. /* Enumeration for AMR-NB DTX mode auto. */
  4148. #define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_AUTO 3
  4149. struct asm_amrnb_enc_cfg {
  4150. struct apr_hdr hdr;
  4151. struct asm_stream_cmd_set_encdec_param encdec;
  4152. struct asm_enc_cfg_blk_param_v2 encblk;
  4153. u16 enc_mode;
  4154. /* AMR-NB encoding rate.
  4155. * Supported values:
  4156. * Use the ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_*
  4157. * macros
  4158. */
  4159. u16 dtx_mode;
  4160. /* Specifies whether DTX mode is disabled or enabled.
  4161. * Supported values:
  4162. * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF
  4163. * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1
  4164. */
  4165. } __packed;
  4166. #define ASM_MEDIA_FMT_AMRWB_FS 0x00010BEC
  4167. /* Enumeration for 6.6 kbps AMR-WB Encoding mode. */
  4168. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR66 0
  4169. /* Enumeration for 8.85 kbps AMR-WB Encoding mode. */
  4170. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR885 1
  4171. /* Enumeration for 12.65 kbps AMR-WB Encoding mode. */
  4172. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1265 2
  4173. /* Enumeration for 14.25 kbps AMR-WB Encoding mode. */
  4174. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1425 3
  4175. /* Enumeration for 15.85 kbps AMR-WB Encoding mode. */
  4176. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1585 4
  4177. /* Enumeration for 18.25 kbps AMR-WB Encoding mode. */
  4178. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1825 5
  4179. /* Enumeration for 19.85 kbps AMR-WB Encoding mode. */
  4180. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1985 6
  4181. /* Enumeration for 23.05 kbps AMR-WB Encoding mode. */
  4182. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2305 7
  4183. /* Enumeration for 23.85 kbps AMR-WB Encoding mode. */
  4184. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2385 8
  4185. struct asm_amrwb_enc_cfg {
  4186. struct apr_hdr hdr;
  4187. struct asm_stream_cmd_set_encdec_param encdec;
  4188. struct asm_enc_cfg_blk_param_v2 encblk;
  4189. u16 enc_mode;
  4190. /* AMR-WB encoding rate.
  4191. * Suupported values:
  4192. * Use the ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_*
  4193. * macros
  4194. */
  4195. u16 dtx_mode;
  4196. /* Specifies whether DTX mode is disabled or enabled.
  4197. * Supported values:
  4198. * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF
  4199. * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1
  4200. */
  4201. } __packed;
  4202. #define ASM_MEDIA_FMT_V13K_FS 0x00010BED
  4203. /* Enumeration for 14.4 kbps V13K Encoding mode. */
  4204. #define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 0
  4205. /* Enumeration for 12.2 kbps V13K Encoding mode. */
  4206. #define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220 1
  4207. /* Enumeration for 11.2 kbps V13K Encoding mode. */
  4208. #define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120 2
  4209. /* Enumeration for 9.0 kbps V13K Encoding mode. */
  4210. #define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90 3
  4211. /* Enumeration for 7.2 kbps V13K eEncoding mode. */
  4212. #define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720 4
  4213. /* Enumeration for 1/8 vocoder rate.*/
  4214. #define ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE 1
  4215. /* Enumeration for 1/4 vocoder rate. */
  4216. #define ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE 2
  4217. /* Enumeration for 1/2 vocoder rate. */
  4218. #define ASM_MEDIA_FMT_VOC_HALF_RATE 3
  4219. /* Enumeration for full vocoder rate. */
  4220. #define ASM_MEDIA_FMT_VOC_FULL_RATE 4
  4221. struct asm_v13k_enc_cfg {
  4222. struct apr_hdr hdr;
  4223. struct asm_stream_cmd_set_encdec_param encdec;
  4224. struct asm_enc_cfg_blk_param_v2 encblk;
  4225. u16 max_rate;
  4226. /* Maximum allowed encoder frame rate.
  4227. * Supported values:
  4228. * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
  4229. * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
  4230. * - #ASM_MEDIA_FMT_VOC_HALF_RATE
  4231. * - #ASM_MEDIA_FMT_VOC_FULL_RATE
  4232. */
  4233. u16 min_rate;
  4234. /* Minimum allowed encoder frame rate.
  4235. * Supported values:
  4236. * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
  4237. * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
  4238. * - #ASM_MEDIA_FMT_VOC_HALF_RATE
  4239. * - #ASM_MEDIA_FMT_VOC_FULL_RATE
  4240. */
  4241. u16 reduced_rate_cmd;
  4242. /* Reduced rate command, used to change
  4243. * the average bitrate of the V13K
  4244. * vocoder.
  4245. * Supported values:
  4246. * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 (Default)
  4247. * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220
  4248. * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120
  4249. * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90
  4250. * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720
  4251. */
  4252. u16 rate_mod_cmd;
  4253. /* Rate modulation command. Default = 0.
  4254. *- If bit 0=1, rate control is enabled.
  4255. *- If bit 1=1, the maximum number of consecutive full rate
  4256. * frames is limited with numbers supplied in
  4257. * bits 2 to 10.
  4258. *- If bit 1=0, the minimum number of non-full rate frames
  4259. * in between two full rate frames is forced to
  4260. * the number supplied in bits 2 to 10. In both cases, if necessary,
  4261. * half rate is used to substitute full rate. - Bits 15 to 10 are
  4262. * reserved and must all be set to zero.
  4263. */
  4264. } __packed;
  4265. #define ASM_MEDIA_FMT_EVRC_FS 0x00010BEE
  4266. /* EVRC encoder configuration structure used in the
  4267. * #ASM_PARAM_ID_ENCDEC_ENC_CFG_BLK_V2 command.
  4268. */
  4269. struct asm_evrc_enc_cfg {
  4270. struct apr_hdr hdr;
  4271. struct asm_stream_cmd_set_encdec_param encdec;
  4272. struct asm_enc_cfg_blk_param_v2 encblk;
  4273. u16 max_rate;
  4274. /* Maximum allowed encoder frame rate.
  4275. * Supported values:
  4276. * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
  4277. * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
  4278. * - #ASM_MEDIA_FMT_VOC_HALF_RATE
  4279. * - #ASM_MEDIA_FMT_VOC_FULL_RATE
  4280. */
  4281. u16 min_rate;
  4282. /* Minimum allowed encoder frame rate.
  4283. * Supported values:
  4284. * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
  4285. * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
  4286. * - #ASM_MEDIA_FMT_VOC_HALF_RATE
  4287. * - #ASM_MEDIA_FMT_VOC_FULL_RATE
  4288. */
  4289. u16 rate_mod_cmd;
  4290. /* Rate modulation command. Default: 0.
  4291. * - If bit 0=1, rate control is enabled.
  4292. * - If bit 1=1, the maximum number of consecutive full rate frames
  4293. * is limited with numbers supplied in bits 2 to 10.
  4294. *
  4295. * - If bit 1=0, the minimum number of non-full rate frames in
  4296. * between two full rate frames is forced to the number supplied in
  4297. * bits 2 to 10. In both cases, if necessary, half rate is used to
  4298. * substitute full rate.
  4299. *
  4300. * - Bits 15 to 10 are reserved and must all be set to zero.
  4301. */
  4302. u16 reserved;
  4303. /* Reserved. Clients must set this field to zero. */
  4304. } __packed;
  4305. #define ASM_MEDIA_FMT_WMA_V10PRO_V2 0x00010DA7
  4306. struct asm_wmaprov10_fmt_blk_v2 {
  4307. struct apr_hdr hdr;
  4308. struct asm_data_cmd_media_fmt_update_v2 fmtblk;
  4309. u16 fmtag;
  4310. /* WMA format type.
  4311. * Supported values:
  4312. * - 0x162 -- WMA 9 Pro
  4313. * - 0x163 -- WMA 9 Pro Lossless
  4314. * - 0x166 -- WMA 10 Pro
  4315. * - 0x167 -- WMA 10 Pro Lossless
  4316. */
  4317. u16 num_channels;
  4318. /* Number of channels encoded in the input stream.
  4319. * Supported values: 1 to 8
  4320. */
  4321. u32 sample_rate;
  4322. /* Number of samples per second (in Hertz).
  4323. * Supported values: 11025, 16000, 22050, 32000, 44100, 48000,
  4324. * 88200, 96000
  4325. */
  4326. u32 avg_bytes_per_sec;
  4327. /* Bitrate expressed as the average bytes per second.
  4328. * Supported values: 2000 to 96000
  4329. */
  4330. u16 blk_align;
  4331. /* Size of the bitstream packet size in bytes. WMA Pro files
  4332. * have a payload of one block per bitstream packet.
  4333. * Supported values: @le 13376
  4334. */
  4335. u16 bits_per_sample;
  4336. /* Number of bits per sample in the encoded WMA stream.
  4337. * Supported values: 16, 24
  4338. */
  4339. u32 channel_mask;
  4340. /* Bit-packed double word (32-bits) that indicates the
  4341. * recommended speaker positions for each source channel.
  4342. */
  4343. u16 enc_options;
  4344. /* Bit-packed word with values that indicate whether certain
  4345. * features of the bitstream are used.
  4346. * Supported values: - 0x0001 -- ENCOPT3_PURE_LOSSLESS - 0x0006 --
  4347. * ENCOPT3_FRM_SIZE_MOD - 0x0038 -- ENCOPT3_SUBFRM_DIV - 0x0040 --
  4348. * ENCOPT3_WRITE_FRAMESIZE_IN_HDR - 0x0080 --
  4349. * ENCOPT3_GENERATE_DRC_PARAMS - 0x0100 -- ENCOPT3_RTMBITS
  4350. */
  4351. u16 usAdvancedEncodeOpt;
  4352. /* Advanced encoding option. */
  4353. u32 advanced_enc_options2;
  4354. /* Advanced encoding option 2. */
  4355. } __packed;
  4356. #define ASM_MEDIA_FMT_WMA_V9_V2 0x00010DA8
  4357. struct asm_wmastdv9_fmt_blk_v2 {
  4358. struct apr_hdr hdr;
  4359. struct asm_data_cmd_media_fmt_update_v2 fmtblk;
  4360. u16 fmtag;
  4361. /* WMA format tag.
  4362. * Supported values: 0x161 (WMA 9 standard)
  4363. */
  4364. u16 num_channels;
  4365. /* Number of channels in the stream.
  4366. * Supported values: 1, 2
  4367. */
  4368. u32 sample_rate;
  4369. /* Number of samples per second (in Hertz).
  4370. * Supported values: 48000
  4371. */
  4372. u32 avg_bytes_per_sec;
  4373. /* Bitrate expressed as the average bytes per second. */
  4374. u16 blk_align;
  4375. /* Block align. All WMA files with a maximum packet size of
  4376. * 13376 are supported.
  4377. */
  4378. u16 bits_per_sample;
  4379. /* Number of bits per sample in the output.
  4380. * Supported values: 16
  4381. */
  4382. u32 channel_mask;
  4383. /* Channel mask.
  4384. * Supported values:
  4385. * - 3 -- Stereo (front left/front right)
  4386. * - 4 -- Mono (center)
  4387. */
  4388. u16 enc_options;
  4389. /* Options used during encoding. */
  4390. u16 reserved;
  4391. } __packed;
  4392. #define ASM_MEDIA_FMT_WMA_V8 0x00010D91
  4393. struct asm_wmastdv8_enc_cfg {
  4394. struct apr_hdr hdr;
  4395. struct asm_stream_cmd_set_encdec_param encdec;
  4396. struct asm_enc_cfg_blk_param_v2 encblk;
  4397. u32 bit_rate;
  4398. /* Encoding rate in bits per second. */
  4399. u32 sample_rate;
  4400. /* Number of samples per second.
  4401. *
  4402. * Supported values:
  4403. * - 0 -- Native mode
  4404. * - Other Supported values are 22050, 32000, 44100, and 48000.
  4405. *
  4406. * Native mode indicates that encoding must be performed with the
  4407. * sampling rate at the input.
  4408. * The sampling rate must not change during encoding.
  4409. */
  4410. u16 channel_cfg;
  4411. /* Number of channels to encode.
  4412. * Supported values:
  4413. * - 0 -- Native mode
  4414. * - 1 -- Mono
  4415. * - 2 -- Stereo
  4416. * - Other values are not supported.
  4417. *
  4418. * Native mode indicates that encoding must be performed with the
  4419. * number of channels at the input.
  4420. * The number of channels must not change during encoding.
  4421. */
  4422. u16 reserved;
  4423. /* Reserved. Clients must set this field to zero.*/
  4424. } __packed;
  4425. #define ASM_MEDIA_FMT_AMR_WB_PLUS_V2 0x00010DA9
  4426. struct asm_amrwbplus_fmt_blk_v2 {
  4427. struct apr_hdr hdr;
  4428. struct asm_data_cmd_media_fmt_update_v2 fmtblk;
  4429. u32 amr_frame_fmt;
  4430. /* AMR frame format.
  4431. * Supported values:
  4432. * - 6 -- Transport Interface Format (TIF)
  4433. * - Any other value -- File storage format (FSF)
  4434. *
  4435. * TIF stream contains 2-byte header for each frame within the
  4436. * superframe. FSF stream contains one 2-byte header per superframe.
  4437. */
  4438. } __packed;
  4439. #define ASM_MEDIA_FMT_AC3 0x00010DEE
  4440. #define ASM_MEDIA_FMT_EAC3 0x00010DEF
  4441. #define ASM_MEDIA_FMT_DTS 0x00010D88
  4442. #define ASM_MEDIA_FMT_MP2 0x00010DE9
  4443. #define ASM_MEDIA_FMT_FLAC 0x00010C16
  4444. #define ASM_MEDIA_FMT_ALAC 0x00012F31
  4445. #define ASM_MEDIA_FMT_VORBIS 0x00010C15
  4446. #define ASM_MEDIA_FMT_APE 0x00012F32
  4447. #define ASM_MEDIA_FMT_DSD 0x00012F3E
  4448. #define ASM_MEDIA_FMT_TRUEHD 0x00013215
  4449. /* 0x0 is used for fomat ID since ADSP dynamically determines the
  4450. * format encapsulated in the IEC61937 (compressed) or IEC60958
  4451. * (pcm) packets.
  4452. */
  4453. #define ASM_MEDIA_FMT_IEC 0x00000000
  4454. /* Media format ID for adaptive transform acoustic coding. This
  4455. * ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED command
  4456. * only.
  4457. */
  4458. #define ASM_MEDIA_FMT_ATRAC 0x00010D89
  4459. /* Media format ID for metadata-enhanced audio transmission.
  4460. * This ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED
  4461. * command only.
  4462. */
  4463. #define ASM_MEDIA_FMT_MAT 0x00010D8A
  4464. /* adsp_media_fmt.h */
  4465. #define ASM_DATA_CMD_WRITE_V2 0x00010DAB
  4466. struct asm_data_cmd_write_v2 {
  4467. struct apr_hdr hdr;
  4468. u32 buf_addr_lsw;
  4469. /* The 64 bit address msw-lsw should be a valid, mapped address.
  4470. * 64 bit address should be a multiple of 32 bytes
  4471. */
  4472. u32 buf_addr_msw;
  4473. /* The 64 bit address msw-lsw should be a valid, mapped address.
  4474. * 64 bit address should be a multiple of 32 bytes.
  4475. * -Address of the buffer containing the data to be decoded.
  4476. * The buffer should be aligned to a 32 byte boundary.
  4477. * -In the case of 32 bit Shared memory address, msw field must
  4478. * -be set to zero.
  4479. * -In the case of 36 bit shared memory address, bit 31 to bit 4
  4480. * -of msw must be set to zero.
  4481. */
  4482. u32 mem_map_handle;
  4483. /* memory map handle returned by DSP through
  4484. * ASM_CMD_SHARED_MEM_MAP_REGIONS command
  4485. */
  4486. u32 buf_size;
  4487. /* Number of valid bytes available in the buffer for decoding. The
  4488. * first byte starts at buf_addr.
  4489. */
  4490. u32 seq_id;
  4491. /* Optional buffer sequence ID. */
  4492. u32 timestamp_lsw;
  4493. /* Lower 32 bits of the 64-bit session time in microseconds of the
  4494. * first buffer sample.
  4495. */
  4496. u32 timestamp_msw;
  4497. /* Upper 32 bits of the 64-bit session time in microseconds of the
  4498. * first buffer sample.
  4499. */
  4500. u32 flags;
  4501. /* Bitfield of flags.
  4502. * Supported values for bit 31:
  4503. * - 1 -- Valid timestamp.
  4504. * - 0 -- Invalid timestamp.
  4505. * - Use #ASM_BIT_MASKIMESTAMP_VALID_FLAG as the bitmask and
  4506. * #ASM_SHIFTIMESTAMP_VALID_FLAG as the shift value to set this bit.
  4507. * Supported values for bit 30:
  4508. * - 1 -- Last buffer.
  4509. * - 0 -- Not the last buffer.
  4510. *
  4511. * Supported values for bit 29:
  4512. * - 1 -- Continue the timestamp from the previous buffer.
  4513. * - 0 -- Timestamp of the current buffer is not related
  4514. * to the timestamp of the previous buffer.
  4515. * - Use #ASM_BIT_MASKS_CONTINUE_FLAG and #ASM_SHIFTS_CONTINUE_FLAG
  4516. * to set this bit.
  4517. *
  4518. * Supported values for bit 4:
  4519. * - 1 -- End of the frame.
  4520. * - 0 -- Not the end of frame, or this information is not known.
  4521. * - Use #ASM_BIT_MASK_EOF_FLAG as the bitmask and #ASM_SHIFT_EOF_FLAG
  4522. * as the shift value to set this bit.
  4523. *
  4524. * All other bits are reserved and must be set to 0.
  4525. *
  4526. * If bit 31=0 and bit 29=1: The timestamp of the first sample in
  4527. * this buffer continues from the timestamp of the last sample in
  4528. * the previous buffer. If there is no previous buffer (i.e., this
  4529. * is the first buffer sent after opening the stream or after a
  4530. * flush operation), or if the previous buffer does not have a valid
  4531. * timestamp, the samples in the current buffer also do not have a
  4532. * valid timestamp. They are played out as soon as possible.
  4533. *
  4534. *
  4535. * If bit 31=0 and bit 29=0: No timestamp is associated with the
  4536. * first sample in this buffer. The samples are played out as soon
  4537. * as possible.
  4538. *
  4539. *
  4540. * If bit 31=1 and bit 29 is ignored: The timestamp specified in
  4541. * this payload is honored.
  4542. *
  4543. *
  4544. * If bit 30=0: Not the last buffer in the stream. This is useful
  4545. * in removing trailing samples.
  4546. *
  4547. *
  4548. * For bit 4: The client can set this flag for every buffer sent in
  4549. * which the last byte is the end of a frame. If this flag is set,
  4550. * the buffer can contain data from multiple frames, but it should
  4551. * always end at a frame boundary. Restrictions allow the aDSP to
  4552. * detect an end of frame without requiring additional processing.
  4553. */
  4554. } __packed;
  4555. #define ASM_DATA_CMD_READ_V2 0x00010DAC
  4556. struct asm_data_cmd_read_v2 {
  4557. struct apr_hdr hdr;
  4558. u32 buf_addr_lsw;
  4559. /* the 64 bit address msw-lsw should be a valid mapped address
  4560. * and should be a multiple of 32 bytes
  4561. */
  4562. u32 buf_addr_msw;
  4563. /* the 64 bit address msw-lsw should be a valid mapped address
  4564. * and should be a multiple of 32 bytes.
  4565. * - Address of the buffer where the DSP puts the encoded data,
  4566. * potentially, at an offset specified by the uOffset field in
  4567. * ASM_DATA_EVENT_READ_DONE structure. The buffer should be aligned
  4568. * to a 32 byte boundary.
  4569. * - In the case of 32 bit Shared memory address, msw field must
  4570. * - be set to zero.
  4571. * - In the case of 36 bit shared memory address, bit 31 to bit
  4572. * - 4 of msw must be set to zero.
  4573. */
  4574. u32 mem_map_handle;
  4575. /* memory map handle returned by DSP through
  4576. * ASM_CMD_SHARED_MEM_MAP_REGIONS command.
  4577. */
  4578. u32 buf_size;
  4579. /* Number of bytes available for the aDSP to write. The aDSP
  4580. * starts writing from buf_addr.
  4581. */
  4582. u32 seq_id;
  4583. /* Optional buffer sequence ID. */
  4584. } __packed;
  4585. #define ASM_DATA_CMD_EOS 0x00010BDB
  4586. #define ASM_DATA_EVENT_RENDERED_EOS 0x00010C1C
  4587. #define ASM_DATA_EVENT_EOS 0x00010BDD
  4588. #define ASM_DATA_EVENT_WRITE_DONE_V2 0x00010D99
  4589. struct asm_data_event_write_done_v2 {
  4590. u32 buf_addr_lsw;
  4591. /* lsw of the 64 bit address */
  4592. u32 buf_addr_msw;
  4593. /* msw of the 64 bit address. address given by the client in
  4594. * ASM_DATA_CMD_WRITE_V2 command.
  4595. */
  4596. u32 mem_map_handle;
  4597. /* memory map handle in the ASM_DATA_CMD_WRITE_V2 */
  4598. u32 status;
  4599. /* Status message (error code) that indicates whether the
  4600. * referenced buffer has been successfully consumed.
  4601. * Supported values: Refer to @xhyperref{Q3,[Q3]}
  4602. */
  4603. } __packed;
  4604. #define ASM_DATA_EVENT_READ_DONE_V2 0x00010D9A
  4605. /* Definition of the frame metadata flag bitmask.*/
  4606. #define ASM_BIT_MASK_FRAME_METADATA_FLAG (0x40000000UL)
  4607. /* Definition of the frame metadata flag shift value. */
  4608. #define ASM_SHIFT_FRAME_METADATA_FLAG 30
  4609. struct asm_data_event_read_done_v2 {
  4610. u32 status;
  4611. /* Status message (error code).
  4612. * Supported values: Refer to @xhyperref{Q3,[Q3]}
  4613. */
  4614. u32 buf_addr_lsw;
  4615. /* 64 bit address msw-lsw is a valid, mapped address. 64 bit
  4616. * address is a multiple of 32 bytes.
  4617. */
  4618. u32 buf_addr_msw;
  4619. /* 64 bit address msw-lsw is a valid, mapped address. 64 bit
  4620. * address is a multiple of 32 bytes.
  4621. *
  4622. * -Same address provided by the client in ASM_DATA_CMD_READ_V2
  4623. * -In the case of 32 bit Shared memory address, msw field is set to
  4624. * zero.
  4625. * -In the case of 36 bit shared memory address, bit 31 to bit 4
  4626. * -of msw is set to zero.
  4627. */
  4628. u32 mem_map_handle;
  4629. /* memory map handle in the ASM_DATA_CMD_READ_V2 */
  4630. u32 enc_framesotal_size;
  4631. /* Total size of the encoded frames in bytes.
  4632. * Supported values: >0
  4633. */
  4634. u32 offset;
  4635. /* Offset (from buf_addr) to the first byte of the first encoded
  4636. * frame. All encoded frames are consecutive, starting from this
  4637. * offset.
  4638. * Supported values: > 0
  4639. */
  4640. u32 timestamp_lsw;
  4641. /* Lower 32 bits of the 64-bit session time in microseconds of
  4642. * the first sample in the buffer. If Bit 5 of mode_flags flag of
  4643. * ASM_STREAM_CMD_OPEN_READ_V2 is 1 then the 64 bit timestamp is
  4644. * absolute capture time otherwise it is relative session time. The
  4645. * absolute timestamp doesn't reset unless the system is reset.
  4646. */
  4647. u32 timestamp_msw;
  4648. /* Upper 32 bits of the 64-bit session time in microseconds of
  4649. * the first sample in the buffer.
  4650. */
  4651. u32 flags;
  4652. /* Bitfield of flags. Bit 30 indicates whether frame metadata is
  4653. * present. If frame metadata is present, num_frames consecutive
  4654. * instances of @xhyperref{hdr:FrameMetaData,Frame metadata} start
  4655. * at the buffer address.
  4656. * Supported values for bit 31:
  4657. * - 1 -- Timestamp is valid.
  4658. * - 0 -- Timestamp is invalid.
  4659. * - Use #ASM_BIT_MASKIMESTAMP_VALID_FLAG and
  4660. * #ASM_SHIFTIMESTAMP_VALID_FLAG to set this bit.
  4661. *
  4662. * Supported values for bit 30:
  4663. * - 1 -- Frame metadata is present.
  4664. * - 0 -- Frame metadata is absent.
  4665. * - Use #ASM_BIT_MASK_FRAME_METADATA_FLAG and
  4666. * #ASM_SHIFT_FRAME_METADATA_FLAG to set this bit.
  4667. *
  4668. * All other bits are reserved; the aDSP sets them to 0.
  4669. */
  4670. u32 num_frames;
  4671. /* Number of encoded frames in the buffer. */
  4672. u32 seq_id;
  4673. /* Optional buffer sequence ID. */
  4674. } __packed;
  4675. struct asm_data_read_buf_metadata_v2 {
  4676. u32 offset;
  4677. /* Offset from buf_addr in #ASM_DATA_EVENT_READ_DONE_PAYLOAD to
  4678. * the frame associated with this metadata.
  4679. * Supported values: > 0
  4680. */
  4681. u32 frm_size;
  4682. /* Size of the encoded frame in bytes.
  4683. * Supported values: > 0
  4684. */
  4685. u32 num_encoded_pcm_samples;
  4686. /* Number of encoded PCM samples (per channel) in the frame
  4687. * associated with this metadata.
  4688. * Supported values: > 0
  4689. */
  4690. u32 timestamp_lsw;
  4691. /* Lower 32 bits of the 64-bit session time in microseconds of the
  4692. * first sample for this frame.
  4693. * If Bit 5 of mode_flags flag of ASM_STREAM_CMD_OPEN_READ_V2 is 1
  4694. * then the 64 bit timestamp is absolute capture time otherwise it
  4695. * is relative session time. The absolute timestamp doesn't reset
  4696. * unless the system is reset.
  4697. */
  4698. u32 timestamp_msw;
  4699. /* Lower 32 bits of the 64-bit session time in microseconds of the
  4700. * first sample for this frame.
  4701. */
  4702. u32 flags;
  4703. /* Frame flags.
  4704. * Supported values for bit 31:
  4705. * - 1 -- Time stamp is valid
  4706. * - 0 -- Time stamp is not valid
  4707. * - All other bits are reserved; the aDSP sets them to 0.
  4708. */
  4709. } __packed;
  4710. /* Notifies the client of a change in the data sampling rate or
  4711. * Channel mode. This event is raised by the decoder service. The
  4712. * event is enabled through the mode flags of
  4713. * #ASM_STREAM_CMD_OPEN_WRITE_V2 or
  4714. * #ASM_STREAM_CMD_OPEN_READWRITE_V2. - The decoder detects a change
  4715. * in the output sampling frequency or the number/positioning of
  4716. * output channels, or if it is the first frame decoded.The new
  4717. * sampling frequency or the new channel configuration is
  4718. * communicated back to the client asynchronously.
  4719. */
  4720. #define ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY 0x00010C65
  4721. /* Payload of the #ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY event.
  4722. * This event is raised when the following conditions are both true:
  4723. * - The event is enabled through the mode_flags of
  4724. * #ASM_STREAM_CMD_OPEN_WRITE_V2 or
  4725. * #ASM_STREAM_CMD_OPEN_READWRITE_V2. - The decoder detects a change
  4726. * in either the output sampling frequency or the number/positioning
  4727. * of output channels, or if it is the first frame decoded.
  4728. * This event is not raised (even if enabled) if the decoder is
  4729. * MIDI, because
  4730. */
  4731. struct asm_data_event_sr_cm_change_notify {
  4732. u32 sample_rate;
  4733. /* New sampling rate (in Hertz) after detecting a change in the
  4734. * bitstream.
  4735. * Supported values: 2000 to 48000
  4736. */
  4737. u16 num_channels;
  4738. /* New number of channels after detecting a change in the
  4739. * bitstream.
  4740. * Supported values: 1 to 8
  4741. */
  4742. u16 reserved;
  4743. /* Reserved for future use. This field must be set to 0.*/
  4744. u8 channel_mapping[8];
  4745. } __packed;
  4746. /* Notifies the client of a data sampling rate or channel mode
  4747. * change. This event is raised by the encoder service.
  4748. * This event is raised when :
  4749. * - Native mode encoding was requested in the encoder
  4750. * configuration (i.e., the channel number was 0), the sample rate
  4751. * was 0, or both were 0.
  4752. *
  4753. * - The input data frame at the encoder is the first one, or the
  4754. * sampling rate/channel mode is different from the previous input
  4755. * data frame.
  4756. *
  4757. */
  4758. #define ASM_DATA_EVENT_ENC_SR_CM_CHANGE_NOTIFY 0x00010BDE
  4759. struct asm_data_event_enc_sr_cm_change_notify {
  4760. u32 sample_rate;
  4761. /* New sampling rate (in Hertz) after detecting a change in the
  4762. * input data.
  4763. * Supported values: 2000 to 48000
  4764. */
  4765. u16 num_channels;
  4766. /* New number of channels after detecting a change in the input
  4767. * data. Supported values: 1 to 8
  4768. */
  4769. u16 bits_per_sample;
  4770. /* New bits per sample after detecting a change in the input
  4771. * data.
  4772. * Supported values: 16, 24
  4773. */
  4774. u8 channel_mapping[8];
  4775. } __packed;
  4776. #define ASM_DATA_CMD_IEC_60958_FRAME_RATE 0x00010D87
  4777. /* Payload of the #ASM_DATA_CMD_IEC_60958_FRAME_RATE command,
  4778. * which is used to indicate the IEC 60958 frame rate of a given
  4779. * packetized audio stream.
  4780. */
  4781. struct asm_data_cmd_iec_60958_frame_rate {
  4782. u32 frame_rate;
  4783. /* IEC 60958 frame rate of the incoming IEC 61937 packetized stream.
  4784. * Supported values: Any valid frame rate
  4785. */
  4786. } __packed;
  4787. /* adsp_asm_data_commands.h*/
  4788. /* Definition of the stream ID bitmask.*/
  4789. #define ASM_BIT_MASK_STREAM_ID (0x000000FFUL)
  4790. /* Definition of the stream ID shift value.*/
  4791. #define ASM_SHIFT_STREAM_ID 0
  4792. /* Definition of the session ID bitmask.*/
  4793. #define ASM_BIT_MASK_SESSION_ID (0x0000FF00UL)
  4794. /* Definition of the session ID shift value.*/
  4795. #define ASM_SHIFT_SESSION_ID 8
  4796. /* Definition of the service ID bitmask.*/
  4797. #define ASM_BIT_MASK_SERVICE_ID (0x00FF0000UL)
  4798. /* Definition of the service ID shift value.*/
  4799. #define ASM_SHIFT_SERVICE_ID 16
  4800. /* Definition of the domain ID bitmask.*/
  4801. #define ASM_BIT_MASK_DOMAIN_ID (0xFF000000UL)
  4802. /* Definition of the domain ID shift value.*/
  4803. #define ASM_SHIFT_DOMAIN_ID 24
  4804. #define ASM_CMD_SHARED_MEM_MAP_REGIONS 0x00010D92
  4805. #define ASM_CMDRSP_SHARED_MEM_MAP_REGIONS 0x00010D93
  4806. #define ASM_CMD_SHARED_MEM_UNMAP_REGIONS 0x00010D94
  4807. /* adsp_asm_service_commands.h */
  4808. #define ASM_MAX_SESSION_ID (15)
  4809. /* Maximum number of sessions.*/
  4810. #define ASM_MAX_NUM_SESSIONS ASM_MAX_SESSION_ID
  4811. /* Maximum number of streams per session.*/
  4812. #define ASM_MAX_STREAMS_PER_SESSION (8)
  4813. #define ASM_SESSION_CMD_RUN_V2 0x00010DAA
  4814. #define ASM_SESSION_CMD_RUN_STARTIME_RUN_IMMEDIATE 0
  4815. #define ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_ABSOLUTEIME 1
  4816. #define ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_RELATIVEIME 2
  4817. #define ASM_SESSION_CMD_RUN_STARTIME_RUN_WITH_DELAY 3
  4818. #define ASM_BIT_MASK_RUN_STARTIME (0x00000003UL)
  4819. /* Bit shift value used to specify the start time for the
  4820. * ASM_SESSION_CMD_RUN_V2 command.
  4821. */
  4822. #define ASM_SHIFT_RUN_STARTIME 0
  4823. struct asm_session_cmd_run_v2 {
  4824. struct apr_hdr hdr;
  4825. u32 flags;
  4826. /* Specifies whether to run immediately or at a specific
  4827. * rendering time or with a specified delay. Run with delay is
  4828. * useful for delaying in case of ASM loopback opened through
  4829. * ASM_STREAM_CMD_OPEN_LOOPBACK_V2. Use #ASM_BIT_MASK_RUN_STARTIME
  4830. * and #ASM_SHIFT_RUN_STARTIME to set this 2-bit flag.
  4831. *
  4832. *
  4833. *Bits 0 and 1 can take one of four possible values:
  4834. *
  4835. *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_IMMEDIATE
  4836. *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_ABSOLUTEIME
  4837. *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_RELATIVEIME
  4838. *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_WITH_DELAY
  4839. *
  4840. *All other bits are reserved; clients must set them to zero.
  4841. */
  4842. u32 time_lsw;
  4843. /* Lower 32 bits of the time in microseconds used to align the
  4844. * session origin time. When bits 0-1 of flags is
  4845. * ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, time lsw is the lsw of
  4846. * the delay in us. For ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY,
  4847. * maximum value of the 64 bit delay is 150 ms.
  4848. */
  4849. u32 time_msw;
  4850. /* Upper 32 bits of the time in microseconds used to align the
  4851. * session origin time. When bits 0-1 of flags is
  4852. * ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, time msw is the msw of
  4853. * the delay in us. For ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY,
  4854. * maximum value of the 64 bit delay is 150 ms.
  4855. */
  4856. } __packed;
  4857. #define ASM_SESSION_CMD_PAUSE 0x00010BD3
  4858. #define ASM_SESSION_CMD_SUSPEND 0x00010DEC
  4859. #define ASM_SESSION_CMD_GET_SESSIONTIME_V3 0x00010D9D
  4860. #define ASM_SESSION_CMD_REGISTER_FOR_RX_UNDERFLOW_EVENTS 0x00010BD5
  4861. struct asm_session_cmd_rgstr_rx_underflow {
  4862. struct apr_hdr hdr;
  4863. u16 enable_flag;
  4864. /* Specifies whether a client is to receive events when an Rx
  4865. * session underflows.
  4866. * Supported values:
  4867. * - 0 -- Do not send underflow events
  4868. * - 1 -- Send underflow events
  4869. */
  4870. u16 reserved;
  4871. /* Reserved. This field must be set to zero.*/
  4872. } __packed;
  4873. #define ASM_SESSION_CMD_REGISTER_FORX_OVERFLOW_EVENTS 0x00010BD6
  4874. struct asm_session_cmd_regx_overflow {
  4875. struct apr_hdr hdr;
  4876. u16 enable_flag;
  4877. /* Specifies whether a client is to receive events when a Tx
  4878. * session overflows.
  4879. * Supported values:
  4880. * - 0 -- Do not send overflow events
  4881. * - 1 -- Send overflow events
  4882. */
  4883. u16 reserved;
  4884. /* Reserved. This field must be set to zero.*/
  4885. } __packed;
  4886. #define ASM_SESSION_EVENT_RX_UNDERFLOW 0x00010C17
  4887. #define ASM_SESSION_EVENTX_OVERFLOW 0x00010C18
  4888. #define ASM_SESSION_CMDRSP_GET_SESSIONTIME_V3 0x00010D9E
  4889. struct asm_session_cmdrsp_get_sessiontime_v3 {
  4890. u32 status;
  4891. /* Status message (error code).
  4892. * Supported values: Refer to @xhyperref{Q3,[Q3]}
  4893. */
  4894. u32 sessiontime_lsw;
  4895. /* Lower 32 bits of the current session time in microseconds.*/
  4896. u32 sessiontime_msw;
  4897. /* Upper 32 bits of the current session time in microseconds.*/
  4898. u32 absolutetime_lsw;
  4899. /* Lower 32 bits in micro seconds of the absolute time at which
  4900. * the * sample corresponding to the above session time gets
  4901. * rendered * to hardware. This absolute time may be slightly in the
  4902. * future or past.
  4903. */
  4904. u32 absolutetime_msw;
  4905. /* Upper 32 bits in micro seconds of the absolute time at which
  4906. * the * sample corresponding to the above session time gets
  4907. * rendered to * hardware. This absolute time may be slightly in the
  4908. * future or past.
  4909. */
  4910. } __packed;
  4911. #define ASM_SESSION_CMD_ADJUST_SESSION_CLOCK_V2 0x00010D9F
  4912. struct asm_session_cmd_adjust_session_clock_v2 {
  4913. struct apr_hdr hdr;
  4914. u32 adjustime_lsw;
  4915. /* Lower 32 bits of the signed 64-bit quantity that specifies the
  4916. * adjustment time in microseconds to the session clock.
  4917. *
  4918. * Positive values indicate advancement of the session clock.
  4919. * Negative values indicate delay of the session clock.
  4920. */
  4921. u32 adjustime_msw;
  4922. /* Upper 32 bits of the signed 64-bit quantity that specifies
  4923. * the adjustment time in microseconds to the session clock.
  4924. * Positive values indicate advancement of the session clock.
  4925. * Negative values indicate delay of the session clock.
  4926. */
  4927. } __packed;
  4928. #define ASM_SESSION_CMDRSP_ADJUST_SESSION_CLOCK_V2 0x00010DA0
  4929. struct asm_session_cmdrsp_adjust_session_clock_v2 {
  4930. u32 status;
  4931. /* Status message (error code).
  4932. * Supported values: Refer to @xhyperref{Q3,[Q3]}
  4933. * An error means the session clock is not adjusted. In this case,
  4934. * the next two fields are irrelevant.
  4935. */
  4936. u32 actual_adjustime_lsw;
  4937. /* Lower 32 bits of the signed 64-bit quantity that specifies
  4938. * the actual adjustment in microseconds performed by the aDSP.
  4939. * A positive value indicates advancement of the session clock. A
  4940. * negative value indicates delay of the session clock.
  4941. */
  4942. u32 actual_adjustime_msw;
  4943. /* Upper 32 bits of the signed 64-bit quantity that specifies
  4944. * the actual adjustment in microseconds performed by the aDSP.
  4945. * A positive value indicates advancement of the session clock. A
  4946. * negative value indicates delay of the session clock.
  4947. */
  4948. u32 cmd_latency_lsw;
  4949. /* Lower 32 bits of the unsigned 64-bit quantity that specifies
  4950. * the amount of time in microseconds taken to perform the session
  4951. * clock adjustment.
  4952. */
  4953. u32 cmd_latency_msw;
  4954. /* Upper 32 bits of the unsigned 64-bit quantity that specifies
  4955. * the amount of time in microseconds taken to perform the session
  4956. * clock adjustment.
  4957. */
  4958. } __packed;
  4959. #define ASM_SESSION_CMD_GET_PATH_DELAY_V2 0x00010DAF
  4960. #define ASM_SESSION_CMDRSP_GET_PATH_DELAY_V2 0x00010DB0
  4961. struct asm_session_cmdrsp_get_path_delay_v2 {
  4962. u32 status;
  4963. /* Status message (error code). Whether this get delay operation
  4964. * is successful or not. Delay value is valid only if status is
  4965. * success.
  4966. * Supported values: Refer to @xhyperref{Q5,[Q5]}
  4967. */
  4968. u32 audio_delay_lsw;
  4969. /* Upper 32 bits of the aDSP delay in microseconds. */
  4970. u32 audio_delay_msw;
  4971. /* Lower 32 bits of the aDSP delay in microseconds. */
  4972. } __packed;
  4973. /* adsp_asm_session_command.h*/
  4974. #define ASM_STREAM_CMD_OPEN_WRITE_V3 0x00010DB3
  4975. #define ASM_LOW_LATENCY_STREAM_SESSION 0x10000000
  4976. #define ASM_ULTRA_LOW_LATENCY_STREAM_SESSION 0x20000000
  4977. #define ASM_ULL_POST_PROCESSING_STREAM_SESSION 0x40000000
  4978. #define ASM_LEGACY_STREAM_SESSION 0
  4979. struct asm_stream_cmd_open_write_v3 {
  4980. struct apr_hdr hdr;
  4981. uint32_t mode_flags;
  4982. /* Mode flags that configure the stream to notify the client
  4983. * whenever it detects an SR/CM change at the input to its POPP.
  4984. * Supported values for bits 0 to 1:
  4985. * - Reserved; clients must set them to zero.
  4986. * Supported values for bit 2:
  4987. * - 0 -- SR/CM change notification event is disabled.
  4988. * - 1 -- SR/CM change notification event is enabled.
  4989. * - Use #ASM_BIT_MASK_SR_CM_CHANGE_NOTIFY_FLAG and
  4990. * #ASM_SHIFT_SR_CM_CHANGE_NOTIFY_FLAG to set or get this bit.
  4991. *
  4992. * Supported values for bit 31:
  4993. * - 0 -- Stream to be opened in on-Gapless mode.
  4994. * - 1 -- Stream to be opened in Gapless mode. In Gapless mode,
  4995. * successive streams must be opened with same session ID but
  4996. * different stream IDs.
  4997. *
  4998. * - Use #ASM_BIT_MASK_GAPLESS_MODE_FLAG and
  4999. * #ASM_SHIFT_GAPLESS_MODE_FLAG to set or get this bit.
  5000. *
  5001. *
  5002. * @note1hang MIDI and DTMF streams cannot be opened in Gapless mode.
  5003. */
  5004. uint16_t sink_endpointype;
  5005. /*< Sink point type.
  5006. * Supported values:
  5007. * - 0 -- Device matrix
  5008. * - Other values are reserved.
  5009. *
  5010. * The device matrix is the gateway to the hardware ports.
  5011. */
  5012. uint16_t bits_per_sample;
  5013. /*< Number of bits per sample processed by ASM modules.
  5014. * Supported values: 16 and 24 bits per sample
  5015. */
  5016. uint32_t postprocopo_id;
  5017. /*< Specifies the topology (order of processing) of
  5018. * postprocessing algorithms. <i>None</i> means no postprocessing.
  5019. * Supported values:
  5020. * - #ASM_STREAM_POSTPROCOPO_ID_DEFAULT
  5021. * - #ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL
  5022. * - #ASM_STREAM_POSTPROCOPO_ID_NONE
  5023. *
  5024. * This field can also be enabled through SetParams flags.
  5025. */
  5026. uint32_t dec_fmt_id;
  5027. /*< Configuration ID of the decoder media format.
  5028. *
  5029. * Supported values:
  5030. * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
  5031. * - #ASM_MEDIA_FMT_ADPCM
  5032. * - #ASM_MEDIA_FMT_MP3
  5033. * - #ASM_MEDIA_FMT_AAC_V2
  5034. * - #ASM_MEDIA_FMT_DOLBY_AAC
  5035. * - #ASM_MEDIA_FMT_AMRNB_FS
  5036. * - #ASM_MEDIA_FMT_AMRWB_FS
  5037. * - #ASM_MEDIA_FMT_AMR_WB_PLUS_V2
  5038. * - #ASM_MEDIA_FMT_V13K_FS
  5039. * - #ASM_MEDIA_FMT_EVRC_FS
  5040. * - #ASM_MEDIA_FMT_EVRCB_FS
  5041. * - #ASM_MEDIA_FMT_EVRCWB_FS
  5042. * - #ASM_MEDIA_FMT_SBC
  5043. * - #ASM_MEDIA_FMT_WMA_V10PRO_V2
  5044. * - #ASM_MEDIA_FMT_WMA_V9_V2
  5045. * - #ASM_MEDIA_FMT_AC3
  5046. * - #ASM_MEDIA_FMT_EAC3
  5047. * - #ASM_MEDIA_FMT_G711_ALAW_FS
  5048. * - #ASM_MEDIA_FMT_G711_MLAW_FS
  5049. * - #ASM_MEDIA_FMT_G729A_FS
  5050. * - #ASM_MEDIA_FMT_FR_FS
  5051. * - #ASM_MEDIA_FMT_VORBIS
  5052. * - #ASM_MEDIA_FMT_FLAC
  5053. * - #ASM_MEDIA_FMT_ALAC
  5054. * - #ASM_MEDIA_FMT_APE
  5055. * - #ASM_MEDIA_FMT_EXAMPLE
  5056. */
  5057. } __packed;
  5058. #define ASM_STREAM_CMD_OPEN_PULL_MODE_WRITE 0x00010DD9
  5059. /* Bitmask for the stream_perf_mode subfield. */
  5060. #define ASM_BIT_MASK_STREAM_PERF_FLAG_PULL_MODE_WRITE 0xE0000000UL
  5061. /* Bitmask for the stream_perf_mode subfield. */
  5062. #define ASM_SHIFT_STREAM_PERF_FLAG_PULL_MODE_WRITE 29
  5063. #define ASM_STREAM_CMD_OPEN_PUSH_MODE_READ 0x00010DDA
  5064. #define ASM_BIT_MASK_STREAM_PERF_FLAG_PUSH_MODE_READ 0xE0000000UL
  5065. #define ASM_SHIFT_STREAM_PERF_FLAG_PUSH_MODE_READ 29
  5066. #define ASM_DATA_EVENT_WATERMARK 0x00010DDB
  5067. struct asm_shared_position_buffer {
  5068. volatile uint32_t frame_counter;
  5069. /* Counter used to handle interprocessor synchronization issues.
  5070. * When frame_counter is 0: read_index, wall_clock_us_lsw, and
  5071. * wall_clock_us_msw are invalid.
  5072. * Supported values: >= 0.
  5073. */
  5074. volatile uint32_t index;
  5075. /* Index in bytes from where the aDSP is reading/writing.
  5076. * Supported values: 0 to circular buffer size - 1
  5077. */
  5078. volatile uint32_t wall_clock_us_lsw;
  5079. /* Lower 32 bits of the 64-bit wall clock time in microseconds when the
  5080. * read index was updated.
  5081. * Supported values: >= 0
  5082. */
  5083. volatile uint32_t wall_clock_us_msw;
  5084. /* Upper 32 bits of the 64 bit wall clock time in microseconds when the
  5085. * read index was updated
  5086. * Supported values: >= 0
  5087. */
  5088. } __packed;
  5089. struct asm_shared_watermark_level {
  5090. uint32_t watermark_level_bytes;
  5091. } __packed;
  5092. struct asm_stream_cmd_open_shared_io {
  5093. struct apr_hdr hdr;
  5094. uint32_t mode_flags;
  5095. uint16_t endpoint_type;
  5096. uint16_t topo_bits_per_sample;
  5097. uint32_t topo_id;
  5098. uint32_t fmt_id;
  5099. uint32_t shared_pos_buf_phy_addr_lsw;
  5100. uint32_t shared_pos_buf_phy_addr_msw;
  5101. uint16_t shared_pos_buf_mem_pool_id;
  5102. uint16_t shared_pos_buf_num_regions;
  5103. uint32_t shared_pos_buf_property_flag;
  5104. uint32_t shared_circ_buf_start_phy_addr_lsw;
  5105. uint32_t shared_circ_buf_start_phy_addr_msw;
  5106. uint32_t shared_circ_buf_size;
  5107. uint16_t shared_circ_buf_mem_pool_id;
  5108. uint16_t shared_circ_buf_num_regions;
  5109. uint32_t shared_circ_buf_property_flag;
  5110. uint32_t num_watermark_levels;
  5111. struct asm_multi_channel_pcm_fmt_blk_v3 fmt;
  5112. struct avs_shared_map_region_payload map_region_pos_buf;
  5113. struct avs_shared_map_region_payload map_region_circ_buf;
  5114. struct asm_shared_watermark_level watermark[0];
  5115. } __packed;
  5116. #define ASM_STREAM_CMD_OPEN_READ_V3 0x00010DB4
  5117. /* Definition of the timestamp type flag bitmask */
  5118. #define ASM_BIT_MASKIMESTAMPYPE_FLAG (0x00000020UL)
  5119. /* Definition of the timestamp type flag shift value. */
  5120. #define ASM_SHIFTIMESTAMPYPE_FLAG 5
  5121. /* Relative timestamp is identified by this value.*/
  5122. #define ASM_RELATIVEIMESTAMP 0
  5123. /* Absolute timestamp is identified by this value.*/
  5124. #define ASM_ABSOLUTEIMESTAMP 1
  5125. /* Bit value for Low Latency Tx stream subfield */
  5126. #define ASM_LOW_LATENCY_TX_STREAM_SESSION 1
  5127. /* Bit shift for the stream_perf_mode subfield. */
  5128. #define ASM_SHIFT_STREAM_PERF_MODE_FLAG_IN_OPEN_READ 29
  5129. struct asm_stream_cmd_open_read_v3 {
  5130. struct apr_hdr hdr;
  5131. u32 mode_flags;
  5132. /* Mode flags that indicate whether meta information per encoded
  5133. * frame is to be provided.
  5134. * Supported values for bit 4:
  5135. *
  5136. * - 0 -- Return data buffer contains all encoded frames only; it
  5137. * does not contain frame metadata.
  5138. *
  5139. * - 1 -- Return data buffer contains an array of metadata and
  5140. * encoded frames.
  5141. *
  5142. * - Use #ASM_BIT_MASK_META_INFO_FLAG as the bitmask and
  5143. * #ASM_SHIFT_META_INFO_FLAG as the shift value for this bit.
  5144. *
  5145. *
  5146. * Supported values for bit 5:
  5147. *
  5148. * - ASM_RELATIVEIMESTAMP -- ASM_DATA_EVENT_READ_DONE_V2 will have
  5149. * - relative time-stamp.
  5150. * - ASM_ABSOLUTEIMESTAMP -- ASM_DATA_EVENT_READ_DONE_V2 will
  5151. * - have absolute time-stamp.
  5152. *
  5153. * - Use #ASM_BIT_MASKIMESTAMPYPE_FLAG as the bitmask and
  5154. * #ASM_SHIFTIMESTAMPYPE_FLAG as the shift value for this bit.
  5155. *
  5156. * All other bits are reserved; clients must set them to zero.
  5157. */
  5158. u32 src_endpointype;
  5159. /* Specifies the endpoint providing the input samples.
  5160. * Supported values:
  5161. * - 0 -- Device matrix
  5162. * - All other values are reserved; clients must set them to zero.
  5163. * Otherwise, an error is returned.
  5164. * The device matrix is the gateway from the tunneled Tx ports.
  5165. */
  5166. u32 preprocopo_id;
  5167. /* Specifies the topology (order of processing) of preprocessing
  5168. * algorithms. <i>None</i> means no preprocessing.
  5169. * Supported values:
  5170. * - #ASM_STREAM_PREPROCOPO_ID_DEFAULT
  5171. * - #ASM_STREAM_PREPROCOPO_ID_NONE
  5172. *
  5173. * This field can also be enabled through SetParams flags.
  5174. */
  5175. u32 enc_cfg_id;
  5176. /* Media configuration ID for encoded output.
  5177. * Supported values:
  5178. * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
  5179. * - #ASM_MEDIA_FMT_AAC_V2
  5180. * - #ASM_MEDIA_FMT_AMRNB_FS
  5181. * - #ASM_MEDIA_FMT_AMRWB_FS
  5182. * - #ASM_MEDIA_FMT_V13K_FS
  5183. * - #ASM_MEDIA_FMT_EVRC_FS
  5184. * - #ASM_MEDIA_FMT_EVRCB_FS
  5185. * - #ASM_MEDIA_FMT_EVRCWB_FS
  5186. * - #ASM_MEDIA_FMT_SBC
  5187. * - #ASM_MEDIA_FMT_G711_ALAW_FS
  5188. * - #ASM_MEDIA_FMT_G711_MLAW_FS
  5189. * - #ASM_MEDIA_FMT_G729A_FS
  5190. * - #ASM_MEDIA_FMT_EXAMPLE
  5191. * - #ASM_MEDIA_FMT_WMA_V8
  5192. */
  5193. u16 bits_per_sample;
  5194. /* Number of bits per sample processed by ASM modules.
  5195. * Supported values: 16 and 24 bits per sample
  5196. */
  5197. u16 reserved;
  5198. /* Reserved for future use. This field must be set to zero.*/
  5199. } __packed;
  5200. #define ASM_POPP_OUTPUT_SR_NATIVE_RATE 0
  5201. /* Enumeration for the maximum sampling rate at the POPP output.*/
  5202. #define ASM_POPP_OUTPUT_SR_MAX_RATE 48000
  5203. #define ASM_STREAM_CMD_OPEN_READWRITE_V2 0x00010D8D
  5204. #define ASM_STREAM_CMD_OPEN_READWRITE_V2 0x00010D8D
  5205. struct asm_stream_cmd_open_readwrite_v2 {
  5206. struct apr_hdr hdr;
  5207. u32 mode_flags;
  5208. /* Mode flags.
  5209. * Supported values for bit 2:
  5210. * - 0 -- SR/CM change notification event is disabled.
  5211. * - 1 -- SR/CM change notification event is enabled. Use
  5212. * #ASM_BIT_MASK_SR_CM_CHANGE_NOTIFY_FLAG and
  5213. * #ASM_SHIFT_SR_CM_CHANGE_NOTIFY_FLAG to set or
  5214. * getting this flag.
  5215. *
  5216. * Supported values for bit 4:
  5217. * - 0 -- Return read data buffer contains all encoded frames only; it
  5218. * does not contain frame metadata.
  5219. * - 1 -- Return read data buffer contains an array of metadata and
  5220. * encoded frames.
  5221. *
  5222. * All other bits are reserved; clients must set them to zero.
  5223. */
  5224. u32 postprocopo_id;
  5225. /* Specifies the topology (order of processing) of postprocessing
  5226. * algorithms. <i>None</i> means no postprocessing.
  5227. *
  5228. * Supported values:
  5229. * - #ASM_STREAM_POSTPROCOPO_ID_DEFAULT
  5230. * - #ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL
  5231. * - #ASM_STREAM_POSTPROCOPO_ID_NONE
  5232. */
  5233. u32 dec_fmt_id;
  5234. /* Specifies the media type of the input data. PCM indicates that
  5235. * no decoding must be performed, e.g., this is an NT encoder
  5236. * session.
  5237. * Supported values:
  5238. * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
  5239. * - #ASM_MEDIA_FMT_ADPCM
  5240. * - #ASM_MEDIA_FMT_MP3
  5241. * - #ASM_MEDIA_FMT_AAC_V2
  5242. * - #ASM_MEDIA_FMT_DOLBY_AAC
  5243. * - #ASM_MEDIA_FMT_AMRNB_FS
  5244. * - #ASM_MEDIA_FMT_AMRWB_FS
  5245. * - #ASM_MEDIA_FMT_V13K_FS
  5246. * - #ASM_MEDIA_FMT_EVRC_FS
  5247. * - #ASM_MEDIA_FMT_EVRCB_FS
  5248. * - #ASM_MEDIA_FMT_EVRCWB_FS
  5249. * - #ASM_MEDIA_FMT_SBC
  5250. * - #ASM_MEDIA_FMT_WMA_V10PRO_V2
  5251. * - #ASM_MEDIA_FMT_WMA_V9_V2
  5252. * - #ASM_MEDIA_FMT_AMR_WB_PLUS_V2
  5253. * - #ASM_MEDIA_FMT_AC3
  5254. * - #ASM_MEDIA_FMT_G711_ALAW_FS
  5255. * - #ASM_MEDIA_FMT_G711_MLAW_FS
  5256. * - #ASM_MEDIA_FMT_G729A_FS
  5257. * - #ASM_MEDIA_FMT_EXAMPLE
  5258. */
  5259. u32 enc_cfg_id;
  5260. /* Specifies the media type for the output of the stream. PCM
  5261. * indicates that no encoding must be performed, e.g., this is an NT
  5262. * decoder session.
  5263. * Supported values:
  5264. * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
  5265. * - #ASM_MEDIA_FMT_AAC_V2
  5266. * - #ASM_MEDIA_FMT_AMRNB_FS
  5267. * - #ASM_MEDIA_FMT_AMRWB_FS
  5268. * - #ASM_MEDIA_FMT_V13K_FS
  5269. * - #ASM_MEDIA_FMT_EVRC_FS
  5270. * - #ASM_MEDIA_FMT_EVRCB_FS
  5271. * - #ASM_MEDIA_FMT_EVRCWB_FS
  5272. * - #ASM_MEDIA_FMT_SBC
  5273. * - #ASM_MEDIA_FMT_G711_ALAW_FS
  5274. * - #ASM_MEDIA_FMT_G711_MLAW_FS
  5275. * - #ASM_MEDIA_FMT_G729A_FS
  5276. * - #ASM_MEDIA_FMT_EXAMPLE
  5277. * - #ASM_MEDIA_FMT_WMA_V8
  5278. */
  5279. u16 bits_per_sample;
  5280. /* Number of bits per sample processed by ASM modules.
  5281. * Supported values: 16 and 24 bits per sample
  5282. */
  5283. u16 reserved;
  5284. /* Reserved for future use. This field must be set to zero.*/
  5285. } __packed;
  5286. #define ASM_STREAM_CMD_OPEN_LOOPBACK_V2 0x00010D8E
  5287. struct asm_stream_cmd_open_loopback_v2 {
  5288. struct apr_hdr hdr;
  5289. u32 mode_flags;
  5290. /* Mode flags.
  5291. * Bit 0-31: reserved; client should set these bits to 0
  5292. */
  5293. u16 src_endpointype;
  5294. /* Endpoint type. 0 = Tx Matrix */
  5295. u16 sink_endpointype;
  5296. /* Endpoint type. 0 = Rx Matrix */
  5297. u32 postprocopo_id;
  5298. /* Postprocessor topology ID. Specifies the topology of
  5299. * postprocessing algorithms.
  5300. */
  5301. u16 bits_per_sample;
  5302. /* The number of bits per sample processed by ASM modules
  5303. * Supported values: 16 and 24 bits per sample
  5304. */
  5305. u16 reserved;
  5306. /* Reserved for future use. This field must be set to zero. */
  5307. } __packed;
  5308. #define ASM_STREAM_CMD_OPEN_TRANSCODE_LOOPBACK 0x00010DBA
  5309. /* Bitmask for the stream's Performance mode. */
  5310. #define ASM_BIT_MASK_STREAM_PERF_MODE_FLAG_IN_OPEN_TRANSCODE_LOOPBACK \
  5311. (0x70000000UL)
  5312. /* Bit shift for the stream's Performance mode. */
  5313. #define ASM_SHIFT_STREAM_PERF_MODE_FLAG_IN_OPEN_TRANSCODE_LOOPBACK 28
  5314. /* Bitmask for the decoder converter enable flag. */
  5315. #define ASM_BIT_MASK_DECODER_CONVERTER_FLAG (0x00000078UL)
  5316. /* Shift value for the decoder converter enable flag. */
  5317. #define ASM_SHIFT_DECODER_CONVERTER_FLAG 3
  5318. /* Converter mode is None (Default). */
  5319. #define ASM_CONVERTER_MODE_NONE 0
  5320. /* Converter mode is DDP-to-DD. */
  5321. #define ASM_DDP_DD_CONVERTER_MODE 1
  5322. /* Identifies a special converter mode where source and sink formats
  5323. * are the same but postprocessing must applied. Therefore, Decode
  5324. * @rarrow Re-encode is necessary.
  5325. */
  5326. #define ASM_POST_PROCESS_CONVERTER_MODE 2
  5327. struct asm_stream_cmd_open_transcode_loopback_t {
  5328. struct apr_hdr hdr;
  5329. u32 mode_flags;
  5330. /* Mode Flags specifies the performance mode in which this stream
  5331. * is to be opened.
  5332. * Supported values{for bits 30 to 28}(stream_perf_mode flag)
  5333. *
  5334. * #ASM_LEGACY_STREAM_SESSION -- This mode ensures backward
  5335. * compatibility to the original behavior
  5336. * of ASM_STREAM_CMD_OPEN_TRANSCODE_LOOPBACK
  5337. *
  5338. * #ASM_LOW_LATENCY_STREAM_SESSION -- Opens a loopback session by using
  5339. * shortened buffers in low latency POPP
  5340. * - Recommendation: Do not enable high latency algorithms. They might
  5341. * negate the benefits of opening a low latency stream, and they
  5342. * might also suffer quality degradation from unexpected jitter.
  5343. * - This Low Latency mode is supported only for PCM In and PCM Out
  5344. * loopbacks. An error is returned if Low Latency mode is opened for
  5345. * other transcode loopback modes.
  5346. * - To configure this subfield, use
  5347. * ASM_BIT_MASK_STREAM_PERF_MODE_FLAG_IN_OPEN_TRANSCODE_LOOPBACK and
  5348. * ASM_SHIFT_STREAM_PERF_MODE_FLAG_IN_OPEN_TRANSCODE_LOOPBACK.
  5349. *
  5350. * Supported values{for bits 6 to 3} (decoder-converter compatibility)
  5351. * #ASM_CONVERTER_MODE_NONE (0x0) -- Default
  5352. * #ASM_DDP_DD_CONVERTER_MODE (0x1)
  5353. * #ASM_POST_PROCESS_CONVERTER_MODE (0x2)
  5354. * 0x3-0xF -- Reserved for future use
  5355. * - Use #ASM_BIT_MASK_DECODER_CONVERTER_FLAG and
  5356. * ASM_SHIFT_DECODER_CONVERTER_FLAG to set this bit
  5357. * All other bits are reserved; clients must set them to 0.
  5358. */
  5359. u32 src_format_id;
  5360. /* Specifies the media format of the input audio stream.
  5361. *
  5362. * Supported values
  5363. * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
  5364. * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V3
  5365. * - #ASM_MEDIA_FMT_DTS
  5366. * - #ASM_MEDIA_FMT_EAC3_DEC
  5367. * - #ASM_MEDIA_FMT_EAC3
  5368. * - #ASM_MEDIA_FMT_AC3_DEC
  5369. * - #ASM_MEDIA_FMT_AC3
  5370. */
  5371. u32 sink_format_id;
  5372. /* Specifies the media format of the output stream.
  5373. *
  5374. * Supported values
  5375. * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
  5376. * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V3
  5377. * - #ASM_MEDIA_FMT_DTS (not supported in Low Latency mode)
  5378. * - #ASM_MEDIA_FMT_EAC3_DEC (not supported in Low Latency mode)
  5379. * - #ASM_MEDIA_FMT_EAC3 (not supported in Low Latency mode)
  5380. * - #ASM_MEDIA_FMT_AC3_DEC (not supported in Low Latency mode)
  5381. * - #ASM_MEDIA_FMT_AC3 (not supported in Low Latency mode)
  5382. */
  5383. u32 audproc_topo_id;
  5384. /* Postprocessing topology ID, which specifies the topology (order of
  5385. * processing) of postprocessing algorithms.
  5386. *
  5387. * Supported values
  5388. * - #ASM_STREAM_POSTPROC_TOPO_ID_DEFAULT
  5389. * - #ASM_STREAM_POSTPROC_TOPO_ID_PEAKMETER
  5390. * - #ASM_STREAM_POSTPROC_TOPO_ID_MCH_PEAK_VOL
  5391. * - #ASM_STREAM_POSTPROC_TOPO_ID_NONE
  5392. * Topologies can be added through #ASM_CMD_ADD_TOPOLOGIES.
  5393. * This field is ignored for the Converter mode, in which no
  5394. * postprocessing is performed.
  5395. */
  5396. u16 src_endpoint_type;
  5397. /* Specifies the source endpoint that provides the input samples.
  5398. *
  5399. * Supported values
  5400. * - 0 -- Tx device matrix or stream router (gateway to the hardware
  5401. * ports)
  5402. * - All other values are reserved
  5403. * Clients must set this field to 0. Otherwise, an error is returned.
  5404. */
  5405. u16 sink_endpoint_type;
  5406. /* Specifies the sink endpoint type.
  5407. *
  5408. * Supported values
  5409. * - 0 -- Rx device matrix or stream router (gateway to the hardware
  5410. * ports)
  5411. * - All other values are reserved
  5412. * Clients must set this field to 0. Otherwise, an error is returned.
  5413. */
  5414. u16 bits_per_sample;
  5415. /* Number of bits per sample processed by the ASM modules.
  5416. * Supported values 16, 24
  5417. */
  5418. u16 reserved;
  5419. /* This field must be set to 0.
  5420. */
  5421. } __packed;
  5422. #define ASM_STREAM_CMD_CLOSE 0x00010BCD
  5423. #define ASM_STREAM_CMD_FLUSH 0x00010BCE
  5424. #define ASM_STREAM_CMD_FLUSH_READBUFS 0x00010C09
  5425. #define ASM_STREAM_CMD_SET_PP_PARAMS_V2 0x00010DA1
  5426. struct asm_stream_cmd_set_pp_params_v2 {
  5427. u32 data_payload_addr_lsw;
  5428. /* LSW of parameter data payload address. Supported values: any. */
  5429. u32 data_payload_addr_msw;
  5430. /* MSW of Parameter data payload address. Supported values: any.
  5431. * - Must be set to zero for in-band data.
  5432. * - In the case of 32 bit Shared memory address, msw field must be
  5433. * - set to zero.
  5434. * - In the case of 36 bit shared memory address, bit 31 to bit 4 of
  5435. * msw
  5436. *
  5437. * - must be set to zero.
  5438. */
  5439. u32 mem_map_handle;
  5440. /* Supported Values: Any.
  5441. * memory map handle returned by DSP through
  5442. * ASM_CMD_SHARED_MEM_MAP_REGIONS
  5443. * command.
  5444. * if mmhandle is NULL, the ParamData payloads are within the
  5445. * message payload (in-band).
  5446. * If mmhandle is non-NULL, the ParamData payloads begin at the
  5447. * address specified in the address msw and lsw (out-of-band).
  5448. */
  5449. u32 data_payload_size;
  5450. /* Size in bytes of the variable payload accompanying the
  5451. * message, or in shared memory. This field is used for parsing the
  5452. * parameter payload.
  5453. */
  5454. } __packed;
  5455. struct asm_stream_param_data_v2 {
  5456. u32 module_id;
  5457. /* Unique module ID. */
  5458. u32 param_id;
  5459. /* Unique parameter ID. */
  5460. u16 param_size;
  5461. /* Data size of the param_id/module_id combination. This is
  5462. * a multiple of 4 bytes.
  5463. */
  5464. u16 reserved;
  5465. /* Reserved for future enhancements. This field must be set to
  5466. * zero.
  5467. */
  5468. } __packed;
  5469. #define ASM_STREAM_CMD_GET_PP_PARAMS_V2 0x00010DA2
  5470. struct asm_stream_cmd_get_pp_params_v2 {
  5471. u32 data_payload_addr_lsw;
  5472. /* LSW of the parameter data payload address. */
  5473. u32 data_payload_addr_msw;
  5474. /* MSW of the parameter data payload address.
  5475. * - Size of the shared memory, if specified, shall be large enough
  5476. * to contain the whole ParamData payload, including Module ID,
  5477. * Param ID, Param Size, and Param Values
  5478. * - Must be set to zero for in-band data
  5479. * - In the case of 32 bit Shared memory address, msw field must be
  5480. * set to zero.
  5481. * - In the case of 36 bit shared memory address, bit 31 to bit 4 of
  5482. * msw must be set to zero.
  5483. */
  5484. u32 mem_map_handle;
  5485. /* Supported Values: Any.
  5486. * memory map handle returned by DSP through ASM_CMD_SHARED_MEM_MAP_REGIONS
  5487. * command.
  5488. * if mmhandle is NULL, the ParamData payloads in the ACK are within the
  5489. * message payload (in-band).
  5490. * If mmhandle is non-NULL, the ParamData payloads in the ACK begin at the
  5491. * address specified in the address msw and lsw.
  5492. * (out-of-band).
  5493. */
  5494. u32 module_id;
  5495. /* Unique module ID. */
  5496. u32 param_id;
  5497. /* Unique parameter ID. */
  5498. u16 param_max_size;
  5499. /* Maximum data size of the module_id/param_id combination. This
  5500. * is a multiple of 4 bytes.
  5501. */
  5502. u16 reserved;
  5503. /* Reserved for backward compatibility. Clients must set this
  5504. * field to zero.
  5505. */
  5506. } __packed;
  5507. #define ASM_STREAM_CMD_SET_ENCDEC_PARAM 0x00010C10
  5508. #define ASM_STREAM_CMD_SET_ENCDEC_PARAM_V2 0x00013218
  5509. struct asm_stream_cmd_set_encdec_param_v2 {
  5510. u16 service_id;
  5511. /* 0 - ASM_ENCODER_SVC; 1 - ASM_DECODER_SVC */
  5512. u16 reserved;
  5513. u32 param_id;
  5514. /* ID of the parameter. */
  5515. u32 param_size;
  5516. /*
  5517. * Data size of this parameter, in bytes. The size is a multiple
  5518. * of 4 bytes.
  5519. */
  5520. } __packed;
  5521. #define ASM_STREAM_CMD_REGISTER_ENCDEC_EVENTS 0x00013219
  5522. #define ASM_STREAM_CMD_ENCDEC_EVENTS 0x0001321A
  5523. #define AVS_PARAM_ID_RTIC_SHARED_MEMORY_ADDR 0x00013237
  5524. struct avs_rtic_shared_mem_addr {
  5525. struct apr_hdr hdr;
  5526. struct asm_stream_cmd_set_encdec_param_v2 encdec;
  5527. u32 shm_buf_addr_lsw;
  5528. /* Lower 32 bit of the RTIC shared memory */
  5529. u32 shm_buf_addr_msw;
  5530. /* Upper 32 bit of the RTIC shared memory */
  5531. u32 buf_size;
  5532. /* Size of buffer */
  5533. u16 shm_buf_mem_pool_id;
  5534. /* ADSP_MEMORY_MAP_SHMEM8_4K_POOL */
  5535. u16 shm_buf_num_regions;
  5536. /* number of regions to map */
  5537. u32 shm_buf_flag;
  5538. /* buffer property flag */
  5539. struct avs_shared_map_region_payload map_region;
  5540. /* memory map region*/
  5541. } __packed;
  5542. #define AVS_PARAM_ID_RTIC_EVENT_ACK 0x00013238
  5543. struct avs_param_rtic_event_ack {
  5544. struct apr_hdr hdr;
  5545. struct asm_stream_cmd_set_encdec_param_v2 encdec;
  5546. } __packed;
  5547. #define ASM_PARAM_ID_ENCDEC_BITRATE 0x00010C13
  5548. struct asm_bitrate_param {
  5549. u32 bitrate;
  5550. /* Maximum supported bitrate. Only the AAC encoder is supported.*/
  5551. } __packed;
  5552. #define ASM_PARAM_ID_ENCDEC_ENC_CFG_BLK_V2 0x00010DA3
  5553. #define ASM_PARAM_ID_AAC_SBR_PS_FLAG 0x00010C63
  5554. /* Flag to turn off both SBR and PS processing, if they are
  5555. * present in the bitstream.
  5556. */
  5557. #define ASM_AAC_SBR_OFF_PS_OFF (2)
  5558. /* Flag to turn on SBR but turn off PS processing,if they are
  5559. * present in the bitstream.
  5560. */
  5561. #define ASM_AAC_SBR_ON_PS_OFF (1)
  5562. /* Flag to turn on both SBR and PS processing, if they are
  5563. * present in the bitstream (default behavior).
  5564. */
  5565. #define ASM_AAC_SBR_ON_PS_ON (0)
  5566. /* Structure for an AAC SBR PS processing flag. */
  5567. /* Payload of the #ASM_PARAM_ID_AAC_SBR_PS_FLAG parameter in the
  5568. * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
  5569. */
  5570. struct asm_aac_sbr_ps_flag_param {
  5571. struct apr_hdr hdr;
  5572. struct asm_stream_cmd_set_encdec_param encdec;
  5573. struct asm_enc_cfg_blk_param_v2 encblk;
  5574. u32 sbr_ps_flag;
  5575. /* Control parameter to enable or disable SBR/PS processing in
  5576. * the AAC bitstream. Use the following macros to set this field:
  5577. * - #ASM_AAC_SBR_OFF_PS_OFF -- Turn off both SBR and PS
  5578. * processing, if they are present in the bitstream.
  5579. * - #ASM_AAC_SBR_ON_PS_OFF -- Turn on SBR processing, but not PS
  5580. * processing, if they are present in the bitstream.
  5581. * - #ASM_AAC_SBR_ON_PS_ON -- Turn on both SBR and PS processing,
  5582. * if they are present in the bitstream (default behavior).
  5583. * - All other values are invalid.
  5584. * Changes are applied to the next decoded frame.
  5585. */
  5586. } __packed;
  5587. #define ASM_PARAM_ID_AAC_DUAL_MONO_MAPPING 0x00010C64
  5588. /* First single channel element in a dual mono bitstream.*/
  5589. #define ASM_AAC_DUAL_MONO_MAP_SCE_1 (1)
  5590. /* Second single channel element in a dual mono bitstream.*/
  5591. #define ASM_AAC_DUAL_MONO_MAP_SCE_2 (2)
  5592. /* Structure for AAC decoder dual mono channel mapping. */
  5593. struct asm_aac_dual_mono_mapping_param {
  5594. struct apr_hdr hdr;
  5595. struct asm_stream_cmd_set_encdec_param encdec;
  5596. u16 left_channel_sce;
  5597. u16 right_channel_sce;
  5598. } __packed;
  5599. #define ASM_STREAM_CMDRSP_GET_PP_PARAMS_V2 0x00010DA4
  5600. struct asm_stream_cmdrsp_get_pp_params_v2 {
  5601. u32 status;
  5602. } __packed;
  5603. #define ASM_PARAM_ID_AC3_KARAOKE_MODE 0x00010D73
  5604. /* Enumeration for both vocals in a karaoke stream.*/
  5605. #define AC3_KARAOKE_MODE_NO_VOCAL (0)
  5606. /* Enumeration for only the left vocal in a karaoke stream.*/
  5607. #define AC3_KARAOKE_MODE_LEFT_VOCAL (1)
  5608. /* Enumeration for only the right vocal in a karaoke stream.*/
  5609. #define AC3_KARAOKE_MODE_RIGHT_VOCAL (2)
  5610. /* Enumeration for both vocal channels in a karaoke stream.*/
  5611. #define AC3_KARAOKE_MODE_BOTH_VOCAL (3)
  5612. #define ASM_PARAM_ID_AC3_DRC_MODE 0x00010D74
  5613. /* Enumeration for the Custom Analog mode.*/
  5614. #define AC3_DRC_MODE_CUSTOM_ANALOG (0)
  5615. /* Enumeration for the Custom Digital mode.*/
  5616. #define AC3_DRC_MODE_CUSTOM_DIGITAL (1)
  5617. /* Enumeration for the Line Out mode (light compression).*/
  5618. #define AC3_DRC_MODE_LINE_OUT (2)
  5619. /* Enumeration for the RF remodulation mode (heavy compression).*/
  5620. #define AC3_DRC_MODE_RF_REMOD (3)
  5621. #define ASM_PARAM_ID_AC3_DUAL_MONO_MODE 0x00010D75
  5622. /* Enumeration for playing dual mono in stereo mode.*/
  5623. #define AC3_DUAL_MONO_MODE_STEREO (0)
  5624. /* Enumeration for playing left mono.*/
  5625. #define AC3_DUAL_MONO_MODE_LEFT_MONO (1)
  5626. /* Enumeration for playing right mono.*/
  5627. #define AC3_DUAL_MONO_MODE_RIGHT_MONO (2)
  5628. /* Enumeration for mixing both dual mono channels and playing them.*/
  5629. #define AC3_DUAL_MONO_MODE_MIXED_MONO (3)
  5630. #define ASM_PARAM_ID_AC3_STEREO_DOWNMIX_MODE 0x00010D76
  5631. /* Enumeration for using the Downmix mode indicated in the bitstream. */
  5632. #define AC3_STEREO_DOWNMIX_MODE_AUTO_DETECT (0)
  5633. /* Enumeration for Surround Compatible mode (preserves the
  5634. * surround information).
  5635. */
  5636. #define AC3_STEREO_DOWNMIX_MODE_LT_RT (1)
  5637. /* Enumeration for Mono Compatible mode (if the output is to be
  5638. * further downmixed to mono).
  5639. */
  5640. #define AC3_STEREO_DOWNMIX_MODE_LO_RO (2)
  5641. /* ID of the AC3 PCM scale factor parameter in the
  5642. * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
  5643. */
  5644. #define ASM_PARAM_ID_AC3_PCM_SCALEFACTOR 0x00010D78
  5645. /* ID of the AC3 DRC boost scale factor parameter in the
  5646. * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
  5647. */
  5648. #define ASM_PARAM_ID_AC3_DRC_BOOST_SCALEFACTOR 0x00010D79
  5649. /* ID of the AC3 DRC cut scale factor parameter in the
  5650. * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
  5651. */
  5652. #define ASM_PARAM_ID_AC3_DRC_CUT_SCALEFACTOR 0x00010D7A
  5653. /* Structure for AC3 Generic Parameter. */
  5654. /* Payload of the AC3 parameters in the
  5655. * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
  5656. */
  5657. struct asm_ac3_generic_param {
  5658. struct apr_hdr hdr;
  5659. struct asm_stream_cmd_set_encdec_param encdec;
  5660. struct asm_enc_cfg_blk_param_v2 encblk;
  5661. u32 generic_parameter;
  5662. /* AC3 generic parameter. Select from one of the following
  5663. * possible values.
  5664. *
  5665. * For #ASM_PARAM_ID_AC3_KARAOKE_MODE, supported values are:
  5666. * - AC3_KARAOKE_MODE_NO_VOCAL
  5667. * - AC3_KARAOKE_MODE_LEFT_VOCAL
  5668. * - AC3_KARAOKE_MODE_RIGHT_VOCAL
  5669. * - AC3_KARAOKE_MODE_BOTH_VOCAL
  5670. *
  5671. * For #ASM_PARAM_ID_AC3_DRC_MODE, supported values are:
  5672. * - AC3_DRC_MODE_CUSTOM_ANALOG
  5673. * - AC3_DRC_MODE_CUSTOM_DIGITAL
  5674. * - AC3_DRC_MODE_LINE_OUT
  5675. * - AC3_DRC_MODE_RF_REMOD
  5676. *
  5677. * For #ASM_PARAM_ID_AC3_DUAL_MONO_MODE, supported values are:
  5678. * - AC3_DUAL_MONO_MODE_STEREO
  5679. * - AC3_DUAL_MONO_MODE_LEFT_MONO
  5680. * - AC3_DUAL_MONO_MODE_RIGHT_MONO
  5681. * - AC3_DUAL_MONO_MODE_MIXED_MONO
  5682. *
  5683. * For #ASM_PARAM_ID_AC3_STEREO_DOWNMIX_MODE, supported values are:
  5684. * - AC3_STEREO_DOWNMIX_MODE_AUTO_DETECT
  5685. * - AC3_STEREO_DOWNMIX_MODE_LT_RT
  5686. * - AC3_STEREO_DOWNMIX_MODE_LO_RO
  5687. *
  5688. * For #ASM_PARAM_ID_AC3_PCM_SCALEFACTOR, supported values are
  5689. * 0 to 1 in Q31 format.
  5690. *
  5691. * For #ASM_PARAM_ID_AC3_DRC_BOOST_SCALEFACTOR, supported values are
  5692. * 0 to 1 in Q31 format.
  5693. *
  5694. * For #ASM_PARAM_ID_AC3_DRC_CUT_SCALEFACTOR, supported values are
  5695. * 0 to 1 in Q31 format.
  5696. */
  5697. } __packed;
  5698. /* Enumeration for Raw mode (no downmixing), which specifies
  5699. * that all channels in the bitstream are to be played out as is
  5700. * without any downmixing. (Default)
  5701. */
  5702. #define WMAPRO_CHANNEL_MASK_RAW (-1)
  5703. /* Enumeration for setting the channel mask to 0. The 7.1 mode
  5704. * (Home Theater) is assigned.
  5705. */
  5706. #define WMAPRO_CHANNEL_MASK_ZERO 0x0000
  5707. /* Speaker layout mask for one channel (Home Theater, mono).
  5708. * - Speaker front center
  5709. */
  5710. #define WMAPRO_CHANNEL_MASK_1_C 0x0004
  5711. /* Speaker layout mask for two channels (Home Theater, stereo).
  5712. * - Speaker front left
  5713. * - Speaker front right
  5714. */
  5715. #define WMAPRO_CHANNEL_MASK_2_L_R 0x0003
  5716. /* Speaker layout mask for three channels (Home Theater).
  5717. * - Speaker front left
  5718. * - Speaker front right
  5719. * - Speaker front center
  5720. */
  5721. #define WMAPRO_CHANNEL_MASK_3_L_C_R 0x0007
  5722. /* Speaker layout mask for two channels (stereo).
  5723. * - Speaker back left
  5724. * - Speaker back right
  5725. */
  5726. #define WMAPRO_CHANNEL_MASK_2_Bl_Br 0x0030
  5727. /* Speaker layout mask for four channels.
  5728. * - Speaker front left
  5729. * - Speaker front right
  5730. * - Speaker back left
  5731. * - Speaker back right
  5732. */
  5733. #define WMAPRO_CHANNEL_MASK_4_L_R_Bl_Br 0x0033
  5734. /* Speaker layout mask for four channels (Home Theater).
  5735. * - Speaker front left
  5736. * - Speaker front right
  5737. * - Speaker front center
  5738. * - Speaker back center
  5739. */
  5740. #define WMAPRO_CHANNEL_MASK_4_L_R_C_Bc_HT 0x0107
  5741. /* Speaker layout mask for five channels.
  5742. * - Speaker front left
  5743. * - Speaker front right
  5744. * - Speaker front center
  5745. * - Speaker back left
  5746. * - Speaker back right
  5747. */
  5748. #define WMAPRO_CHANNEL_MASK_5_L_C_R_Bl_Br 0x0037
  5749. /* Speaker layout mask for five channels (5 mode, Home Theater).
  5750. * - Speaker front left
  5751. * - Speaker front right
  5752. * - Speaker front center
  5753. * - Speaker side left
  5754. * - Speaker side right
  5755. */
  5756. #define WMAPRO_CHANNEL_MASK_5_L_C_R_Sl_Sr_HT 0x0607
  5757. /* Speaker layout mask for six channels (5.1 mode).
  5758. * - Speaker front left
  5759. * - Speaker front right
  5760. * - Speaker front center
  5761. * - Speaker low frequency
  5762. * - Speaker back left
  5763. * - Speaker back right
  5764. */
  5765. #define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Bl_Br_SLF 0x003F
  5766. /* Speaker layout mask for six channels (5.1 mode, Home Theater).
  5767. * - Speaker front left
  5768. * - Speaker front right
  5769. * - Speaker front center
  5770. * - Speaker low frequency
  5771. * - Speaker side left
  5772. * - Speaker side right
  5773. */
  5774. #define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Sl_Sr_SLF_HT 0x060F
  5775. /* Speaker layout mask for six channels (5.1 mode, no LFE).
  5776. * - Speaker front left
  5777. * - Speaker front right
  5778. * - Speaker front center
  5779. * - Speaker back left
  5780. * - Speaker back right
  5781. * - Speaker back center
  5782. */
  5783. #define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Bl_Br_Bc 0x0137
  5784. /* Speaker layout mask for six channels (5.1 mode, Home Theater,
  5785. * no LFE).
  5786. * - Speaker front left
  5787. * - Speaker front right
  5788. * - Speaker front center
  5789. * - Speaker back center
  5790. * - Speaker side left
  5791. * - Speaker side right
  5792. */
  5793. #define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Sl_Sr_Bc_HT 0x0707
  5794. /* Speaker layout mask for seven channels (6.1 mode).
  5795. * - Speaker front left
  5796. * - Speaker front right
  5797. * - Speaker front center
  5798. * - Speaker low frequency
  5799. * - Speaker back left
  5800. * - Speaker back right
  5801. * - Speaker back center
  5802. */
  5803. #define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Bl_Br_Bc_SLF 0x013F
  5804. /* Speaker layout mask for seven channels (6.1 mode, Home
  5805. * Theater).
  5806. * - Speaker front left
  5807. * - Speaker front right
  5808. * - Speaker front center
  5809. * - Speaker low frequency
  5810. * - Speaker back center
  5811. * - Speaker side left
  5812. * - Speaker side right
  5813. */
  5814. #define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Sl_Sr_Bc_SLF_HT 0x070F
  5815. /* Speaker layout mask for seven channels (6.1 mode, no LFE).
  5816. * - Speaker front left
  5817. * - Speaker front right
  5818. * - Speaker front center
  5819. * - Speaker back left
  5820. * - Speaker back right
  5821. * - Speaker front left of center
  5822. * - Speaker front right of center
  5823. */
  5824. #define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Bl_Br_SFLOC_SFROC 0x00F7
  5825. /* Speaker layout mask for seven channels (6.1 mode, Home
  5826. * Theater, no LFE).
  5827. * - Speaker front left
  5828. * - Speaker front right
  5829. * - Speaker front center
  5830. * - Speaker side left
  5831. * - Speaker side right
  5832. * - Speaker front left of center
  5833. * - Speaker front right of center
  5834. */
  5835. #define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Sl_Sr_SFLOC_SFROC_HT 0x0637
  5836. /* Speaker layout mask for eight channels (7.1 mode).
  5837. * - Speaker front left
  5838. * - Speaker front right
  5839. * - Speaker front center
  5840. * - Speaker back left
  5841. * - Speaker back right
  5842. * - Speaker low frequency
  5843. * - Speaker front left of center
  5844. * - Speaker front right of center
  5845. */
  5846. #define WMAPRO_CHANNEL_MASK_7DOT1_L_C_R_Bl_Br_SLF_SFLOC_SFROC \
  5847. 0x00FF
  5848. /* Speaker layout mask for eight channels (7.1 mode, Home Theater).
  5849. * - Speaker front left
  5850. * - Speaker front right
  5851. * - Speaker front center
  5852. * - Speaker side left
  5853. * - Speaker side right
  5854. * - Speaker low frequency
  5855. * - Speaker front left of center
  5856. * - Speaker front right of center
  5857. *
  5858. */
  5859. #define WMAPRO_CHANNEL_MASK_7DOT1_L_C_R_Sl_Sr_SLF_SFLOC_SFROC_HT \
  5860. 0x063F
  5861. #define ASM_PARAM_ID_DEC_OUTPUT_CHAN_MAP 0x00010D82
  5862. /* Maximum number of decoder output channels. */
  5863. #define MAX_CHAN_MAP_CHANNELS 16
  5864. /* Structure for decoder output channel mapping. */
  5865. /* Payload of the #ASM_PARAM_ID_DEC_OUTPUT_CHAN_MAP parameter in the
  5866. * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
  5867. */
  5868. struct asm_dec_out_chan_map_param {
  5869. struct apr_hdr hdr;
  5870. struct asm_stream_cmd_set_encdec_param encdec;
  5871. u32 num_channels;
  5872. /* Number of decoder output channels.
  5873. * Supported values: 0 to #MAX_CHAN_MAP_CHANNELS
  5874. *
  5875. * A value of 0 indicates native channel mapping, which is valid
  5876. * only for NT mode. This means the output of the decoder is to be
  5877. * preserved as is.
  5878. */
  5879. u8 channel_mapping[MAX_CHAN_MAP_CHANNELS];
  5880. } __packed;
  5881. #define ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED 0x00010D84
  5882. /* Bitmask for the IEC 61937 enable flag.*/
  5883. #define ASM_BIT_MASK_IEC_61937_STREAM_FLAG (0x00000001UL)
  5884. /* Shift value for the IEC 61937 enable flag.*/
  5885. #define ASM_SHIFT_IEC_61937_STREAM_FLAG 0
  5886. /* Bitmask for the IEC 60958 enable flag.*/
  5887. #define ASM_BIT_MASK_IEC_60958_STREAM_FLAG (0x00000002UL)
  5888. /* Shift value for the IEC 60958 enable flag.*/
  5889. #define ASM_SHIFT_IEC_60958_STREAM_FLAG 1
  5890. /* Payload format for open write compressed command */
  5891. /* Payload format for the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED
  5892. * command, which opens a stream for a given session ID and stream ID
  5893. * to be rendered in the compressed format.
  5894. */
  5895. struct asm_stream_cmd_open_write_compressed {
  5896. struct apr_hdr hdr;
  5897. u32 flags;
  5898. /* Mode flags that configure the stream for a specific format.
  5899. * Supported values:
  5900. * - Bit 0 -- IEC 61937 compatibility
  5901. * - 0 -- Stream is not in IEC 61937 format
  5902. * - 1 -- Stream is in IEC 61937 format
  5903. * - Bit 1 -- IEC 60958 compatibility
  5904. * - 0 -- Stream is not in IEC 60958 format
  5905. * - 1 -- Stream is in IEC 60958 format
  5906. * - Bits 2 to 31 -- 0 (Reserved)
  5907. *
  5908. * For the same stream, bit 0 cannot be set to 0 and bit 1 cannot
  5909. * be set to 1. A compressed stream connot have IEC 60958
  5910. * packetization applied without IEC 61937 packetization.
  5911. * @note1hang Currently, IEC 60958 packetized input streams are not
  5912. * supported.
  5913. */
  5914. u32 fmt_id;
  5915. /* Specifies the media type of the HDMI stream to be opened.
  5916. * Supported values:
  5917. * - #ASM_MEDIA_FMT_AC3
  5918. * - #ASM_MEDIA_FMT_EAC3
  5919. * - #ASM_MEDIA_FMT_DTS
  5920. * - #ASM_MEDIA_FMT_ATRAC
  5921. * - #ASM_MEDIA_FMT_MAT
  5922. *
  5923. * @note1hang This field must be set to a valid media type even if
  5924. * IEC 61937 packetization is not performed by the aDSP.
  5925. */
  5926. } __packed;
  5927. /* Indicates the number of samples per channel to be removed from the
  5928. * beginning of the stream.
  5929. */
  5930. #define ASM_DATA_CMD_REMOVE_INITIAL_SILENCE 0x00010D67
  5931. /* Indicates the number of samples per channel to be removed from
  5932. * the end of the stream.
  5933. */
  5934. #define ASM_DATA_CMD_REMOVE_TRAILING_SILENCE 0x00010D68
  5935. struct asm_data_cmd_remove_silence {
  5936. struct apr_hdr hdr;
  5937. u32 num_samples_to_remove;
  5938. /* < Number of samples per channel to be removed.
  5939. * @values 0 to (2@sscr{32}-1)
  5940. */
  5941. } __packed;
  5942. #define ASM_STREAM_CMD_OPEN_READ_COMPRESSED 0x00010D95
  5943. struct asm_stream_cmd_open_read_compressed {
  5944. struct apr_hdr hdr;
  5945. u32 mode_flags;
  5946. /* Mode flags that indicate whether meta information per encoded
  5947. * frame is to be provided.
  5948. * Supported values for bit 4:
  5949. * - 0 -- Return data buffer contains all encoded frames only; it does
  5950. * not contain frame metadata.
  5951. * - 1 -- Return data buffer contains an array of metadata and encoded
  5952. * frames.
  5953. * - Use #ASM_BIT_MASK_META_INFO_FLAG to set the bitmask and
  5954. * #ASM_SHIFT_META_INFO_FLAG to set the shift value for this bit.
  5955. * All other bits are reserved; clients must set them to zero.
  5956. */
  5957. u32 frames_per_buf;
  5958. /* Indicates the number of frames that need to be returned per
  5959. * read buffer
  5960. * Supported values: should be greater than 0
  5961. */
  5962. } __packed;
  5963. /* adsp_asm_stream_commands.h*/
  5964. /* adsp_asm_api.h (no changes)*/
  5965. #define ASM_STREAM_POSTPROCOPO_ID_DEFAULT \
  5966. 0x00010BE4
  5967. #define ASM_STREAM_POSTPROCOPO_ID_PEAKMETER \
  5968. 0x00010D83
  5969. #define ASM_STREAM_POSTPROCOPO_ID_NONE \
  5970. 0x00010C68
  5971. #define ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL \
  5972. 0x00010D8B
  5973. #define ASM_STREAM_PREPROCOPO_ID_DEFAULT \
  5974. ASM_STREAM_POSTPROCOPO_ID_DEFAULT
  5975. #define ASM_STREAM_PREPROCOPO_ID_NONE \
  5976. ASM_STREAM_POSTPROCOPO_ID_NONE
  5977. #define ADM_CMD_COPP_OPENOPOLOGY_ID_NONE_AUDIO_COPP \
  5978. 0x00010312
  5979. #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MONO_AUDIO_COPP \
  5980. 0x00010313
  5981. #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP \
  5982. 0x00010314
  5983. #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_IIR_AUDIO_COPP\
  5984. 0x00010704
  5985. #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MONO_AUDIO_COPP_MBDRCV2\
  5986. 0x0001070D
  5987. #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP_MBDRCV2\
  5988. 0x0001070E
  5989. #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_IIR_AUDIO_COPP_MBDRCV2\
  5990. 0x0001070F
  5991. #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP_MBDRC_V3 \
  5992. 0x11000000
  5993. #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MCH_PEAK_VOL \
  5994. 0x0001031B
  5995. #define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_MONO_AUDIO_COPP 0x00010315
  5996. #define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_STEREO_AUDIO_COPP 0x00010316
  5997. #define AUDPROC_COPPOPOLOGY_ID_MCHAN_IIR_AUDIO 0x00010715
  5998. #define ADM_CMD_COPP_OPENOPOLOGY_ID_DEFAULT_AUDIO_COPP 0x00010BE3
  5999. #define ADM_CMD_COPP_OPENOPOLOGY_ID_PEAKMETER_AUDIO_COPP 0x00010317
  6000. #define AUDPROC_MODULE_ID_AIG 0x00010716
  6001. #define AUDPROC_PARAM_ID_AIG_ENABLE 0x00010717
  6002. #define AUDPROC_PARAM_ID_AIG_CONFIG 0x00010718
  6003. struct Audio_AigParam {
  6004. uint16_t mode;
  6005. /*< Mode word for enabling AIG/SIG mode .
  6006. * Byte offset: 0
  6007. */
  6008. int16_t staticGainL16Q12;
  6009. /*< Static input gain when aigMode is set to 1.
  6010. * Byte offset: 2
  6011. */
  6012. int16_t initialGainDBL16Q7;
  6013. /*<Initial value that the adaptive gain update starts from dB
  6014. * Q7 Byte offset: 4
  6015. */
  6016. int16_t idealRMSDBL16Q7;
  6017. /*<Average RMS level that AIG attempts to achieve Q8.7
  6018. * Byte offset: 6
  6019. */
  6020. int32_t noiseGateL32;
  6021. /*Threshold below which signal is considered as noise and AIG
  6022. * Byte offset: 8
  6023. */
  6024. int32_t minGainL32Q15;
  6025. /*Minimum gain that can be provided by AIG Q16.15
  6026. * Byte offset: 12
  6027. */
  6028. int32_t maxGainL32Q15;
  6029. /*Maximum gain that can be provided by AIG Q16.15
  6030. * Byte offset: 16
  6031. */
  6032. uint32_t gainAtRtUL32Q31;
  6033. /*Attack/release time for AIG update Q1.31
  6034. * Byte offset: 20
  6035. */
  6036. uint32_t longGainAtRtUL32Q31;
  6037. /*Long attack/release time while updating gain for
  6038. * noise/silence Q1.31 Byte offset: 24
  6039. */
  6040. uint32_t rmsTavUL32Q32;
  6041. /* RMS smoothing time constant used for long-term RMS estimate
  6042. * Q0.32 Byte offset: 28
  6043. */
  6044. uint32_t gainUpdateStartTimMsUL32Q0;
  6045. /* The waiting time before which AIG starts to apply adaptive
  6046. * gain update Q32.0 Byte offset: 32
  6047. */
  6048. } __packed;
  6049. #define ADM_MODULE_ID_EANS 0x00010C4A
  6050. #define ADM_PARAM_ID_EANS_ENABLE 0x00010C4B
  6051. #define ADM_PARAM_ID_EANS_PARAMS 0x00010C4C
  6052. struct adm_eans_enable {
  6053. uint32_t enable_flag;
  6054. /*< Specifies whether EANS is disabled (0) or enabled
  6055. * (nonzero).
  6056. * This is supported only for sampling rates of 8, 12, 16, 24, 32,
  6057. * and 48 kHz. It is not supported for sampling rates of 11.025,
  6058. * 22.05, or 44.1 kHz.
  6059. */
  6060. } __packed;
  6061. struct adm_eans_params {
  6062. int16_t eans_mode;
  6063. /*< Mode word for enabling/disabling submodules.
  6064. * Byte offset: 0
  6065. */
  6066. int16_t eans_input_gain;
  6067. /*< Q2.13 input gain to the EANS module.
  6068. * Byte offset: 2
  6069. */
  6070. int16_t eans_output_gain;
  6071. /*< Q2.13 output gain to the EANS module.
  6072. * Byte offset: 4
  6073. */
  6074. int16_t eansarget_ns;
  6075. /*< Target noise suppression level in dB.
  6076. * Byte offset: 6
  6077. */
  6078. int16_t eans_s_alpha;
  6079. /*< Q3.12 over-subtraction factor for stationary noise
  6080. * suppression.
  6081. * Byte offset: 8
  6082. */
  6083. int16_t eans_n_alpha;
  6084. /* < Q3.12 over-subtraction factor for nonstationary noise
  6085. * suppression.
  6086. * Byte offset: 10
  6087. */
  6088. int16_t eans_n_alphamax;
  6089. /*< Q3.12 maximum over-subtraction factor for nonstationary
  6090. * noise suppression.
  6091. * Byte offset: 12
  6092. */
  6093. int16_t eans_e_alpha;
  6094. /*< Q15 scaling factor for excess noise suppression.
  6095. * Byte offset: 14
  6096. */
  6097. int16_t eans_ns_snrmax;
  6098. /*< Upper boundary in dB for SNR estimation.
  6099. * Byte offset: 16
  6100. */
  6101. int16_t eans_sns_block;
  6102. /*< Quarter block size for stationary noise suppression.
  6103. * Byte offset: 18
  6104. */
  6105. int16_t eans_ns_i;
  6106. /*< Initialization block size for noise suppression.
  6107. * Byte offset: 20
  6108. */
  6109. int16_t eans_np_scale;
  6110. /*< Power scale factor for nonstationary noise update.
  6111. * Byte offset: 22
  6112. */
  6113. int16_t eans_n_lambda;
  6114. /*< Smoothing factor for higher level nonstationary noise
  6115. * update.
  6116. * Byte offset: 24
  6117. */
  6118. int16_t eans_n_lambdaf;
  6119. /*< Medium averaging factor for noise update.
  6120. * Byte offset: 26
  6121. */
  6122. int16_t eans_gs_bias;
  6123. /*< Bias factor in dB for gain calculation.
  6124. * Byte offset: 28
  6125. */
  6126. int16_t eans_gs_max;
  6127. /*< SNR lower boundary in dB for aggressive gain calculation.
  6128. * Byte offset: 30
  6129. */
  6130. int16_t eans_s_alpha_hb;
  6131. /*< Q3.12 over-subtraction factor for high-band stationary
  6132. * noise suppression.
  6133. * Byte offset: 32
  6134. */
  6135. int16_t eans_n_alphamax_hb;
  6136. /*< Q3.12 maximum over-subtraction factor for high-band
  6137. * nonstationary noise suppression.
  6138. * Byte offset: 34
  6139. */
  6140. int16_t eans_e_alpha_hb;
  6141. /*< Q15 scaling factor for high-band excess noise suppression.
  6142. * Byte offset: 36
  6143. */
  6144. int16_t eans_n_lambda0;
  6145. /*< Smoothing factor for nonstationary noise update during
  6146. * speech activity.
  6147. * Byte offset: 38
  6148. */
  6149. int16_t thresh;
  6150. /*< Threshold for generating a binary VAD decision.
  6151. * Byte offset: 40
  6152. */
  6153. int16_t pwr_scale;
  6154. /*< Indirect lower boundary of the noise level estimate.
  6155. * Byte offset: 42
  6156. */
  6157. int16_t hangover_max;
  6158. /*< Avoids mid-speech clipping and reliably detects weak speech
  6159. * bursts at the end of speech activity.
  6160. * Byte offset: 44
  6161. */
  6162. int16_t alpha_snr;
  6163. /*< Controls responsiveness of the VAD.
  6164. * Byte offset: 46
  6165. */
  6166. int16_t snr_diff_max;
  6167. /*< Maximum SNR difference. Decreasing this parameter value may
  6168. * help in making correct decisions during abrupt changes; however,
  6169. * decreasing too much may increase false alarms during long
  6170. * pauses/silences.
  6171. * Byte offset: 48
  6172. */
  6173. int16_t snr_diff_min;
  6174. /*< Minimum SNR difference. Decreasing this parameter value may
  6175. * help in making correct decisions during abrupt changes; however,
  6176. * decreasing too much may increase false alarms during long
  6177. * pauses/silences.
  6178. * Byte offset: 50
  6179. */
  6180. int16_t init_length;
  6181. /*< Defines the number of frames for which a noise level
  6182. * estimate is set to a fixed value.
  6183. * Byte offset: 52
  6184. */
  6185. int16_t max_val;
  6186. /*< Defines the upper limit of the noise level.
  6187. * Byte offset: 54
  6188. */
  6189. int16_t init_bound;
  6190. /*< Defines the initial bounding value for the noise level
  6191. * estimate. This is used during the initial segment defined by the
  6192. * init_length parameter.
  6193. * Byte offset: 56
  6194. */
  6195. int16_t reset_bound;
  6196. /*< Reset boundary for noise tracking.
  6197. * Byte offset: 58
  6198. */
  6199. int16_t avar_scale;
  6200. /*< Defines the bias factor in noise estimation.
  6201. * Byte offset: 60
  6202. */
  6203. int16_t sub_nc;
  6204. /*< Defines the window length for noise estimation.
  6205. * Byte offset: 62
  6206. */
  6207. int16_t spow_min;
  6208. /*< Defines the minimum signal power required to update the
  6209. * boundaries for the noise floor estimate.
  6210. * Byte offset: 64
  6211. */
  6212. int16_t eans_gs_fast;
  6213. /*< Fast smoothing factor for postprocessor gain.
  6214. * Byte offset: 66
  6215. */
  6216. int16_t eans_gs_med;
  6217. /*< Medium smoothing factor for postprocessor gain.
  6218. * Byte offset: 68
  6219. */
  6220. int16_t eans_gs_slow;
  6221. /*< Slow smoothing factor for postprocessor gain.
  6222. * Byte offset: 70
  6223. */
  6224. int16_t eans_swb_salpha;
  6225. /*< Q3.12 super wideband aggressiveness factor for stationary
  6226. * noise suppression.
  6227. * Byte offset: 72
  6228. */
  6229. int16_t eans_swb_nalpha;
  6230. /*< Q3.12 super wideband aggressiveness factor for
  6231. * nonstationary noise suppression.
  6232. * Byte offset: 74
  6233. */
  6234. } __packed;
  6235. #define ADM_MODULE_IDX_MIC_GAIN_CTRL 0x00010C35
  6236. /* @addtogroup audio_pp_param_ids
  6237. * ID of the Tx mic gain control parameter used by the
  6238. * #ADM_MODULE_IDX_MIC_GAIN_CTRL module.
  6239. * @messagepayload
  6240. * @structure{admx_mic_gain}
  6241. * @tablespace
  6242. * @inputtable{Audio_Postproc_ADM_PARAM_IDX_MIC_GAIN.tex}
  6243. */
  6244. #define ADM_PARAM_IDX_MIC_GAIN 0x00010C36
  6245. /* Structure for a Tx mic gain parameter for the mic gain
  6246. * control module.
  6247. */
  6248. /* @brief Payload of the #ADM_PARAM_IDX_MIC_GAIN parameter in the
  6249. * Tx Mic Gain Control module.
  6250. */
  6251. struct admx_mic_gain {
  6252. uint16_t tx_mic_gain;
  6253. /*< Linear gain in Q13 format. */
  6254. uint16_t reserved;
  6255. /*< Clients must set this field to zero. */
  6256. } __packed;
  6257. struct adm_set_mic_gain_params {
  6258. struct adm_cmd_set_pp_params_v5 params;
  6259. struct adm_param_data_v5 data;
  6260. struct admx_mic_gain mic_gain_data;
  6261. } __packed;
  6262. /* end_addtogroup audio_pp_param_ids */
  6263. /* @ingroup audio_pp_module_ids
  6264. * ID of the Rx Codec Gain Control module.
  6265. *
  6266. * This module supports the following parameter ID:
  6267. * - #ADM_PARAM_ID_RX_CODEC_GAIN
  6268. */
  6269. #define ADM_MODULE_ID_RX_CODEC_GAIN_CTRL 0x00010C37
  6270. /* @addtogroup audio_pp_param_ids
  6271. * ID of the Rx codec gain control parameter used by the
  6272. * #ADM_MODULE_ID_RX_CODEC_GAIN_CTRL module.
  6273. *
  6274. * @messagepayload
  6275. * @structure{adm_rx_codec_gain}
  6276. * @tablespace
  6277. * @inputtable{Audio_Postproc_ADM_PARAM_ID_RX_CODEC_GAIN.tex}
  6278. */
  6279. #define ADM_PARAM_ID_RX_CODEC_GAIN 0x00010C38
  6280. /* Structure for the Rx common codec gain control module. */
  6281. /* @brief Payload of the #ADM_PARAM_ID_RX_CODEC_GAIN parameter
  6282. * in the Rx Codec Gain Control module.
  6283. */
  6284. struct adm_rx_codec_gain {
  6285. uint16_t rx_codec_gain;
  6286. /* Linear gain in Q13 format. */
  6287. uint16_t reserved;
  6288. /* Clients must set this field to zero.*/
  6289. } __packed;
  6290. /* end_addtogroup audio_pp_param_ids */
  6291. /* @ingroup audio_pp_module_ids
  6292. * ID of the HPF Tuning Filter module on the Tx path.
  6293. * This module supports the following parameter IDs:
  6294. * - #ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG
  6295. * - #ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN
  6296. * - #ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS
  6297. */
  6298. #define ADM_MODULE_ID_HPF_IIRX_FILTER 0x00010C3D
  6299. /* @addtogroup audio_pp_param_ids */
  6300. /* ID of the Tx HPF IIR filter enable parameter used by the
  6301. * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
  6302. * @parspace Message payload
  6303. * @structure{adm_hpfx_iir_filter_enable_cfg}
  6304. * @tablespace
  6305. * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG.tex}
  6306. */
  6307. #define ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG 0x00010C3E
  6308. /* ID of the Tx HPF IIR filter pregain parameter used by the
  6309. * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
  6310. * @parspace Message payload
  6311. * @structure{adm_hpfx_iir_filter_pre_gain}
  6312. * @tablespace
  6313. * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN.tex}
  6314. */
  6315. #define ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN 0x00010C3F
  6316. /* ID of the Tx HPF IIR filter configuration parameters used by the
  6317. * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
  6318. * @parspace Message payload
  6319. * @structure{adm_hpfx_iir_filter_cfg_params}
  6320. * @tablespace
  6321. * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PA
  6322. * RAMS.tex}
  6323. */
  6324. #define ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS 0x00010C40
  6325. /* Structure for enabling a configuration parameter for
  6326. * the HPF IIR tuning filter module on the Tx path.
  6327. */
  6328. /* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG
  6329. * parameter in the Tx path HPF Tuning Filter module.
  6330. */
  6331. struct adm_hpfx_iir_filter_enable_cfg {
  6332. uint32_t enable_flag;
  6333. /* Specifies whether the HPF tuning filter is disabled (0) or
  6334. * enabled (nonzero).
  6335. */
  6336. } __packed;
  6337. /* Structure for the pregain parameter for the HPF
  6338. * IIR tuning filter module on the Tx path.
  6339. */
  6340. /* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN parameter
  6341. * in the Tx path HPF Tuning Filter module.
  6342. */
  6343. struct adm_hpfx_iir_filter_pre_gain {
  6344. uint16_t pre_gain;
  6345. /* Linear gain in Q13 format. */
  6346. uint16_t reserved;
  6347. /* Clients must set this field to zero.*/
  6348. } __packed;
  6349. /* Structure for the configuration parameter for the
  6350. * HPF IIR tuning filter module on the Tx path.
  6351. */
  6352. /* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS
  6353. * parameters in the Tx path HPF Tuning Filter module. \n
  6354. * \n
  6355. * This structure is followed by tuning filter coefficients as follows: \n
  6356. * - Sequence of int32_t FilterCoeffs.
  6357. * Each band has five coefficients, each in int32_t format in the order of
  6358. * b0, b1, b2, a1, a2.
  6359. * - Sequence of int16_t NumShiftFactor.
  6360. * One int16_t per band. The numerator shift factor is related to the Q
  6361. * factor of the filter coefficients.
  6362. * - Sequence of uint16_t PanSetting.
  6363. * One uint16_t for each band to indicate application of the filter to
  6364. * left (0), right (1), or both (2) channels.
  6365. */
  6366. struct adm_hpfx_iir_filter_cfg_params {
  6367. uint16_t num_biquad_stages;
  6368. /*< Number of bands.
  6369. * Supported values: 0 to 20
  6370. */
  6371. uint16_t reserved;
  6372. /*< Clients must set this field to zero.*/
  6373. } __packed;
  6374. /* end_addtogroup audio_pp_module_ids */
  6375. /* @addtogroup audio_pp_module_ids */
  6376. /* ID of the Tx path IIR Tuning Filter module.
  6377. * This module supports the following parameter IDs:
  6378. * - #ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG
  6379. */
  6380. #define ADM_MODULE_IDX_IIR_FILTER 0x00010C41
  6381. /* ID of the Rx path IIR Tuning Filter module for the left channel.
  6382. * The parameter IDs of the IIR tuning filter module
  6383. * (#ASM_MODULE_ID_IIRUNING_FILTER) are used for the left IIR Rx tuning
  6384. * filter.
  6385. *
  6386. * Pan parameters are not required for this per-channel IIR filter; the pan
  6387. * parameters are ignored by this module.
  6388. */
  6389. #define ADM_MODULE_ID_LEFT_IIRUNING_FILTER 0x00010705
  6390. /* ID of the the Rx path IIR Tuning Filter module for the right
  6391. * channel.
  6392. * The parameter IDs of the IIR tuning filter module
  6393. * (#ASM_MODULE_ID_IIRUNING_FILTER) are used for the right IIR Rx
  6394. * tuning filter.
  6395. *
  6396. * Pan parameters are not required for this per-channel IIR filter;
  6397. * the pan parameters are ignored by this module.
  6398. */
  6399. #define ADM_MODULE_ID_RIGHT_IIRUNING_FILTER 0x00010706
  6400. /* end_addtogroup audio_pp_module_ids */
  6401. /* @addtogroup audio_pp_param_ids */
  6402. /* ID of the Tx IIR filter enable parameter used by the
  6403. * #ADM_MODULE_IDX_IIR_FILTER module.
  6404. * @parspace Message payload
  6405. * @structure{admx_iir_filter_enable_cfg}
  6406. * @tablespace
  6407. * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG.tex}
  6408. */
  6409. #define ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG 0x00010C42
  6410. /* ID of the Tx IIR filter pregain parameter used by the
  6411. * #ADM_MODULE_IDX_IIR_FILTER module.
  6412. * @parspace Message payload
  6413. * @structure{admx_iir_filter_pre_gain}
  6414. * @tablespace
  6415. * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN.tex}
  6416. */
  6417. #define ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN 0x00010C43
  6418. /* ID of the Tx IIR filter configuration parameters used by the
  6419. * #ADM_MODULE_IDX_IIR_FILTER module.
  6420. * @parspace Message payload
  6421. * @structure{admx_iir_filter_cfg_params}
  6422. * @tablespace
  6423. * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS.tex}
  6424. */
  6425. #define ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS 0x00010C44
  6426. /* Structure for enabling the configuration parameter for the
  6427. * IIR filter module on the Tx path.
  6428. */
  6429. /* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG
  6430. * parameter in the Tx Path IIR Tuning Filter module.
  6431. */
  6432. struct admx_iir_filter_enable_cfg {
  6433. uint32_t enable_flag;
  6434. /*< Specifies whether the IIR tuning filter is disabled (0) or
  6435. * enabled (nonzero).
  6436. */
  6437. } __packed;
  6438. /* Structure for the pregain parameter for the
  6439. * IIR filter module on the Tx path.
  6440. */
  6441. /* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN
  6442. * parameter in the Tx Path IIR Tuning Filter module.
  6443. */
  6444. struct admx_iir_filter_pre_gain {
  6445. uint16_t pre_gain;
  6446. /*< Linear gain in Q13 format. */
  6447. uint16_t reserved;
  6448. /*< Clients must set this field to zero.*/
  6449. } __packed;
  6450. /* Structure for the configuration parameter for the
  6451. * IIR filter module on the Tx path.
  6452. */
  6453. /* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS
  6454. * parameter in the Tx Path IIR Tuning Filter module. \n
  6455. * \n
  6456. * This structure is followed by the HPF IIR filter coefficients on
  6457. * the Tx path as follows: \n
  6458. * - Sequence of int32_t ulFilterCoeffs. Each band has five
  6459. * coefficients, each in int32_t format in the order of b0, b1, b2,
  6460. * a1, a2.
  6461. * - Sequence of int16_t sNumShiftFactor. One int16_t per band. The
  6462. * numerator shift factor is related to the Q factor of the filter
  6463. * coefficients.
  6464. * - Sequence of uint16_t usPanSetting. One uint16_t for each band
  6465. * to indicate if the filter is applied to left (0), right (1), or
  6466. * both (2) channels.
  6467. */
  6468. struct admx_iir_filter_cfg_params {
  6469. uint16_t num_biquad_stages;
  6470. /*< Number of bands.
  6471. * Supported values: 0 to 20
  6472. */
  6473. uint16_t reserved;
  6474. /*< Clients must set this field to zero.*/
  6475. } __packed;
  6476. /* end_addtogroup audio_pp_module_ids */
  6477. /* @ingroup audio_pp_module_ids
  6478. * ID of the QEnsemble module.
  6479. * This module supports the following parameter IDs:
  6480. * - #ADM_PARAM_ID_QENSEMBLE_ENABLE
  6481. * - #ADM_PARAM_ID_QENSEMBLE_BACKGAIN
  6482. * - #ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE
  6483. */
  6484. #define ADM_MODULE_ID_QENSEMBLE 0x00010C59
  6485. /* @addtogroup audio_pp_param_ids */
  6486. /* ID of the QEnsemble enable parameter used by the
  6487. * #ADM_MODULE_ID_QENSEMBLE module.
  6488. * @messagepayload
  6489. * @structure{adm_qensemble_enable}
  6490. * @tablespace
  6491. * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_ENABLE.tex}
  6492. */
  6493. #define ADM_PARAM_ID_QENSEMBLE_ENABLE 0x00010C60
  6494. /* ID of the QEnsemble back gain parameter used by the
  6495. * #ADM_MODULE_ID_QENSEMBLE module.
  6496. * @messagepayload
  6497. * @structure{adm_qensemble_param_backgain}
  6498. * @tablespace
  6499. * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_BACKGAIN.tex}
  6500. */
  6501. #define ADM_PARAM_ID_QENSEMBLE_BACKGAIN 0x00010C61
  6502. /* ID of the QEnsemble new angle parameter used by the
  6503. * #ADM_MODULE_ID_QENSEMBLE module.
  6504. * @messagepayload
  6505. * @structure{adm_qensemble_param_set_new_angle}
  6506. * @tablespace
  6507. * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE.tex}
  6508. */
  6509. #define ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE 0x00010C62
  6510. /* Structure for enabling the configuration parameter for the
  6511. * QEnsemble module.
  6512. */
  6513. /* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_ENABLE
  6514. * parameter used by the QEnsemble module.
  6515. */
  6516. struct adm_qensemble_enable {
  6517. uint32_t enable_flag;
  6518. /*< Specifies whether the QEnsemble module is disabled (0) or enabled
  6519. * (nonzero).
  6520. */
  6521. } __packed;
  6522. /* Structure for the background gain for the QEnsemble module. */
  6523. /* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_BACKGAIN
  6524. * parameter used by
  6525. * the QEnsemble module.
  6526. */
  6527. struct adm_qensemble_param_backgain {
  6528. int16_t back_gain;
  6529. /*< Linear gain in Q15 format.
  6530. * Supported values: 0 to 32767
  6531. */
  6532. uint16_t reserved;
  6533. /*< Clients must set this field to zero.*/
  6534. } __packed;
  6535. /* Structure for setting a new angle for the QEnsemble module. */
  6536. /* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE
  6537. * parameter used
  6538. * by the QEnsemble module.
  6539. */
  6540. struct adm_qensemble_param_set_new_angle {
  6541. int16_t new_angle;
  6542. /*< New angle in degrees.
  6543. * Supported values: 0 to 359
  6544. */
  6545. int16_t time_ms;
  6546. /*< Transition time in milliseconds to set the new angle.
  6547. * Supported values: 0 to 32767
  6548. */
  6549. } __packed;
  6550. #define ADM_CMD_GET_PP_TOPO_MODULE_LIST 0x00010349
  6551. #define ADM_CMDRSP_GET_PP_TOPO_MODULE_LIST 0x00010350
  6552. #define AUDPROC_PARAM_ID_ENABLE 0x00010904
  6553. /*
  6554. * Payload of the ADM_CMD_GET_PP_TOPO_MODULE_LIST command.
  6555. */
  6556. struct adm_cmd_get_pp_topo_module_list_t {
  6557. struct apr_hdr hdr;
  6558. /* Lower 32 bits of the 64-bit parameter data payload address. */
  6559. uint32_t data_payload_addr_lsw;
  6560. /*
  6561. * Upper 32 bits of the 64-bit parameter data payload address.
  6562. *
  6563. *
  6564. * The size of the shared memory, if specified, must be large enough to
  6565. * contain the entire parameter data payload, including the module ID,
  6566. * parameter ID, parameter size, and parameter values.
  6567. */
  6568. uint32_t data_payload_addr_msw;
  6569. /*
  6570. * Unique identifier for an address.
  6571. *
  6572. * This memory map handle is returned by the aDSP through the
  6573. * #ADM_CMD_SHARED_MEM_MAP_REGIONS command.
  6574. *
  6575. * @values
  6576. * - Non-NULL -- On acknowledgment, the parameter data payloads begin at
  6577. * the address specified (out-of-band)
  6578. * - NULL -- The acknowledgment's payload contains the parameter data
  6579. * (in-band) @tablebulletend
  6580. */
  6581. uint32_t mem_map_handle;
  6582. /*
  6583. * Maximum data size of the list of modules. This
  6584. * field is a multiple of 4 bytes.
  6585. */
  6586. uint16_t param_max_size;
  6587. /* This field must be set to zero. */
  6588. uint16_t reserved;
  6589. } __packed;
  6590. /*
  6591. * Payload of the ADM_CMDRSP_GET_PP_TOPO_MODULE_LIST message, which returns
  6592. * module ids in response to an ADM_CMD_GET_PP_TOPO_MODULE_LIST command.
  6593. * Immediately following this structure is the acknowledgment <b>module id
  6594. * data variable payload</b> containing the pre/postprocessing module id
  6595. * values. For an in-band scenario, the variable payload depends on the size
  6596. * of the parameter.
  6597. */
  6598. struct adm_cmd_rsp_get_pp_topo_module_list_t {
  6599. /* Status message (error code). */
  6600. uint32_t status;
  6601. } __packed;
  6602. struct audproc_topology_module_id_info_t {
  6603. uint32_t num_modules;
  6604. } __packed;
  6605. /* end_addtogroup audio_pp_module_ids */
  6606. /* @ingroup audio_pp_module_ids
  6607. * ID of the Volume Control module pre/postprocessing block.
  6608. * This module supports the following parameter IDs:
  6609. * - #ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN
  6610. * - #ASM_PARAM_ID_MULTICHANNEL_GAIN
  6611. * - #ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG
  6612. * - #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
  6613. * - #ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS
  6614. * - #ASM_PARAM_ID_MULTICHANNEL_GAIN
  6615. * - #ASM_PARAM_ID_MULTICHANNEL_MUTE
  6616. */
  6617. #define ASM_MODULE_ID_VOL_CTRL 0x00010BFE
  6618. #define ASM_MODULE_ID_VOL_CTRL2 0x00010910
  6619. #define AUDPROC_MODULE_ID_VOL_CTRL ASM_MODULE_ID_VOL_CTRL
  6620. /* @addtogroup audio_pp_param_ids */
  6621. /* ID of the master gain parameter used by the #ASM_MODULE_ID_VOL_CTRL
  6622. * module.
  6623. * @messagepayload
  6624. * @structure{asm_volume_ctrl_master_gain}
  6625. * @tablespace
  6626. * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN.tex}
  6627. */
  6628. #define ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN 0x00010BFF
  6629. #define AUDPROC_PARAM_ID_VOL_CTRL_MASTER_GAIN ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN
  6630. /* ID of the left/right channel gain parameter used by the
  6631. * #ASM_MODULE_ID_VOL_CTRL module.
  6632. * @messagepayload
  6633. * @structure{asm_volume_ctrl_lr_chan_gain}
  6634. * @tablespace
  6635. * @inputtable{Audio_Postproc_ASM_PARAM_ID_MULTICHANNEL_GAIN.tex}
  6636. */
  6637. #define ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN 0x00010C00
  6638. /* ID of the mute configuration parameter used by the
  6639. * #ASM_MODULE_ID_VOL_CTRL module.
  6640. * @messagepayload
  6641. * @structure{asm_volume_ctrl_mute_config}
  6642. * @tablespace
  6643. * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG.tex}
  6644. */
  6645. #define ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG 0x00010C01
  6646. /* ID of the soft stepping volume parameters used by the
  6647. * #ASM_MODULE_ID_VOL_CTRL module.
  6648. * @messagepayload
  6649. * @structure{asm_soft_step_volume_params}
  6650. * @tablespace
  6651. * @inputtable{Audio_Postproc_ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMET
  6652. * ERS.tex}
  6653. */
  6654. #define ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS 0x00010C29
  6655. #define AUDPROC_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS\
  6656. ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
  6657. /* ID of the soft pause parameters used by the #ASM_MODULE_ID_VOL_CTRL
  6658. * module.
  6659. */
  6660. #define ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS 0x00010D6A
  6661. /* ID of the multiple-channel volume control parameters used by the
  6662. * #ASM_MODULE_ID_VOL_CTRL module.
  6663. */
  6664. #define ASM_PARAM_ID_MULTICHANNEL_GAIN 0x00010713
  6665. /* ID of the multiple-channel mute configuration parameters used by the
  6666. * #ASM_MODULE_ID_VOL_CTRL module.
  6667. */
  6668. #define ASM_PARAM_ID_MULTICHANNEL_MUTE 0x00010714
  6669. /* Structure for the master gain parameter for a volume control
  6670. * module.
  6671. */
  6672. /* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN
  6673. * parameter used by the Volume Control module.
  6674. */
  6675. struct asm_volume_ctrl_master_gain {
  6676. struct apr_hdr hdr;
  6677. struct asm_stream_cmd_set_pp_params_v2 param;
  6678. struct asm_stream_param_data_v2 data;
  6679. uint16_t master_gain;
  6680. /* Linear gain in Q13 format. */
  6681. uint16_t reserved;
  6682. /* Clients must set this field to zero. */
  6683. } __packed;
  6684. struct asm_volume_ctrl_lr_chan_gain {
  6685. struct apr_hdr hdr;
  6686. struct asm_stream_cmd_set_pp_params_v2 param;
  6687. struct asm_stream_param_data_v2 data;
  6688. uint16_t l_chan_gain;
  6689. /*< Linear gain in Q13 format for the left channel. */
  6690. uint16_t r_chan_gain;
  6691. /*< Linear gain in Q13 format for the right channel.*/
  6692. } __packed;
  6693. /* Structure for the mute configuration parameter for a
  6694. * volume control module.
  6695. */
  6696. /* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG
  6697. * parameter used by the Volume Control module.
  6698. */
  6699. struct asm_volume_ctrl_mute_config {
  6700. struct apr_hdr hdr;
  6701. struct asm_stream_cmd_set_pp_params_v2 param;
  6702. struct asm_stream_param_data_v2 data;
  6703. uint32_t mute_flag;
  6704. /*< Specifies whether mute is disabled (0) or enabled (nonzero).*/
  6705. } __packed;
  6706. /*
  6707. * Supported parameters for a soft stepping linear ramping curve.
  6708. */
  6709. #define ASM_PARAM_SVC_RAMPINGCURVE_LINEAR 0
  6710. /*
  6711. * Exponential ramping curve.
  6712. */
  6713. #define ASM_PARAM_SVC_RAMPINGCURVE_EXP 1
  6714. /*
  6715. * Logarithmic ramping curve.
  6716. */
  6717. #define ASM_PARAM_SVC_RAMPINGCURVE_LOG 2
  6718. /* Structure for holding soft stepping volume parameters. */
  6719. /* Payload of the #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
  6720. * parameters used by the Volume Control module.
  6721. */
  6722. struct asm_soft_step_volume_params {
  6723. struct apr_hdr hdr;
  6724. struct asm_stream_cmd_set_pp_params_v2 param;
  6725. struct asm_stream_param_data_v2 data;
  6726. uint32_t period;
  6727. /*< Period in milliseconds.
  6728. * Supported values: 0 to 15000
  6729. */
  6730. uint32_t step;
  6731. /*< Step in microseconds.
  6732. * Supported values: 0 to 15000000
  6733. */
  6734. uint32_t ramping_curve;
  6735. /*< Ramping curve type.
  6736. * Supported values:
  6737. * - #ASM_PARAM_SVC_RAMPINGCURVE_LINEAR
  6738. * - #ASM_PARAM_SVC_RAMPINGCURVE_EXP
  6739. * - #ASM_PARAM_SVC_RAMPINGCURVE_LOG
  6740. */
  6741. } __packed;
  6742. /* Structure for holding soft pause parameters. */
  6743. /* Payload of the #ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS
  6744. * parameters used by the Volume Control module.
  6745. */
  6746. struct asm_soft_pause_params {
  6747. struct apr_hdr hdr;
  6748. struct asm_stream_cmd_set_pp_params_v2 param;
  6749. struct asm_stream_param_data_v2 data;
  6750. uint32_t enable_flag;
  6751. /*< Specifies whether soft pause is disabled (0) or enabled
  6752. * (nonzero).
  6753. */
  6754. uint32_t period;
  6755. /*< Period in milliseconds.
  6756. * Supported values: 0 to 15000
  6757. */
  6758. uint32_t step;
  6759. /*< Step in microseconds.
  6760. * Supported values: 0 to 15000000
  6761. */
  6762. uint32_t ramping_curve;
  6763. /*< Ramping curve.
  6764. * Supported values:
  6765. * - #ASM_PARAM_SVC_RAMPINGCURVE_LINEAR
  6766. * - #ASM_PARAM_SVC_RAMPINGCURVE_EXP
  6767. * - #ASM_PARAM_SVC_RAMPINGCURVE_LOG
  6768. */
  6769. } __packed;
  6770. /* Maximum number of channels.*/
  6771. #define VOLUME_CONTROL_MAX_CHANNELS 8
  6772. /* Structure for holding one channel type - gain pair. */
  6773. /* Payload of the #ASM_PARAM_ID_MULTICHANNEL_GAIN channel
  6774. * type/gain pairs used by the Volume Control module. \n \n This
  6775. * structure immediately follows the
  6776. * asm_volume_ctrl_multichannel_gain structure.
  6777. */
  6778. struct asm_volume_ctrl_channeltype_gain_pair {
  6779. uint8_t channeltype;
  6780. /*
  6781. * Channel type for which the gain setting is to be applied.
  6782. * Supported values:
  6783. * - #PCM_CHANNEL_L
  6784. * - #PCM_CHANNEL_R
  6785. * - #PCM_CHANNEL_C
  6786. * - #PCM_CHANNEL_LS
  6787. * - #PCM_CHANNEL_RS
  6788. * - #PCM_CHANNEL_LFE
  6789. * - #PCM_CHANNEL_CS
  6790. * - #PCM_CHANNEL_LB
  6791. * - #PCM_CHANNEL_RB
  6792. * - #PCM_CHANNELS
  6793. * - #PCM_CHANNEL_CVH
  6794. * - #PCM_CHANNEL_MS
  6795. * - #PCM_CHANNEL_FLC
  6796. * - #PCM_CHANNEL_FRC
  6797. * - #PCM_CHANNEL_RLC
  6798. * - #PCM_CHANNEL_RRC
  6799. */
  6800. uint8_t reserved1;
  6801. /* Clients must set this field to zero. */
  6802. uint8_t reserved2;
  6803. /* Clients must set this field to zero. */
  6804. uint8_t reserved3;
  6805. /* Clients must set this field to zero. */
  6806. uint32_t gain;
  6807. /*
  6808. * Gain value for this channel in Q28 format.
  6809. * Supported values: Any
  6810. */
  6811. } __packed;
  6812. /* Structure for the multichannel gain command */
  6813. /* Payload of the #ASM_PARAM_ID_MULTICHANNEL_GAIN
  6814. * parameters used by the Volume Control module.
  6815. */
  6816. struct asm_volume_ctrl_multichannel_gain {
  6817. struct apr_hdr hdr;
  6818. struct asm_stream_cmd_set_pp_params_v2 param;
  6819. struct asm_stream_param_data_v2 data;
  6820. uint32_t num_channels;
  6821. /*
  6822. * Number of channels for which gain values are provided. Any
  6823. * channels present in the data for which gain is not provided are
  6824. * set to unity gain.
  6825. * Supported values: 1 to 8
  6826. */
  6827. struct asm_volume_ctrl_channeltype_gain_pair
  6828. gain_data[VOLUME_CONTROL_MAX_CHANNELS];
  6829. /* Array of channel type/gain pairs.*/
  6830. } __packed;
  6831. /* Structure for holding one channel type - mute pair. */
  6832. /* Payload of the #ASM_PARAM_ID_MULTICHANNEL_MUTE channel
  6833. * type/mute setting pairs used by the Volume Control module. \n \n
  6834. * This structure immediately follows the
  6835. * asm_volume_ctrl_multichannel_mute structure.
  6836. */
  6837. struct asm_volume_ctrl_channelype_mute_pair {
  6838. struct apr_hdr hdr;
  6839. struct asm_stream_cmd_set_pp_params_v2 param;
  6840. struct asm_stream_param_data_v2 data;
  6841. uint8_t channelype;
  6842. /*< Channel type for which the mute setting is to be applied.
  6843. * Supported values:
  6844. * - #PCM_CHANNEL_L
  6845. * - #PCM_CHANNEL_R
  6846. * - #PCM_CHANNEL_C
  6847. * - #PCM_CHANNEL_LS
  6848. * - #PCM_CHANNEL_RS
  6849. * - #PCM_CHANNEL_LFE
  6850. * - #PCM_CHANNEL_CS
  6851. * - #PCM_CHANNEL_LB
  6852. * - #PCM_CHANNEL_RB
  6853. * - #PCM_CHANNELS
  6854. * - #PCM_CHANNEL_CVH
  6855. * - #PCM_CHANNEL_MS
  6856. * - #PCM_CHANNEL_FLC
  6857. * - #PCM_CHANNEL_FRC
  6858. * - #PCM_CHANNEL_RLC
  6859. * - #PCM_CHANNEL_RRC
  6860. */
  6861. uint8_t reserved1;
  6862. /*< Clients must set this field to zero. */
  6863. uint8_t reserved2;
  6864. /*< Clients must set this field to zero. */
  6865. uint8_t reserved3;
  6866. /*< Clients must set this field to zero. */
  6867. uint32_t mute;
  6868. /*< Mute setting for this channel.
  6869. * Supported values:
  6870. * - 0 = Unmute
  6871. * - Nonzero = Mute
  6872. */
  6873. } __packed;
  6874. /* Structure for the multichannel mute command */
  6875. /* @brief Payload of the #ASM_PARAM_ID_MULTICHANNEL_MUTE
  6876. * parameters used by the Volume Control module.
  6877. */
  6878. struct asm_volume_ctrl_multichannel_mute {
  6879. struct apr_hdr hdr;
  6880. struct asm_stream_cmd_set_pp_params_v2 param;
  6881. struct asm_stream_param_data_v2 data;
  6882. uint32_t num_channels;
  6883. /*< Number of channels for which mute configuration is
  6884. * provided. Any channels present in the data for which mute
  6885. * configuration is not provided are set to unmute.
  6886. * Supported values: 1 to 8
  6887. */
  6888. struct asm_volume_ctrl_channelype_mute_pair
  6889. mute_data[VOLUME_CONTROL_MAX_CHANNELS];
  6890. /*< Array of channel type/mute setting pairs.*/
  6891. } __packed;
  6892. /* end_addtogroup audio_pp_param_ids */
  6893. /* audio_pp_module_ids
  6894. * ID of the IIR Tuning Filter module.
  6895. * This module supports the following parameter IDs:
  6896. * - #ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG
  6897. * - #ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN
  6898. * - #ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS
  6899. */
  6900. #define ASM_MODULE_ID_IIRUNING_FILTER 0x00010C02
  6901. /* @addtogroup audio_pp_param_ids */
  6902. /* ID of the IIR tuning filter enable parameter used by the
  6903. * #ASM_MODULE_ID_IIRUNING_FILTER module.
  6904. * @messagepayload
  6905. * @structure{asm_iiruning_filter_enable}
  6906. * @tablespace
  6907. * @inputtable{Audio_Postproc_ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CO
  6908. * NFIG.tex}
  6909. */
  6910. #define ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG 0x00010C03
  6911. /* ID of the IIR tuning filter pregain parameter used by the
  6912. * #ASM_MODULE_ID_IIRUNING_FILTER module.
  6913. */
  6914. #define ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN 0x00010C04
  6915. /* ID of the IIR tuning filter configuration parameters used by the
  6916. * #ASM_MODULE_ID_IIRUNING_FILTER module.
  6917. */
  6918. #define ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS 0x00010C05
  6919. /* Structure for an enable configuration parameter for an
  6920. * IIR tuning filter module.
  6921. */
  6922. /* @brief Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG
  6923. * parameter used by the IIR Tuning Filter module.
  6924. */
  6925. struct asm_iiruning_filter_enable {
  6926. uint32_t enable_flag;
  6927. /*< Specifies whether the IIR tuning filter is disabled (0) or
  6928. * enabled (1).
  6929. */
  6930. } __packed;
  6931. /* Structure for the pregain parameter for an IIR tuning filter module. */
  6932. /* Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN
  6933. * parameters used by the IIR Tuning Filter module.
  6934. */
  6935. struct asm_iiruning_filter_pregain {
  6936. uint16_t pregain;
  6937. /*< Linear gain in Q13 format. */
  6938. uint16_t reserved;
  6939. /*< Clients must set this field to zero.*/
  6940. } __packed;
  6941. /* Structure for the configuration parameter for an IIR tuning filter
  6942. * module.
  6943. */
  6944. /* @brief Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS
  6945. * parameters used by the IIR Tuning Filter module. \n
  6946. * \n
  6947. * This structure is followed by the IIR filter coefficients: \n
  6948. * - Sequence of int32_t FilterCoeffs \n
  6949. * Five coefficients for each band. Each coefficient is in int32_t format, in
  6950. * the order of b0, b1, b2, a1, a2.
  6951. * - Sequence of int16_t NumShiftFactor \n
  6952. * One int16_t per band. The numerator shift factor is related to the Q
  6953. * factor of the filter coefficients.
  6954. * - Sequence of uint16_t PanSetting \n
  6955. * One uint16_t per band, indicating if the filter is applied to left (0),
  6956. * right (1), or both (2) channels.
  6957. */
  6958. struct asm_iir_filter_config_params {
  6959. uint16_t num_biquad_stages;
  6960. /*< Number of bands.
  6961. * Supported values: 0 to 20
  6962. */
  6963. uint16_t reserved;
  6964. /*< Clients must set this field to zero.*/
  6965. } __packed;
  6966. /* audio_pp_module_ids
  6967. * ID of the Multiband Dynamic Range Control (MBDRC) module on the Tx/Rx
  6968. * paths.
  6969. * This module supports the following parameter IDs:
  6970. * - #ASM_PARAM_ID_MBDRC_ENABLE
  6971. * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS
  6972. */
  6973. #define ASM_MODULE_ID_MBDRC 0x00010C06
  6974. /* audio_pp_param_ids */
  6975. /* ID of the MBDRC enable parameter used by the #ASM_MODULE_ID_MBDRC module.
  6976. * @messagepayload
  6977. * @structure{asm_mbdrc_enable}
  6978. * @tablespace
  6979. * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_ENABLE.tex}
  6980. */
  6981. #define ASM_PARAM_ID_MBDRC_ENABLE 0x00010C07
  6982. /* ID of the MBDRC configuration parameters used by the
  6983. * #ASM_MODULE_ID_MBDRC module.
  6984. * @messagepayload
  6985. * @structure{asm_mbdrc_config_params}
  6986. * @tablespace
  6987. * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_CONFIG_PARAMS.tex}
  6988. *
  6989. * @parspace Sub-band DRC configuration parameters
  6990. * @structure{asm_subband_drc_config_params}
  6991. * @tablespace
  6992. * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_subband_DRC.tex}
  6993. *
  6994. * @keep{6}
  6995. * To obtain legacy ADRC from MBDRC, use the calibration tool to:
  6996. *
  6997. * - Enable MBDRC (EnableFlag = TRUE)
  6998. * - Set number of bands to 1 (uiNumBands = 1)
  6999. * - Enable the first MBDRC band (DrcMode[0] = DRC_ENABLED = 1)
  7000. * - Clear the first band mute flag (MuteFlag[0] = 0)
  7001. * - Set the first band makeup gain to unity (compMakeUpGain[0] = 0x2000)
  7002. * - Use the legacy ADRC parameters to calibrate the rest of the MBDRC
  7003. * parameters.
  7004. */
  7005. #define ASM_PARAM_ID_MBDRC_CONFIG_PARAMS 0x00010C08
  7006. /* end_addtogroup audio_pp_param_ids */
  7007. /* audio_pp_module_ids
  7008. * ID of the MMBDRC module version 2 pre/postprocessing block.
  7009. * This module differs from the original MBDRC (#ASM_MODULE_ID_MBDRC) in
  7010. * the length of the filters used in each sub-band.
  7011. * This module supports the following parameter ID:
  7012. * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_IMPROVED_FILTBANK_V2
  7013. */
  7014. #define ASM_MODULE_ID_MBDRCV2 0x0001070B
  7015. /* @addtogroup audio_pp_param_ids */
  7016. /* ID of the configuration parameters used by the
  7017. * #ASM_MODULE_ID_MBDRCV2 module for the improved filter structure
  7018. * of the MBDRC v2 pre/postprocessing block.
  7019. * The update to this configuration structure from the original
  7020. * MBDRC is the number of filter coefficients in the filter
  7021. * structure. The sequence for is as follows:
  7022. * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
  7023. * - 2 bands = 141 FIR coefficients + 2 mute flags + uint16_t padding
  7024. * - 3 bands = 141+81 FIR coefficients + 3 mute flags + uint16_t padding
  7025. * - 4 bands = 141+81+61 FIR coefficients + 4 mute flags + uint16_t
  7026. * padding
  7027. * - 5 bands = 141+81+61+61 FIR coefficients + 5 mute flags +
  7028. * uint16_t padding
  7029. * This block uses the same parameter structure as
  7030. * #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS.
  7031. */
  7032. #define ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_IMPROVED_FILTBANK_V2 \
  7033. 0x0001070C
  7034. #define ASM_MODULE_ID_MBDRCV3 0x0001090B
  7035. /*
  7036. * ID of the MMBDRC module version 3 pre/postprocessing block.
  7037. * This module differs from MBDRCv2 (#ASM_MODULE_ID_MBDRCV2) in
  7038. * that it supports both 16- and 24-bit data.
  7039. * This module supports the following parameter ID:
  7040. * - #ASM_PARAM_ID_MBDRC_ENABLE
  7041. * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS
  7042. * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_V3
  7043. * - #ASM_PARAM_ID_MBDRC_FILTER_XOVER_FREQS
  7044. */
  7045. /* Structure for the enable parameter for an MBDRC module. */
  7046. /* Payload of the #ASM_PARAM_ID_MBDRC_ENABLE parameter used by the
  7047. * MBDRC module.
  7048. */
  7049. struct asm_mbdrc_enable {
  7050. uint32_t enable_flag;
  7051. /*< Specifies whether MBDRC is disabled (0) or enabled (nonzero).*/
  7052. } __packed;
  7053. /* Structure for the configuration parameters for an MBDRC module. */
  7054. /* Payload of the #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS
  7055. * parameters used by the MBDRC module. \n \n Following this
  7056. * structure is the payload for sub-band DRC configuration
  7057. * parameters (asm_subband_drc_config_params). This sub-band
  7058. * structure must be repeated for each band.
  7059. */
  7060. struct asm_mbdrc_config_params {
  7061. uint16_t num_bands;
  7062. /*< Number of bands.
  7063. * Supported values: 1 to 5
  7064. */
  7065. int16_t limiterhreshold;
  7066. /*< Threshold in decibels for the limiter output.
  7067. * Supported values: -72 to 18 \n
  7068. * Recommended value: 3994 (-0.22 db in Q3.12 format)
  7069. */
  7070. int16_t limiter_makeup_gain;
  7071. /*< Makeup gain in decibels for the limiter output.
  7072. * Supported values: -42 to 42 \n
  7073. * Recommended value: 256 (0 dB in Q7.8 format)
  7074. */
  7075. int16_t limiter_gc;
  7076. /*< Limiter gain recovery coefficient.
  7077. * Supported values: 0.5 to 0.99 \n
  7078. * Recommended value: 32440 (0.99 in Q15 format)
  7079. */
  7080. int16_t limiter_delay;
  7081. /*< Limiter delay in samples.
  7082. * Supported values: 0 to 10 \n
  7083. * Recommended value: 262 (0.008 samples in Q15 format)
  7084. */
  7085. int16_t limiter_max_wait;
  7086. /*< Maximum limiter waiting time in samples.
  7087. * Supported values: 0 to 10 \n
  7088. * Recommended value: 262 (0.008 samples in Q15 format)
  7089. */
  7090. } __packed;
  7091. /* DRC configuration structure for each sub-band of an MBDRC module. */
  7092. /* Payload of the #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS DRC
  7093. * configuration parameters for each sub-band in the MBDRC module.
  7094. * After this DRC structure is configured for valid bands, the next
  7095. * MBDRC setparams expects the sequence of sub-band MBDRC filter
  7096. * coefficients (the length depends on the number of bands) plus the
  7097. * mute flag for that band plus uint16_t padding.
  7098. *
  7099. * @keep{10}
  7100. * The filter coefficient and mute flag are of type int16_t:
  7101. * - FIR coefficient = int16_t firFilter
  7102. * - Mute flag = int16_t fMuteFlag
  7103. *
  7104. * The sequence is as follows:
  7105. * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
  7106. * - 2 bands = 97 FIR coefficients + 2 mute flags + uint16_t padding
  7107. * - 3 bands = 97+33 FIR coefficients + 3 mute flags + uint16_t padding
  7108. * - 4 bands = 97+33+33 FIR coefficients + 4 mute flags + uint16_t padding
  7109. * - 5 bands = 97+33+33+33 FIR coefficients + 5 mute flags + uint16_t padding
  7110. *
  7111. * For improved filterbank, the sequence is as follows:
  7112. * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
  7113. * - 2 bands = 141 FIR coefficients + 2 mute flags + uint16_t padding
  7114. * - 3 bands = 141+81 FIR coefficients + 3 mute flags + uint16_t padding
  7115. * - 4 bands = 141+81+61 FIR coefficients + 4 mute flags + uint16_t padding
  7116. * - 5 bands = 141+81+61+61 FIR coefficients + 5 mute flags + uint16_t padding
  7117. */
  7118. struct asm_subband_drc_config_params {
  7119. int16_t drc_stereo_linked_flag;
  7120. /*< Specifies whether all stereo channels have the same applied
  7121. * dynamics (1) or if they process their dynamics independently (0).
  7122. * Supported values:
  7123. * - 0 -- Not linked
  7124. * - 1 -- Linked
  7125. */
  7126. int16_t drc_mode;
  7127. /*< Specifies whether DRC mode is bypassed for sub-bands.
  7128. * Supported values:
  7129. * - 0 -- Disabled
  7130. * - 1 -- Enabled
  7131. */
  7132. int16_t drc_down_sample_level;
  7133. /*< DRC down sample level.
  7134. * Supported values: @ge 1
  7135. */
  7136. int16_t drc_delay;
  7137. /*< DRC delay in samples.
  7138. * Supported values: 0 to 1200
  7139. */
  7140. uint16_t drc_rmsime_avg_const;
  7141. /*< RMS signal energy time-averaging constant.
  7142. * Supported values: 0 to 2^16-1
  7143. */
  7144. uint16_t drc_makeup_gain;
  7145. /*< DRC makeup gain in decibels.
  7146. * Supported values: 258 to 64917
  7147. */
  7148. /* Down expander settings */
  7149. int16_t down_expdrhreshold;
  7150. /*< Down expander threshold.
  7151. * Supported Q7 format values: 1320 to up_cmpsrhreshold
  7152. */
  7153. int16_t down_expdr_slope;
  7154. /*< Down expander slope.
  7155. * Supported Q8 format values: -32768 to 0.
  7156. */
  7157. uint32_t down_expdr_attack;
  7158. /*< Down expander attack constant.
  7159. * Supported Q31 format values: 196844 to 2^31.
  7160. */
  7161. uint32_t down_expdr_release;
  7162. /*< Down expander release constant.
  7163. * Supported Q31 format values: 19685 to 2^31
  7164. */
  7165. uint16_t down_expdr_hysteresis;
  7166. /*< Down expander hysteresis constant.
  7167. * Supported Q14 format values: 1 to 32690
  7168. */
  7169. uint16_t reserved;
  7170. /*< Clients must set this field to zero. */
  7171. int32_t down_expdr_min_gain_db;
  7172. /*< Down expander minimum gain.
  7173. * Supported Q23 format values: -805306368 to 0.
  7174. */
  7175. /* Up compressor settings */
  7176. int16_t up_cmpsrhreshold;
  7177. /*< Up compressor threshold.
  7178. * Supported Q7 format values: down_expdrhreshold to
  7179. * down_cmpsrhreshold.
  7180. */
  7181. uint16_t up_cmpsr_slope;
  7182. /*< Up compressor slope.
  7183. * Supported Q16 format values: 0 to 64881.
  7184. */
  7185. uint32_t up_cmpsr_attack;
  7186. /*< Up compressor attack constant.
  7187. * Supported Q31 format values: 196844 to 2^31.
  7188. */
  7189. uint32_t up_cmpsr_release;
  7190. /*< Up compressor release constant.
  7191. * Supported Q31 format values: 19685 to 2^31.
  7192. */
  7193. uint16_t up_cmpsr_hysteresis;
  7194. /*< Up compressor hysteresis constant.
  7195. * Supported Q14 format values: 1 to 32690.
  7196. */
  7197. /* Down compressor settings */
  7198. int16_t down_cmpsrhreshold;
  7199. /*< Down compressor threshold.
  7200. * Supported Q7 format values: up_cmpsrhreshold to 11560.
  7201. */
  7202. uint16_t down_cmpsr_slope;
  7203. /*< Down compressor slope.
  7204. * Supported Q16 format values: 0 to 64881.
  7205. */
  7206. uint16_t reserved1;
  7207. /*< Clients must set this field to zero. */
  7208. uint32_t down_cmpsr_attack;
  7209. /*< Down compressor attack constant.
  7210. * Supported Q31 format values: 196844 to 2^31.
  7211. */
  7212. uint32_t down_cmpsr_release;
  7213. /*< Down compressor release constant.
  7214. * Supported Q31 format values: 19685 to 2^31.
  7215. */
  7216. uint16_t down_cmpsr_hysteresis;
  7217. /*< Down compressor hysteresis constant.
  7218. * Supported Q14 values: 1 to 32690.
  7219. */
  7220. uint16_t reserved2;
  7221. /*< Clients must set this field to zero.*/
  7222. } __packed;
  7223. #define ASM_MODULE_ID_EQUALIZER 0x00010C27
  7224. #define ASM_PARAM_ID_EQUALIZER_PARAMETERS 0x00010C28
  7225. #define ASM_MAX_EQ_BANDS 12
  7226. struct asm_eq_per_band_params {
  7227. uint32_t band_idx;
  7228. /*< Band index.
  7229. * Supported values: 0 to 11
  7230. */
  7231. uint32_t filterype;
  7232. /*< Type of filter.
  7233. * Supported values:
  7234. * - #ASM_PARAM_EQYPE_NONE
  7235. * - #ASM_PARAM_EQ_BASS_BOOST
  7236. * - #ASM_PARAM_EQ_BASS_CUT
  7237. * - #ASM_PARAM_EQREBLE_BOOST
  7238. * - #ASM_PARAM_EQREBLE_CUT
  7239. * - #ASM_PARAM_EQ_BAND_BOOST
  7240. * - #ASM_PARAM_EQ_BAND_CUT
  7241. */
  7242. uint32_t center_freq_hz;
  7243. /*< Filter band center frequency in Hertz. */
  7244. int32_t filter_gain;
  7245. /*< Filter band initial gain.
  7246. * Supported values: +12 to -12 dB in 1 dB increments
  7247. */
  7248. int32_t q_factor;
  7249. /*< Filter band quality factor expressed as a Q8 number, i.e., a
  7250. * fixed-point number with q factor of 8. For example, 3000/(2^8).
  7251. */
  7252. } __packed;
  7253. struct asm_eq_params {
  7254. struct apr_hdr hdr;
  7255. struct asm_stream_cmd_set_pp_params_v2 param;
  7256. struct asm_stream_param_data_v2 data;
  7257. uint32_t enable_flag;
  7258. /*< Specifies whether the equalizer module is disabled (0) or enabled
  7259. * (nonzero).
  7260. */
  7261. uint32_t num_bands;
  7262. /*< Number of bands.
  7263. * Supported values: 1 to 12
  7264. */
  7265. struct asm_eq_per_band_params eq_bands[ASM_MAX_EQ_BANDS];
  7266. } __packed;
  7267. /* No equalizer effect.*/
  7268. #define ASM_PARAM_EQYPE_NONE 0
  7269. /* Bass boost equalizer effect.*/
  7270. #define ASM_PARAM_EQ_BASS_BOOST 1
  7271. /*Bass cut equalizer effect.*/
  7272. #define ASM_PARAM_EQ_BASS_CUT 2
  7273. /* Treble boost equalizer effect */
  7274. #define ASM_PARAM_EQREBLE_BOOST 3
  7275. /* Treble cut equalizer effect.*/
  7276. #define ASM_PARAM_EQREBLE_CUT 4
  7277. /* Band boost equalizer effect.*/
  7278. #define ASM_PARAM_EQ_BAND_BOOST 5
  7279. /* Band cut equalizer effect.*/
  7280. #define ASM_PARAM_EQ_BAND_CUT 6
  7281. /* Get & set params */
  7282. #define VSS_ICOMMON_CMD_SET_PARAM_V2 0x0001133D
  7283. #define VSS_ICOMMON_CMD_GET_PARAM_V2 0x0001133E
  7284. #define VSS_ICOMMON_RSP_GET_PARAM 0x00011008
  7285. #define VSS_MAX_AVCS_NUM_SERVICES 25
  7286. /* ID of the Bass Boost module.
  7287. * This module supports the following parameter IDs:
  7288. * - #AUDPROC_PARAM_ID_BASS_BOOST_ENABLE
  7289. * - #AUDPROC_PARAM_ID_BASS_BOOST_MODE
  7290. * - #AUDPROC_PARAM_ID_BASS_BOOST_STRENGTH
  7291. */
  7292. #define AUDPROC_MODULE_ID_BASS_BOOST 0x000108A1
  7293. /* ID of the Bass Boost enable parameter used by
  7294. * AUDPROC_MODULE_ID_BASS_BOOST.
  7295. */
  7296. #define AUDPROC_PARAM_ID_BASS_BOOST_ENABLE 0x000108A2
  7297. /* ID of the Bass Boost mode parameter used by
  7298. * AUDPROC_MODULE_ID_BASS_BOOST.
  7299. */
  7300. #define AUDPROC_PARAM_ID_BASS_BOOST_MODE 0x000108A3
  7301. /* ID of the Bass Boost strength parameter used by
  7302. * AUDPROC_MODULE_ID_BASS_BOOST.
  7303. */
  7304. #define AUDPROC_PARAM_ID_BASS_BOOST_STRENGTH 0x000108A4
  7305. /* ID of the PBE module.
  7306. * This module supports the following parameter IDs:
  7307. * - #AUDPROC_PARAM_ID_PBE_ENABLE
  7308. * - #AUDPROC_PARAM_ID_PBE_PARAM_CONFIG
  7309. */
  7310. #define AUDPROC_MODULE_ID_PBE 0x00010C2A
  7311. /* ID of the Bass Boost enable parameter used by
  7312. * AUDPROC_MODULE_ID_BASS_BOOST.
  7313. */
  7314. #define AUDPROC_PARAM_ID_PBE_ENABLE 0x00010C2B
  7315. /* ID of the Bass Boost mode parameter used by
  7316. * AUDPROC_MODULE_ID_BASS_BOOST.
  7317. */
  7318. #define AUDPROC_PARAM_ID_PBE_PARAM_CONFIG 0x00010C49
  7319. /* ID of the Virtualizer module. This module supports the
  7320. * following parameter IDs:
  7321. * - #AUDPROC_PARAM_ID_VIRTUALIZER_ENABLE
  7322. * - #AUDPROC_PARAM_ID_VIRTUALIZER_STRENGTH
  7323. * - #AUDPROC_PARAM_ID_VIRTUALIZER_OUT_TYPE
  7324. * - #AUDPROC_PARAM_ID_VIRTUALIZER_GAIN_ADJUST
  7325. */
  7326. #define AUDPROC_MODULE_ID_VIRTUALIZER 0x000108A5
  7327. /* ID of the Virtualizer enable parameter used by
  7328. * AUDPROC_MODULE_ID_VIRTUALIZER.
  7329. */
  7330. #define AUDPROC_PARAM_ID_VIRTUALIZER_ENABLE 0x000108A6
  7331. /* ID of the Virtualizer strength parameter used by
  7332. * AUDPROC_MODULE_ID_VIRTUALIZER.
  7333. */
  7334. #define AUDPROC_PARAM_ID_VIRTUALIZER_STRENGTH 0x000108A7
  7335. /* ID of the Virtualizer out type parameter used by
  7336. * AUDPROC_MODULE_ID_VIRTUALIZER.
  7337. */
  7338. #define AUDPROC_PARAM_ID_VIRTUALIZER_OUT_TYPE 0x000108A8
  7339. /* ID of the Virtualizer out type parameter used by
  7340. * AUDPROC_MODULE_ID_VIRTUALIZER.
  7341. */
  7342. #define AUDPROC_PARAM_ID_VIRTUALIZER_GAIN_ADJUST 0x000108A9
  7343. /* ID of the Reverb module. This module supports the following
  7344. * parameter IDs:
  7345. * - #AUDPROC_PARAM_ID_REVERB_ENABLE
  7346. * - #AUDPROC_PARAM_ID_REVERB_MODE
  7347. * - #AUDPROC_PARAM_ID_REVERB_PRESET
  7348. * - #AUDPROC_PARAM_ID_REVERB_WET_MIX
  7349. * - #AUDPROC_PARAM_ID_REVERB_GAIN_ADJUST
  7350. * - #AUDPROC_PARAM_ID_REVERB_ROOM_LEVEL
  7351. * - #AUDPROC_PARAM_ID_REVERB_ROOM_HF_LEVEL
  7352. * - #AUDPROC_PARAM_ID_REVERB_DECAY_TIME
  7353. * - #AUDPROC_PARAM_ID_REVERB_DECAY_HF_RATIO
  7354. * - #AUDPROC_PARAM_ID_REVERB_REFLECTIONS_LEVEL
  7355. * - #AUDPROC_PARAM_ID_REVERB_REFLECTIONS_DELAY
  7356. * - #AUDPROC_PARAM_ID_REVERB_LEVEL
  7357. * - #AUDPROC_PARAM_ID_REVERB_DELAY
  7358. * - #AUDPROC_PARAM_ID_REVERB_DIFFUSION
  7359. * - #AUDPROC_PARAM_ID_REVERB_DENSITY
  7360. */
  7361. #define AUDPROC_MODULE_ID_REVERB 0x000108AA
  7362. /* ID of the Reverb enable parameter used by
  7363. * AUDPROC_MODULE_ID_REVERB.
  7364. */
  7365. #define AUDPROC_PARAM_ID_REVERB_ENABLE 0x000108AB
  7366. /* ID of the Reverb mode parameter used by
  7367. * AUDPROC_MODULE_ID_REVERB.
  7368. */
  7369. #define AUDPROC_PARAM_ID_REVERB_MODE 0x000108AC
  7370. /* ID of the Reverb preset parameter used by
  7371. * AUDPROC_MODULE_ID_REVERB.
  7372. */
  7373. #define AUDPROC_PARAM_ID_REVERB_PRESET 0x000108AD
  7374. /* ID of the Reverb wet mix parameter used by
  7375. * AUDPROC_MODULE_ID_REVERB.
  7376. */
  7377. #define AUDPROC_PARAM_ID_REVERB_WET_MIX 0x000108AE
  7378. /* ID of the Reverb gain adjust parameter used by
  7379. * AUDPROC_MODULE_ID_REVERB.
  7380. */
  7381. #define AUDPROC_PARAM_ID_REVERB_GAIN_ADJUST 0x000108AF
  7382. /* ID of the Reverb room level parameter used by
  7383. * AUDPROC_MODULE_ID_REVERB.
  7384. */
  7385. #define AUDPROC_PARAM_ID_REVERB_ROOM_LEVEL 0x000108B0
  7386. /* ID of the Reverb room hf level parameter used by
  7387. * AUDPROC_MODULE_ID_REVERB.
  7388. */
  7389. #define AUDPROC_PARAM_ID_REVERB_ROOM_HF_LEVEL 0x000108B1
  7390. /* ID of the Reverb decay time parameter used by
  7391. * AUDPROC_MODULE_ID_REVERB.
  7392. */
  7393. #define AUDPROC_PARAM_ID_REVERB_DECAY_TIME 0x000108B2
  7394. /* ID of the Reverb decay hf ratio parameter used by
  7395. * AUDPROC_MODULE_ID_REVERB.
  7396. */
  7397. #define AUDPROC_PARAM_ID_REVERB_DECAY_HF_RATIO 0x000108B3
  7398. /* ID of the Reverb reflections level parameter used by
  7399. * AUDPROC_MODULE_ID_REVERB.
  7400. */
  7401. #define AUDPROC_PARAM_ID_REVERB_REFLECTIONS_LEVEL 0x000108B4
  7402. /* ID of the Reverb reflections delay parameter used by
  7403. * AUDPROC_MODULE_ID_REVERB.
  7404. */
  7405. #define AUDPROC_PARAM_ID_REVERB_REFLECTIONS_DELAY 0x000108B5
  7406. /* ID of the Reverb level parameter used by
  7407. * AUDPROC_MODULE_ID_REVERB.
  7408. */
  7409. #define AUDPROC_PARAM_ID_REVERB_LEVEL 0x000108B6
  7410. /* ID of the Reverb delay parameter used by
  7411. * AUDPROC_MODULE_ID_REVERB.
  7412. */
  7413. #define AUDPROC_PARAM_ID_REVERB_DELAY 0x000108B7
  7414. /* ID of the Reverb diffusion parameter used by
  7415. * AUDPROC_MODULE_ID_REVERB.
  7416. */
  7417. #define AUDPROC_PARAM_ID_REVERB_DIFFUSION 0x000108B8
  7418. /* ID of the Reverb density parameter used by
  7419. * AUDPROC_MODULE_ID_REVERB.
  7420. */
  7421. #define AUDPROC_PARAM_ID_REVERB_DENSITY 0x000108B9
  7422. /* ID of the Popless Equalizer module. This module supports the
  7423. * following parameter IDs:
  7424. * - #AUDPROC_PARAM_ID_EQ_ENABLE
  7425. * - #AUDPROC_PARAM_ID_EQ_CONFIG
  7426. * - #AUDPROC_PARAM_ID_EQ_NUM_BANDS
  7427. * - #AUDPROC_PARAM_ID_EQ_BAND_LEVELS
  7428. * - #AUDPROC_PARAM_ID_EQ_BAND_LEVEL_RANGE
  7429. * - #AUDPROC_PARAM_ID_EQ_BAND_FREQS
  7430. * - #AUDPROC_PARAM_ID_EQ_SINGLE_BAND_FREQ_RANGE
  7431. * - #AUDPROC_PARAM_ID_EQ_SINGLE_BAND_FREQ
  7432. * - #AUDPROC_PARAM_ID_EQ_BAND_INDEX
  7433. * - #AUDPROC_PARAM_ID_EQ_PRESET_ID
  7434. * - #AUDPROC_PARAM_ID_EQ_NUM_PRESETS
  7435. * - #AUDPROC_PARAM_ID_EQ_GET_PRESET_NAME
  7436. */
  7437. #define AUDPROC_MODULE_ID_POPLESS_EQUALIZER 0x000108BA
  7438. /* ID of the Popless Equalizer enable parameter used by
  7439. * AUDPROC_MODULE_ID_POPLESS_EQUALIZER.
  7440. */
  7441. #define AUDPROC_PARAM_ID_EQ_ENABLE 0x000108BB
  7442. /* ID of the Popless Equalizer config parameter used by
  7443. * AUDPROC_MODULE_ID_POPLESS_EQUALIZER.
  7444. */
  7445. #define AUDPROC_PARAM_ID_EQ_CONFIG 0x000108BC
  7446. /* ID of the Popless Equalizer number of bands parameter used
  7447. * by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is
  7448. * used for get param only.
  7449. */
  7450. #define AUDPROC_PARAM_ID_EQ_NUM_BANDS 0x000108BD
  7451. /* ID of the Popless Equalizer band levels parameter used by
  7452. * AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is
  7453. * used for get param only.
  7454. */
  7455. #define AUDPROC_PARAM_ID_EQ_BAND_LEVELS 0x000108BE
  7456. /* ID of the Popless Equalizer band level range parameter used
  7457. * by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is
  7458. * used for get param only.
  7459. */
  7460. #define AUDPROC_PARAM_ID_EQ_BAND_LEVEL_RANGE 0x000108BF
  7461. /* ID of the Popless Equalizer band frequencies parameter used
  7462. * by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is
  7463. * used for get param only.
  7464. */
  7465. #define AUDPROC_PARAM_ID_EQ_BAND_FREQS 0x000108C0
  7466. /* ID of the Popless Equalizer single band frequency range
  7467. * parameter used by AUDPROC_MODULE_ID_POPLESS_EQUALIZER.
  7468. * This param ID is used for get param only.
  7469. */
  7470. #define AUDPROC_PARAM_ID_EQ_SINGLE_BAND_FREQ_RANGE 0x000108C1
  7471. /* ID of the Popless Equalizer single band frequency parameter
  7472. * used by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID
  7473. * is used for set param only.
  7474. */
  7475. #define AUDPROC_PARAM_ID_EQ_SINGLE_BAND_FREQ 0x000108C2
  7476. /* ID of the Popless Equalizer band index parameter used by
  7477. * AUDPROC_MODULE_ID_POPLESS_EQUALIZER.
  7478. */
  7479. #define AUDPROC_PARAM_ID_EQ_BAND_INDEX 0x000108C3
  7480. /* ID of the Popless Equalizer preset id parameter used by
  7481. * AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is used
  7482. * for get param only.
  7483. */
  7484. #define AUDPROC_PARAM_ID_EQ_PRESET_ID 0x000108C4
  7485. /* ID of the Popless Equalizer number of presets parameter used
  7486. * by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is used
  7487. * for get param only.
  7488. */
  7489. #define AUDPROC_PARAM_ID_EQ_NUM_PRESETS 0x000108C5
  7490. /* ID of the Popless Equalizer preset name parameter used by
  7491. * AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is used
  7492. * for get param only.
  7493. */
  7494. #define AUDPROC_PARAM_ID_EQ_PRESET_NAME 0x000108C6
  7495. /* Set Q6 topologies */
  7496. #define ASM_CMD_ADD_TOPOLOGIES 0x00010DBE
  7497. #define ADM_CMD_ADD_TOPOLOGIES 0x00010335
  7498. #define AFE_CMD_ADD_TOPOLOGIES 0x000100f8
  7499. /* structure used for both ioctls */
  7500. struct cmd_set_topologies {
  7501. struct apr_hdr hdr;
  7502. u32 payload_addr_lsw;
  7503. /* LSW of parameter data payload address.*/
  7504. u32 payload_addr_msw;
  7505. /* MSW of parameter data payload address.*/
  7506. u32 mem_map_handle;
  7507. /* Memory map handle returned by mem map command */
  7508. u32 payload_size;
  7509. /* Size in bytes of the variable payload in shared memory */
  7510. } __packed;
  7511. /* This module represents the Rx processing of Feedback speaker protection.
  7512. * It contains the excursion control, thermal protection,
  7513. * analog clip manager features in it.
  7514. * This module id will support following param ids.
  7515. * - AFE_PARAM_ID_FBSP_MODE_RX_CFG
  7516. */
  7517. #define AFE_MODULE_FB_SPKR_PROT_RX 0x0001021C
  7518. #define AFE_MODULE_FB_SPKR_PROT_V2_RX 0x0001025F
  7519. #define AFE_PARAM_ID_SP_RX_LIMITER_TH 0x000102B1
  7520. #define AFE_PARAM_ID_FBSP_MODE_RX_CFG 0x0001021D
  7521. #define AFE_PARAM_ID_FBSP_PTONE_RAMP_CFG 0x00010260
  7522. struct asm_fbsp_mode_rx_cfg {
  7523. uint32_t minor_version;
  7524. uint32_t mode;
  7525. } __packed;
  7526. /* This module represents the VI processing of feedback speaker protection.
  7527. * It will receive Vsens and Isens from codec and generates necessary
  7528. * parameters needed by Rx processing.
  7529. * This module id will support following param ids.
  7530. * - AFE_PARAM_ID_SPKR_CALIB_VI_PROC_CFG
  7531. * - AFE_PARAM_ID_CALIB_RES_CFG
  7532. * - AFE_PARAM_ID_FEEDBACK_PATH_CFG
  7533. */
  7534. #define AFE_MODULE_FB_SPKR_PROT_VI_PROC 0x00010226
  7535. #define AFE_MODULE_FB_SPKR_PROT_VI_PROC_V2 0x0001026A
  7536. #define AFE_PARAM_ID_SPKR_CALIB_VI_PROC_CFG 0x0001022A
  7537. #define AFE_PARAM_ID_SPKR_CALIB_VI_PROC_CFG_V2 0x0001026B
  7538. struct asm_spkr_calib_vi_proc_cfg {
  7539. uint32_t minor_version;
  7540. uint32_t operation_mode;
  7541. uint32_t r0_t0_selection_flag[SP_V2_NUM_MAX_SPKR];
  7542. int32_t r0_cali_q24[SP_V2_NUM_MAX_SPKR];
  7543. int16_t t0_cali_q6[SP_V2_NUM_MAX_SPKR];
  7544. uint32_t quick_calib_flag;
  7545. } __packed;
  7546. #define AFE_PARAM_ID_CALIB_RES_CFG 0x0001022B
  7547. #define AFE_PARAM_ID_CALIB_RES_CFG_V2 0x0001026E
  7548. struct asm_calib_res_cfg {
  7549. uint32_t minor_version;
  7550. int32_t r0_cali_q24[SP_V2_NUM_MAX_SPKR];
  7551. uint32_t th_vi_ca_state;
  7552. } __packed;
  7553. #define AFE_PARAM_ID_FEEDBACK_PATH_CFG 0x0001022C
  7554. #define AFE_MODULE_FEEDBACK 0x00010257
  7555. struct asm_feedback_path_cfg {
  7556. uint32_t minor_version;
  7557. int32_t dst_portid;
  7558. int32_t num_channels;
  7559. int32_t chan_info[4];
  7560. } __packed;
  7561. #define AFE_PARAM_ID_MODE_VI_PROC_CFG 0x00010227
  7562. struct asm_mode_vi_proc_cfg {
  7563. uint32_t minor_version;
  7564. uint32_t cal_mode;
  7565. } __packed;
  7566. #define AFE_MODULE_SPEAKER_PROTECTION_V2_TH_VI 0x0001026A
  7567. #define AFE_PARAM_ID_SP_V2_TH_VI_MODE_CFG 0x0001026B
  7568. #define AFE_PARAM_ID_SP_V2_TH_VI_FTM_CFG 0x0001029F
  7569. #define AFE_PARAM_ID_SP_V2_TH_VI_FTM_PARAMS 0x000102A0
  7570. struct afe_sp_th_vi_mode_cfg {
  7571. uint32_t minor_version;
  7572. uint32_t operation_mode;
  7573. /*
  7574. * Operation mode of thermal VI module.
  7575. * 0 -- Normal Running mode
  7576. * 1 -- Calibration mode
  7577. * 2 -- FTM mode
  7578. */
  7579. uint32_t r0t0_selection_flag[SP_V2_NUM_MAX_SPKR];
  7580. /*
  7581. * Specifies which set of R0, T0 values the algorithm will use.
  7582. * This field is valid only in Normal mode (operation_mode = 0).
  7583. * 0 -- Use calibrated R0, T0 value
  7584. * 1 -- Use safe R0, T0 value
  7585. */
  7586. int32_t r0_cali_q24[SP_V2_NUM_MAX_SPKR];
  7587. /*
  7588. * Calibration point resistance per device. This field is valid
  7589. * only in Normal mode (operation_mode = 0).
  7590. * values 33554432 to 1073741824 Ohms (in Q24 format)
  7591. */
  7592. int16_t t0_cali_q6[SP_V2_NUM_MAX_SPKR];
  7593. /*
  7594. * Calibration point temperature per device. This field is valid
  7595. * in both Normal mode and Calibration mode.
  7596. * values -1920 to 5120 degrees C (in Q6 format)
  7597. */
  7598. uint32_t quick_calib_flag;
  7599. /*
  7600. * Indicates whether calibration is to be done in quick mode or not.
  7601. * This field is valid only in Calibration mode (operation_mode = 1).
  7602. * 0 -- Disabled
  7603. * 1 -- Enabled
  7604. */
  7605. } __packed;
  7606. struct afe_sp_th_vi_ftm_cfg {
  7607. uint32_t minor_version;
  7608. uint32_t wait_time_ms[SP_V2_NUM_MAX_SPKR];
  7609. /*
  7610. * Wait time to heat up speaker before collecting statistics
  7611. * for ftm mode in ms.
  7612. * values 0 to 4294967295 ms
  7613. */
  7614. uint32_t ftm_time_ms[SP_V2_NUM_MAX_SPKR];
  7615. /*
  7616. * duration for which FTM statistics are collected in ms.
  7617. * values 0 to 2000 ms
  7618. */
  7619. } __packed;
  7620. struct afe_sp_th_vi_ftm_params {
  7621. uint32_t minor_version;
  7622. int32_t dc_res_q24[SP_V2_NUM_MAX_SPKR];
  7623. /*
  7624. * DC resistance value in q24 format
  7625. * values 0 to 2147483647 Ohms (in Q24 format)
  7626. */
  7627. int32_t temp_q22[SP_V2_NUM_MAX_SPKR];
  7628. /*
  7629. * temperature value in q22 format
  7630. * values -125829120 to 2147483647 degC (in Q22 format)
  7631. */
  7632. uint32_t status[SP_V2_NUM_MAX_SPKR];
  7633. /*
  7634. * FTM packet status
  7635. * 0 - Incorrect operation mode.This status is returned
  7636. * when GET_PARAM is called in non FTM Mode
  7637. * 1 - Inactive mode -- Port is not yet started.
  7638. * 2 - Wait state. wait_time_ms has not yet elapsed
  7639. * 3 - In progress state. ftm_time_ms has not yet elapsed.
  7640. * 4 - Success.
  7641. * 5 - Failed.
  7642. */
  7643. } __packed;
  7644. struct afe_sp_th_vi_get_param {
  7645. struct apr_hdr hdr;
  7646. struct afe_port_cmd_get_param_v2 get_param;
  7647. struct afe_port_param_data_v2 pdata;
  7648. struct afe_sp_th_vi_ftm_params param;
  7649. } __packed;
  7650. struct afe_sp_th_vi_get_param_resp {
  7651. uint32_t status;
  7652. struct afe_port_param_data_v2 pdata;
  7653. struct afe_sp_th_vi_ftm_params param;
  7654. } __packed;
  7655. #define AFE_MODULE_SPEAKER_PROTECTION_V2_EX_VI 0x0001026F
  7656. #define AFE_PARAM_ID_SP_V2_EX_VI_MODE_CFG 0x000102A1
  7657. #define AFE_PARAM_ID_SP_V2_EX_VI_FTM_CFG 0x000102A2
  7658. #define AFE_PARAM_ID_SP_V2_EX_VI_FTM_PARAMS 0x000102A3
  7659. struct afe_sp_ex_vi_mode_cfg {
  7660. uint32_t minor_version;
  7661. uint32_t operation_mode;
  7662. /*
  7663. * Operation mode of Excursion VI module.
  7664. * 0 - Normal Running mode
  7665. * 2 - FTM mode
  7666. */
  7667. } __packed;
  7668. struct afe_sp_ex_vi_ftm_cfg {
  7669. uint32_t minor_version;
  7670. uint32_t wait_time_ms[SP_V2_NUM_MAX_SPKR];
  7671. /*
  7672. * Wait time to heat up speaker before collecting statistics
  7673. * for ftm mode in ms.
  7674. * values 0 to 4294967295 ms
  7675. */
  7676. uint32_t ftm_time_ms[SP_V2_NUM_MAX_SPKR];
  7677. /*
  7678. * duration for which FTM statistics are collected in ms.
  7679. * values 0 to 2000 ms
  7680. */
  7681. } __packed;
  7682. struct afe_sp_ex_vi_ftm_params {
  7683. uint32_t minor_version;
  7684. int32_t freq_q20[SP_V2_NUM_MAX_SPKR];
  7685. /*
  7686. * Resonance frequency in q20 format
  7687. * values 0 to 2147483647 Hz (in Q20 format)
  7688. */
  7689. int32_t resis_q24[SP_V2_NUM_MAX_SPKR];
  7690. /*
  7691. * Mechanical resistance in q24 format
  7692. * values 0 to 2147483647 Ohms (in Q24 format)
  7693. */
  7694. int32_t qmct_q24[SP_V2_NUM_MAX_SPKR];
  7695. /*
  7696. * Mechanical Qfactor in q24 format
  7697. * values 0 to 2147483647 (in Q24 format)
  7698. */
  7699. uint32_t status[SP_V2_NUM_MAX_SPKR];
  7700. /*
  7701. * FTM packet status
  7702. * 0 - Incorrect operation mode.This status is returned
  7703. * when GET_PARAM is called in non FTM Mode.
  7704. * 1 - Inactive mode -- Port is not yet started.
  7705. * 2 - Wait state. wait_time_ms has not yet elapsed
  7706. * 3 - In progress state. ftm_time_ms has not yet elapsed.
  7707. * 4 - Success.
  7708. * 5 - Failed.
  7709. */
  7710. } __packed;
  7711. struct afe_sp_ex_vi_get_param {
  7712. struct apr_hdr hdr;
  7713. struct afe_port_cmd_get_param_v2 get_param;
  7714. struct afe_port_param_data_v2 pdata;
  7715. struct afe_sp_ex_vi_ftm_params param;
  7716. } __packed;
  7717. struct afe_sp_ex_vi_get_param_resp {
  7718. uint32_t status;
  7719. struct afe_port_param_data_v2 pdata;
  7720. struct afe_sp_ex_vi_ftm_params param;
  7721. } __packed;
  7722. struct afe_sp_rx_limiter_th_param {
  7723. uint32_t minor_version;
  7724. uint32_t lim_thr_per_calib_q27[SP_V2_NUM_MAX_SPKR];
  7725. } __packed;
  7726. union afe_spkr_prot_config {
  7727. struct asm_fbsp_mode_rx_cfg mode_rx_cfg;
  7728. struct asm_spkr_calib_vi_proc_cfg vi_proc_cfg;
  7729. struct asm_feedback_path_cfg feedback_path_cfg;
  7730. struct asm_mode_vi_proc_cfg mode_vi_proc_cfg;
  7731. struct afe_sp_th_vi_mode_cfg th_vi_mode_cfg;
  7732. struct afe_sp_th_vi_ftm_cfg th_vi_ftm_cfg;
  7733. struct afe_sp_ex_vi_mode_cfg ex_vi_mode_cfg;
  7734. struct afe_sp_ex_vi_ftm_cfg ex_vi_ftm_cfg;
  7735. struct afe_sp_rx_limiter_th_param limiter_th_cfg;
  7736. } __packed;
  7737. struct afe_spkr_prot_config_command {
  7738. struct apr_hdr hdr;
  7739. struct afe_port_cmd_set_param_v2 param;
  7740. struct afe_port_param_data_v2 pdata;
  7741. union afe_spkr_prot_config prot_config;
  7742. } __packed;
  7743. struct afe_spkr_prot_get_vi_calib {
  7744. struct apr_hdr hdr;
  7745. struct afe_port_cmd_get_param_v2 get_param;
  7746. struct afe_port_param_data_v2 pdata;
  7747. struct asm_calib_res_cfg res_cfg;
  7748. } __packed;
  7749. struct afe_spkr_prot_calib_get_resp {
  7750. uint32_t status;
  7751. struct afe_port_param_data_v2 pdata;
  7752. struct asm_calib_res_cfg res_cfg;
  7753. } __packed;
  7754. /* SRS TRUMEDIA start */
  7755. /* topology */
  7756. #define SRS_TRUMEDIA_TOPOLOGY_ID 0x00010D90
  7757. /* module */
  7758. #define SRS_TRUMEDIA_MODULE_ID 0x10005010
  7759. /* parameters */
  7760. #define SRS_TRUMEDIA_PARAMS 0x10005011
  7761. #define SRS_TRUMEDIA_PARAMS_WOWHD 0x10005012
  7762. #define SRS_TRUMEDIA_PARAMS_CSHP 0x10005013
  7763. #define SRS_TRUMEDIA_PARAMS_HPF 0x10005014
  7764. #define SRS_TRUMEDIA_PARAMS_AEQ 0x10005015
  7765. #define SRS_TRUMEDIA_PARAMS_HL 0x10005016
  7766. #define SRS_TRUMEDIA_PARAMS_GEQ 0x10005017
  7767. #define SRS_ID_GLOBAL 0x00000001
  7768. #define SRS_ID_WOWHD 0x00000002
  7769. #define SRS_ID_CSHP 0x00000003
  7770. #define SRS_ID_HPF 0x00000004
  7771. #define SRS_ID_AEQ 0x00000005
  7772. #define SRS_ID_HL 0x00000006
  7773. #define SRS_ID_GEQ 0x00000007
  7774. #define SRS_CMD_UPLOAD 0x7FFF0000
  7775. #define SRS_PARAM_OFFSET_MASK 0x3FFF0000
  7776. #define SRS_PARAM_VALUE_MASK 0x0000FFFF
  7777. struct srs_trumedia_params_GLOBAL {
  7778. uint8_t v1;
  7779. uint8_t v2;
  7780. uint8_t v3;
  7781. uint8_t v4;
  7782. uint8_t v5;
  7783. uint8_t v6;
  7784. uint8_t v7;
  7785. uint8_t v8;
  7786. uint16_t v9;
  7787. } __packed;
  7788. struct srs_trumedia_params_WOWHD {
  7789. uint32_t v1;
  7790. uint16_t v2;
  7791. uint16_t v3;
  7792. uint16_t v4;
  7793. uint16_t v5;
  7794. uint16_t v6;
  7795. uint16_t v7;
  7796. uint16_t v8;
  7797. uint16_t v____A1;
  7798. uint32_t v9;
  7799. uint16_t v10;
  7800. uint16_t v11;
  7801. uint32_t v12[16];
  7802. uint32_t v13[16];
  7803. uint32_t v14[16];
  7804. uint32_t v15[16];
  7805. uint32_t v16;
  7806. uint16_t v17;
  7807. uint16_t v18;
  7808. } __packed;
  7809. struct srs_trumedia_params_CSHP {
  7810. uint32_t v1;
  7811. uint16_t v2;
  7812. uint16_t v3;
  7813. uint16_t v4;
  7814. uint16_t v5;
  7815. uint16_t v6;
  7816. uint16_t v____A1;
  7817. uint32_t v7;
  7818. uint16_t v8;
  7819. uint16_t v9;
  7820. uint32_t v10[16];
  7821. } __packed;
  7822. struct srs_trumedia_params_HPF {
  7823. uint32_t v1;
  7824. uint32_t v2[26];
  7825. } __packed;
  7826. struct srs_trumedia_params_AEQ {
  7827. uint32_t v1;
  7828. uint16_t v2;
  7829. uint16_t v3;
  7830. uint16_t v4;
  7831. uint16_t v____A1;
  7832. uint32_t v5[74];
  7833. uint32_t v6[74];
  7834. uint16_t v7[2048];
  7835. } __packed;
  7836. struct srs_trumedia_params_HL {
  7837. uint16_t v1;
  7838. uint16_t v2;
  7839. uint16_t v3;
  7840. uint16_t v____A1;
  7841. int32_t v4;
  7842. uint32_t v5;
  7843. uint16_t v6;
  7844. uint16_t v____A2;
  7845. uint32_t v7;
  7846. } __packed;
  7847. struct srs_trumedia_params_GEQ {
  7848. int16_t v1[10];
  7849. } __packed;
  7850. struct srs_trumedia_params {
  7851. struct srs_trumedia_params_GLOBAL global;
  7852. struct srs_trumedia_params_WOWHD wowhd;
  7853. struct srs_trumedia_params_CSHP cshp;
  7854. struct srs_trumedia_params_HPF hpf;
  7855. struct srs_trumedia_params_AEQ aeq;
  7856. struct srs_trumedia_params_HL hl;
  7857. struct srs_trumedia_params_GEQ geq;
  7858. } __packed;
  7859. /* SRS TruMedia end */
  7860. #define AUDPROC_PARAM_ID_ENABLE 0x00010904
  7861. #define ASM_STREAM_POSTPROC_TOPO_ID_SA_PLUS 0x1000FFFF
  7862. /* DTS Eagle */
  7863. #define AUDPROC_MODULE_ID_DTS_HPX_PREMIX 0x0001077C
  7864. #define AUDPROC_MODULE_ID_DTS_HPX_POSTMIX 0x0001077B
  7865. #define ASM_STREAM_POSTPROC_TOPO_ID_DTS_HPX 0x00010DED
  7866. #define ASM_STREAM_POSTPROC_TOPO_ID_HPX_PLUS 0x10015000
  7867. #define ASM_STREAM_POSTPROC_TOPO_ID_HPX_MASTER 0x10015001
  7868. struct asm_dts_eagle_param {
  7869. struct apr_hdr hdr;
  7870. struct asm_stream_cmd_set_pp_params_v2 param;
  7871. struct asm_stream_param_data_v2 data;
  7872. } __packed;
  7873. struct asm_dts_eagle_param_get {
  7874. struct apr_hdr hdr;
  7875. struct asm_stream_cmd_get_pp_params_v2 param;
  7876. } __packed;
  7877. /* Opcode to set BT address and license for aptx decoder */
  7878. #define APTX_DECODER_BT_ADDRESS 0x00013201
  7879. #define APTX_CLASSIC_DEC_LICENSE_ID 0x00013202
  7880. struct aptx_dec_bt_addr_cfg {
  7881. uint32_t lap;
  7882. uint32_t uap;
  7883. uint32_t nap;
  7884. } __packed;
  7885. struct aptx_dec_bt_dev_addr {
  7886. struct apr_hdr hdr;
  7887. struct asm_stream_cmd_set_encdec_param encdec;
  7888. struct aptx_dec_bt_addr_cfg bt_addr_cfg;
  7889. } __packed;
  7890. struct asm_aptx_dec_fmt_blk_v2 {
  7891. struct apr_hdr hdr;
  7892. struct asm_data_cmd_media_fmt_update_v2 fmtblk;
  7893. u32 sample_rate;
  7894. /* Number of samples per second.
  7895. * Supported values: 44100 and 48000 Hz
  7896. */
  7897. } __packed;
  7898. /* Q6Core Specific */
  7899. #define AVCS_CMD_GET_FWK_VERSION (0x0001292C)
  7900. #define AVCS_CMDRSP_GET_FWK_VERSION (0x0001292D)
  7901. #define AVCS_SERVICE_ID_ALL (0xFFFFFFFF)
  7902. #define APRV2_IDS_SERVICE_ID_ADSP_CVP_V (0xB)
  7903. struct avcs_get_fwk_version {
  7904. /*
  7905. * Indicates the major version of the AVS build.
  7906. * This value is incremented on chipset family boundaries.
  7907. */
  7908. uint32_t build_major_version;
  7909. /*
  7910. * Minor version of the AVS build.
  7911. * This value represents the mainline to which the AVS build belongs.
  7912. */
  7913. uint32_t build_minor_version;
  7914. /* Indicates the AVS branch version to which the image belongs. */
  7915. uint32_t build_branch_version;
  7916. /* Indicates the AVS sub-branch or customer product line information. */
  7917. uint32_t build_subbranch_version;
  7918. /* Number of supported AVS services in the current build. */
  7919. uint32_t num_services;
  7920. };
  7921. struct avs_svc_api_info {
  7922. /*
  7923. * APRV2 service IDs for the individual static services.
  7924. *
  7925. * @values
  7926. * - APRV2_IDS_SERVICE_ID_ADSP_CORE_V
  7927. * - APRV2_IDS_SERVICE_ID_ADSP_AFE_V
  7928. * - APRV2_IDS_SERVICE_ID_ADSP_ASM_V
  7929. * - APRV2_IDS_SERVICE_ID_ADSP_ADM_V
  7930. * - APRV2_IDS_SERVICE_ID_ADSP_MVM_V
  7931. * - APRV2_IDS_SERVICE_ID_ADSP_CVS_V
  7932. * - APRV2_IDS_SERVICE_ID_ADSP_CVP_V
  7933. * - APRV2_IDS_SERVICE_ID_ADSP_LSM_V
  7934. */
  7935. uint32_t service_id;
  7936. /*
  7937. * Indicates the API version of the service.
  7938. *
  7939. * Each new API update that warrants a change on the HLOS side triggers
  7940. * an increment in the version.
  7941. */
  7942. uint32_t api_version;
  7943. /*
  7944. * Indicates the API increments on a sub-branch (not on the mainline).
  7945. *
  7946. * API branch version numbers can increment independently on different
  7947. * sub-branches.
  7948. */
  7949. uint32_t api_branch_version;
  7950. };
  7951. struct avcs_fwk_ver_info {
  7952. struct avcs_get_fwk_version avcs_fwk_version;
  7953. struct avs_svc_api_info services[0];
  7954. } __packed;
  7955. /* LSM Specific */
  7956. #define VW_FEAT_DIM (39)
  7957. #define APRV2_IDS_SERVICE_ID_ADSP_LSM_V (0xD)
  7958. #define APRV2_IDS_DOMAIN_ID_ADSP_V (0x4)
  7959. #define APRV2_IDS_DOMAIN_ID_APPS_V (0x5)
  7960. #define LSM_SESSION_CMD_SHARED_MEM_MAP_REGIONS (0x00012A7F)
  7961. #define LSM_SESSION_CMDRSP_SHARED_MEM_MAP_REGIONS (0x00012A80)
  7962. #define LSM_SESSION_CMD_SHARED_MEM_UNMAP_REGIONS (0x00012A81)
  7963. #define LSM_SESSION_CMD_OPEN_TX (0x00012A82)
  7964. #define LSM_SESSION_CMD_CLOSE_TX (0x00012A88)
  7965. #define LSM_SESSION_CMD_SET_PARAMS (0x00012A83)
  7966. #define LSM_SESSION_CMD_SET_PARAMS_V2 (0x00012A8F)
  7967. #define LSM_SESSION_CMD_REGISTER_SOUND_MODEL (0x00012A84)
  7968. #define LSM_SESSION_CMD_DEREGISTER_SOUND_MODEL (0x00012A85)
  7969. #define LSM_SESSION_CMD_START (0x00012A86)
  7970. #define LSM_SESSION_CMD_STOP (0x00012A87)
  7971. #define LSM_SESSION_CMD_EOB (0x00012A89)
  7972. #define LSM_SESSION_CMD_READ (0x00012A8A)
  7973. #define LSM_SESSION_CMD_OPEN_TX_V2 (0x00012A8B)
  7974. #define LSM_CMD_ADD_TOPOLOGIES (0x00012A8C)
  7975. #define LSM_SESSION_EVENT_DETECTION_STATUS (0x00012B00)
  7976. #define LSM_SESSION_EVENT_DETECTION_STATUS_V2 (0x00012B01)
  7977. #define LSM_DATA_EVENT_READ_DONE (0x00012B02)
  7978. #define LSM_DATA_EVENT_STATUS (0x00012B03)
  7979. #define LSM_SESSION_EVENT_DETECTION_STATUS_V3 (0x00012B04)
  7980. #define LSM_MODULE_ID_VOICE_WAKEUP (0x00012C00)
  7981. #define LSM_PARAM_ID_ENDPOINT_DETECT_THRESHOLD (0x00012C01)
  7982. #define LSM_PARAM_ID_OPERATION_MODE (0x00012C02)
  7983. #define LSM_PARAM_ID_GAIN (0x00012C03)
  7984. #define LSM_PARAM_ID_CONNECT_TO_PORT (0x00012C04)
  7985. #define LSM_PARAM_ID_FEATURE_COMPENSATION_DATA (0x00012C07)
  7986. #define LSM_PARAM_ID_MIN_CONFIDENCE_LEVELS (0x00012C07)
  7987. #define LSM_MODULE_ID_LAB (0x00012C08)
  7988. #define LSM_PARAM_ID_LAB_ENABLE (0x00012C09)
  7989. #define LSM_PARAM_ID_LAB_CONFIG (0x00012C0A)
  7990. #define LSM_MODULE_ID_FRAMEWORK (0x00012C0E)
  7991. #define LSM_PARAM_ID_SWMAD_CFG (0x00012C18)
  7992. #define LSM_PARAM_ID_SWMAD_MODEL (0x00012C19)
  7993. #define LSM_PARAM_ID_SWMAD_ENABLE (0x00012C1A)
  7994. #define LSM_PARAM_ID_POLLING_ENABLE (0x00012C1B)
  7995. #define LSM_PARAM_ID_MEDIA_FMT (0x00012C1E)
  7996. #define LSM_PARAM_ID_FWK_MODE_CONFIG (0x00012C27)
  7997. /* HW MAD specific */
  7998. #define AFE_MODULE_HW_MAD (0x00010230)
  7999. #define AFE_PARAM_ID_HW_MAD_CFG (0x00010231)
  8000. #define AFE_PARAM_ID_HW_MAD_CTRL (0x00010232)
  8001. #define AFE_PARAM_ID_SLIMBUS_SLAVE_PORT_CFG (0x00010233)
  8002. /* SW MAD specific */
  8003. #define AFE_MODULE_SW_MAD (0x0001022D)
  8004. #define AFE_PARAM_ID_SW_MAD_CFG (0x0001022E)
  8005. #define AFE_PARAM_ID_SVM_MODEL (0x0001022F)
  8006. /* Commands/Params to pass the codec/slimbus data to DSP */
  8007. #define AFE_SVC_CMD_SET_PARAM (0x000100f3)
  8008. #define AFE_MODULE_CDC_DEV_CFG (0x00010234)
  8009. #define AFE_PARAM_ID_CDC_SLIMBUS_SLAVE_CFG (0x00010235)
  8010. #define AFE_PARAM_ID_CDC_REG_CFG (0x00010236)
  8011. #define AFE_PARAM_ID_CDC_REG_CFG_INIT (0x00010237)
  8012. #define AFE_PARAM_ID_CDC_REG_PAGE_CFG (0x00010296)
  8013. #define AFE_MAX_CDC_REGISTERS_TO_CONFIG (20)
  8014. /* AANC Port Config Specific */
  8015. #define AFE_PARAM_ID_AANC_PORT_CONFIG (0x00010215)
  8016. #define AFE_API_VERSION_AANC_PORT_CONFIG (0x1)
  8017. #define AANC_TX_MIC_UNUSED (0)
  8018. #define AANC_TX_VOICE_MIC (1)
  8019. #define AANC_TX_ERROR_MIC (2)
  8020. #define AANC_TX_NOISE_MIC (3)
  8021. #define AFE_PORT_MAX_CHANNEL_CNT (8)
  8022. #define AFE_MODULE_AANC (0x00010214)
  8023. #define AFE_PARAM_ID_CDC_AANC_VERSION (0x0001023A)
  8024. #define AFE_API_VERSION_CDC_AANC_VERSION (0x1)
  8025. #define AANC_HW_BLOCK_VERSION_1 (1)
  8026. #define AANC_HW_BLOCK_VERSION_2 (2)
  8027. /*Clip bank selection*/
  8028. #define AFE_API_VERSION_CLIP_BANK_SEL_CFG 0x1
  8029. #define AFE_CLIP_MAX_BANKS 4
  8030. #define AFE_PARAM_ID_CLIP_BANK_SEL_CFG 0x00010242
  8031. struct afe_param_aanc_port_cfg {
  8032. /* Minor version used for tracking the version of the module's
  8033. * source port configuration.
  8034. */
  8035. uint32_t aanc_port_cfg_minor_version;
  8036. /* Sampling rate of the source Tx port. 8k - 192k*/
  8037. uint32_t tx_port_sample_rate;
  8038. /* Channel mapping for the Tx port signal carrying Noise (X),
  8039. * Error (E), and Voice (V) signals.
  8040. */
  8041. uint8_t tx_port_channel_map[AFE_PORT_MAX_CHANNEL_CNT];
  8042. /* Number of channels on the source Tx port. */
  8043. uint16_t tx_port_num_channels;
  8044. /* Port ID of the Rx path reference signal. */
  8045. uint16_t rx_path_ref_port_id;
  8046. /* Sampling rate of the reference port. 8k - 192k*/
  8047. uint32_t ref_port_sample_rate;
  8048. } __packed;
  8049. struct afe_param_id_cdc_aanc_version {
  8050. /* Minor version used for tracking the version of the module's
  8051. * hw version
  8052. */
  8053. uint32_t cdc_aanc_minor_version;
  8054. /* HW version. */
  8055. uint32_t aanc_hw_version;
  8056. } __packed;
  8057. struct afe_param_id_clip_bank_sel {
  8058. /* Minor version used for tracking the version of the module's
  8059. * hw version
  8060. */
  8061. uint32_t minor_version;
  8062. /* Number of banks to be read */
  8063. uint32_t num_banks;
  8064. uint32_t bank_map[AFE_CLIP_MAX_BANKS];
  8065. } __packed;
  8066. /* ERROR CODES */
  8067. /* Success. The operation completed with no errors. */
  8068. #define ADSP_EOK 0x00000000
  8069. /* General failure. */
  8070. #define ADSP_EFAILED 0x00000001
  8071. /* Bad operation parameter. */
  8072. #define ADSP_EBADPARAM 0x00000002
  8073. /* Unsupported routine or operation. */
  8074. #define ADSP_EUNSUPPORTED 0x00000003
  8075. /* Unsupported version. */
  8076. #define ADSP_EVERSION 0x00000004
  8077. /* Unexpected problem encountered. */
  8078. #define ADSP_EUNEXPECTED 0x00000005
  8079. /* Unhandled problem occurred. */
  8080. #define ADSP_EPANIC 0x00000006
  8081. /* Unable to allocate resource. */
  8082. #define ADSP_ENORESOURCE 0x00000007
  8083. /* Invalid handle. */
  8084. #define ADSP_EHANDLE 0x00000008
  8085. /* Operation is already processed. */
  8086. #define ADSP_EALREADY 0x00000009
  8087. /* Operation is not ready to be processed. */
  8088. #define ADSP_ENOTREADY 0x0000000A
  8089. /* Operation is pending completion. */
  8090. #define ADSP_EPENDING 0x0000000B
  8091. /* Operation could not be accepted or processed. */
  8092. #define ADSP_EBUSY 0x0000000C
  8093. /* Operation aborted due to an error. */
  8094. #define ADSP_EABORTED 0x0000000D
  8095. /* Operation preempted by a higher priority. */
  8096. #define ADSP_EPREEMPTED 0x0000000E
  8097. /* Operation requests intervention to complete. */
  8098. #define ADSP_ECONTINUE 0x0000000F
  8099. /* Operation requests immediate intervention to complete. */
  8100. #define ADSP_EIMMEDIATE 0x00000010
  8101. /* Operation is not implemented. */
  8102. #define ADSP_ENOTIMPL 0x00000011
  8103. /* Operation needs more data or resources. */
  8104. #define ADSP_ENEEDMORE 0x00000012
  8105. /* Operation does not have memory. */
  8106. #define ADSP_ENOMEMORY 0x00000014
  8107. /* Item does not exist. */
  8108. #define ADSP_ENOTEXIST 0x00000015
  8109. /* Max count for adsp error code sent to HLOS*/
  8110. #define ADSP_ERR_MAX (ADSP_ENOTEXIST + 1)
  8111. /* Operation is finished. */
  8112. #define ADSP_ETERMINATED 0x00011174
  8113. /*bharath, adsp_error_codes.h */
  8114. /* LPASS clock for I2S Interface */
  8115. /* Supported OSR clock values */
  8116. #define Q6AFE_LPASS_OSR_CLK_12_P288_MHZ 0xBB8000
  8117. #define Q6AFE_LPASS_OSR_CLK_11_P2896_MHZ 0xAC4400
  8118. #define Q6AFE_LPASS_OSR_CLK_9_P600_MHZ 0x927C00
  8119. #define Q6AFE_LPASS_OSR_CLK_8_P192_MHZ 0x7D0000
  8120. #define Q6AFE_LPASS_OSR_CLK_6_P144_MHZ 0x5DC000
  8121. #define Q6AFE_LPASS_OSR_CLK_4_P096_MHZ 0x3E8000
  8122. #define Q6AFE_LPASS_OSR_CLK_3_P072_MHZ 0x2EE000
  8123. #define Q6AFE_LPASS_OSR_CLK_2_P048_MHZ 0x1F4000
  8124. #define Q6AFE_LPASS_OSR_CLK_1_P536_MHZ 0x177000
  8125. #define Q6AFE_LPASS_OSR_CLK_1_P024_MHZ 0xFA000
  8126. #define Q6AFE_LPASS_OSR_CLK_768_kHZ 0xBB800
  8127. #define Q6AFE_LPASS_OSR_CLK_512_kHZ 0x7D000
  8128. #define Q6AFE_LPASS_OSR_CLK_DISABLE 0x0
  8129. /* Supported Bit clock values */
  8130. #define Q6AFE_LPASS_IBIT_CLK_12_P288_MHZ 0xBB8000
  8131. #define Q6AFE_LPASS_IBIT_CLK_11_P2896_MHZ 0xAC4400
  8132. #define Q6AFE_LPASS_IBIT_CLK_8_P192_MHZ 0x7D0000
  8133. #define Q6AFE_LPASS_IBIT_CLK_6_P144_MHZ 0x5DC000
  8134. #define Q6AFE_LPASS_IBIT_CLK_4_P096_MHZ 0x3E8000
  8135. #define Q6AFE_LPASS_IBIT_CLK_3_P072_MHZ 0x2EE000
  8136. #define Q6AFE_LPASS_IBIT_CLK_2_P8224_MHZ 0x2b1100
  8137. #define Q6AFE_LPASS_IBIT_CLK_2_P048_MHZ 0x1F4000
  8138. #define Q6AFE_LPASS_IBIT_CLK_1_P536_MHZ 0x177000
  8139. #define Q6AFE_LPASS_IBIT_CLK_1_P4112_MHZ 0x158880
  8140. #define Q6AFE_LPASS_IBIT_CLK_1_P024_MHZ 0xFA000
  8141. #define Q6AFE_LPASS_IBIT_CLK_768_KHZ 0xBB800
  8142. #define Q6AFE_LPASS_IBIT_CLK_512_KHZ 0x7D000
  8143. #define Q6AFE_LPASS_IBIT_CLK_256_KHZ 0x3E800
  8144. #define Q6AFE_LPASS_IBIT_CLK_DISABLE 0x0
  8145. /* Supported LPASS CLK sources */
  8146. #define Q6AFE_LPASS_CLK_SRC_EXTERNAL 0
  8147. #define Q6AFE_LPASS_CLK_SRC_INTERNAL 1
  8148. /* Supported LPASS CLK root*/
  8149. #define Q6AFE_LPASS_CLK_ROOT_DEFAULT 0
  8150. enum afe_lpass_clk_mode {
  8151. Q6AFE_LPASS_MODE_BOTH_INVALID,
  8152. Q6AFE_LPASS_MODE_CLK1_VALID,
  8153. Q6AFE_LPASS_MODE_CLK2_VALID,
  8154. Q6AFE_LPASS_MODE_BOTH_VALID,
  8155. } __packed;
  8156. /* Clock ID Enumeration Define. */
  8157. /* Clock ID for Primary I2S IBIT */
  8158. #define Q6AFE_LPASS_CLK_ID_PRI_MI2S_IBIT 0x100
  8159. /* Clock ID for Primary I2S EBIT */
  8160. #define Q6AFE_LPASS_CLK_ID_PRI_MI2S_EBIT 0x101
  8161. /* Clock ID for Secondary I2S IBIT */
  8162. #define Q6AFE_LPASS_CLK_ID_SEC_MI2S_IBIT 0x102
  8163. /* Clock ID for Secondary I2S EBIT */
  8164. #define Q6AFE_LPASS_CLK_ID_SEC_MI2S_EBIT 0x103
  8165. /* Clock ID for Tertiary I2S IBIT */
  8166. #define Q6AFE_LPASS_CLK_ID_TER_MI2S_IBIT 0x104
  8167. /* Clock ID for Tertiary I2S EBIT */
  8168. #define Q6AFE_LPASS_CLK_ID_TER_MI2S_EBIT 0x105
  8169. /* Clock ID for Quartnery I2S IBIT */
  8170. #define Q6AFE_LPASS_CLK_ID_QUAD_MI2S_IBIT 0x106
  8171. /* Clock ID for Quartnery I2S EBIT */
  8172. #define Q6AFE_LPASS_CLK_ID_QUAD_MI2S_EBIT 0x107
  8173. /* Clock ID for Speaker I2S IBIT */
  8174. #define Q6AFE_LPASS_CLK_ID_SPEAKER_I2S_IBIT 0x108
  8175. /* Clock ID for Speaker I2S EBIT */
  8176. #define Q6AFE_LPASS_CLK_ID_SPEAKER_I2S_EBIT 0x109
  8177. /* Clock ID for Speaker I2S OSR */
  8178. #define Q6AFE_LPASS_CLK_ID_SPEAKER_I2S_OSR 0x10A
  8179. /* Clock ID for QUINARY I2S IBIT */
  8180. #define Q6AFE_LPASS_CLK_ID_QUI_MI2S_IBIT 0x10B
  8181. /* Clock ID for QUINARY I2S EBIT */
  8182. #define Q6AFE_LPASS_CLK_ID_QUI_MI2S_EBIT 0x10C
  8183. /* Clock ID for SENARY I2S IBIT */
  8184. #define Q6AFE_LPASS_CLK_ID_SEN_MI2S_IBIT 0x10D
  8185. /* Clock ID for SENARY I2S EBIT */
  8186. #define Q6AFE_LPASS_CLK_ID_SEN_MI2S_EBIT 0x10E
  8187. /* Clock ID for INT0 I2S IBIT */
  8188. #define Q6AFE_LPASS_CLK_ID_INT0_MI2S_IBIT 0x10F
  8189. /* Clock ID for INT1 I2S IBIT */
  8190. #define Q6AFE_LPASS_CLK_ID_INT1_MI2S_IBIT 0x110
  8191. /* Clock ID for INT2 I2S IBIT */
  8192. #define Q6AFE_LPASS_CLK_ID_INT2_MI2S_IBIT 0x111
  8193. /* Clock ID for INT3 I2S IBIT */
  8194. #define Q6AFE_LPASS_CLK_ID_INT3_MI2S_IBIT 0x112
  8195. /* Clock ID for INT4 I2S IBIT */
  8196. #define Q6AFE_LPASS_CLK_ID_INT4_MI2S_IBIT 0x113
  8197. /* Clock ID for INT5 I2S IBIT */
  8198. #define Q6AFE_LPASS_CLK_ID_INT5_MI2S_IBIT 0x114
  8199. /* Clock ID for INT6 I2S IBIT */
  8200. #define Q6AFE_LPASS_CLK_ID_INT6_MI2S_IBIT 0x115
  8201. /* Clock ID for QUINARY MI2S OSR CLK */
  8202. #define Q6AFE_LPASS_CLK_ID_QUI_MI2S_OSR 0x116
  8203. /* Clock ID for Primary PCM IBIT */
  8204. #define Q6AFE_LPASS_CLK_ID_PRI_PCM_IBIT 0x200
  8205. /* Clock ID for Primary PCM EBIT */
  8206. #define Q6AFE_LPASS_CLK_ID_PRI_PCM_EBIT 0x201
  8207. /* Clock ID for Secondary PCM IBIT */
  8208. #define Q6AFE_LPASS_CLK_ID_SEC_PCM_IBIT 0x202
  8209. /* Clock ID for Secondary PCM EBIT */
  8210. #define Q6AFE_LPASS_CLK_ID_SEC_PCM_EBIT 0x203
  8211. /* Clock ID for Tertiary PCM IBIT */
  8212. #define Q6AFE_LPASS_CLK_ID_TER_PCM_IBIT 0x204
  8213. /* Clock ID for Tertiary PCM EBIT */
  8214. #define Q6AFE_LPASS_CLK_ID_TER_PCM_EBIT 0x205
  8215. /* Clock ID for Quartery PCM IBIT */
  8216. #define Q6AFE_LPASS_CLK_ID_QUAD_PCM_IBIT 0x206
  8217. /* Clock ID for Quartery PCM EBIT */
  8218. #define Q6AFE_LPASS_CLK_ID_QUAD_PCM_EBIT 0x207
  8219. /* Clock ID for Quinary PCM IBIT */
  8220. #define Q6AFE_LPASS_CLK_ID_QUIN_PCM_IBIT 0x208
  8221. /* Clock ID for Quinary PCM EBIT */
  8222. #define Q6AFE_LPASS_CLK_ID_QUIN_PCM_EBIT 0x209
  8223. /* Clock ID for QUINARY PCM OSR */
  8224. #define Q6AFE_LPASS_CLK_ID_QUI_PCM_OSR 0x20A
  8225. /** Clock ID for Primary TDM IBIT */
  8226. #define Q6AFE_LPASS_CLK_ID_PRI_TDM_IBIT 0x200
  8227. /** Clock ID for Primary TDM EBIT */
  8228. #define Q6AFE_LPASS_CLK_ID_PRI_TDM_EBIT 0x201
  8229. /** Clock ID for Secondary TDM IBIT */
  8230. #define Q6AFE_LPASS_CLK_ID_SEC_TDM_IBIT 0x202
  8231. /** Clock ID for Secondary TDM EBIT */
  8232. #define Q6AFE_LPASS_CLK_ID_SEC_TDM_EBIT 0x203
  8233. /** Clock ID for Tertiary TDM IBIT */
  8234. #define Q6AFE_LPASS_CLK_ID_TER_TDM_IBIT 0x204
  8235. /** Clock ID for Tertiary TDM EBIT */
  8236. #define Q6AFE_LPASS_CLK_ID_TER_TDM_EBIT 0x205
  8237. /** Clock ID for Quartery TDM IBIT */
  8238. #define Q6AFE_LPASS_CLK_ID_QUAD_TDM_IBIT 0x206
  8239. /** Clock ID for Quartery TDM EBIT */
  8240. #define Q6AFE_LPASS_CLK_ID_QUAD_TDM_EBIT 0x207
  8241. /** Clock ID for Quinary TDM IBIT */
  8242. #define Q6AFE_LPASS_CLK_ID_QUIN_TDM_IBIT 0x208
  8243. /** Clock ID for Quinary TDM EBIT */
  8244. #define Q6AFE_LPASS_CLK_ID_QUIN_TDM_EBIT 0x209
  8245. /** Clock ID for Quinary TDM OSR */
  8246. #define Q6AFE_LPASS_CLK_ID_QUIN_TDM_OSR 0x20A
  8247. /* Clock ID for MCLK1 */
  8248. #define Q6AFE_LPASS_CLK_ID_MCLK_1 0x300
  8249. /* Clock ID for MCLK2 */
  8250. #define Q6AFE_LPASS_CLK_ID_MCLK_2 0x301
  8251. /* Clock ID for MCLK3 */
  8252. #define Q6AFE_LPASS_CLK_ID_MCLK_3 0x302
  8253. /* Clock ID for MCLK4 */
  8254. #define Q6AFE_LPASS_CLK_ID_MCLK_4 0x304
  8255. /* Clock ID for Internal Digital Codec Core */
  8256. #define Q6AFE_LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE 0x303
  8257. /* Clock ID for INT MCLK0 */
  8258. #define Q6AFE_LPASS_CLK_ID_INT_MCLK_0 0x305
  8259. /* Clock ID for INT MCLK1 */
  8260. #define Q6AFE_LPASS_CLK_ID_INT_MCLK_1 0x306
  8261. /*
  8262. * Clock ID for soundwire NPL.
  8263. * This is the clock to be used to enable NPL clock for internal Soundwire.
  8264. */
  8265. #define AFE_CLOCK_SET_CLOCK_ID_SWR_NPL_CLK 0x307
  8266. /* Clock ID for AHB HDMI input */
  8267. #define Q6AFE_LPASS_CLK_ID_AHB_HDMI_INPUT 0x400
  8268. /* Clock ID for SPDIF core */
  8269. #define Q6AFE_LPASS_CLK_ID_SPDIF_CORE 0x500
  8270. /* Clock attribute for invalid use (reserved for internal usage) */
  8271. #define Q6AFE_LPASS_CLK_ATTRIBUTE_INVALID 0x0
  8272. /* Clock attribute for no couple case */
  8273. #define Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO 0x1
  8274. /* Clock attribute for dividend couple case */
  8275. #define Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_DIVIDEND 0x2
  8276. /* Clock attribute for divisor couple case */
  8277. #define Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_DIVISOR 0x3
  8278. /* Clock attribute for invert and no couple case */
  8279. #define Q6AFE_LPASS_CLK_ATTRIBUTE_INVERT_COUPLE_NO 0x4
  8280. /* Clock set API version */
  8281. #define Q6AFE_LPASS_CLK_CONFIG_API_VERSION 0x1
  8282. struct afe_clk_set {
  8283. /*
  8284. * Minor version used for tracking clock set.
  8285. * @values #AFE_API_VERSION_CLOCK_SET
  8286. */
  8287. uint32_t clk_set_minor_version;
  8288. /*
  8289. * Clock ID
  8290. * @values
  8291. * - 0x100 to 0x10A - MSM8996
  8292. * - 0x200 to 0x207 - MSM8996
  8293. * - 0x300 to 0x302 - MSM8996 @tablebulletend
  8294. */
  8295. uint32_t clk_id;
  8296. /*
  8297. * Clock frequency (in Hertz) to be set.
  8298. * @values
  8299. * - >= 0 for clock frequency to set @tablebulletend
  8300. */
  8301. uint32_t clk_freq_in_hz;
  8302. /* Use to specific divider for two clocks if needed.
  8303. * Set to Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO for no divider
  8304. * relation clocks
  8305. * @values
  8306. * - #Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO
  8307. * - #Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_DIVIDEND
  8308. * - #Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_DIVISOR @tablebulletend
  8309. */
  8310. uint16_t clk_attri;
  8311. /*
  8312. * Specifies the root clock source.
  8313. * Currently, only Q6AFE_LPASS_CLK_ROOT_DEFAULT is valid
  8314. * @values
  8315. * - 0 @tablebulletend
  8316. */
  8317. uint16_t clk_root;
  8318. /*
  8319. * for enable and disable clock.
  8320. * "clk_freq_in_hz", "clk_attri", and "clk_root"
  8321. * are ignored in disable clock case.
  8322. * @values 
  8323. * - 0 -- Disabled
  8324. * - 1 -- Enabled @tablebulletend
  8325. */
  8326. uint32_t enable;
  8327. };
  8328. struct afe_clk_cfg {
  8329. /* Minor version used for tracking the version of the I2S
  8330. * configuration interface.
  8331. * Supported values: #AFE_API_VERSION_I2S_CONFIG
  8332. */
  8333. u32 i2s_cfg_minor_version;
  8334. /* clk value 1 in MHz. */
  8335. u32 clk_val1;
  8336. /* clk value 2 in MHz. */
  8337. u32 clk_val2;
  8338. /* clk_src
  8339. * #Q6AFE_LPASS_CLK_SRC_EXTERNAL
  8340. * #Q6AFE_LPASS_CLK_SRC_INTERNAL
  8341. */
  8342. u16 clk_src;
  8343. /* clk_root -0 for default */
  8344. u16 clk_root;
  8345. /* clk_set_mode
  8346. * #Q6AFE_LPASS_MODE_BOTH_INVALID
  8347. * #Q6AFE_LPASS_MODE_CLK1_VALID
  8348. * #Q6AFE_LPASS_MODE_CLK2_VALID
  8349. * #Q6AFE_LPASS_MODE_BOTH_VALID
  8350. */
  8351. u16 clk_set_mode;
  8352. /* This param id is used to configure I2S clk */
  8353. u16 reserved;
  8354. } __packed;
  8355. /* This param id is used to configure I2S clk */
  8356. #define AFE_PARAM_ID_LPAIF_CLK_CONFIG 0x00010238
  8357. #define AFE_MODULE_CLOCK_SET 0x0001028F
  8358. #define AFE_PARAM_ID_CLOCK_SET 0x00010290
  8359. struct afe_lpass_clk_config_command {
  8360. struct apr_hdr hdr;
  8361. struct afe_port_cmd_set_param_v2 param;
  8362. struct afe_port_param_data_v2 pdata;
  8363. struct afe_clk_cfg clk_cfg;
  8364. } __packed;
  8365. enum afe_lpass_digital_clk_src {
  8366. Q6AFE_LPASS_DIGITAL_ROOT_INVALID,
  8367. Q6AFE_LPASS_DIGITAL_ROOT_PRI_MI2S_OSR,
  8368. Q6AFE_LPASS_DIGITAL_ROOT_SEC_MI2S_OSR,
  8369. Q6AFE_LPASS_DIGITAL_ROOT_TER_MI2S_OSR,
  8370. Q6AFE_LPASS_DIGITAL_ROOT_QUAD_MI2S_OSR,
  8371. Q6AFE_LPASS_DIGITAL_ROOT_CDC_ROOT_CLK,
  8372. } __packed;
  8373. /* This param id is used to configure internal clk */
  8374. #define AFE_PARAM_ID_INTERNAL_DIGIATL_CDC_CLK_CONFIG 0x00010239
  8375. struct afe_digital_clk_cfg {
  8376. /* Minor version used for tracking the version of the I2S
  8377. * configuration interface.
  8378. * Supported values: #AFE_API_VERSION_I2S_CONFIG
  8379. */
  8380. u32 i2s_cfg_minor_version;
  8381. /* clk value in MHz. */
  8382. u32 clk_val;
  8383. /* INVALID
  8384. * PRI_MI2S_OSR
  8385. * SEC_MI2S_OSR
  8386. * TER_MI2S_OSR
  8387. * QUAD_MI2S_OSR
  8388. * DIGT_CDC_ROOT
  8389. */
  8390. u16 clk_root;
  8391. /* This field must be set to zero. */
  8392. u16 reserved;
  8393. } __packed;
  8394. struct afe_lpass_digital_clk_config_command {
  8395. struct apr_hdr hdr;
  8396. struct afe_port_cmd_set_param_v2 param;
  8397. struct afe_port_param_data_v2 pdata;
  8398. struct afe_digital_clk_cfg clk_cfg;
  8399. } __packed;
  8400. /*
  8401. * Opcode for AFE to start DTMF.
  8402. */
  8403. #define AFE_PORTS_CMD_DTMF_CTL 0x00010102
  8404. /** DTMF payload.*/
  8405. struct afe_dtmf_generation_command {
  8406. struct apr_hdr hdr;
  8407. /*
  8408. * Duration of the DTMF tone in ms.
  8409. * -1 -> continuous,
  8410. * 0 -> disable
  8411. */
  8412. int64_t duration_in_ms;
  8413. /*
  8414. * The DTMF high tone frequency.
  8415. */
  8416. uint16_t high_freq;
  8417. /*
  8418. * The DTMF low tone frequency.
  8419. */
  8420. uint16_t low_freq;
  8421. /*
  8422. * The DTMF volume setting
  8423. */
  8424. uint16_t gain;
  8425. /*
  8426. * The number of ports to enable/disable on.
  8427. */
  8428. uint16_t num_ports;
  8429. /*
  8430. * The Destination ports - array .
  8431. * For DTMF on multiple ports, portIds needs to
  8432. * be populated numPorts times.
  8433. */
  8434. uint16_t port_ids;
  8435. /*
  8436. * variable for 32 bit alignment of APR packet.
  8437. */
  8438. uint16_t reserved;
  8439. } __packed;
  8440. enum afe_config_type {
  8441. AFE_SLIMBUS_SLAVE_PORT_CONFIG,
  8442. AFE_SLIMBUS_SLAVE_CONFIG,
  8443. AFE_CDC_REGISTERS_CONFIG,
  8444. AFE_AANC_VERSION,
  8445. AFE_CDC_CLIP_REGISTERS_CONFIG,
  8446. AFE_CLIP_BANK_SEL,
  8447. AFE_CDC_REGISTER_PAGE_CONFIG,
  8448. AFE_MAX_CONFIG_TYPES,
  8449. };
  8450. struct afe_param_slimbus_slave_port_cfg {
  8451. uint32_t minor_version;
  8452. uint16_t slimbus_dev_id;
  8453. uint16_t slave_dev_pgd_la;
  8454. uint16_t slave_dev_intfdev_la;
  8455. uint16_t bit_width;
  8456. uint16_t data_format;
  8457. uint16_t num_channels;
  8458. uint16_t slave_port_mapping[AFE_PORT_MAX_AUDIO_CHAN_CNT];
  8459. } __packed;
  8460. struct afe_param_cdc_slimbus_slave_cfg {
  8461. uint32_t minor_version;
  8462. uint32_t device_enum_addr_lsw;
  8463. uint32_t device_enum_addr_msw;
  8464. uint16_t tx_slave_port_offset;
  8465. uint16_t rx_slave_port_offset;
  8466. } __packed;
  8467. struct afe_param_cdc_reg_cfg {
  8468. uint32_t minor_version;
  8469. uint32_t reg_logical_addr;
  8470. uint32_t reg_field_type;
  8471. uint32_t reg_field_bit_mask;
  8472. uint16_t reg_bit_width;
  8473. uint16_t reg_offset_scale;
  8474. } __packed;
  8475. #define AFE_API_VERSION_CDC_REG_PAGE_CFG 1
  8476. enum {
  8477. AFE_CDC_REG_PAGE_ASSIGN_PROC_ID_0 = 0,
  8478. AFE_CDC_REG_PAGE_ASSIGN_PROC_ID_1,
  8479. AFE_CDC_REG_PAGE_ASSIGN_PROC_ID_2,
  8480. AFE_CDC_REG_PAGE_ASSIGN_PROC_ID_3,
  8481. };
  8482. struct afe_param_cdc_reg_page_cfg {
  8483. uint32_t minor_version;
  8484. uint32_t enable;
  8485. uint32_t proc_id;
  8486. } __packed;
  8487. struct afe_param_cdc_reg_cfg_data {
  8488. uint32_t num_registers;
  8489. struct afe_param_cdc_reg_cfg *reg_data;
  8490. } __packed;
  8491. struct afe_svc_cmd_set_param {
  8492. uint32_t payload_size;
  8493. uint32_t payload_address_lsw;
  8494. uint32_t payload_address_msw;
  8495. uint32_t mem_map_handle;
  8496. } __packed;
  8497. struct afe_svc_param_data {
  8498. uint32_t module_id;
  8499. uint32_t param_id;
  8500. uint16_t param_size;
  8501. uint16_t reserved;
  8502. } __packed;
  8503. struct afe_param_hw_mad_ctrl {
  8504. uint32_t minor_version;
  8505. uint16_t mad_type;
  8506. uint16_t mad_enable;
  8507. } __packed;
  8508. struct afe_cmd_hw_mad_ctrl {
  8509. struct apr_hdr hdr;
  8510. struct afe_port_cmd_set_param_v2 param;
  8511. struct afe_port_param_data_v2 pdata;
  8512. struct afe_param_hw_mad_ctrl payload;
  8513. } __packed;
  8514. struct afe_cmd_hw_mad_slimbus_slave_port_cfg {
  8515. struct apr_hdr hdr;
  8516. struct afe_port_cmd_set_param_v2 param;
  8517. struct afe_port_param_data_v2 pdata;
  8518. struct afe_param_slimbus_slave_port_cfg sb_port_cfg;
  8519. } __packed;
  8520. struct afe_cmd_sw_mad_enable {
  8521. struct apr_hdr hdr;
  8522. struct afe_port_cmd_set_param_v2 param;
  8523. struct afe_port_param_data_v2 pdata;
  8524. } __packed;
  8525. struct afe_param_cdc_reg_cfg_payload {
  8526. struct afe_svc_param_data common;
  8527. struct afe_param_cdc_reg_cfg reg_cfg;
  8528. } __packed;
  8529. struct afe_lpass_clk_config_command_v2 {
  8530. struct apr_hdr hdr;
  8531. struct afe_svc_cmd_set_param param;
  8532. struct afe_svc_param_data pdata;
  8533. struct afe_clk_set clk_cfg;
  8534. } __packed;
  8535. /*
  8536. * reg_data's size can be up to AFE_MAX_CDC_REGISTERS_TO_CONFIG
  8537. */
  8538. struct afe_svc_cmd_cdc_reg_cfg {
  8539. struct apr_hdr hdr;
  8540. struct afe_svc_cmd_set_param param;
  8541. struct afe_param_cdc_reg_cfg_payload reg_data[0];
  8542. } __packed;
  8543. struct afe_svc_cmd_init_cdc_reg_cfg {
  8544. struct apr_hdr hdr;
  8545. struct afe_svc_cmd_set_param param;
  8546. struct afe_port_param_data_v2 init;
  8547. } __packed;
  8548. struct afe_svc_cmd_sb_slave_cfg {
  8549. struct apr_hdr hdr;
  8550. struct afe_svc_cmd_set_param param;
  8551. struct afe_port_param_data_v2 pdata;
  8552. struct afe_param_cdc_slimbus_slave_cfg sb_slave_cfg;
  8553. } __packed;
  8554. struct afe_svc_cmd_cdc_reg_page_cfg {
  8555. struct apr_hdr hdr;
  8556. struct afe_svc_cmd_set_param param;
  8557. struct afe_port_param_data_v2 pdata;
  8558. struct afe_param_cdc_reg_page_cfg cdc_reg_page_cfg;
  8559. } __packed;
  8560. struct afe_svc_cmd_cdc_aanc_version {
  8561. struct apr_hdr hdr;
  8562. struct afe_svc_cmd_set_param param;
  8563. struct afe_port_param_data_v2 pdata;
  8564. struct afe_param_id_cdc_aanc_version version;
  8565. } __packed;
  8566. struct afe_port_cmd_set_aanc_param {
  8567. struct apr_hdr hdr;
  8568. struct afe_port_cmd_set_param_v2 param;
  8569. struct afe_port_param_data_v2 pdata;
  8570. union {
  8571. struct afe_param_aanc_port_cfg aanc_port_cfg;
  8572. struct afe_mod_enable_param mod_enable;
  8573. } __packed data;
  8574. } __packed;
  8575. struct afe_port_cmd_set_aanc_acdb_table {
  8576. struct apr_hdr hdr;
  8577. struct afe_port_cmd_set_param_v2 param;
  8578. } __packed;
  8579. /* Dolby DAP topology */
  8580. #define DOLBY_ADM_COPP_TOPOLOGY_ID 0x0001033B
  8581. #define DS2_ADM_COPP_TOPOLOGY_ID 0x1301033B
  8582. /* RMS value from DSP */
  8583. #define RMS_MODULEID_APPI_PASSTHRU 0x10009011
  8584. #define RMS_PARAM_FIRST_SAMPLE 0x10009012
  8585. #define RMS_PAYLOAD_LEN 4
  8586. /* Customized mixing in matix mixer */
  8587. #define MTMX_MODULE_ID_DEFAULT_CHMIXER 0x00010341
  8588. #define DEFAULT_CHMIXER_PARAM_ID_COEFF 0x00010342
  8589. #define CUSTOM_STEREO_PAYLOAD_SIZE 9
  8590. #define CUSTOM_STEREO_CMD_PARAM_SIZE 24
  8591. #define CUSTOM_STEREO_NUM_OUT_CH 0x0002
  8592. #define CUSTOM_STEREO_NUM_IN_CH 0x0002
  8593. #define CUSTOM_STEREO_INDEX_PARAM 0x0002
  8594. #define Q14_GAIN_ZERO_POINT_FIVE 0x2000
  8595. #define Q14_GAIN_UNITY 0x4000
  8596. struct afe_svc_cmd_set_clip_bank_selection {
  8597. struct apr_hdr hdr;
  8598. struct afe_svc_cmd_set_param param;
  8599. struct afe_port_param_data_v2 pdata;
  8600. struct afe_param_id_clip_bank_sel bank_sel;
  8601. } __packed;
  8602. /* Ultrasound supported formats */
  8603. #define US_POINT_EPOS_FORMAT_V2 0x0001272D
  8604. #define US_RAW_FORMAT_V2 0x0001272C
  8605. #define US_PROX_FORMAT_V4 0x0001273B
  8606. #define US_RAW_SYNC_FORMAT 0x0001272F
  8607. #define US_GES_SYNC_FORMAT 0x00012730
  8608. #define AFE_MODULE_GROUP_DEVICE 0x00010254
  8609. #define AFE_PARAM_ID_GROUP_DEVICE_CFG 0x00010255
  8610. #define AFE_PARAM_ID_GROUP_DEVICE_ENABLE 0x00010256
  8611. #define AFE_GROUP_DEVICE_ID_SECONDARY_MI2S_RX 0x1102
  8612. /* Payload of the #AFE_PARAM_ID_GROUP_DEVICE_CFG
  8613. * parameter, which configures max of 8 AFE ports
  8614. * into a group.
  8615. * The fixed size of this structure is sixteen bytes.
  8616. */
  8617. struct afe_group_device_group_cfg {
  8618. u32 minor_version;
  8619. u16 group_id;
  8620. u16 num_channels;
  8621. u16 port_id[8];
  8622. } __packed;
  8623. #define AFE_GROUP_DEVICE_ID_PRIMARY_TDM_RX \
  8624. (AFE_PORT_ID_PRIMARY_TDM_RX + 0x100)
  8625. #define AFE_GROUP_DEVICE_ID_PRIMARY_TDM_TX \
  8626. (AFE_PORT_ID_PRIMARY_TDM_TX + 0x100)
  8627. #define AFE_GROUP_DEVICE_ID_SECONDARY_TDM_RX \
  8628. (AFE_PORT_ID_SECONDARY_TDM_RX + 0x100)
  8629. #define AFE_GROUP_DEVICE_ID_SECONDARY_TDM_TX \
  8630. (AFE_PORT_ID_SECONDARY_TDM_TX + 0x100)
  8631. #define AFE_GROUP_DEVICE_ID_TERTIARY_TDM_RX \
  8632. (AFE_PORT_ID_TERTIARY_TDM_RX + 0x100)
  8633. #define AFE_GROUP_DEVICE_ID_TERTIARY_TDM_TX \
  8634. (AFE_PORT_ID_TERTIARY_TDM_TX + 0x100)
  8635. #define AFE_GROUP_DEVICE_ID_QUATERNARY_TDM_RX \
  8636. (AFE_PORT_ID_QUATERNARY_TDM_RX + 0x100)
  8637. #define AFE_GROUP_DEVICE_ID_QUATERNARY_TDM_TX \
  8638. (AFE_PORT_ID_QUATERNARY_TDM_TX + 0x100)
  8639. #define AFE_GROUP_DEVICE_ID_QUINARY_TDM_RX \
  8640. (AFE_PORT_ID_QUINARY_TDM_RX + 0x100)
  8641. #define AFE_GROUP_DEVICE_ID_QUINARY_TDM_TX \
  8642. (AFE_PORT_ID_QUINARY_TDM_TX + 0x100)
  8643. /* ID of the parameter used by #AFE_MODULE_GROUP_DEVICE to configure the
  8644. * group device. #AFE_SVC_CMD_SET_PARAM can use this parameter ID.
  8645. *
  8646. * Requirements:
  8647. * - Configure the group before the member ports in the group are
  8648. * configured and started.
  8649. * - Enable the group only after it is configured.
  8650. * - Stop all member ports in the group before disabling the group.
  8651. */
  8652. #define AFE_PARAM_ID_GROUP_DEVICE_TDM_CONFIG 0x0001029E
  8653. /* Version information used to handle future additions to
  8654. * AFE_PARAM_ID_GROUP_DEVICE_TDM_CONFIG processing (for backward compatibility).
  8655. */
  8656. #define AFE_API_VERSION_GROUP_DEVICE_TDM_CONFIG 0x1
  8657. /* Number of AFE ports in group device */
  8658. #define AFE_GROUP_DEVICE_NUM_PORTS 8
  8659. /* Payload of the AFE_PARAM_ID_GROUP_DEVICE_TDM_CONFIG parameter ID
  8660. * used by AFE_MODULE_GROUP_DEVICE.
  8661. */
  8662. struct afe_param_id_group_device_tdm_cfg {
  8663. u32 group_device_cfg_minor_version;
  8664. /* Minor version used to track group device configuration.
  8665. * @values #AFE_API_VERSION_GROUP_DEVICE_TDM_CONFIG
  8666. */
  8667. u16 group_id;
  8668. /* ID for the group device.
  8669. * @values
  8670. * - #AFE_GROUP_DEVICE_ID_PRIMARY_TDM_RX
  8671. * - #AFE_GROUP_DEVICE_ID_PRIMARY_TDM_TX
  8672. * - #AFE_GROUP_DEVICE_ID_SECONDARY_TDM_RX
  8673. * - #AFE_GROUP_DEVICE_ID_SECONDARY_TDM_TX
  8674. * - #AFE_GROUP_DEVICE_ID_TERTIARY_TDM_RX
  8675. * - #AFE_GROUP_DEVICE_ID_TERTIARY_TDM_TX
  8676. * - #AFE_GROUP_DEVICE_ID_QUATERNARY_TDM_RX
  8677. * - #AFE_GROUP_DEVICE_ID_QUATERNARY_TDM_TX
  8678. */
  8679. u16 reserved;
  8680. /* 0 */
  8681. u16 port_id[AFE_GROUP_DEVICE_NUM_PORTS];
  8682. /* Array of member port IDs of this group.
  8683. * @values
  8684. * - #AFE_PORT_ID_PRIMARY_TDM_RX
  8685. * - #AFE_PORT_ID_PRIMARY_TDM_RX_1
  8686. * - #AFE_PORT_ID_PRIMARY_TDM_RX_2
  8687. * - #AFE_PORT_ID_PRIMARY_TDM_RX_3
  8688. * - #AFE_PORT_ID_PRIMARY_TDM_RX_4
  8689. * - #AFE_PORT_ID_PRIMARY_TDM_RX_5
  8690. * - #AFE_PORT_ID_PRIMARY_TDM_RX_6
  8691. * - #AFE_PORT_ID_PRIMARY_TDM_RX_7
  8692. * - #AFE_PORT_ID_PRIMARY_TDM_TX
  8693. * - #AFE_PORT_ID_PRIMARY_TDM_TX_1
  8694. * - #AFE_PORT_ID_PRIMARY_TDM_TX_2
  8695. * - #AFE_PORT_ID_PRIMARY_TDM_TX_3
  8696. * - #AFE_PORT_ID_PRIMARY_TDM_TX_4
  8697. * - #AFE_PORT_ID_PRIMARY_TDM_TX_5
  8698. * - #AFE_PORT_ID_PRIMARY_TDM_TX_6
  8699. * - #AFE_PORT_ID_PRIMARY_TDM_TX_7
  8700. * - #AFE_PORT_ID_SECONDARY_TDM_RX
  8701. * - #AFE_PORT_ID_SECONDARY_TDM_RX_1
  8702. * - #AFE_PORT_ID_SECONDARY_TDM_RX_2
  8703. * - #AFE_PORT_ID_SECONDARY_TDM_RX_3
  8704. * - #AFE_PORT_ID_SECONDARY_TDM_RX_4
  8705. * - #AFE_PORT_ID_SECONDARY_TDM_RX_5
  8706. * - #AFE_PORT_ID_SECONDARY_TDM_RX_6
  8707. * - #AFE_PORT_ID_SECONDARY_TDM_RX_7
  8708. * - #AFE_PORT_ID_SECONDARY_TDM_TX
  8709. * - #AFE_PORT_ID_SECONDARY_TDM_TX_1
  8710. * - #AFE_PORT_ID_SECONDARY_TDM_TX_2
  8711. * - #AFE_PORT_ID_SECONDARY_TDM_TX_3
  8712. * - #AFE_PORT_ID_SECONDARY_TDM_TX_4
  8713. * - #AFE_PORT_ID_SECONDARY_TDM_TX_5
  8714. * - #AFE_PORT_ID_SECONDARY_TDM_TX_6
  8715. * - #AFE_PORT_ID_SECONDARY_TDM_TX_7
  8716. * - #AFE_PORT_ID_TERTIARY_TDM_RX
  8717. * - #AFE_PORT_ID_TERTIARY_TDM_RX_1
  8718. * - #AFE_PORT_ID_TERTIARY_TDM_RX_2
  8719. * - #AFE_PORT_ID_TERTIARY_TDM_RX_3
  8720. * - #AFE_PORT_ID_TERTIARY_TDM_RX_4
  8721. * - #AFE_PORT_ID_TERTIARY_TDM_RX_5
  8722. * - #AFE_PORT_ID_TERTIARY_TDM_RX_6
  8723. * - #AFE_PORT_ID_TERTIARY_TDM_RX_7
  8724. * - #AFE_PORT_ID_TERTIARY_TDM_TX
  8725. * - #AFE_PORT_ID_TERTIARY_TDM_TX_1
  8726. * - #AFE_PORT_ID_TERTIARY_TDM_TX_2
  8727. * - #AFE_PORT_ID_TERTIARY_TDM_TX_3
  8728. * - #AFE_PORT_ID_TERTIARY_TDM_TX_4
  8729. * - #AFE_PORT_ID_TERTIARY_TDM_TX_5
  8730. * - #AFE_PORT_ID_TERTIARY_TDM_TX_6
  8731. * - #AFE_PORT_ID_TERTIARY_TDM_TX_7
  8732. * - #AFE_PORT_ID_QUATERNARY_TDM_RX
  8733. * - #AFE_PORT_ID_QUATERNARY_TDM_RX_1
  8734. * - #AFE_PORT_ID_QUATERNARY_TDM_RX_2
  8735. * - #AFE_PORT_ID_QUATERNARY_TDM_RX_3
  8736. * - #AFE_PORT_ID_QUATERNARY_TDM_RX_4
  8737. * - #AFE_PORT_ID_QUATERNARY_TDM_RX_5
  8738. * - #AFE_PORT_ID_QUATERNARY_TDM_RX_6
  8739. * - #AFE_PORT_ID_QUATERNARY_TDM_RX_7
  8740. * - #AFE_PORT_ID_QUATERNARY_TDM_TX
  8741. * - #AFE_PORT_ID_QUATERNARY_TDM_TX_1
  8742. * - #AFE_PORT_ID_QUATERNARY_TDM_TX_2
  8743. * - #AFE_PORT_ID_QUATERNARY_TDM_TX_3
  8744. * - #AFE_PORT_ID_QUATERNARY_TDM_TX_4
  8745. * - #AFE_PORT_ID_QUATERNARY_TDM_TX_5
  8746. * - #AFE_PORT_ID_QUATERNARY_TDM_TX_6
  8747. * - #AFE_PORT_ID_QUATERNARY_TDM_TX_7
  8748. * @tablebulletend
  8749. */
  8750. u32 num_channels;
  8751. /* Number of enabled slots for TDM frame.
  8752. * @values 1 to 8
  8753. */
  8754. u32 sample_rate;
  8755. /* Sampling rate of the port.
  8756. * @values
  8757. * - #AFE_PORT_SAMPLE_RATE_8K
  8758. * - #AFE_PORT_SAMPLE_RATE_16K
  8759. * - #AFE_PORT_SAMPLE_RATE_24K
  8760. * - #AFE_PORT_SAMPLE_RATE_32K
  8761. * - #AFE_PORT_SAMPLE_RATE_48K @tablebulletend
  8762. */
  8763. u32 bit_width;
  8764. /* Bit width of the sample.
  8765. * @values 16, 24, (32)
  8766. */
  8767. u16 nslots_per_frame;
  8768. /* Number of slots per frame. Typical : 1, 2, 4, 8, 16, 32.
  8769. * @values 1 - 32
  8770. */
  8771. u16 slot_width;
  8772. /* Slot width of the slot in a TDM frame. (slot_width >= bit_width)
  8773. * have to be satisfied.
  8774. * @values 16, 24, 32
  8775. */
  8776. u32 slot_mask;
  8777. /* Position of active slots. When that bit is set, that paricular
  8778. * slot is active.
  8779. * Number of active slots can be inferred by number of bits set in
  8780. * the mask. Only 8 individual bits can be enabled.
  8781. * Bits 0..31 corresponding to slot 0..31
  8782. * @values 1 to 2^32 -1
  8783. */
  8784. } __packed;
  8785. /* Payload of the #AFE_PARAM_ID_GROUP_DEVICE_ENABLE
  8786. * parameter, which enables or
  8787. * disables any module.
  8788. * The fixed size of this structure is four bytes.
  8789. */
  8790. struct afe_group_device_enable {
  8791. u16 group_id;
  8792. /* valid value is AFE_GROUP_DEVICE_ID_SECONDARY_MI2S_RX */
  8793. u16 enable;
  8794. /* Enables (1) or disables (0) the module. */
  8795. } __packed;
  8796. union afe_port_group_config {
  8797. struct afe_group_device_group_cfg group_cfg;
  8798. struct afe_group_device_enable group_enable;
  8799. struct afe_param_id_group_device_tdm_cfg tdm_cfg;
  8800. } __packed;
  8801. struct afe_port_group_create {
  8802. struct apr_hdr hdr;
  8803. struct afe_svc_cmd_set_param param;
  8804. struct afe_port_param_data_v2 pdata;
  8805. union afe_port_group_config data;
  8806. } __packed;
  8807. /* ID of the parameter used by #AFE_MODULE_AUDIO_DEV_INTERFACE to specify
  8808. * the timing statistics of the corresponding device interface.
  8809. * Client can periodically query for the device time statistics to help adjust
  8810. * the PLL based on the drift value. The get param command must be sent to
  8811. * AFE port ID corresponding to device interface
  8812. * This parameter ID supports following get param commands:
  8813. * #AFE_PORT_CMD_GET_PARAM_V2 and
  8814. * #AFE_PORT_CMD_GET_PARAM_V3.
  8815. */
  8816. #define AFE_PARAM_ID_DEV_TIMING_STATS 0x000102AD
  8817. /* Version information used to handle future additions to AFE device
  8818. * interface timing statistics (for backward compatibility).
  8819. */
  8820. #define AFE_API_VERSION_DEV_TIMING_STATS 0x1
  8821. /* Enumeration for specifying a sink(Rx) device */
  8822. #define AFE_SINK_DEVICE 0x0
  8823. /* Enumeration for specifying a source(Tx) device */
  8824. #define AFE_SOURCE_DEVICE 0x1
  8825. /* Enumeration for specifying the drift reference is of type AV Timer */
  8826. #define AFE_REF_TIMER_TYPE_AVTIMER 0x0
  8827. /* Message payload structure for the
  8828. * AFE_PARAM_ID_DEV_TIMING_STATS parameter.
  8829. */
  8830. struct afe_param_id_dev_timing_stats {
  8831. /* Minor version used to track the version of device interface timing
  8832. * statistics. Currently, the supported version is 1.
  8833. * @values #AFE_API_VERSION_DEV_TIMING_STATS
  8834. */
  8835. u32 minor_version;
  8836. /* Indicates the device interface direction as either
  8837. * source (Tx) or sink (Rx).
  8838. * @values
  8839. * #AFE_SINK_DEVICE
  8840. * #AFE_SOURCE_DEVICE
  8841. */
  8842. u16 device_direction;
  8843. /* Reference timer for drift accumulation and time stamp information.
  8844. * @values
  8845. * #AFE_REF_TIMER_TYPE_AVTIMER @tablebulletend
  8846. */
  8847. u16 reference_timer;
  8848. /*
  8849. * Flag to indicate if resync is required on the client side for
  8850. * drift correction. Flag is set to TRUE for the first get_param
  8851. * response after device interface starts. This flag value can be
  8852. * used by client to identify if device interface restart has
  8853. * happened and if any re-sync is required at their end for drift
  8854. * correction.
  8855. * @values
  8856. * 0: FALSE (Resync not required)
  8857. * 1: TRUE (Resync required) @tablebulletend
  8858. */
  8859. u32 resync_flag;
  8860. /* Accumulated drift value in microseconds. This value is updated
  8861. * every 100th ms.
  8862. * Positive drift value indicates AV timer is running faster than device
  8863. * Negative drift value indicates AV timer is running slower than device
  8864. * @values Any valid int32 number
  8865. */
  8866. s32 acc_drift_value;
  8867. /* Lower 32 bits of the 64-bit absolute timestamp of reference
  8868. * timer in microseconds.
  8869. * This timestamp corresponds to the time when the drift values
  8870. * are accumlated for every 100th ms.
  8871. * @values Any valid uint32 number
  8872. */
  8873. u32 ref_timer_abs_ts_lsw;
  8874. /* Upper 32 bits of the 64-bit absolute timestamp of reference
  8875. * timer in microseconds.
  8876. * This timestamp corresponds to the time when the drift values
  8877. * are accumlated for every 100th ms.
  8878. * @values Any valid uint32 number
  8879. */
  8880. u32 ref_timer_abs_ts_msw;
  8881. } __packed;
  8882. struct afe_av_dev_drift_get_param {
  8883. struct apr_hdr hdr;
  8884. struct afe_port_cmd_get_param_v2 get_param;
  8885. struct afe_port_param_data_v2 pdata;
  8886. struct afe_param_id_dev_timing_stats timing_stats;
  8887. } __packed;
  8888. struct afe_av_dev_drift_get_param_resp {
  8889. uint32_t status;
  8890. struct afe_port_param_data_v2 pdata;
  8891. struct afe_param_id_dev_timing_stats timing_stats;
  8892. } __packed;
  8893. /* Command for Matrix or Stream Router */
  8894. #define ASM_SESSION_CMD_SET_MTMX_STRTR_PARAMS_V2 0x00010DCE
  8895. /* Module for AVSYNC */
  8896. #define ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC 0x00010DC6
  8897. /* Parameter used by #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC to specify the
  8898. * render window start value. This parameter is supported only for a Set
  8899. * command (not a Get command) in the Rx direction
  8900. * (#ASM_SESSION_CMD_SET_MTMX_STRTR_PARAMS_V2).
  8901. * Render window start is a value (session time minus timestamp, or ST-TS)
  8902. * below which frames are held, and after which frames are immediately
  8903. * rendered.
  8904. */
  8905. #define ASM_SESSION_MTMX_STRTR_PARAM_RENDER_WINDOW_START_V2 0x00010DD1
  8906. /* Parameter used by #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC to specify the
  8907. * render window end value. This parameter is supported only for a Set
  8908. * command (not a Get command) in the Rx direction
  8909. * (#ASM_SESSION_CMD_SET_MTMX_STRTR_PARAMS_V2). Render window end is a value
  8910. * (session time minus timestamp) above which frames are dropped, and below
  8911. * which frames are immediately rendered.
  8912. */
  8913. #define ASM_SESSION_MTMX_STRTR_PARAM_RENDER_WINDOW_END_V2 0x00010DD2
  8914. /* Generic payload of the window parameters in the
  8915. * #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC module.
  8916. * This payload is supported only for a Set command
  8917. * (not a Get command) on the Rx path.
  8918. */
  8919. struct asm_session_mtmx_strtr_param_window_v2_t {
  8920. u32 window_lsw;
  8921. /* Lower 32 bits of the render window start value. */
  8922. u32 window_msw;
  8923. /* Upper 32 bits of the render window start value.
  8924. *
  8925. * The 64-bit number formed by window_lsw and window_msw specifies a
  8926. * signed 64-bit window value in microseconds. The sign extension is
  8927. * necessary. This value is used by the following parameter IDs:
  8928. * #ASM_SESSION_MTMX_STRTR_PARAM_RENDER_WINDOW_START_V2
  8929. * #ASM_SESSION_MTMX_STRTR_PARAM_RENDER_WINDOW_END_V2
  8930. * #ASM_SESSION_MTMX_STRTR_PARAM_STAT_WINDOW_START_V2
  8931. * #ASM_SESSION_MTMX_STRTR_PARAM_STAT_WINDOW_END_V2
  8932. * The value depends on which parameter ID is used.
  8933. * The aDSP honors the windows at a granularity of 1 ms.
  8934. */
  8935. };
  8936. struct asm_session_cmd_set_mtmx_strstr_params_v2 {
  8937. uint32_t data_payload_addr_lsw;
  8938. /* Lower 32 bits of the 64-bit data payload address. */
  8939. uint32_t data_payload_addr_msw;
  8940. /* Upper 32 bits of the 64-bit data payload address.
  8941. * If the address is not sent (NULL), the message is in the payload.
  8942. * If the address is sent (non-NULL), the parameter data payloads
  8943. * begin at the specified address.
  8944. */
  8945. uint32_t mem_map_handle;
  8946. /* Unique identifier for an address. This memory map handle is returned
  8947. * by the aDSP through the #ASM_CMD_SHARED_MEM_MAP_REGIONS command.
  8948. * values
  8949. * - NULL -- Parameter data payloads are within the message payload
  8950. * (in-band).
  8951. * - Non-NULL -- Parameter data payloads begin at the address specified
  8952. * in the data_payload_addr_lsw and data_payload_addr_msw fields
  8953. * (out-of-band).
  8954. */
  8955. uint32_t data_payload_size;
  8956. /* Actual size of the variable payload accompanying the message, or in
  8957. * shared memory. This field is used for parsing the parameter payload.
  8958. * values > 0 bytes
  8959. */
  8960. uint32_t direction;
  8961. /* Direction of the entity (matrix mixer or stream router) on which
  8962. * the parameter is to be set.
  8963. * values
  8964. * - 0 -- Rx (for Rx stream router or Rx matrix mixer)
  8965. * - 1 -- Tx (for Tx stream router or Tx matrix mixer)
  8966. */
  8967. };
  8968. /* Parameter used by #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC which allows the
  8969. * audio client choose the rendering decision that the audio DSP should use.
  8970. */
  8971. #define ASM_SESSION_MTMX_STRTR_PARAM_RENDER_MODE_CMD 0x00012F0D
  8972. /* Indicates that rendering decision will be based on default rate
  8973. * (session clock based rendering, device driven).
  8974. * 1. The default session clock based rendering is inherently driven
  8975. * by the timing of the device.
  8976. * 2. After the initial decision is made (first buffer after a run
  8977. * command), subsequent data rendering decisions are made with
  8978. * respect to the rate at which the device is rendering, thus deriving
  8979. * its timing from the device.
  8980. * 3. While this decision making is simple, it has some inherent limitations
  8981. * (mentioned in the next section).
  8982. * 4. If this API is not set, the session clock based rendering will be assumed
  8983. * and this will ensure that the DSP is backward compatible.
  8984. */
  8985. #define ASM_SESSION_MTMX_STRTR_PARAM_RENDER_DEFAULT 0
  8986. /* Indicates that rendering decision will be based on local clock rate.
  8987. * 1. In the DSP loopback/client loopback use cases (frame based
  8988. * inputs), the incoming data into audio DSP is time-stamped at the
  8989. * local clock rate (STC).
  8990. * 2. This TS rate may match the incoming data rate or maybe different
  8991. * from the incoming data rate.
  8992. * 3. Regardless, the data will be time-stamped with local STC and
  8993. * therefore, the client is recommended to set this mode for these
  8994. * use cases. This method is inherently more robust to sequencing
  8995. * (AFE Start/Stop) and device switches, among other benefits.
  8996. * 4. This API will inform the DSP to compare every incoming buffer TS
  8997. * against local STC.
  8998. * 5. DSP will continue to honor render windows APIs, as before.
  8999. */
  9000. #define ASM_SESSION_MTMX_STRTR_PARAM_RENDER_LOCAL_STC 1
  9001. /* Structure for rendering decision parameter */
  9002. struct asm_session_mtmx_strtr_param_render_mode_t {
  9003. /* Specifies the type of rendering decision the audio DSP should use.
  9004. *
  9005. * @values
  9006. * - #ASM_SESSION_MTMX_STRTR_PARAM_RENDER_DEFAULT
  9007. * - #ASM_SESSION_MTMX_STRTR_PARAM_RENDER_LOCAL_STC
  9008. */
  9009. u32 flags;
  9010. } __packed;
  9011. /* Parameter used by #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC which allows the
  9012. * audio client to specify the clock recovery mechanism that the audio DSP
  9013. * should use.
  9014. */
  9015. #define ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC_CMD 0x00012F0E
  9016. /* Indicates that default clock recovery will be used (no clock recovery).
  9017. * If the client wishes that no clock recovery be done, the client can
  9018. * choose this. This means that no attempt will made by the DSP to try and
  9019. * match the rates of the input and output audio.
  9020. */
  9021. #define ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC_NONE 0
  9022. /* Indicates that independent clock recovery needs to be used.
  9023. * 1. In the DSP loopback/client loopback use cases (frame based inputs),
  9024. * the client should choose the independent clock recovery option.
  9025. * 2. This basically de-couples the audio and video from knowing each others
  9026. * clock sources and lets the audio DSP independently rate match the input
  9027. * and output rates.
  9028. * 3. After drift detection, the drift correction is achieved by either pulling
  9029. * the PLLs (if applicable) or by stream to device rate matching
  9030. * (for PCM use cases) by comparing drift with respect to STC.
  9031. * 4. For passthrough use cases, since the PLL pulling is the only option,
  9032. * a best effort will be made.
  9033. * If PLL pulling is not possible / available, the rendering will be
  9034. * done without rate matching.
  9035. */
  9036. #define ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC_AUTO 1
  9037. /* Payload of the #ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC parameter.
  9038. */
  9039. struct asm_session_mtmx_strtr_param_clk_rec_t {
  9040. /* Specifies the type of clock recovery that the audio DSP should
  9041. * use for rate matching.
  9042. */
  9043. /* @values
  9044. * #ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC_DEFAULT
  9045. * #ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC_INDEPENDENT
  9046. */
  9047. u32 flags;
  9048. } __packed;
  9049. /* Parameter used by #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC to
  9050. * realize smoother adjustment of audio session clock for a specified session.
  9051. * The desired audio session clock adjustment(in micro seconds) is specified
  9052. * using the command #ASM_SESSION_CMD_ADJUST_SESSION_CLOCK_V2.
  9053. * Delaying/Advancing the session clock would be implemented by inserting
  9054. * interpolated/dropping audio samples in the playback path respectively.
  9055. * Also, this parameter has to be configured before the Audio Session is put
  9056. * to RUN state to avoid cold start latency/glitches in the playback.
  9057. */
  9058. #define ASM_SESSION_MTMX_PARAM_ADJUST_SESSION_TIME_CTL 0x00013217
  9059. struct asm_session_mtmx_param_adjust_session_time_ctl_t {
  9060. /* Specifies whether the module is enabled or not
  9061. * @values
  9062. * 0 -- disabled
  9063. * 1 -- enabled
  9064. */
  9065. u32 enable;
  9066. };
  9067. union asm_session_mtmx_strtr_param_config {
  9068. struct asm_session_mtmx_strtr_param_window_v2_t window_param;
  9069. struct asm_session_mtmx_strtr_param_render_mode_t render_param;
  9070. struct asm_session_mtmx_strtr_param_clk_rec_t clk_rec_param;
  9071. struct asm_session_mtmx_param_adjust_session_time_ctl_t adj_time_param;
  9072. } __packed;
  9073. struct asm_mtmx_strtr_params {
  9074. struct apr_hdr hdr;
  9075. struct asm_session_cmd_set_mtmx_strstr_params_v2 param;
  9076. struct asm_stream_param_data_v2 data;
  9077. union asm_session_mtmx_strtr_param_config config;
  9078. } __packed;
  9079. #define ASM_SESSION_CMD_GET_MTMX_STRTR_PARAMS_V2 0x00010DCF
  9080. #define ASM_SESSION_CMDRSP_GET_MTMX_STRTR_PARAMS_V2 0x00010DD0
  9081. #define ASM_SESSION_MTMX_STRTR_PARAM_SESSION_TIME_V3 0x00012F0B
  9082. #define ASM_SESSION_MTMX_STRTR_PARAM_STIME_TSTMP_FLG_BMASK (0x80000000UL)
  9083. struct asm_session_cmd_get_mtmx_strstr_params_v2 {
  9084. uint32_t data_payload_addr_lsw;
  9085. /* Lower 32 bits of the 64-bit data payload address. */
  9086. uint32_t data_payload_addr_msw;
  9087. /*
  9088. * Upper 32 bits of the 64-bit data payload address.
  9089. * If the address is not sent (NULL), the message is in the payload.
  9090. * If the address is sent (non-NULL), the parameter data payloads
  9091. * begin at the specified address.
  9092. */
  9093. uint32_t mem_map_handle;
  9094. /*
  9095. * Unique identifier for an address. This memory map handle is returned
  9096. * by the aDSP through the #ASM_CMD_SHARED_MEM_MAP_REGIONS command.
  9097. * values
  9098. * - NULL -- Parameter data payloads are within the message payload
  9099. * (in-band).
  9100. * - Non-NULL -- Parameter data payloads begin at the address specified
  9101. * in the data_payload_addr_lsw and data_payload_addr_msw fields
  9102. * (out-of-band).
  9103. */
  9104. uint32_t direction;
  9105. /*
  9106. * Direction of the entity (matrix mixer or stream router) on which
  9107. * the parameter is to be set.
  9108. * values
  9109. * - 0 -- Rx (for Rx stream router or Rx matrix mixer)
  9110. * - 1 -- Tx (for Tx stream router or Tx matrix mixer)
  9111. */
  9112. uint32_t module_id;
  9113. /* Unique module ID. */
  9114. uint32_t param_id;
  9115. /* Unique parameter ID. */
  9116. uint32_t param_max_size;
  9117. };
  9118. struct asm_session_mtmx_strtr_param_session_time_v3_t {
  9119. uint32_t session_time_lsw;
  9120. /* Lower 32 bits of the current session time in microseconds */
  9121. uint32_t session_time_msw;
  9122. /*
  9123. * Upper 32 bits of the current session time in microseconds.
  9124. * The 64-bit number formed by session_time_lsw and session_time_msw
  9125. * is treated as signed.
  9126. */
  9127. uint32_t absolute_time_lsw;
  9128. /*
  9129. * Lower 32 bits of the 64-bit absolute time in microseconds.
  9130. * This is the time when the sample corresponding to the
  9131. * session_time_lsw is rendered to the hardware. This absolute
  9132. * time can be slightly in the future or past.
  9133. */
  9134. uint32_t absolute_time_msw;
  9135. /*
  9136. * Upper 32 bits of the 64-bit absolute time in microseconds.
  9137. * This is the time when the sample corresponding to the
  9138. * session_time_msw is rendered to hardware. This absolute
  9139. * time can be slightly in the future or past. The 64-bit number
  9140. * formed by absolute_time_lsw and absolute_time_msw is treated as
  9141. * unsigned.
  9142. */
  9143. uint32_t time_stamp_lsw;
  9144. /* Lower 32 bits of the last processed timestamp in microseconds */
  9145. uint32_t time_stamp_msw;
  9146. /*
  9147. * Upper 32 bits of the last processed timestamp in microseconds.
  9148. * The 64-bit number formed by time_stamp_lsw and time_stamp_lsw
  9149. * is treated as unsigned.
  9150. */
  9151. uint32_t flags;
  9152. /*
  9153. * Keeps track of any additional flags needed.
  9154. * @values{for bit 31}
  9155. * - 0 -- Uninitialized/invalid
  9156. * - 1 -- Valid
  9157. * All other bits are reserved; clients must set them to zero.
  9158. */
  9159. };
  9160. union asm_session_mtmx_strtr_data_type {
  9161. struct asm_session_mtmx_strtr_param_session_time_v3_t session_time;
  9162. };
  9163. struct asm_mtmx_strtr_get_params {
  9164. struct apr_hdr hdr;
  9165. struct asm_session_cmd_get_mtmx_strstr_params_v2 param_info;
  9166. } __packed;
  9167. struct asm_mtmx_strtr_get_params_cmdrsp {
  9168. uint32_t err_code;
  9169. struct asm_stream_param_data_v2 param_info;
  9170. union asm_session_mtmx_strtr_data_type param_data;
  9171. } __packed;
  9172. #define AUDPROC_MODULE_ID_RESAMPLER 0x00010719
  9173. enum {
  9174. LEGACY_PCM = 0,
  9175. COMPRESSED_PASSTHROUGH,
  9176. COMPRESSED_PASSTHROUGH_CONVERT,
  9177. COMPRESSED_PASSTHROUGH_DSD,
  9178. LISTEN,
  9179. COMPRESSED_PASSTHROUGH_GEN,
  9180. COMPRESSED_PASSTHROUGH_IEC61937
  9181. };
  9182. #define AUDPROC_MODULE_ID_COMPRESSED_MUTE 0x00010770
  9183. #define AUDPROC_PARAM_ID_COMPRESSED_MUTE 0x00010771
  9184. struct adm_set_compressed_device_mute {
  9185. struct adm_cmd_set_pp_params_v5 command;
  9186. struct adm_param_data_v5 params;
  9187. u32 mute_on;
  9188. } __packed;
  9189. #define AUDPROC_MODULE_ID_COMPRESSED_LATENCY 0x0001076E
  9190. #define AUDPROC_PARAM_ID_COMPRESSED_LATENCY 0x0001076F
  9191. struct adm_set_compressed_device_latency {
  9192. struct adm_cmd_set_pp_params_v5 command;
  9193. struct adm_param_data_v5 params;
  9194. u32 latency;
  9195. } __packed;
  9196. #define VOICEPROC_MODULE_ID_GENERIC_TX 0x00010EF6
  9197. #define VOICEPROC_PARAM_ID_FLUENCE_SOUNDFOCUS 0x00010E37
  9198. #define VOICEPROC_PARAM_ID_FLUENCE_SOURCETRACKING 0x00010E38
  9199. #define MAX_SECTORS 8
  9200. #define MAX_NOISE_SOURCE_INDICATORS 3
  9201. #define MAX_POLAR_ACTIVITY_INDICATORS 360
  9202. struct sound_focus_param {
  9203. uint16_t start_angle[MAX_SECTORS];
  9204. uint8_t enable[MAX_SECTORS];
  9205. uint16_t gain_step;
  9206. } __packed;
  9207. struct source_tracking_param {
  9208. uint8_t vad[MAX_SECTORS];
  9209. uint16_t doa_speech;
  9210. uint16_t doa_noise[MAX_NOISE_SOURCE_INDICATORS];
  9211. uint8_t polar_activity[MAX_POLAR_ACTIVITY_INDICATORS];
  9212. } __packed;
  9213. struct adm_param_fluence_soundfocus_t {
  9214. uint16_t start_angles[MAX_SECTORS];
  9215. uint8_t enables[MAX_SECTORS];
  9216. uint16_t gain_step;
  9217. uint16_t reserved;
  9218. } __packed;
  9219. struct adm_set_fluence_soundfocus_param {
  9220. struct adm_cmd_set_pp_params_v5 params;
  9221. struct adm_param_data_v5 data;
  9222. struct adm_param_fluence_soundfocus_t soundfocus_data;
  9223. } __packed;
  9224. struct adm_param_fluence_sourcetracking_t {
  9225. uint8_t vad[MAX_SECTORS];
  9226. uint16_t doa_speech;
  9227. uint16_t doa_noise[MAX_NOISE_SOURCE_INDICATORS];
  9228. uint8_t polar_activity[MAX_POLAR_ACTIVITY_INDICATORS];
  9229. } __packed;
  9230. #define AUDPROC_MODULE_ID_AUDIOSPHERE 0x00010916
  9231. #define AUDPROC_PARAM_ID_AUDIOSPHERE_ENABLE 0x00010917
  9232. #define AUDPROC_PARAM_ID_AUDIOSPHERE_STRENGTH 0x00010918
  9233. #define AUDPROC_PARAM_ID_AUDIOSPHERE_CONFIG_MODE 0x00010919
  9234. #define AUDPROC_PARAM_ID_AUDIOSPHERE_COEFFS_STEREO_INPUT 0x0001091A
  9235. #define AUDPROC_PARAM_ID_AUDIOSPHERE_COEFFS_MULTICHANNEL_INPUT 0x0001091B
  9236. #define AUDPROC_PARAM_ID_AUDIOSPHERE_DESIGN_STEREO_INPUT 0x0001091C
  9237. #define AUDPROC_PARAM_ID_AUDIOSPHERE_DESIGN_MULTICHANNEL_INPUT 0x0001091D
  9238. #define AUDPROC_PARAM_ID_AUDIOSPHERE_OPERATING_INPUT_MEDIA_INFO 0x0001091E
  9239. #define AUDPROC_MODULE_ID_VOICE_TX_SECNS 0x10027059
  9240. #define AUDPROC_PARAM_IDX_SEC_PRIMARY_MIC_CH 0x10014444
  9241. struct admx_sec_primary_mic_ch {
  9242. uint16_t version;
  9243. uint16_t reserved;
  9244. uint16_t sec_primary_mic_ch;
  9245. uint16_t reserved1;
  9246. } __packed;
  9247. struct adm_set_sec_primary_ch_params {
  9248. struct adm_cmd_set_pp_params_v5 params;
  9249. struct adm_param_data_v5 data;
  9250. struct admx_sec_primary_mic_ch sec_primary_mic_ch_data;
  9251. } __packed;
  9252. #endif /*_APR_AUDIO_V2_H_ */