apr_audio-v2.h 337 KB

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