apr_audio-v2.h 374 KB

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