apr_audio-v2.h 323 KB

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