apr_audio-v2.h 367 KB

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