apr_audio-v2.h 324 KB

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