apr_audio-v2.h 216 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471
  1. /* Copyright (c) 2012-2014, 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 <mach/qdsp6v2/apr.h>
  15. #ifdef CONFIG_SND_SOC_MAXIM_DSM
  16. #include <sound/maxim_dsm.h>
  17. #endif
  18. #define ADSP_ADM_VERSION 0x00070000
  19. #define ADM_CMD_SHARED_MEM_MAP_REGIONS 0x00010322
  20. #define ADM_CMDRSP_SHARED_MEM_MAP_REGIONS 0x00010323
  21. #define ADM_CMD_SHARED_MEM_UNMAP_REGIONS 0x00010324
  22. #define ADM_CMD_MATRIX_MAP_ROUTINGS_V5 0x00010325
  23. /* Enumeration for an audio Rx matrix ID.*/
  24. #define ADM_MATRIX_ID_AUDIO_RX 0
  25. #define ADM_MATRIX_ID_AUDIO_TX 1
  26. /* Enumeration for an audio Tx matrix ID.*/
  27. #define ADM_MATRIX_ID_AUDIOX 1
  28. #define ADM_MAX_COPPS 5
  29. /* Session map node structure.
  30. * Immediately following this structure are num_copps
  31. * entries of COPP IDs. The COPP IDs are 16 bits, so
  32. * there might be a padding 16-bit field if num_copps
  33. * is odd.
  34. */
  35. struct adm_session_map_node_v5 {
  36. u16 session_id;
  37. /* Handle of the ASM session to be routed. Supported values: 1
  38. * to 8.
  39. */
  40. u16 num_copps;
  41. /* Number of COPPs to which this session is to be routed.
  42. Supported values: 0 < num_copps <= ADM_MAX_COPPS.
  43. */
  44. } __packed;
  45. /* Payload of the #ADM_CMD_MATRIX_MAP_ROUTINGS_V5 command.
  46. * Immediately following this structure are num_sessions of the session map
  47. * node payload (adm_session_map_node_v5).
  48. */
  49. struct adm_cmd_matrix_map_routings_v5 {
  50. struct apr_hdr hdr;
  51. u32 matrix_id;
  52. /* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx
  53. * (1). Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX
  54. * macros to set this field.
  55. */
  56. u32 num_sessions;
  57. /* Number of sessions being updated by this command (optional).*/
  58. } __packed;
  59. /* This command allows a client to open a COPP/Voice Proc. TX module
  60. * and sets up the device session: Matrix -> COPP -> AFE on the RX
  61. * and AFE -> COPP -> Matrix on the TX. This enables PCM data to
  62. * be transferred to/from the endpoint (AFEPortID).
  63. *
  64. * @return
  65. * #ADM_CMDRSP_DEVICE_OPEN_V5 with the resulting status and
  66. * COPP ID.
  67. */
  68. #define ADM_CMD_DEVICE_OPEN_V5 0x00010326
  69. /* Definition for a low latency stream session. */
  70. #define ADM_LOW_LATENCY_DEVICE_SESSION 0x2000
  71. /* Definition for a ultra low latency stream session. */
  72. #define ADM_ULTRA_LOW_LATENCY_DEVICE_SESSION 0x4000
  73. /* Definition for a legacy device session. */
  74. #define ADM_LEGACY_DEVICE_SESSION 0
  75. /* Indicates that endpoint_id_2 is to be ignored.*/
  76. #define ADM_CMD_COPP_OPEN_END_POINT_ID_2_IGNORE 0xFFFF
  77. #define ADM_CMD_COPP_OPEN_MODE_OF_OPERATION_RX_PATH_COPP 1
  78. #define ADM_CMD_COPP_OPEN_MODE_OF_OPERATIONX_PATH_LIVE_COPP 2
  79. #define ADM_CMD_COPP_OPEN_MODE_OF_OPERATIONX_PATH_NON_LIVE_COPP 3
  80. /* Indicates that an audio COPP is to send/receive a mono PCM
  81. * stream to/from
  82. * END_POINT_ID_1.
  83. */
  84. #define ADM_CMD_COPP_OPEN_CHANNEL_CONFIG_MONO 1
  85. /* Indicates that an audio COPP is to send/receive a
  86. * stereo PCM stream to/from END_POINT_ID_1.
  87. */
  88. #define ADM_CMD_COPP_OPEN_CHANNEL_CONFIG_STEREO 2
  89. /* Sample rate is 8000 Hz.*/
  90. #define ADM_CMD_COPP_OPEN_SAMPLE_RATE_8K 8000
  91. /* Sample rate is 16000 Hz.*/
  92. #define ADM_CMD_COPP_OPEN_SAMPLE_RATE_16K 16000
  93. /* Sample rate is 48000 Hz.*/
  94. #define ADM_CMD_COPP_OPEN_SAMPLE_RATE_48K 48000
  95. /* Definition for a COPP live input flag bitmask.*/
  96. #define ADM_BIT_MASK_COPP_LIVE_INPUT_FLAG (0x0001U)
  97. /* Definition for a COPP live shift value bitmask.*/
  98. #define ADM_SHIFT_COPP_LIVE_INPUT_FLAG 0
  99. /* Definition for the COPP ID bitmask.*/
  100. #define ADM_BIT_MASK_COPP_ID (0x0000FFFFUL)
  101. /* Definition for the COPP ID shift value.*/
  102. #define ADM_SHIFT_COPP_ID 0
  103. /* Definition for the service ID bitmask.*/
  104. #define ADM_BIT_MASK_SERVICE_ID (0x00FF0000UL)
  105. /* Definition for the service ID shift value.*/
  106. #define ADM_SHIFT_SERVICE_ID 16
  107. /* Definition for the domain ID bitmask.*/
  108. #define ADM_BIT_MASK_DOMAIN_ID (0xFF000000UL)
  109. /* Definition for the domain ID shift value.*/
  110. #define ADM_SHIFT_DOMAIN_ID 24
  111. /* ADM device open command payload of the
  112. #ADM_CMD_DEVICE_OPEN_V5 command.
  113. */
  114. struct adm_cmd_device_open_v5 {
  115. struct apr_hdr hdr;
  116. u16 flags;
  117. /* Reserved for future use. Clients must set this field
  118. * to zero.
  119. */
  120. u16 mode_of_operation;
  121. /* Specifies whether the COPP must be opened on the Tx or Rx
  122. * path. Use the ADM_CMD_COPP_OPEN_MODE_OF_OPERATION_* macros for
  123. * supported values and interpretation.
  124. * Supported values:
  125. * - 0x1 -- Rx path COPP
  126. * - 0x2 -- Tx path live COPP
  127. * - 0x3 -- Tx path nonlive COPP
  128. * Live connections cause sample discarding in the Tx device
  129. * matrix if the destination output ports do not pull them
  130. * fast enough. Nonlive connections queue the samples
  131. * indefinitely.
  132. */
  133. u16 endpoint_id_1;
  134. /* Logical and physical endpoint ID of the audio path.
  135. * If the ID is a voice processor Tx block, it receives near
  136. * samples. Supported values: Any pseudoport, AFE Rx port,
  137. * or AFE Tx port For a list of valid IDs, refer to
  138. * @xhyperref{Q4,[Q4]}.
  139. * Q4 = Hexagon Multimedia: AFE Interface Specification
  140. */
  141. u16 endpoint_id_2;
  142. /* Logical and physical endpoint ID 2 for a voice processor
  143. * Tx block.
  144. * This is not applicable to audio COPP.
  145. * Supported values:
  146. * - AFE Rx port
  147. * - 0xFFFF -- Endpoint 2 is unavailable and the voice
  148. * processor Tx
  149. * block ignores this endpoint
  150. * When the voice processor Tx block is created on the audio
  151. * record path,
  152. * it can receive far-end samples from an AFE Rx port if the
  153. * voice call
  154. * is active. The ID of the AFE port is provided in this
  155. * field.
  156. * For a list of valid IDs, refer @xhyperref{Q4,[Q4]}.
  157. */
  158. u32 topology_id;
  159. /* Audio COPP topology ID; 32-bit GUID. */
  160. u16 dev_num_channel;
  161. /* Number of channels the audio COPP sends to/receives from
  162. * the endpoint.
  163. * Supported values: 1 to 8.
  164. * The value is ignored for the voice processor Tx block,
  165. * where channel
  166. * configuration is derived from the topology ID.
  167. */
  168. u16 bit_width;
  169. /* Bit width (in bits) that the audio COPP sends to/receives
  170. * from the
  171. * endpoint. The value is ignored for the voice processing
  172. * Tx block,
  173. * where the PCM width is 16 bits.
  174. */
  175. u32 sample_rate;
  176. /* Sampling rate at which the audio COPP/voice processor
  177. * Tx block
  178. * interfaces with the endpoint.
  179. * Supported values for voice processor Tx: 8000, 16000,
  180. * 48000 Hz
  181. * Supported values for audio COPP: >0 and <=192 kHz
  182. */
  183. u8 dev_channel_mapping[8];
  184. /* Array of channel mapping of buffers that the audio COPP
  185. * sends to the endpoint. Channel[i] mapping describes channel
  186. * I inside the buffer, where 0 < i < dev_num_channel.
  187. * This value is relevent only for an audio Rx COPP.
  188. * For the voice processor block and Tx audio block, this field
  189. * is set to zero and is ignored.
  190. */
  191. } __packed;
  192. /*
  193. * This command allows the client to close a COPP and disconnect
  194. * the device session.
  195. */
  196. #define ADM_CMD_DEVICE_CLOSE_V5 0x00010327
  197. /* Sets one or more parameters to a COPP.
  198. */
  199. #define ADM_CMD_SET_PP_PARAMS_V5 0x00010328
  200. /* Payload of the #ADM_CMD_SET_PP_PARAMS_V5 command.
  201. * If the data_payload_addr_lsw and data_payload_addr_msw element
  202. * are NULL, a series of adm_param_datastructures immediately
  203. * follows, whose total size is data_payload_size bytes.
  204. */
  205. struct adm_cmd_set_pp_params_v5 {
  206. struct apr_hdr hdr;
  207. u32 payload_addr_lsw;
  208. /* LSW of parameter data payload address.*/
  209. u32 payload_addr_msw;
  210. /* MSW of parameter data payload address.*/
  211. u32 mem_map_handle;
  212. /* Memory map handle returned by ADM_CMD_SHARED_MEM_MAP_REGIONS
  213. * command */
  214. /* If mem_map_handle is zero implies the message is in
  215. * the payload */
  216. u32 payload_size;
  217. /* Size in bytes of the variable payload accompanying this
  218. * message or
  219. * in shared memory. This is used for parsing the parameter
  220. * payload.
  221. */
  222. } __packed;
  223. /* Payload format for COPP parameter data.
  224. * Immediately following this structure are param_size bytes
  225. * of parameter
  226. * data.
  227. */
  228. struct adm_param_data_v5 {
  229. u32 module_id;
  230. /* Unique ID of the module. */
  231. u32 param_id;
  232. /* Unique ID of the parameter. */
  233. u16 param_size;
  234. /* Data size of the param_id/module_id combination.
  235. This value is a
  236. multiple of 4 bytes. */
  237. u16 reserved;
  238. /* Reserved for future enhancements.
  239. * This field must be set to zero.
  240. */
  241. } __packed;
  242. /* Defined specifically for in-band use, includes params */
  243. struct adm_cmd_set_pp_params_inband_v5 {
  244. struct apr_hdr hdr;
  245. /* LSW of parameter data payload address.*/
  246. u32 payload_addr_lsw;
  247. /* MSW of parameter data payload address.*/
  248. u32 payload_addr_msw;
  249. /* Memory map handle returned by ADM_CMD_SHARED_MEM_MAP_REGIONS */
  250. /* command. If mem_map_handle is zero implies the message is in */
  251. /* the payload */
  252. u32 mem_map_handle;
  253. /* Size in bytes of the variable payload accompanying this */
  254. /* message or in shared memory. This is used for parsing the */
  255. /* parameter payload. */
  256. u32 payload_size;
  257. /* Parameters passed for in band payload */
  258. struct adm_param_data_v5 params;
  259. } __packed;
  260. /* Returns the status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V5 command.
  261. */
  262. #define ADM_CMDRSP_DEVICE_OPEN_V5 0x00010329
  263. /* Payload of the #ADM_CMDRSP_DEVICE_OPEN_V5 message,
  264. * which returns the
  265. * status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V5 command.
  266. */
  267. struct adm_cmd_rsp_device_open_v5 {
  268. u32 status;
  269. /* Status message (error code).*/
  270. u16 copp_id;
  271. /* COPP ID: Supported values: 0 <= copp_id < ADM_MAX_COPPS*/
  272. u16 reserved;
  273. /* Reserved. This field must be set to zero.*/
  274. } __packed;
  275. /* This command allows a query of one COPP parameter.
  276. */
  277. #define ADM_CMD_GET_PP_PARAMS_V5 0x0001032A
  278. /* Payload an #ADM_CMD_GET_PP_PARAMS_V5 command.
  279. */
  280. struct adm_cmd_get_pp_params_v5 {
  281. struct apr_hdr hdr;
  282. u32 data_payload_addr_lsw;
  283. /* LSW of parameter data payload address.*/
  284. u32 data_payload_addr_msw;
  285. /* MSW of parameter data payload address.*/
  286. /* If the mem_map_handle is non zero,
  287. * on ACK, the ParamData payloads begin at
  288. * the address specified (out-of-band).
  289. */
  290. u32 mem_map_handle;
  291. /* Memory map handle returned
  292. * by ADM_CMD_SHARED_MEM_MAP_REGIONS command.
  293. * If the mem_map_handle is 0, it implies that
  294. * the ACK's payload will contain the ParamData (in-band).
  295. */
  296. u32 module_id;
  297. /* Unique ID of the module. */
  298. u32 param_id;
  299. /* Unique ID of the parameter. */
  300. u16 param_max_size;
  301. /* Maximum data size of the parameter
  302. *ID/module ID combination. This
  303. * field is a multiple of 4 bytes.
  304. */
  305. u16 reserved;
  306. /* Reserved for future enhancements.
  307. * This field must be set to zero.
  308. */
  309. } __packed;
  310. /* Returns parameter values
  311. * in response to an #ADM_CMD_GET_PP_PARAMS_V5 command.
  312. */
  313. #define ADM_CMDRSP_GET_PP_PARAMS_V5 0x0001032B
  314. /* Payload of the #ADM_CMDRSP_GET_PP_PARAMS_V5 message,
  315. * which returns parameter values in response
  316. * to an #ADM_CMD_GET_PP_PARAMS_V5 command.
  317. * Immediately following this
  318. * structure is the adm_param_data_v5
  319. * structure containing the pre/postprocessing
  320. * parameter data. For an in-band
  321. * scenario, the variable payload depends
  322. * on the size of the parameter.
  323. */
  324. struct adm_cmd_rsp_get_pp_params_v5 {
  325. u32 status;
  326. /* Status message (error code).*/
  327. } __packed;
  328. /* Allows a client to control the gains on various session-to-COPP paths.
  329. */
  330. #define ADM_CMD_MATRIX_RAMP_GAINS_V5 0x0001032C
  331. /* Indicates that the target gain in the
  332. * current adm_session_copp_gain_v5
  333. * structure is to be applied to all
  334. * the session-to-COPP paths that exist for
  335. * the specified session.
  336. */
  337. #define ADM_CMD_MATRIX_RAMP_GAINS_COPP_ID_ALL_CONNECTED_COPPS 0xFFFF
  338. /* Indicates that the target gain is
  339. * to be immediately applied to the
  340. * specified session-to-COPP path,
  341. * without a ramping fashion.
  342. */
  343. #define ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE 0x0000
  344. /* Enumeration for a linear ramping curve.*/
  345. #define ADM_CMD_MATRIX_RAMP_GAINS_RAMP_CURVE_LINEAR 0x0000
  346. /* Payload of the #ADM_CMD_MATRIX_RAMP_GAINS_V5 command.
  347. * Immediately following this structure are num_gains of the
  348. * adm_session_copp_gain_v5structure.
  349. */
  350. struct adm_cmd_matrix_ramp_gains_v5 {
  351. u32 matrix_id;
  352. /* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx (1).
  353. * Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX
  354. * macros to set this field.
  355. */
  356. u16 num_gains;
  357. /* Number of gains being applied. */
  358. u16 reserved_for_align;
  359. /* Reserved. This field must be set to zero.*/
  360. } __packed;
  361. /* Session-to-COPP path gain structure, used by the
  362. * #ADM_CMD_MATRIX_RAMP_GAINS_V5 command.
  363. * This structure specifies the target
  364. * gain (per channel) that must be applied
  365. * to a particular session-to-COPP path in
  366. * the audio matrix. The structure can
  367. * also be used to apply the gain globally
  368. * to all session-to-COPP paths that
  369. * exist for the given session.
  370. * The aDSP uses device channel mapping to
  371. * determine which channel gains to
  372. * use from this command. For example,
  373. * if the device is configured as stereo,
  374. * the aDSP uses only target_gain_ch_1 and
  375. * target_gain_ch_2, and it ignores
  376. * the others.
  377. */
  378. struct adm_session_copp_gain_v5 {
  379. u16 session_id;
  380. /* Handle of the ASM session.
  381. * Supported values: 1 to 8.
  382. */
  383. u16 copp_id;
  384. /* Handle of the COPP. Gain will be applied on the Session ID
  385. * COPP ID path.
  386. */
  387. u16 ramp_duration;
  388. /* Duration (in milliseconds) of the ramp over
  389. * which target gains are
  390. * to be applied. Use
  391. * #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE
  392. * to indicate that gain must be applied immediately.
  393. */
  394. u16 step_duration;
  395. /* Duration (in milliseconds) of each step in the ramp.
  396. * This parameter is ignored if ramp_duration is equal to
  397. * #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE.
  398. * Supported value: 1
  399. */
  400. u16 ramp_curve;
  401. /* Type of ramping curve.
  402. * Supported value: #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_CURVE_LINEAR
  403. */
  404. u16 reserved_for_align;
  405. /* Reserved. This field must be set to zero. */
  406. u16 target_gain_ch_1;
  407. /* Target linear gain for channel 1 in Q13 format; */
  408. u16 target_gain_ch_2;
  409. /* Target linear gain for channel 2 in Q13 format; */
  410. u16 target_gain_ch_3;
  411. /* Target linear gain for channel 3 in Q13 format; */
  412. u16 target_gain_ch_4;
  413. /* Target linear gain for channel 4 in Q13 format; */
  414. u16 target_gain_ch_5;
  415. /* Target linear gain for channel 5 in Q13 format; */
  416. u16 target_gain_ch_6;
  417. /* Target linear gain for channel 6 in Q13 format; */
  418. u16 target_gain_ch_7;
  419. /* Target linear gain for channel 7 in Q13 format; */
  420. u16 target_gain_ch_8;
  421. /* Target linear gain for channel 8 in Q13 format; */
  422. } __packed;
  423. /* Allows to set mute/unmute on various session-to-COPP paths.
  424. * For every session-to-COPP path (stream-device interconnection),
  425. * mute/unmute can be set individually on the output channels.
  426. */
  427. #define ADM_CMD_MATRIX_MUTE_V5 0x0001032D
  428. /* Indicates that mute/unmute in the
  429. * current adm_session_copp_mute_v5structure
  430. * is to be applied to all the session-to-COPP
  431. * paths that exist for the specified session.
  432. */
  433. #define ADM_CMD_MATRIX_MUTE_COPP_ID_ALL_CONNECTED_COPPS 0xFFFF
  434. /* Payload of the #ADM_CMD_MATRIX_MUTE_V5 command*/
  435. struct adm_cmd_matrix_mute_v5 {
  436. u32 matrix_id;
  437. /* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx (1).
  438. * Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX
  439. * macros to set this field.
  440. */
  441. u16 session_id;
  442. /* Handle of the ASM session.
  443. * Supported values: 1 to 8.
  444. */
  445. u16 copp_id;
  446. /* Handle of the COPP.
  447. * Use ADM_CMD_MATRIX_MUTE_COPP_ID_ALL_CONNECTED_COPPS
  448. * to indicate that mute/unmute must be applied to
  449. * all the COPPs connected to session_id.
  450. * Supported values:
  451. * - 0xFFFF -- Apply mute/unmute to all connected COPPs
  452. * - Other values -- Valid COPP ID
  453. */
  454. u8 mute_flag_ch_1;
  455. /* Mute flag for channel 1 is set to unmute (0) or mute (1). */
  456. u8 mute_flag_ch_2;
  457. /* Mute flag for channel 2 is set to unmute (0) or mute (1). */
  458. u8 mute_flag_ch_3;
  459. /* Mute flag for channel 3 is set to unmute (0) or mute (1). */
  460. u8 mute_flag_ch_4;
  461. /* Mute flag for channel 4 is set to unmute (0) or mute (1). */
  462. u8 mute_flag_ch_5;
  463. /* Mute flag for channel 5 is set to unmute (0) or mute (1). */
  464. u8 mute_flag_ch_6;
  465. /* Mute flag for channel 6 is set to unmute (0) or mute (1). */
  466. u8 mute_flag_ch_7;
  467. /* Mute flag for channel 7 is set to unmute (0) or mute (1). */
  468. u8 mute_flag_ch_8;
  469. /* Mute flag for channel 8 is set to unmute (0) or mute (1). */
  470. u16 ramp_duration;
  471. /* Period (in milliseconds) over which the soft mute/unmute will be
  472. * applied.
  473. * Supported values: 0 (Default) to 0xFFFF
  474. * The default of 0 means mute/unmute will be applied immediately.
  475. */
  476. u16 reserved_for_align;
  477. /* Clients must set this field to zero.*/
  478. } __packed;
  479. #define ASM_PARAM_ID_AAC_STEREO_MIX_COEFF_SELECTION_FLAG_V2 (0x00010DD8)
  480. struct asm_aac_stereo_mix_coeff_selection_param_v2 {
  481. struct apr_hdr hdr;
  482. u32 param_id;
  483. u32 param_size;
  484. u32 aac_stereo_mix_coeff_flag;
  485. } __packed;
  486. /* Allows a client to connect the desired stream to
  487. * the desired AFE port through the stream router
  488. *
  489. * This command allows the client to connect specified session to
  490. * specified AFE port. This is used for compressed streams only
  491. * opened using the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED or
  492. * #ASM_STREAM_CMD_OPEN_READ_COMPRESSED command.
  493. *
  494. * @prerequisites
  495. * Session ID and AFE Port ID must be valid.
  496. * #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED or
  497. * #ASM_STREAM_CMD_OPEN_READ_COMPRESSED
  498. * must have been called on this session.
  499. */
  500. #define ADM_CMD_CONNECT_AFE_PORT_V5 0x0001032E
  501. #define ADM_CMD_DISCONNECT_AFE_PORT_V5 0x0001032F
  502. /* Enumeration for the Rx stream router ID.*/
  503. #define ADM_STRTR_ID_RX 0
  504. /* Enumeration for the Tx stream router ID.*/
  505. #define ADM_STRTR_IDX 1
  506. /* Payload of the #ADM_CMD_CONNECT_AFE_PORT_V5 command.*/
  507. struct adm_cmd_connect_afe_port_v5 {
  508. struct apr_hdr hdr;
  509. u8 mode;
  510. /* ID of the stream router (RX/TX). Use the
  511. * ADM_STRTR_ID_RX or ADM_STRTR_IDX macros
  512. * to set this field.
  513. */
  514. u8 session_id;
  515. /* Session ID of the stream to connect */
  516. u16 afe_port_id;
  517. /* Port ID of the AFE port to connect to.*/
  518. u32 num_channels;
  519. /* Number of device channels
  520. * Supported values: 2(Audio Sample Packet),
  521. * 8 (HBR Audio Stream Sample Packet)
  522. */
  523. u32 sampling_rate;
  524. /* Device sampling rate
  525. * Supported values: Any
  526. */
  527. } __packed;
  528. /* adsp_adm_api.h */
  529. /* Port ID. Update afe_get_port_index
  530. * when a new port is added here. */
  531. #define PRIMARY_I2S_RX 0
  532. #define PRIMARY_I2S_TX 1
  533. #define SECONDARY_I2S_RX 4
  534. #define SECONDARY_I2S_TX 5
  535. #define MI2S_RX 6
  536. #define MI2S_TX 7
  537. #define HDMI_RX 8
  538. #define RSVD_2 9
  539. #define RSVD_3 10
  540. #define DIGI_MIC_TX 11
  541. #define VOICE2_PLAYBACK_TX 0x8002
  542. #define VOICE_RECORD_RX 0x8003
  543. #define VOICE_RECORD_TX 0x8004
  544. #define VOICE_PLAYBACK_TX 0x8005
  545. /* Slimbus Multi channel port id pool */
  546. #define SLIMBUS_0_RX 0x4000
  547. #define SLIMBUS_0_TX 0x4001
  548. #define SLIMBUS_1_RX 0x4002
  549. #define SLIMBUS_1_TX 0x4003
  550. #define SLIMBUS_2_RX 0x4004
  551. #define SLIMBUS_2_TX 0x4005
  552. #define SLIMBUS_3_RX 0x4006
  553. #define SLIMBUS_3_TX 0x4007
  554. #define SLIMBUS_4_RX 0x4008
  555. #define SLIMBUS_4_TX 0x4009
  556. #define SLIMBUS_5_RX 0x400a
  557. #define SLIMBUS_5_TX 0x400b
  558. #define SLIMBUS_6_RX 0x400c
  559. #define SLIMBUS_6_TX 0x400d
  560. #define SLIMBUS_PORT_LAST SLIMBUS_6_TX
  561. #define INT_BT_SCO_RX 0x3000
  562. #define INT_BT_SCO_TX 0x3001
  563. #define INT_BT_A2DP_RX 0x3002
  564. #define INT_FM_RX 0x3004
  565. #define INT_FM_TX 0x3005
  566. #define RT_PROXY_PORT_001_RX 0x2000
  567. #define RT_PROXY_PORT_001_TX 0x2001
  568. #define AFE_PORT_INVALID 0xFFFF
  569. #define SLIMBUS_INVALID AFE_PORT_INVALID
  570. #define AFE_PORT_CMD_START 0x000100ca
  571. #define AFE_EVENT_RTPORT_START 0
  572. #define AFE_EVENT_RTPORT_STOP 1
  573. #define AFE_EVENT_RTPORT_LOW_WM 2
  574. #define AFE_EVENT_RTPORT_HI_WM 3
  575. #define ADSP_AFE_VERSION 0x00200000
  576. /* Size of the range of port IDs for the audio interface. */
  577. #define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_SIZE 0xF
  578. /* Size of the range of port IDs for internal BT-FM ports. */
  579. #define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_SIZE 0x6
  580. /* Size of the range of port IDs for SLIMbus<sup>&reg;
  581. * </sup> multichannel
  582. * ports.
  583. */
  584. #define AFE_PORT_ID_SLIMBUS_RANGE_SIZE 0xA
  585. /* Size of the range of port IDs for real-time proxy ports. */
  586. #define AFE_PORT_ID_RT_PROXY_PORT_RANGE_SIZE 0x2
  587. /* Size of the range of port IDs for pseudoports. */
  588. #define AFE_PORT_ID_PSEUDOPORT_RANGE_SIZE 0x5
  589. /* Start of the range of port IDs for the audio interface. */
  590. #define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_START 0x1000
  591. /* End of the range of port IDs for the audio interface. */
  592. #define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_END \
  593. (AFE_PORT_ID_AUDIO_IF_PORT_RANGE_START +\
  594. AFE_PORT_ID_AUDIO_IF_PORT_RANGE_SIZE - 1)
  595. /* Start of the range of port IDs for real-time proxy ports. */
  596. #define AFE_PORT_ID_RT_PROXY_PORT_RANGE_START 0x2000
  597. /* End of the range of port IDs for real-time proxy ports. */
  598. #define AFE_PORT_ID_RT_PROXY_PORT_RANGE_END \
  599. (AFE_PORT_ID_RT_PROXY_PORT_RANGE_START +\
  600. AFE_PORT_ID_RT_PROXY_PORT_RANGE_SIZE-1)
  601. /* Start of the range of port IDs for internal BT-FM devices. */
  602. #define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_START 0x3000
  603. /* End of the range of port IDs for internal BT-FM devices. */
  604. #define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_END \
  605. (AFE_PORT_ID_INTERNAL_BT_FM_RANGE_START +\
  606. AFE_PORT_ID_INTERNAL_BT_FM_RANGE_SIZE-1)
  607. /* Start of the range of port IDs for SLIMbus devices. */
  608. #define AFE_PORT_ID_SLIMBUS_RANGE_START 0x4000
  609. /* End of the range of port IDs for SLIMbus devices. */
  610. #define AFE_PORT_ID_SLIMBUS_RANGE_END \
  611. (AFE_PORT_ID_SLIMBUS_RANGE_START +\
  612. AFE_PORT_ID_SLIMBUS_RANGE_SIZE-1)
  613. /* Start of the range of port IDs for pseudoports. */
  614. #define AFE_PORT_ID_PSEUDOPORT_RANGE_START 0x8001
  615. /* End of the range of port IDs for pseudoports. */
  616. #define AFE_PORT_ID_PSEUDOPORT_RANGE_END \
  617. (AFE_PORT_ID_PSEUDOPORT_RANGE_START +\
  618. AFE_PORT_ID_PSEUDOPORT_RANGE_SIZE-1)
  619. #define AFE_PORT_ID_PRIMARY_MI2S_RX 0x1000
  620. #define AFE_PORT_ID_PRIMARY_MI2S_TX 0x1001
  621. #define AFE_PORT_ID_SECONDARY_MI2S_RX 0x1002
  622. #define AFE_PORT_ID_SECONDARY_MI2S_TX 0x1003
  623. #define AFE_PORT_ID_TERTIARY_MI2S_RX 0x1004
  624. #define AFE_PORT_ID_TERTIARY_MI2S_TX 0x1005
  625. #define AFE_PORT_ID_QUATERNARY_MI2S_RX 0x1006
  626. #define AFE_PORT_ID_QUATERNARY_MI2S_TX 0x1007
  627. #define AUDIO_PORT_ID_I2S_RX 0x1008
  628. #define AFE_PORT_ID_DIGITAL_MIC_TX 0x1009
  629. #define AFE_PORT_ID_PRIMARY_PCM_RX 0x100A
  630. #define AFE_PORT_ID_PRIMARY_PCM_TX 0x100B
  631. #define AFE_PORT_ID_SECONDARY_PCM_RX 0x100C
  632. #define AFE_PORT_ID_SECONDARY_PCM_TX 0x100D
  633. #define AFE_PORT_ID_MULTICHAN_HDMI_RX 0x100E
  634. #define AFE_PORT_ID_RT_PROXY_PORT_001_RX 0x2000
  635. #define AFE_PORT_ID_RT_PROXY_PORT_001_TX 0x2001
  636. #define AFE_PORT_ID_INTERNAL_BT_SCO_RX 0x3000
  637. #define AFE_PORT_ID_INTERNAL_BT_SCO_TX 0x3001
  638. #define AFE_PORT_ID_INTERNAL_BT_A2DP_RX 0x3002
  639. #define AFE_PORT_ID_INTERNAL_FM_RX 0x3004
  640. #define AFE_PORT_ID_INTERNAL_FM_TX 0x3005
  641. /* SLIMbus Rx port on channel 0. */
  642. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_RX 0x4000
  643. /* SLIMbus Tx port on channel 0. */
  644. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_TX 0x4001
  645. /* SLIMbus Rx port on channel 1. */
  646. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_RX 0x4002
  647. /* SLIMbus Tx port on channel 1. */
  648. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_TX 0x4003
  649. /* SLIMbus Rx port on channel 2. */
  650. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_RX 0x4004
  651. /* SLIMbus Tx port on channel 2. */
  652. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_TX 0x4005
  653. /* SLIMbus Rx port on channel 3. */
  654. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_RX 0x4006
  655. /* SLIMbus Tx port on channel 3. */
  656. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_TX 0x4007
  657. /* SLIMbus Rx port on channel 4. */
  658. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_RX 0x4008
  659. /* SLIMbus Tx port on channel 4. */
  660. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_TX 0x4009
  661. /* SLIMbus Rx port on channel 5. */
  662. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_5_RX 0x400a
  663. /* SLIMbus Tx port on channel 5. */
  664. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_5_TX 0x400b
  665. /* SLIMbus Rx port on channel 6. */
  666. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_6_RX 0x400c
  667. /* SLIMbus Tx port on channel 6. */
  668. #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_6_TX 0x400d
  669. /* Generic pseudoport 1. */
  670. #define AFE_PORT_ID_PSEUDOPORT_01 0x8001
  671. /* Generic pseudoport 2. */
  672. #define AFE_PORT_ID_PSEUDOPORT_02 0x8002
  673. /* @xreflabel{hdr:AfePortIdPrimaryAuxPcmTx}
  674. Primary Aux PCM Tx port ID.
  675. */
  676. #define AFE_PORT_ID_PRIMARY_PCM_TX 0x100B
  677. /* Pseudoport that corresponds to the voice Rx path.
  678. * For recording, the voice Rx path samples are written to this
  679. * port and consumed by the audio path.
  680. */
  681. #define AFE_PORT_ID_VOICE_RECORD_RX 0x8003
  682. /* Pseudoport that corresponds to the voice Tx path.
  683. * For recording, the voice Tx path samples are written to this
  684. * port and consumed by the audio path.
  685. */
  686. #define AFE_PORT_ID_VOICE_RECORD_TX 0x8004
  687. /* Pseudoport that corresponds to in-call voice delivery samples.
  688. * During in-call audio delivery, the audio path delivers samples
  689. * to this port from where the voice path delivers them on the
  690. * Rx path.
  691. */
  692. #define AFE_PORT_ID_VOICE2_PLAYBACK_TX 0x8002
  693. #define AFE_PORT_ID_VOICE_PLAYBACK_TX 0x8005
  694. #define AFE_PORT_ID_INVALID 0xFFFF
  695. #define AAC_ENC_MODE_AAC_LC 0x02
  696. #define AAC_ENC_MODE_AAC_P 0x05
  697. #define AAC_ENC_MODE_EAAC_P 0x1D
  698. #define AFE_PSEUDOPORT_CMD_START 0x000100cf
  699. struct afe_pseudoport_start_command {
  700. struct apr_hdr hdr;
  701. u16 port_id; /* Pseudo Port 1 = 0x8000 */
  702. /* Pseudo Port 2 = 0x8001 */
  703. /* Pseudo Port 3 = 0x8002 */
  704. u16 timing; /* FTRT = 0 , AVTimer = 1, */
  705. } __packed;
  706. #define AFE_PSEUDOPORT_CMD_STOP 0x000100d0
  707. struct afe_pseudoport_stop_command {
  708. struct apr_hdr hdr;
  709. u16 port_id; /* Pseudo Port 1 = 0x8000 */
  710. /* Pseudo Port 2 = 0x8001 */
  711. /* Pseudo Port 3 = 0x8002 */
  712. u16 reserved;
  713. } __packed;
  714. #define AFE_MODULE_SIDETONE_IIR_FILTER 0x00010202
  715. #define AFE_PARAM_ID_ENABLE 0x00010203
  716. /* Payload of the #AFE_PARAM_ID_ENABLE
  717. * parameter, which enables or
  718. * disables any module.
  719. * The fixed size of this structure is four bytes.
  720. */
  721. struct afe_mod_enable_param {
  722. u16 enable;
  723. /* Enables (1) or disables (0) the module. */
  724. u16 reserved;
  725. /* This field must be set to zero.
  726. */
  727. } __packed;
  728. /* ID of the configuration parameter used by the
  729. * #AFE_MODULE_SIDETONE_IIR_FILTER module.
  730. */
  731. #define AFE_PARAM_ID_SIDETONE_IIR_FILTER_CONFIG 0x00010204
  732. struct afe_sidetone_iir_filter_config_params {
  733. u16 num_biquad_stages;
  734. /* Number of stages.
  735. * Supported values: Minimum of 5 and maximum of 10
  736. */
  737. u16 pregain;
  738. /* Pregain for the compensating filter response.
  739. * Supported values: Any number in Q13 format
  740. */
  741. } __packed;
  742. #define AFE_MODULE_LOOPBACK 0x00010205
  743. #define AFE_PARAM_ID_LOOPBACK_GAIN_PER_PATH 0x00010206
  744. /* Payload of the #AFE_PARAM_ID_LOOPBACK_GAIN_PER_PATH parameter,
  745. * which gets/sets loopback gain of a port to an Rx port.
  746. * The Tx port ID of the loopback is part of the set_param command.
  747. */
  748. /* Payload of the #AFE_PORT_CMD_SET_PARAM_V2 command's
  749. * configuration/calibration settings for the AFE port.
  750. */
  751. struct afe_port_cmd_set_param_v2 {
  752. u16 port_id;
  753. /* Port interface and direction (Rx or Tx) to start.
  754. */
  755. u16 payload_size;
  756. /* Actual size of the payload in bytes.
  757. * This is used for parsing the parameter payload.
  758. * Supported values: > 0
  759. */
  760. u32 payload_address_lsw;
  761. /* LSW of 64 bit Payload address.
  762. * Address should be 32-byte,
  763. * 4kbyte aligned and must be contiguous memory.
  764. */
  765. u32 payload_address_msw;
  766. /* MSW of 64 bit Payload address.
  767. * In case of 32-bit shared memory address,
  768. * this field must be set to zero.
  769. * In case of 36-bit shared memory address,
  770. * bit-4 to bit-31 must be set to zero.
  771. * Address should be 32-byte, 4kbyte aligned
  772. * and must be contiguous memory.
  773. */
  774. u32 mem_map_handle;
  775. /* Memory map handle returned by
  776. * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands.
  777. * Supported Values:
  778. * - NULL -- Message. The parameter data is in-band.
  779. * - Non-NULL -- The parameter data is Out-band.Pointer to
  780. * the physical address
  781. * in shared memory of the payload data.
  782. * An optional field is available if parameter
  783. * data is in-band:
  784. * afe_param_data_v2 param_data[...].
  785. * For detailed payload content, see the
  786. * afe_port_param_data_v2 structure.
  787. */
  788. } __packed;
  789. #define AFE_PORT_CMD_SET_PARAM_V2 0x000100EF
  790. struct afe_port_param_data_v2 {
  791. u32 module_id;
  792. /* ID of the module to be configured.
  793. * Supported values: Valid module ID
  794. */
  795. u32 param_id;
  796. /* ID of the parameter corresponding to the supported parameters
  797. * for the module ID.
  798. * Supported values: Valid parameter ID
  799. */
  800. u16 param_size;
  801. /* Actual size of the data for the
  802. * module_id/param_id pair. The size is a
  803. * multiple of four bytes.
  804. * Supported values: > 0
  805. */
  806. u16 reserved;
  807. /* This field must be set to zero.
  808. */
  809. } __packed;
  810. struct afe_loopback_gain_per_path_param {
  811. struct apr_hdr hdr;
  812. struct afe_port_cmd_set_param_v2 param;
  813. struct afe_port_param_data_v2 pdata;
  814. u16 rx_port_id;
  815. /* Rx port of the loopback. */
  816. u16 gain;
  817. /* Loopback gain per path of the port.
  818. * Supported values: Any number in Q13 format
  819. */
  820. } __packed;
  821. /* Parameter ID used to configure and enable/disable the
  822. * loopback path. The difference with respect to the existing
  823. * API, AFE_PORT_CMD_LOOPBACK, is that it allows Rx port to be
  824. * configured as source port in loopback path. Port-id in
  825. * AFE_PORT_CMD_SET_PARAM cmd is the source port whcih can be
  826. * Tx or Rx port. In addition, we can configure the type of
  827. * routing mode to handle different use cases.
  828. */
  829. #define AFE_PARAM_ID_LOOPBACK_CONFIG 0x0001020B
  830. #define AFE_API_VERSION_LOOPBACK_CONFIG 0x1
  831. enum afe_loopback_routing_mode {
  832. LB_MODE_DEFAULT = 1,
  833. /* Regular loopback from source to destination port */
  834. LB_MODE_SIDETONE,
  835. /* Sidetone feed from Tx source to Rx destination port */
  836. LB_MODE_EC_REF_VOICE_AUDIO,
  837. /* Echo canceller reference, voice + audio + DTMF */
  838. LB_MODE_EC_REF_VOICE
  839. /* Echo canceller reference, voice alone */
  840. } __packed;
  841. /* Payload of the #AFE_PARAM_ID_LOOPBACK_CONFIG ,
  842. * which enables/disables one AFE loopback.
  843. */
  844. struct afe_loopback_cfg_v1 {
  845. struct apr_hdr hdr;
  846. struct afe_port_cmd_set_param_v2 param;
  847. struct afe_port_param_data_v2 pdata;
  848. u32 loopback_cfg_minor_version;
  849. /* Minor version used for tracking the version of the RMC module
  850. * configuration interface.
  851. * Supported values: #AFE_API_VERSION_LOOPBACK_CONFIG
  852. */
  853. u16 dst_port_id;
  854. /* Destination Port Id. */
  855. u16 routing_mode;
  856. /* Specifies data path type from src to dest port.
  857. * Supported values:
  858. * #LB_MODE_DEFAULT
  859. * #LB_MODE_SIDETONE
  860. * #LB_MODE_EC_REF_VOICE_AUDIO
  861. * #LB_MODE_EC_REF_VOICE_A
  862. * #LB_MODE_EC_REF_VOICE
  863. */
  864. u16 enable;
  865. /* Specifies whether to enable (1) or
  866. * disable (0) an AFE loopback.
  867. */
  868. u16 reserved;
  869. /* Reserved for 32-bit alignment. This field must be set to 0.
  870. */
  871. } __packed;
  872. #define AFE_MODULE_SPEAKER_PROTECTION 0x00010209
  873. #define AFE_PARAM_ID_SPKR_PROT_CONFIG 0x0001020a
  874. #define AFE_API_VERSION_SPKR_PROT_CONFIG 0x1
  875. #define AFE_SPKR_PROT_EXCURSIONF_LEN 512
  876. struct afe_spkr_prot_cfg_param_v1 {
  877. u32 spkr_prot_minor_version;
  878. /*
  879. * Minor version used for tracking the version of the
  880. * speaker protection module configuration interface.
  881. * Supported values: #AFE_API_VERSION_SPKR_PROT_CONFIG
  882. */
  883. int16_t win_size;
  884. /* Analysis and synthesis window size (nWinSize).
  885. * Supported values: 1024, 512, 256 samples
  886. */
  887. int16_t margin;
  888. /* Allowable margin for excursion prediction,
  889. * in L16Q15 format. This is a
  890. * control parameter to allow
  891. * for overestimation of peak excursion.
  892. */
  893. int16_t spkr_exc_limit;
  894. /* Speaker excursion limit, in L16Q15 format.*/
  895. int16_t spkr_resonance_freq;
  896. /* Resonance frequency of the speaker; used
  897. * to define a frequency range
  898. * for signal modification.
  899. *
  900. * Supported values: 0 to 2000 Hz */
  901. int16_t limhresh;
  902. /* Threshold of the hard limiter; used to
  903. * prevent overshooting beyond a
  904. * signal level that was set by the limiter
  905. * prior to speaker protection.
  906. * Supported values: 0 to 32767
  907. */
  908. int16_t hpf_cut_off_freq;
  909. /* High pass filter cutoff frequency.
  910. * Supported values: 100, 200, 300 Hz
  911. */
  912. int16_t hpf_enable;
  913. /* Specifies whether the high pass filter
  914. * is enabled (0) or disabled (1).
  915. */
  916. int16_t reserved;
  917. /* This field must be set to zero. */
  918. int32_t amp_gain;
  919. /* Amplifier gain in L32Q15 format.
  920. * This is the RMS voltage at the
  921. * loudspeaker when a 0dBFS tone
  922. * is played in the digital domain.
  923. */
  924. int16_t excursionf[AFE_SPKR_PROT_EXCURSIONF_LEN];
  925. /* Array of the excursion transfer function.
  926. * The peak excursion of the
  927. * loudspeaker diaphragm is
  928. * measured in millimeters for 1 Vrms Sine
  929. * tone at all FFT bin frequencies.
  930. * Supported values: Q15 format
  931. */
  932. } __packed;
  933. #define AFE_SERVICE_CMD_REGISTER_RT_PORT_DRIVER 0x000100E0
  934. /* Payload of the #AFE_SERVICE_CMD_REGISTER_RT_PORT_DRIVER
  935. * command, which registers a real-time port driver
  936. * with the AFE service.
  937. */
  938. struct afe_service_cmd_register_rt_port_driver {
  939. struct apr_hdr hdr;
  940. u16 port_id;
  941. /* Port ID with which the real-time driver exchanges data
  942. * (registers for events).
  943. * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
  944. * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
  945. */
  946. u16 reserved;
  947. /* This field must be set to zero. */
  948. } __packed;
  949. #define AFE_SERVICE_CMD_UNREGISTER_RT_PORT_DRIVER 0x000100E1
  950. /* Payload of the #AFE_SERVICE_CMD_UNREGISTER_RT_PORT_DRIVER
  951. * command, which unregisters a real-time port driver from
  952. * the AFE service.
  953. */
  954. struct afe_service_cmd_unregister_rt_port_driver {
  955. struct apr_hdr hdr;
  956. u16 port_id;
  957. /* Port ID from which the real-time
  958. * driver unregisters for events.
  959. * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
  960. * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
  961. */
  962. u16 reserved;
  963. /* This field must be set to zero. */
  964. } __packed;
  965. #define AFE_EVENT_RT_PROXY_PORT_STATUS 0x00010105
  966. #define AFE_EVENTYPE_RT_PROXY_PORT_START 0
  967. #define AFE_EVENTYPE_RT_PROXY_PORT_STOP 1
  968. #define AFE_EVENTYPE_RT_PROXY_PORT_LOW_WATER_MARK 2
  969. #define AFE_EVENTYPE_RT_PROXY_PORT_HIGH_WATER_MARK 3
  970. #define AFE_EVENTYPE_RT_PROXY_PORT_INVALID 0xFFFF
  971. /* Payload of the #AFE_EVENT_RT_PROXY_PORT_STATUS
  972. * message, which sends an event from the AFE service
  973. * to a registered client.
  974. */
  975. struct afe_event_rt_proxy_port_status {
  976. u16 port_id;
  977. /* Port ID to which the event is sent.
  978. * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
  979. * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
  980. */
  981. u16 eventype;
  982. /* Type of event.
  983. * Supported values:
  984. * - #AFE_EVENTYPE_RT_PROXY_PORT_START
  985. * - #AFE_EVENTYPE_RT_PROXY_PORT_STOP
  986. * - #AFE_EVENTYPE_RT_PROXY_PORT_LOW_WATER_MARK
  987. * - #AFE_EVENTYPE_RT_PROXY_PORT_HIGH_WATER_MARK
  988. */
  989. } __packed;
  990. #define AFE_PORT_DATA_CMD_RT_PROXY_PORT_WRITE_V2 0x000100ED
  991. struct afe_port_data_cmd_rt_proxy_port_write_v2 {
  992. struct apr_hdr hdr;
  993. u16 port_id;
  994. /* Tx (mic) proxy port ID with which the real-time
  995. * driver exchanges data.
  996. * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
  997. * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
  998. */
  999. u16 reserved;
  1000. /* This field must be set to zero. */
  1001. u32 buffer_address_lsw;
  1002. /* LSW Address of the buffer containing the
  1003. * data from the real-time source
  1004. * device on a client.
  1005. */
  1006. u32 buffer_address_msw;
  1007. /* MSW Address of the buffer containing the
  1008. * data from the real-time source
  1009. * device on a client.
  1010. */
  1011. u32 mem_map_handle;
  1012. /* A memory map handle encapsulating shared memory
  1013. * attributes is returned if
  1014. * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS
  1015. * command is successful.
  1016. * Supported Values:
  1017. * - Any 32 bit value
  1018. */
  1019. u32 available_bytes;
  1020. /* Number of valid bytes available
  1021. * in the buffer (including all
  1022. * channels: number of bytes per
  1023. * channel = availableBytesumChannels).
  1024. * Supported values: > 0
  1025. *
  1026. * This field must be equal to the frame
  1027. * size specified in the #AFE_PORT_AUDIO_IF_CONFIG
  1028. * command that was sent to configure this
  1029. * port.
  1030. */
  1031. } __packed;
  1032. #define AFE_PORT_DATA_CMD_RT_PROXY_PORT_READ_V2 0x000100EE
  1033. /* Payload of the
  1034. * #AFE_PORT_DATA_CMD_RT_PROXY_PORT_READ_V2 command, which
  1035. * delivers an empty buffer to the AFE service. On
  1036. * acknowledgment, data is filled in the buffer.
  1037. */
  1038. struct afe_port_data_cmd_rt_proxy_port_read_v2 {
  1039. struct apr_hdr hdr;
  1040. u16 port_id;
  1041. /* Rx proxy port ID with which the real-time
  1042. * driver exchanges data.
  1043. * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
  1044. * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
  1045. * (This must be an Rx (speaker) port.)
  1046. */
  1047. u16 reserved;
  1048. /* This field must be set to zero. */
  1049. u32 buffer_address_lsw;
  1050. /* LSW Address of the buffer containing the data sent from the AFE
  1051. * service to a real-time sink device on the client.
  1052. */
  1053. u32 buffer_address_msw;
  1054. /* MSW Address of the buffer containing the data sent from the AFE
  1055. * service to a real-time sink device on the client.
  1056. */
  1057. u32 mem_map_handle;
  1058. /* A memory map handle encapsulating shared memory attributes is
  1059. * returned if AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS command is
  1060. * successful.
  1061. * Supported Values:
  1062. * - Any 32 bit value
  1063. */
  1064. u32 available_bytes;
  1065. /* Number of valid bytes available in the buffer (including all
  1066. * channels).
  1067. * Supported values: > 0
  1068. * This field must be equal to the frame size specified in the
  1069. * #AFE_PORT_AUDIO_IF_CONFIG command that was sent to configure
  1070. * this port.
  1071. */
  1072. } __packed;
  1073. /* This module ID is related to device configuring like I2S,PCM,
  1074. * HDMI, SLIMBus etc. This module supports follwing parameter ids.
  1075. * - #AFE_PARAM_ID_I2S_CONFIG
  1076. * - #AFE_PARAM_ID_PCM_CONFIG
  1077. * - #AFE_PARAM_ID_DIGI_MIC_CONFIG
  1078. * - #AFE_PARAM_ID_HDMI_CONFIG
  1079. * - #AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG
  1080. * - #AFE_PARAM_ID_SLIMBUS_CONFIG
  1081. * - #AFE_PARAM_ID_RT_PROXY_CONFIG
  1082. */
  1083. #define AFE_MODULE_AUDIO_DEV_INTERFACE 0x0001020C
  1084. #define AFE_PORT_SAMPLE_RATE_8K 8000
  1085. #define AFE_PORT_SAMPLE_RATE_16K 16000
  1086. #define AFE_PORT_SAMPLE_RATE_48K 48000
  1087. #define AFE_PORT_SAMPLE_RATE_96K 96000
  1088. #define AFE_PORT_SAMPLE_RATE_192K 192000
  1089. #define AFE_LINEAR_PCM_DATA 0x0
  1090. #define AFE_NON_LINEAR_DATA 0x1
  1091. #define AFE_LINEAR_PCM_DATA_PACKED_60958 0x2
  1092. #define AFE_NON_LINEAR_DATA_PACKED_60958 0x3
  1093. /* This param id is used to configure I2S interface */
  1094. #define AFE_PARAM_ID_I2S_CONFIG 0x0001020D
  1095. #define AFE_API_VERSION_I2S_CONFIG 0x1
  1096. /* Enumeration for setting the I2S configuration
  1097. * channel_mode parameter to
  1098. * serial data wire number 1-3 (SD3).
  1099. */
  1100. #define AFE_PORT_I2S_SD0 0x1
  1101. #define AFE_PORT_I2S_SD1 0x2
  1102. #define AFE_PORT_I2S_SD2 0x3
  1103. #define AFE_PORT_I2S_SD3 0x4
  1104. #define AFE_PORT_I2S_QUAD01 0x5
  1105. #define AFE_PORT_I2S_QUAD23 0x6
  1106. #define AFE_PORT_I2S_6CHS 0x7
  1107. #define AFE_PORT_I2S_8CHS 0x8
  1108. #define AFE_PORT_I2S_MONO 0x0
  1109. #define AFE_PORT_I2S_STEREO 0x1
  1110. #define AFE_PORT_CONFIG_I2S_WS_SRC_EXTERNAL 0x0
  1111. #define AFE_PORT_CONFIG_I2S_WS_SRC_INTERNAL 0x1
  1112. /* Payload of the #AFE_PARAM_ID_I2S_CONFIG
  1113. * command's (I2S configuration
  1114. * parameter).
  1115. */
  1116. struct afe_param_id_i2s_cfg {
  1117. u32 i2s_cfg_minor_version;
  1118. /* Minor version used for tracking the version of the I2S
  1119. * configuration interface.
  1120. * Supported values: #AFE_API_VERSION_I2S_CONFIG
  1121. */
  1122. u16 bit_width;
  1123. /* Bit width of the sample.
  1124. * Supported values: 16, 24
  1125. */
  1126. u16 channel_mode;
  1127. /* I2S lines and multichannel operation.
  1128. * Supported values:
  1129. * - #AFE_PORT_I2S_SD0
  1130. * - #AFE_PORT_I2S_SD1
  1131. * - #AFE_PORT_I2S_SD2
  1132. * - #AFE_PORT_I2S_SD3
  1133. * - #AFE_PORT_I2S_QUAD01
  1134. * - #AFE_PORT_I2S_QUAD23
  1135. * - #AFE_PORT_I2S_6CHS
  1136. * - #AFE_PORT_I2S_8CHS
  1137. */
  1138. u16 mono_stereo;
  1139. /* Specifies mono or stereo. This applies only when
  1140. * a single I2S line is used.
  1141. * Supported values:
  1142. * - #AFE_PORT_I2S_MONO
  1143. * - #AFE_PORT_I2S_STEREO
  1144. */
  1145. u16 ws_src;
  1146. /* Word select source: internal or external.
  1147. * Supported values:
  1148. * - #AFE_PORT_CONFIG_I2S_WS_SRC_EXTERNAL
  1149. * - #AFE_PORT_CONFIG_I2S_WS_SRC_INTERNAL
  1150. */
  1151. u32 sample_rate;
  1152. /* Sampling rate of the port.
  1153. * Supported values:
  1154. * - #AFE_PORT_SAMPLE_RATE_8K
  1155. * - #AFE_PORT_SAMPLE_RATE_16K
  1156. * - #AFE_PORT_SAMPLE_RATE_48K
  1157. * - #AFE_PORT_SAMPLE_RATE_96K
  1158. * - #AFE_PORT_SAMPLE_RATE_192K
  1159. */
  1160. u16 data_format;
  1161. /* data format
  1162. * Supported values:
  1163. * - #LINEAR_PCM_DATA
  1164. * - #NON_LINEAR_DATA
  1165. * - #LINEAR_PCM_DATA_PACKED_IN_60958
  1166. * - #NON_LINEAR_DATA_PACKED_IN_60958
  1167. */
  1168. u16 reserved;
  1169. /* This field must be set to zero. */
  1170. } __packed;
  1171. /*
  1172. * This param id is used to configure PCM interface
  1173. */
  1174. #define AFE_PARAM_ID_PCM_CONFIG 0x0001020E
  1175. #define AFE_API_VERSION_PCM_CONFIG 0x1
  1176. /* Enumeration for the auxiliary PCM synchronization signal
  1177. * provided by an external source.
  1178. */
  1179. #define AFE_PORT_PCM_SYNC_SRC_EXTERNAL 0x0
  1180. /* Enumeration for the auxiliary PCM synchronization signal
  1181. * provided by an internal source.
  1182. */
  1183. #define AFE_PORT_PCM_SYNC_SRC_INTERNAL 0x1
  1184. /* Enumeration for the PCM configuration aux_mode parameter,
  1185. * which configures the auxiliary PCM interface to use
  1186. * short synchronization.
  1187. */
  1188. #define AFE_PORT_PCM_AUX_MODE_PCM 0x0
  1189. /*
  1190. * Enumeration for the PCM configuration aux_mode parameter,
  1191. * which configures the auxiliary PCM interface to use long
  1192. * synchronization.
  1193. */
  1194. #define AFE_PORT_PCM_AUX_MODE_AUX 0x1
  1195. /*
  1196. * Enumeration for setting the PCM configuration frame to 8.
  1197. */
  1198. #define AFE_PORT_PCM_BITS_PER_FRAME_8 0x0
  1199. /*
  1200. * Enumeration for setting the PCM configuration frame to 16.
  1201. */
  1202. #define AFE_PORT_PCM_BITS_PER_FRAME_16 0x1
  1203. /* Enumeration for setting the PCM configuration frame to 32.*/
  1204. #define AFE_PORT_PCM_BITS_PER_FRAME_32 0x2
  1205. /* Enumeration for setting the PCM configuration frame to 64.*/
  1206. #define AFE_PORT_PCM_BITS_PER_FRAME_64 0x3
  1207. /* Enumeration for setting the PCM configuration frame to 128.*/
  1208. #define AFE_PORT_PCM_BITS_PER_FRAME_128 0x4
  1209. /* Enumeration for setting the PCM configuration frame to 256.*/
  1210. #define AFE_PORT_PCM_BITS_PER_FRAME_256 0x5
  1211. /* Enumeration for setting the PCM configuration
  1212. * quantype parameter to A-law with no padding.
  1213. */
  1214. #define AFE_PORT_PCM_ALAW_NOPADDING 0x0
  1215. /* Enumeration for setting the PCM configuration quantype
  1216. * parameter to mu-law with no padding.
  1217. */
  1218. #define AFE_PORT_PCM_MULAW_NOPADDING 0x1
  1219. /* Enumeration for setting the PCM configuration quantype
  1220. * parameter to linear with no padding.
  1221. */
  1222. #define AFE_PORT_PCM_LINEAR_NOPADDING 0x2
  1223. /* Enumeration for setting the PCM configuration quantype
  1224. * parameter to A-law with padding.
  1225. */
  1226. #define AFE_PORT_PCM_ALAW_PADDING 0x3
  1227. /* Enumeration for setting the PCM configuration quantype
  1228. * parameter to mu-law with padding.
  1229. */
  1230. #define AFE_PORT_PCM_MULAW_PADDING 0x4
  1231. /* Enumeration for setting the PCM configuration quantype
  1232. * parameter to linear with padding.
  1233. */
  1234. #define AFE_PORT_PCM_LINEAR_PADDING 0x5
  1235. /* Enumeration for disabling the PCM configuration
  1236. * ctrl_data_out_enable parameter.
  1237. * The PCM block is the only master.
  1238. */
  1239. #define AFE_PORT_PCM_CTRL_DATA_OE_DISABLE 0x0
  1240. /*
  1241. * Enumeration for enabling the PCM configuration
  1242. * ctrl_data_out_enable parameter. The PCM block shares
  1243. * the signal with other masters.
  1244. */
  1245. #define AFE_PORT_PCM_CTRL_DATA_OE_ENABLE 0x1
  1246. /* Payload of the #AFE_PARAM_ID_PCM_CONFIG command's
  1247. * (PCM configuration parameter).
  1248. */
  1249. struct afe_param_id_pcm_cfg {
  1250. u32 pcm_cfg_minor_version;
  1251. /* Minor version used for tracking the version of the AUX PCM
  1252. * configuration interface.
  1253. * Supported values: #AFE_API_VERSION_PCM_CONFIG
  1254. */
  1255. u16 aux_mode;
  1256. /* PCM synchronization setting.
  1257. * Supported values:
  1258. * - #AFE_PORT_PCM_AUX_MODE_PCM
  1259. * - #AFE_PORT_PCM_AUX_MODE_AUX
  1260. */
  1261. u16 sync_src;
  1262. /* Synchronization source.
  1263. * Supported values:
  1264. * - #AFE_PORT_PCM_SYNC_SRC_EXTERNAL
  1265. * - #AFE_PORT_PCM_SYNC_SRC_INTERNAL
  1266. */
  1267. u16 frame_setting;
  1268. /* Number of bits per frame.
  1269. * Supported values:
  1270. * - #AFE_PORT_PCM_BITS_PER_FRAME_8
  1271. * - #AFE_PORT_PCM_BITS_PER_FRAME_16
  1272. * - #AFE_PORT_PCM_BITS_PER_FRAME_32
  1273. * - #AFE_PORT_PCM_BITS_PER_FRAME_64
  1274. * - #AFE_PORT_PCM_BITS_PER_FRAME_128
  1275. * - #AFE_PORT_PCM_BITS_PER_FRAME_256
  1276. */
  1277. u16 quantype;
  1278. /* PCM quantization type.
  1279. * Supported values:
  1280. * - #AFE_PORT_PCM_ALAW_NOPADDING
  1281. * - #AFE_PORT_PCM_MULAW_NOPADDING
  1282. * - #AFE_PORT_PCM_LINEAR_NOPADDING
  1283. * - #AFE_PORT_PCM_ALAW_PADDING
  1284. * - #AFE_PORT_PCM_MULAW_PADDING
  1285. * - #AFE_PORT_PCM_LINEAR_PADDING
  1286. */
  1287. u16 ctrl_data_out_enable;
  1288. /* Specifies whether the PCM block shares the data-out
  1289. * signal to the drive with other masters.
  1290. * Supported values:
  1291. * - #AFE_PORT_PCM_CTRL_DATA_OE_DISABLE
  1292. * - #AFE_PORT_PCM_CTRL_DATA_OE_ENABLE
  1293. */
  1294. u16 reserved;
  1295. /* This field must be set to zero. */
  1296. u32 sample_rate;
  1297. /* Sampling rate of the port.
  1298. * Supported values:
  1299. * - #AFE_PORT_SAMPLE_RATE_8K
  1300. * - #AFE_PORT_SAMPLE_RATE_16K
  1301. */
  1302. u16 bit_width;
  1303. /* Bit width of the sample.
  1304. * Supported values: 16
  1305. */
  1306. u16 num_channels;
  1307. /* Number of channels.
  1308. * Supported values: 1 to 4
  1309. */
  1310. u16 slot_number_mapping[4];
  1311. /* Specifies the slot number for the each channel in
  1312. * multi channel scenario.
  1313. * Supported values: 1 to 32
  1314. */
  1315. } __packed;
  1316. /*
  1317. * This param id is used to configure DIGI MIC interface
  1318. */
  1319. #define AFE_PARAM_ID_DIGI_MIC_CONFIG 0x0001020F
  1320. /* This version information is used to handle the new
  1321. * additions to the config interface in future in backward
  1322. * compatible manner.
  1323. */
  1324. #define AFE_API_VERSION_DIGI_MIC_CONFIG 0x1
  1325. /* Enumeration for setting the digital mic configuration
  1326. * channel_mode parameter to left 0.
  1327. */
  1328. #define AFE_PORT_DIGI_MIC_MODE_LEFT0 0x1
  1329. /*Enumeration for setting the digital mic configuration
  1330. * channel_mode parameter to right 0.
  1331. */
  1332. #define AFE_PORT_DIGI_MIC_MODE_RIGHT0 0x2
  1333. /* Enumeration for setting the digital mic configuration
  1334. * channel_mode parameter to left 1.
  1335. */
  1336. #define AFE_PORT_DIGI_MIC_MODE_LEFT1 0x3
  1337. /* Enumeration for setting the digital mic configuration
  1338. * channel_mode parameter to right 1.
  1339. */
  1340. #define AFE_PORT_DIGI_MIC_MODE_RIGHT1 0x4
  1341. /* Enumeration for setting the digital mic configuration
  1342. * channel_mode parameter to stereo 0.
  1343. */
  1344. #define AFE_PORT_DIGI_MIC_MODE_STEREO0 0x5
  1345. /* Enumeration for setting the digital mic configuration
  1346. * channel_mode parameter to stereo 1.
  1347. */
  1348. #define AFE_PORT_DIGI_MIC_MODE_STEREO1 0x6
  1349. /* Enumeration for setting the digital mic configuration
  1350. * channel_mode parameter to quad.
  1351. */
  1352. #define AFE_PORT_DIGI_MIC_MODE_QUAD 0x7
  1353. /* Payload of the #AFE_PARAM_ID_DIGI_MIC_CONFIG command's
  1354. * (DIGI MIC configuration
  1355. * parameter).
  1356. */
  1357. struct afe_param_id_digi_mic_cfg {
  1358. u32 digi_mic_cfg_minor_version;
  1359. /* Minor version used for tracking the version of the DIGI Mic
  1360. * configuration interface.
  1361. * Supported values: #AFE_API_VERSION_DIGI_MIC_CONFIG
  1362. */
  1363. u16 bit_width;
  1364. /* Bit width of the sample.
  1365. * Supported values: 16
  1366. */
  1367. u16 channel_mode;
  1368. /* Digital mic and multichannel operation.
  1369. * Supported values:
  1370. * - #AFE_PORT_DIGI_MIC_MODE_LEFT0
  1371. * - #AFE_PORT_DIGI_MIC_MODE_RIGHT0
  1372. * - #AFE_PORT_DIGI_MIC_MODE_LEFT1
  1373. * - #AFE_PORT_DIGI_MIC_MODE_RIGHT1
  1374. * - #AFE_PORT_DIGI_MIC_MODE_STEREO0
  1375. * - #AFE_PORT_DIGI_MIC_MODE_STEREO1
  1376. * - #AFE_PORT_DIGI_MIC_MODE_QUAD
  1377. */
  1378. u32 sample_rate;
  1379. /* Sampling rate of the port.
  1380. * Supported values:
  1381. * - #AFE_PORT_SAMPLE_RATE_8K
  1382. * - #AFE_PORT_SAMPLE_RATE_16K
  1383. * - #AFE_PORT_SAMPLE_RATE_48K
  1384. */
  1385. } __packed;
  1386. /*
  1387. * This param id is used to configure HDMI interface
  1388. */
  1389. #define AFE_PARAM_ID_HDMI_CONFIG 0x00010210
  1390. /* This version information is used to handle the new
  1391. * additions to the config interface in future in backward
  1392. * compatible manner.
  1393. */
  1394. #define AFE_API_VERSION_HDMI_CONFIG 0x1
  1395. /* Payload of the #AFE_PARAM_ID_HDMI_CONFIG command,
  1396. * which configures a multichannel HDMI audio interface.
  1397. */
  1398. struct afe_param_id_hdmi_multi_chan_audio_cfg {
  1399. u32 hdmi_cfg_minor_version;
  1400. /* Minor version used for tracking the version of the HDMI
  1401. * configuration interface.
  1402. * Supported values: #AFE_API_VERSION_HDMI_CONFIG
  1403. */
  1404. u16 datatype;
  1405. /* data type
  1406. * Supported values:
  1407. * - #LINEAR_PCM_DATA
  1408. * - #NON_LINEAR_DATA
  1409. * - #LINEAR_PCM_DATA_PACKED_IN_60958
  1410. * - #NON_LINEAR_DATA_PACKED_IN_60958
  1411. */
  1412. u16 channel_allocation;
  1413. /* HDMI channel allocation information for programming an HDMI
  1414. * frame. The default is 0 (Stereo).
  1415. *
  1416. * This information is defined in the HDMI standard, CEA 861-D
  1417. * (refer to @xhyperref{S1,[S1]}). The number of channels is also
  1418. * inferred from this parameter.
  1419. */
  1420. u32 sample_rate;
  1421. /* Sampling rate of the port.
  1422. * Supported values:
  1423. * - #AFE_PORT_SAMPLE_RATE_8K
  1424. * - #AFE_PORT_SAMPLE_RATE_16K
  1425. * - #AFE_PORT_SAMPLE_RATE_48K
  1426. * - #AFE_PORT_SAMPLE_RATE_96K
  1427. * - 22050, 44100, 176400 for compressed streams
  1428. */
  1429. u16 bit_width;
  1430. /* Bit width of the sample.
  1431. * Supported values: 16, 24
  1432. */
  1433. u16 reserved;
  1434. /* This field must be set to zero. */
  1435. } __packed;
  1436. /*
  1437. * This param id is used to configure BT or FM(RIVA) interface
  1438. */
  1439. #define AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG 0x00010211
  1440. /* This version information is used to handle the new
  1441. * additions to the config interface in future in backward
  1442. * compatible manner.
  1443. */
  1444. #define AFE_API_VERSION_INTERNAL_BT_FM_CONFIG 0x1
  1445. /* Payload of the #AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG
  1446. * command's BT voice/BT audio/FM configuration parameter.
  1447. */
  1448. struct afe_param_id_internal_bt_fm_cfg {
  1449. u32 bt_fm_cfg_minor_version;
  1450. /* Minor version used for tracking the version of the BT and FM
  1451. * configuration interface.
  1452. * Supported values: #AFE_API_VERSION_INTERNAL_BT_FM_CONFIG
  1453. */
  1454. u16 num_channels;
  1455. /* Number of channels.
  1456. * Supported values: 1 to 2
  1457. */
  1458. u16 bit_width;
  1459. /* Bit width of the sample.
  1460. * Supported values: 16
  1461. */
  1462. u32 sample_rate;
  1463. /* Sampling rate of the port.
  1464. * Supported values:
  1465. * - #AFE_PORT_SAMPLE_RATE_8K (only for BTSCO)
  1466. * - #AFE_PORT_SAMPLE_RATE_16K (only for BTSCO)
  1467. * - #AFE_PORT_SAMPLE_RATE_48K (FM and A2DP)
  1468. */
  1469. } __packed;
  1470. /* This param id is used to configure SLIMBUS interface using
  1471. * shared channel approach.
  1472. */
  1473. #define AFE_PARAM_ID_SLIMBUS_CONFIG 0x00010212
  1474. /* This version information is used to handle the new
  1475. * additions to the config interface in future in backward
  1476. * compatible manner.
  1477. */
  1478. #define AFE_API_VERSION_SLIMBUS_CONFIG 0x1
  1479. /* Enumeration for setting SLIMbus device ID 1.
  1480. */
  1481. #define AFE_SLIMBUS_DEVICE_1 0x0
  1482. /* Enumeration for setting SLIMbus device ID 2.
  1483. */
  1484. #define AFE_SLIMBUS_DEVICE_2 0x1
  1485. /* Enumeration for setting the SLIMbus data formats.
  1486. */
  1487. #define AFE_SB_DATA_FORMAT_NOT_INDICATED 0x0
  1488. /* Enumeration for setting the maximum number of streams per
  1489. * device.
  1490. */
  1491. #define AFE_PORT_MAX_AUDIO_CHAN_CNT 0x8
  1492. /* Payload of the #AFE_PORT_CMD_SLIMBUS_CONFIG command's SLIMbus
  1493. * port configuration parameter.
  1494. */
  1495. struct afe_param_id_slimbus_cfg {
  1496. u32 sb_cfg_minor_version;
  1497. /* Minor version used for tracking the version of the SLIMBUS
  1498. * configuration interface.
  1499. * Supported values: #AFE_API_VERSION_SLIMBUS_CONFIG
  1500. */
  1501. u16 slimbus_dev_id;
  1502. /* SLIMbus hardware device ID, which is required to handle
  1503. * multiple SLIMbus hardware blocks.
  1504. * Supported values: - #AFE_SLIMBUS_DEVICE_1 - #AFE_SLIMBUS_DEVICE_2
  1505. */
  1506. u16 bit_width;
  1507. /* Bit width of the sample.
  1508. * Supported values: 16, 24
  1509. */
  1510. u16 data_format;
  1511. /* Data format supported by the SLIMbus hardware. The default is
  1512. * 0 (#AFE_SB_DATA_FORMAT_NOT_INDICATED), which indicates the
  1513. * hardware does not perform any format conversions before the data
  1514. * transfer.
  1515. */
  1516. u16 num_channels;
  1517. /* Number of channels.
  1518. * Supported values: 1 to #AFE_PORT_MAX_AUDIO_CHAN_CNT
  1519. */
  1520. u8 shared_ch_mapping[AFE_PORT_MAX_AUDIO_CHAN_CNT];
  1521. /* Mapping of shared channel IDs (128 to 255) to which the
  1522. * master port is to be connected.
  1523. * Shared_channel_mapping[i] represents the shared channel assigned
  1524. * for audio channel i in multichannel audio data.
  1525. */
  1526. u32 sample_rate;
  1527. /* Sampling rate of the port.
  1528. * Supported values:
  1529. * - #AFE_PORT_SAMPLE_RATE_8K
  1530. * - #AFE_PORT_SAMPLE_RATE_16K
  1531. * - #AFE_PORT_SAMPLE_RATE_48K
  1532. * - #AFE_PORT_SAMPLE_RATE_96K
  1533. * - #AFE_PORT_SAMPLE_RATE_192K
  1534. */
  1535. } __packed;
  1536. /*
  1537. * This param id is used to configure Real Time Proxy interface.
  1538. */
  1539. #define AFE_PARAM_ID_RT_PROXY_CONFIG 0x00010213
  1540. /* This version information is used to handle the new
  1541. * additions to the config interface in future in backward
  1542. * compatible manner.
  1543. */
  1544. #define AFE_API_VERSION_RT_PROXY_CONFIG 0x1
  1545. /* Payload of the #AFE_PARAM_ID_RT_PROXY_CONFIG
  1546. * command (real-time proxy port configuration parameter).
  1547. */
  1548. struct afe_param_id_rt_proxy_port_cfg {
  1549. u32 rt_proxy_cfg_minor_version;
  1550. /* Minor version used for tracking the version of rt-proxy
  1551. * config interface.
  1552. */
  1553. u16 bit_width;
  1554. /* Bit width of the sample.
  1555. * Supported values: 16
  1556. */
  1557. u16 interleaved;
  1558. /* Specifies whether the data exchanged between the AFE
  1559. * interface and real-time port is interleaved.
  1560. * Supported values: - 0 -- Non-interleaved (samples from each
  1561. * channel are contiguous in the buffer) - 1 -- Interleaved
  1562. * (corresponding samples from each input channel are interleaved
  1563. * within the buffer)
  1564. */
  1565. u16 frame_size;
  1566. /* Size of the frames that are used for PCM exchanges with this
  1567. * port.
  1568. * Supported values: > 0, in bytes
  1569. * For example, 5 ms buffers of 16 bits and 16 kHz stereo samples
  1570. * is 5 ms * 16 samples/ms * 2 bytes/sample * 2 channels = 320
  1571. * bytes.
  1572. */
  1573. u16 jitter_allowance;
  1574. /* Configures the amount of jitter that the port will allow.
  1575. * Supported values: > 0
  1576. * For example, if +/-10 ms of jitter is anticipated in the timing
  1577. * of sending frames to the port, and the configuration is 16 kHz
  1578. * mono with 16-bit samples, this field is 10 ms * 16 samples/ms * 2
  1579. * bytes/sample = 320.
  1580. */
  1581. u16 low_water_mark;
  1582. /* Low watermark in bytes (including all channels).
  1583. * Supported values:
  1584. * - 0 -- Do not send any low watermark events
  1585. * - > 0 -- Low watermark for triggering an event
  1586. * If the number of bytes in an internal circular buffer is lower
  1587. * than this low_water_mark parameter, a LOW_WATER_MARK event is
  1588. * sent to applications (via the #AFE_EVENT_RT_PROXY_PORT_STATUS
  1589. * event).
  1590. * Use of watermark events is optional for debugging purposes.
  1591. */
  1592. u16 high_water_mark;
  1593. /* High watermark in bytes (including all channels).
  1594. * Supported values:
  1595. * - 0 -- Do not send any high watermark events
  1596. * - > 0 -- High watermark for triggering an event
  1597. * If the number of bytes in an internal circular buffer exceeds
  1598. * TOTAL_CIRC_BUF_SIZE minus high_water_mark, a high watermark event
  1599. * is sent to applications (via the #AFE_EVENT_RT_PROXY_PORT_STATUS
  1600. * event).
  1601. * The use of watermark events is optional and for debugging
  1602. * purposes.
  1603. */
  1604. u32 sample_rate;
  1605. /* Sampling rate of the port.
  1606. * Supported values:
  1607. * - #AFE_PORT_SAMPLE_RATE_8K
  1608. * - #AFE_PORT_SAMPLE_RATE_16K
  1609. * - #AFE_PORT_SAMPLE_RATE_48K
  1610. */
  1611. u16 num_channels;
  1612. /* Number of channels.
  1613. * Supported values: 1 to #AFE_PORT_MAX_AUDIO_CHAN_CNT
  1614. */
  1615. u16 reserved;
  1616. /* For 32 bit alignment. */
  1617. } __packed;
  1618. /* This param id is used to configure the Pseudoport interface */
  1619. #define AFE_PARAM_ID_PSEUDO_PORT_CONFIG 0x00010219
  1620. /* Version information used to handle future additions to the configuration
  1621. * interface (for backward compatibility).
  1622. */
  1623. #define AFE_API_VERSION_PSEUDO_PORT_CONFIG 0x1
  1624. /* Enumeration for setting the timing_mode parameter to faster than real
  1625. * time.
  1626. */
  1627. #define AFE_PSEUDOPORT_TIMING_MODE_FTRT 0x0
  1628. /* Enumeration for setting the timing_mode parameter to real time using
  1629. * timers.
  1630. */
  1631. #define AFE_PSEUDOPORT_TIMING_MODE_TIMER 0x1
  1632. /* Payload of the AFE_PARAM_ID_PSEUDO_PORT_CONFIG parameter used by
  1633. AFE_MODULE_AUDIO_DEV_INTERFACE.
  1634. */
  1635. struct afe_param_id_pseudo_port_cfg {
  1636. u32 pseud_port_cfg_minor_version;
  1637. /*
  1638. * Minor version used for tracking the version of the pseudoport
  1639. * configuration interface.
  1640. */
  1641. u16 bit_width;
  1642. /* Bit width of the sample at values 16, 24 */
  1643. u16 num_channels;
  1644. /* Number of channels at values 1 to 8 */
  1645. u16 data_format;
  1646. /* Non-linear data format supported by the pseudoport (for future use).
  1647. * At values #AFE_LINEAR_PCM_DATA
  1648. */
  1649. u16 timing_mode;
  1650. /* Indicates whether the pseudoport synchronizes to the clock or
  1651. * operates faster than real time.
  1652. * at values
  1653. * - #AFE_PSEUDOPORT_TIMING_MODE_FTRT
  1654. * - #AFE_PSEUDOPORT_TIMING_MODE_TIMER @tablebulletend
  1655. */
  1656. u32 sample_rate;
  1657. /* Sample rate at which the pseudoport will run.
  1658. * at values
  1659. * - #AFE_PORT_SAMPLE_RATE_8K
  1660. * - #AFE_PORT_SAMPLE_RATE_32K
  1661. * - #AFE_PORT_SAMPLE_RATE_48K
  1662. * - #AFE_PORT_SAMPLE_RATE_96K
  1663. * - #AFE_PORT_SAMPLE_RATE_192K @tablebulletend
  1664. */
  1665. } __packed;
  1666. #define AFE_PARAM_ID_DEVICE_HW_DELAY 0x00010243
  1667. #define AFE_API_VERSION_DEVICE_HW_DELAY 0x1
  1668. struct afe_param_id_device_hw_delay_cfg {
  1669. uint32_t device_hw_delay_minor_version;
  1670. uint32_t delay_in_us;
  1671. } __packed;
  1672. union afe_port_config {
  1673. struct afe_param_id_pcm_cfg pcm;
  1674. struct afe_param_id_i2s_cfg i2s;
  1675. struct afe_param_id_hdmi_multi_chan_audio_cfg hdmi_multi_ch;
  1676. struct afe_param_id_slimbus_cfg slim_sch;
  1677. struct afe_param_id_rt_proxy_port_cfg rtproxy;
  1678. struct afe_param_id_internal_bt_fm_cfg int_bt_fm;
  1679. struct afe_param_id_pseudo_port_cfg pseudo_port;
  1680. struct afe_param_id_device_hw_delay_cfg hw_delay;
  1681. } __packed;
  1682. struct afe_audioif_config_command_no_payload {
  1683. struct apr_hdr hdr;
  1684. struct afe_port_cmd_set_param_v2 param;
  1685. } __packed;
  1686. struct afe_audioif_config_command {
  1687. struct apr_hdr hdr;
  1688. struct afe_port_cmd_set_param_v2 param;
  1689. struct afe_port_param_data_v2 pdata;
  1690. union afe_port_config port;
  1691. } __packed;
  1692. #define AFE_PORT_CMD_DEVICE_START 0x000100E5
  1693. /* Payload of the #AFE_PORT_CMD_DEVICE_START.*/
  1694. struct afe_port_cmd_device_start {
  1695. struct apr_hdr hdr;
  1696. u16 port_id;
  1697. /* Port interface and direction (Rx or Tx) to start. An even
  1698. * number represents the Rx direction, and an odd number represents
  1699. * the Tx direction.
  1700. */
  1701. u16 reserved;
  1702. /* Reserved for 32-bit alignment. This field must be set to 0.*/
  1703. } __packed;
  1704. #define AFE_PORT_CMD_DEVICE_STOP 0x000100E6
  1705. /* Payload of the #AFE_PORT_CMD_DEVICE_STOP.
  1706. */
  1707. struct afe_port_cmd_device_stop {
  1708. struct apr_hdr hdr;
  1709. u16 port_id;
  1710. /* Port interface and direction (Rx or Tx) to start. An even
  1711. * number represents the Rx direction, and an odd number represents
  1712. * the Tx direction.
  1713. */
  1714. u16 reserved;
  1715. /* Reserved for 32-bit alignment. This field must be set to 0.*/
  1716. } __packed;
  1717. #define AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS 0x000100EA
  1718. /* Memory map regions command payload used by the
  1719. * #AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS .
  1720. * This structure allows clients to map multiple shared memory
  1721. * regions in a single command. Following this structure are
  1722. * num_regions of afe_service_shared_map_region_payload.
  1723. */
  1724. struct afe_service_cmd_shared_mem_map_regions {
  1725. struct apr_hdr hdr;
  1726. u16 mem_pool_id;
  1727. /* Type of memory on which this memory region is mapped.
  1728. * Supported values:
  1729. * - #ADSP_MEMORY_MAP_EBI_POOL
  1730. * - #ADSP_MEMORY_MAP_SMI_POOL
  1731. * - #ADSP_MEMORY_MAP_SHMEM8_4K_POOL
  1732. * - Other values are reserved
  1733. *
  1734. * The memory pool ID implicitly defines the characteristics of the
  1735. * memory. Characteristics may include alignment type, permissions,
  1736. * etc.
  1737. *
  1738. * ADSP_MEMORY_MAP_EBI_POOL is External Buffer Interface type memory
  1739. * ADSP_MEMORY_MAP_SMI_POOL is Shared Memory Interface type memory
  1740. * ADSP_MEMORY_MAP_SHMEM8_4K_POOL is shared memory, byte
  1741. * addressable, and 4 KB aligned.
  1742. */
  1743. u16 num_regions;
  1744. /* Number of regions to map.
  1745. * Supported values:
  1746. * - Any value greater than zero
  1747. */
  1748. u32 property_flag;
  1749. /* Configures one common property for all the regions in the
  1750. * payload.
  1751. *
  1752. * Supported values: - 0x00000000 to 0x00000001
  1753. *
  1754. * b0 - bit 0 indicates physical or virtual mapping 0 Shared memory
  1755. * address provided in afe_service_shared_map_region_payloadis a
  1756. * physical address. The shared memory needs to be mapped( hardware
  1757. * TLB entry) and a software entry needs to be added for internal
  1758. * book keeping.
  1759. *
  1760. * 1 Shared memory address provided in
  1761. * afe_service_shared_map_region_payloadis a virtual address. The
  1762. * shared memory must not be mapped (since hardware TLB entry is
  1763. * already available) but a software entry needs to be added for
  1764. * internal book keeping. This can be useful if two services with in
  1765. * ADSP is communicating via APR. They can now directly communicate
  1766. * via the Virtual address instead of Physical address. The virtual
  1767. * regions must be contiguous. num_regions must be 1 in this case.
  1768. *
  1769. * b31-b1 - reserved bits. must be set to zero
  1770. */
  1771. } __packed;
  1772. /* Map region payload used by the
  1773. * afe_service_shared_map_region_payloadstructure.
  1774. */
  1775. struct afe_service_shared_map_region_payload {
  1776. u32 shm_addr_lsw;
  1777. /* least significant word of starting address in the memory
  1778. * region to map. It must be contiguous memory, and it must be 4 KB
  1779. * aligned.
  1780. * Supported values: - Any 32 bit value
  1781. */
  1782. u32 shm_addr_msw;
  1783. /* most significant word of startng address in the memory region
  1784. * to map. For 32 bit shared memory address, this field must be set
  1785. * to zero. For 36 bit shared memory address, bit31 to bit 4 must be
  1786. * set to zero
  1787. *
  1788. * Supported values: - For 32 bit shared memory address, this field
  1789. * must be set to zero. - For 36 bit shared memory address, bit31 to
  1790. * bit 4 must be set to zero - For 64 bit shared memory address, any
  1791. * 32 bit value
  1792. */
  1793. u32 mem_size_bytes;
  1794. /* Number of bytes in the region. The aDSP will always map the
  1795. * regions as virtual contiguous memory, but the memory size must be
  1796. * in multiples of 4 KB to avoid gaps in the virtually contiguous
  1797. * mapped memory.
  1798. *
  1799. * Supported values: - multiples of 4KB
  1800. */
  1801. } __packed;
  1802. #define AFE_SERVICE_CMDRSP_SHARED_MEM_MAP_REGIONS 0x000100EB
  1803. struct afe_service_cmdrsp_shared_mem_map_regions {
  1804. u32 mem_map_handle;
  1805. /* A memory map handle encapsulating shared memory attributes is
  1806. * returned iff AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS command is
  1807. * successful. In the case of failure , a generic APR error response
  1808. * is returned to the client.
  1809. *
  1810. * Supported Values: - Any 32 bit value
  1811. */
  1812. } __packed;
  1813. #define AFE_SERVICE_CMD_SHARED_MEM_UNMAP_REGIONS 0x000100EC
  1814. /* Memory unmap regions command payload used by the
  1815. * #AFE_SERVICE_CMD_SHARED_MEM_UNMAP_REGIONS
  1816. *
  1817. * This structure allows clients to unmap multiple shared memory
  1818. * regions in a single command.
  1819. */
  1820. struct afe_service_cmd_shared_mem_unmap_regions {
  1821. struct apr_hdr hdr;
  1822. u32 mem_map_handle;
  1823. /* memory map handle returned by
  1824. * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands
  1825. *
  1826. * Supported Values:
  1827. * - Any 32 bit value
  1828. */
  1829. } __packed;
  1830. #define AFE_PORT_CMD_GET_PARAM_V2 0x000100F0
  1831. /* Payload of the #AFE_PORT_CMD_GET_PARAM_V2 command,
  1832. * which queries for one post/preprocessing parameter of a
  1833. * stream.
  1834. */
  1835. struct afe_port_cmd_get_param_v2 {
  1836. struct apr_hdr hdr;
  1837. u16 port_id;
  1838. /* Port interface and direction (Rx or Tx) to start. */
  1839. u16 payload_size;
  1840. /* Maximum data size of the parameter ID/module ID combination.
  1841. * This is a multiple of four bytes
  1842. * Supported values: > 0
  1843. */
  1844. u32 payload_address_lsw;
  1845. /* LSW of 64 bit Payload address. Address should be 32-byte,
  1846. * 4kbyte aligned and must be contig memory.
  1847. */
  1848. u32 payload_address_msw;
  1849. /* MSW of 64 bit Payload address. In case of 32-bit shared
  1850. * memory address, this field must be set to zero. In case of 36-bit
  1851. * shared memory address, bit-4 to bit-31 must be set to zero.
  1852. * Address should be 32-byte, 4kbyte aligned and must be contiguous
  1853. * memory.
  1854. */
  1855. u32 mem_map_handle;
  1856. /* Memory map handle returned by
  1857. * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands.
  1858. * Supported Values: - NULL -- Message. The parameter data is
  1859. * in-band. - Non-NULL -- The parameter data is Out-band.Pointer to
  1860. * - the physical address in shared memory of the payload data.
  1861. * For detailed payload content, see the afe_port_param_data_v2
  1862. * structure
  1863. */
  1864. u32 module_id;
  1865. /* ID of the module to be queried.
  1866. * Supported values: Valid module ID
  1867. */
  1868. u32 param_id;
  1869. /* ID of the parameter to be queried.
  1870. * Supported values: Valid parameter ID
  1871. */
  1872. } __packed;
  1873. #define AFE_PORT_CMDRSP_GET_PARAM_V2 0x00010106
  1874. /* Payload of the #AFE_PORT_CMDRSP_GET_PARAM_V2 message, which
  1875. * responds to an #AFE_PORT_CMD_GET_PARAM_V2 command.
  1876. *
  1877. * Immediately following this structure is the parameters structure
  1878. * (afe_port_param_data) containing the response(acknowledgment)
  1879. * parameter payload. This payload is included for an in-band
  1880. * scenario. For an address/shared memory-based set parameter, this
  1881. * payload is not needed.
  1882. */
  1883. struct afe_port_cmdrsp_get_param_v2 {
  1884. u32 status;
  1885. } __packed;
  1886. /* adsp_afe_service_commands.h */
  1887. #define ADSP_MEMORY_MAP_EBI_POOL 0
  1888. #define ADSP_MEMORY_MAP_SMI_POOL 1
  1889. #define ADSP_MEMORY_MAP_IMEM_POOL 2
  1890. #define ADSP_MEMORY_MAP_SHMEM8_4K_POOL 3
  1891. /*
  1892. * Definition of virtual memory flag
  1893. */
  1894. #define ADSP_MEMORY_MAP_VIRTUAL_MEMORY 1
  1895. /*
  1896. * Definition of physical memory flag
  1897. */
  1898. #define ADSP_MEMORY_MAP_PHYSICAL_MEMORY 0
  1899. #define NULL_COPP_TOPOLOGY 0x00010312
  1900. #define DEFAULT_COPP_TOPOLOGY 0x00010be3
  1901. #define DEFAULT_POPP_TOPOLOGY 0x00010be4
  1902. #define VPM_TX_SM_ECNS_COPP_TOPOLOGY 0x00010F71
  1903. #define VPM_TX_DM_FLUENCE_COPP_TOPOLOGY 0x00010F72
  1904. #define VPM_TX_QMIC_FLUENCE_COPP_TOPOLOGY 0x00010F75
  1905. #define VPM_TX_DM_RFECNS_COPP_TOPOLOGY 0x00010F86
  1906. // NXP LVVEFQ
  1907. #define VPM_TX_SM_LVVE_COPP_TOPOLOGY 0x1000BFFF
  1908. /* Memory map regions command payload used by the
  1909. * #ASM_CMD_SHARED_MEM_MAP_REGIONS ,#ADM_CMD_SHARED_MEM_MAP_REGIONS
  1910. * commands.
  1911. *
  1912. * This structure allows clients to map multiple shared memory
  1913. * regions in a single command. Following this structure are
  1914. * num_regions of avs_shared_map_region_payload.
  1915. */
  1916. struct avs_cmd_shared_mem_map_regions {
  1917. struct apr_hdr hdr;
  1918. u16 mem_pool_id;
  1919. /* Type of memory on which this memory region is mapped.
  1920. *
  1921. * Supported values: - #ADSP_MEMORY_MAP_EBI_POOL -
  1922. * #ADSP_MEMORY_MAP_SMI_POOL - #ADSP_MEMORY_MAP_IMEM_POOL
  1923. * (unsupported) - #ADSP_MEMORY_MAP_SHMEM8_4K_POOL - Other values
  1924. * are reserved
  1925. *
  1926. * The memory ID implicitly defines the characteristics of the
  1927. * memory. Characteristics may include alignment type, permissions,
  1928. * etc.
  1929. *
  1930. * SHMEM8_4K is shared memory, byte addressable, and 4 KB aligned.
  1931. */
  1932. u16 num_regions;
  1933. /* Number of regions to map.*/
  1934. u32 property_flag;
  1935. /* Configures one common property for all the regions in the
  1936. * payload. No two regions in the same memory map regions cmd can
  1937. * have differnt property. Supported values: - 0x00000000 to
  1938. * 0x00000001
  1939. *
  1940. * b0 - bit 0 indicates physical or virtual mapping 0 shared memory
  1941. * address provided in avs_shared_map_regions_payload is physical
  1942. * address. The shared memory needs to be mapped( hardware TLB
  1943. * entry)
  1944. *
  1945. * and a software entry needs to be added for internal book keeping.
  1946. *
  1947. * 1 Shared memory address provided in MayPayload[usRegions] is
  1948. * virtual address. The shared memory must not be mapped (since
  1949. * hardware TLB entry is already available) but a software entry
  1950. * needs to be added for internal book keeping. This can be useful
  1951. * if two services with in ADSP is communicating via APR. They can
  1952. * now directly communicate via the Virtual address instead of
  1953. * Physical address. The virtual regions must be contiguous.
  1954. *
  1955. * b31-b1 - reserved bits. must be set to zero
  1956. */
  1957. } __packed;
  1958. struct avs_shared_map_region_payload {
  1959. u32 shm_addr_lsw;
  1960. /* least significant word of shared memory address of the memory
  1961. * region to map. It must be contiguous memory, and it must be 4 KB
  1962. * aligned.
  1963. */
  1964. u32 shm_addr_msw;
  1965. /* most significant word of shared memory address of the memory
  1966. * region to map. For 32 bit shared memory address, this field must
  1967. * tbe set to zero. For 36 bit shared memory address, bit31 to bit 4
  1968. * must be set to zero
  1969. */
  1970. u32 mem_size_bytes;
  1971. /* Number of bytes in the region.
  1972. *
  1973. * The aDSP will always map the regions as virtual contiguous
  1974. * memory, but the memory size must be in multiples of 4 KB to avoid
  1975. * gaps in the virtually contiguous mapped memory.
  1976. */
  1977. } __packed;
  1978. struct avs_cmd_shared_mem_unmap_regions {
  1979. struct apr_hdr hdr;
  1980. u32 mem_map_handle;
  1981. /* memory map handle returned by ASM_CMD_SHARED_MEM_MAP_REGIONS
  1982. * , ADM_CMD_SHARED_MEM_MAP_REGIONS, commands
  1983. */
  1984. } __packed;
  1985. /* Memory map command response payload used by the
  1986. * #ASM_CMDRSP_SHARED_MEM_MAP_REGIONS
  1987. * ,#ADM_CMDRSP_SHARED_MEM_MAP_REGIONS
  1988. */
  1989. struct avs_cmdrsp_shared_mem_map_regions {
  1990. u32 mem_map_handle;
  1991. /* A memory map handle encapsulating shared memory attributes is
  1992. * returned
  1993. */
  1994. } __packed;
  1995. /*adsp_audio_memmap_api.h*/
  1996. /* ASM related data structures */
  1997. struct asm_wma_cfg {
  1998. u16 format_tag;
  1999. u16 ch_cfg;
  2000. u32 sample_rate;
  2001. u32 avg_bytes_per_sec;
  2002. u16 block_align;
  2003. u16 valid_bits_per_sample;
  2004. u32 ch_mask;
  2005. u16 encode_opt;
  2006. u16 adv_encode_opt;
  2007. u32 adv_encode_opt2;
  2008. u32 drc_peak_ref;
  2009. u32 drc_peak_target;
  2010. u32 drc_ave_ref;
  2011. u32 drc_ave_target;
  2012. } __packed;
  2013. struct asm_wmapro_cfg {
  2014. u16 format_tag;
  2015. u16 ch_cfg;
  2016. u32 sample_rate;
  2017. u32 avg_bytes_per_sec;
  2018. u16 block_align;
  2019. u16 valid_bits_per_sample;
  2020. u32 ch_mask;
  2021. u16 encode_opt;
  2022. u16 adv_encode_opt;
  2023. u32 adv_encode_opt2;
  2024. u32 drc_peak_ref;
  2025. u32 drc_peak_target;
  2026. u32 drc_ave_ref;
  2027. u32 drc_ave_target;
  2028. } __packed;
  2029. struct asm_aac_cfg {
  2030. u16 format;
  2031. u16 aot;
  2032. u16 ep_config;
  2033. u16 section_data_resilience;
  2034. u16 scalefactor_data_resilience;
  2035. u16 spectral_data_resilience;
  2036. u16 ch_cfg;
  2037. u16 reserved;
  2038. u32 sample_rate;
  2039. } __packed;
  2040. struct asm_amrwbplus_cfg {
  2041. u32 size_bytes;
  2042. u32 version;
  2043. u32 num_channels;
  2044. u32 amr_band_mode;
  2045. u32 amr_dtx_mode;
  2046. u32 amr_frame_fmt;
  2047. u32 amr_lsf_idx;
  2048. } __packed;
  2049. struct asm_softpause_params {
  2050. u32 enable;
  2051. u32 period;
  2052. u32 step;
  2053. u32 rampingcurve;
  2054. } __packed;
  2055. struct asm_softvolume_params {
  2056. u32 period;
  2057. u32 step;
  2058. u32 rampingcurve;
  2059. } __packed;
  2060. #define ASM_END_POINT_DEVICE_MATRIX 0
  2061. #define PCM_CHANNEL_NULL 0
  2062. /* Front left channel. */
  2063. #define PCM_CHANNEL_FL 1
  2064. /* Front right channel. */
  2065. #define PCM_CHANNEL_FR 2
  2066. /* Front center channel. */
  2067. #define PCM_CHANNEL_FC 3
  2068. /* Left surround channel.*/
  2069. #define PCM_CHANNEL_LS 4
  2070. /* Right surround channel.*/
  2071. #define PCM_CHANNEL_RS 5
  2072. /* Low frequency effect channel. */
  2073. #define PCM_CHANNEL_LFE 6
  2074. /* Center surround channel; Rear center channel. */
  2075. #define PCM_CHANNEL_CS 7
  2076. /* Left back channel; Rear left channel. */
  2077. #define PCM_CHANNEL_LB 8
  2078. /* Right back channel; Rear right channel. */
  2079. #define PCM_CHANNEL_RB 9
  2080. /* Top surround channel. */
  2081. #define PCM_CHANNELS 10
  2082. /* Center vertical height channel.*/
  2083. #define PCM_CHANNEL_CVH 11
  2084. /* Mono surround channel.*/
  2085. #define PCM_CHANNEL_MS 12
  2086. /* Front left of center. */
  2087. #define PCM_CHANNEL_FLC 13
  2088. /* Front right of center. */
  2089. #define PCM_CHANNEL_FRC 14
  2090. /* Rear left of center. */
  2091. #define PCM_CHANNEL_RLC 15
  2092. /* Rear right of center. */
  2093. #define PCM_CHANNEL_RRC 16
  2094. #define PCM_FORMAT_MAX_NUM_CHANNEL 8
  2095. #define ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2 0x00010DA5
  2096. #define ASM_STREAM_POSTPROC_TOPO_ID_DEFAULT 0x00010BE4
  2097. #define ASM_STREAM_POSTPROC_TOPO_ID_NONE 0x00010C68
  2098. #define ASM_MEDIA_FMT_EVRCB_FS 0x00010BEF
  2099. #define ASM_MEDIA_FMT_EVRCWB_FS 0x00010BF0
  2100. #define ASM_MAX_EQ_BANDS 12
  2101. #define ASM_DATA_CMD_MEDIA_FMT_UPDATE_V2 0x00010D98
  2102. struct asm_data_cmd_media_fmt_update_v2 {
  2103. u32 fmt_blk_size;
  2104. /* Media format block size in bytes.*/
  2105. } __packed;
  2106. struct asm_multi_channel_pcm_fmt_blk_v2 {
  2107. struct apr_hdr hdr;
  2108. struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
  2109. u16 num_channels;
  2110. /* Number of channels. Supported values: 1 to 8 */
  2111. u16 bits_per_sample;
  2112. /* Number of bits per sample per channel. * Supported values:
  2113. * 16, 24 * When used for playback, the client must send 24-bit
  2114. * samples packed in 32-bit words. The 24-bit samples must be placed
  2115. * in the most significant 24 bits of the 32-bit word. When used for
  2116. * recording, the aDSP sends 24-bit samples packed in 32-bit words.
  2117. * The 24-bit samples are placed in the most significant 24 bits of
  2118. * the 32-bit word.
  2119. */
  2120. u32 sample_rate;
  2121. /* Number of samples per second (in Hertz).
  2122. * Supported values: 2000 to 48000
  2123. */
  2124. u16 is_signed;
  2125. /* Flag that indicates the samples are signed (1). */
  2126. u16 reserved;
  2127. /* reserved field for 32 bit alignment. must be set to zero. */
  2128. u8 channel_mapping[8];
  2129. /* Channel array of size 8.
  2130. * Supported values:
  2131. * - #PCM_CHANNEL_L
  2132. * - #PCM_CHANNEL_R
  2133. * - #PCM_CHANNEL_C
  2134. * - #PCM_CHANNEL_LS
  2135. * - #PCM_CHANNEL_RS
  2136. * - #PCM_CHANNEL_LFE
  2137. * - #PCM_CHANNEL_CS
  2138. * - #PCM_CHANNEL_LB
  2139. * - #PCM_CHANNEL_RB
  2140. * - #PCM_CHANNELS
  2141. * - #PCM_CHANNEL_CVH
  2142. * - #PCM_CHANNEL_MS
  2143. * - #PCM_CHANNEL_FLC
  2144. * - #PCM_CHANNEL_FRC
  2145. * - #PCM_CHANNEL_RLC
  2146. * - #PCM_CHANNEL_RRC
  2147. *
  2148. * Channel[i] mapping describes channel I. Each element i of the
  2149. * array describes channel I inside the buffer where 0 @le I <
  2150. * num_channels. An unused channel is set to zero.
  2151. */
  2152. } __packed;
  2153. struct asm_stream_cmd_set_encdec_param {
  2154. u32 param_id;
  2155. /* ID of the parameter. */
  2156. u32 param_size;
  2157. /* Data size of this parameter, in bytes. The size is a multiple
  2158. * of 4 bytes.
  2159. */
  2160. } __packed;
  2161. struct asm_enc_cfg_blk_param_v2 {
  2162. u32 frames_per_buf;
  2163. /* Number of encoded frames to pack into each buffer.
  2164. *
  2165. * @note1hang This is only guidance information for the aDSP. The
  2166. * number of encoded frames put into each buffer (specified by the
  2167. * client) is less than or equal to this number.
  2168. */
  2169. u32 enc_cfg_blk_size;
  2170. /* Size in bytes of the encoder configuration block that follows
  2171. * this member.
  2172. */
  2173. } __packed;
  2174. /* @brief Dolby Digital Plus end point configuration structure
  2175. */
  2176. struct asm_dec_ddp_endp_param_v2 {
  2177. struct apr_hdr hdr;
  2178. struct asm_stream_cmd_set_encdec_param encdec;
  2179. int endp_param_value;
  2180. } __packed;
  2181. /* @brief Multichannel PCM encoder configuration structure used
  2182. * in the #ASM_STREAM_CMD_OPEN_READ_V2 command.
  2183. */
  2184. struct asm_multi_channel_pcm_enc_cfg_v2 {
  2185. struct apr_hdr hdr;
  2186. struct asm_stream_cmd_set_encdec_param encdec;
  2187. struct asm_enc_cfg_blk_param_v2 encblk;
  2188. uint16_t num_channels;
  2189. /*< Number of PCM channels.
  2190. *
  2191. * Supported values: - 0 -- Native mode - 1 -- 8 Native mode
  2192. * indicates that encoding must be performed with the number of
  2193. * channels at the input.
  2194. */
  2195. uint16_t bits_per_sample;
  2196. /*< Number of bits per sample per channel.
  2197. * Supported values: 16, 24
  2198. */
  2199. uint32_t sample_rate;
  2200. /*< Number of samples per second (in Hertz).
  2201. *
  2202. * Supported values: 0, 8000 to 48000 A value of 0 indicates the
  2203. * native sampling rate. Encoding is performed at the input sampling
  2204. * rate.
  2205. */
  2206. uint16_t is_signed;
  2207. /*< Specifies whether the samples are signed (1). Currently,
  2208. * only signed samples are supported.
  2209. */
  2210. uint16_t reserved;
  2211. /*< reserved field for 32 bit alignment. must be set to zero.*/
  2212. uint8_t channel_mapping[8];
  2213. } __packed;
  2214. #define ASM_MEDIA_FMT_MP3 0x00010BE9
  2215. #define ASM_MEDIA_FMT_AAC_V2 0x00010DA6
  2216. /* @xreflabel
  2217. * {hdr:AsmMediaFmtDolbyAac} Media format ID for the
  2218. * Dolby AAC decoder. This format ID is be used if the client wants
  2219. * to use the Dolby AAC decoder to decode MPEG2 and MPEG4 AAC
  2220. * contents.
  2221. */
  2222. #define ASM_MEDIA_FMT_DOLBY_AAC 0x00010D86
  2223. /* Enumeration for the audio data transport stream AAC format. */
  2224. #define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS 0
  2225. /* Enumeration for low overhead audio stream AAC format. */
  2226. #define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS 1
  2227. /* Enumeration for the audio data interchange format
  2228. * AAC format.
  2229. */
  2230. #define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF 2
  2231. /* Enumeration for the raw AAC format. */
  2232. #define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW 3
  2233. #define ASM_MEDIA_FMT_AAC_AOT_LC 2
  2234. #define ASM_MEDIA_FMT_AAC_AOT_SBR 5
  2235. #define ASM_MEDIA_FMT_AAC_AOT_PS 29
  2236. #define ASM_MEDIA_FMT_AAC_AOT_BSAC 22
  2237. struct asm_aac_fmt_blk_v2 {
  2238. struct apr_hdr hdr;
  2239. struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
  2240. u16 aac_fmt_flag;
  2241. /* Bitstream format option.
  2242. * Supported values:
  2243. * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
  2244. * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS
  2245. * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF
  2246. * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
  2247. */
  2248. u16 audio_objype;
  2249. /* Audio Object Type (AOT) present in the AAC stream.
  2250. * Supported values:
  2251. * - #ASM_MEDIA_FMT_AAC_AOT_LC
  2252. * - #ASM_MEDIA_FMT_AAC_AOT_SBR
  2253. * - #ASM_MEDIA_FMT_AAC_AOT_BSAC
  2254. * - #ASM_MEDIA_FMT_AAC_AOT_PS
  2255. * - Otherwise -- Not supported
  2256. */
  2257. u16 channel_config;
  2258. /* Number of channels present in the AAC stream.
  2259. * Supported values:
  2260. * - 1 -- Mono
  2261. * - 2 -- Stereo
  2262. * - 6 -- 5.1 content
  2263. */
  2264. u16 total_size_of_PCE_bits;
  2265. /* greater or equal to zero. * -In case of RAW formats and
  2266. * channel config = 0 (PCE), client can send * the bit stream
  2267. * containing PCE immediately following this structure * (in-band).
  2268. * -This number does not include bits included for 32 bit alignment.
  2269. * -If zero, then the PCE info is assumed to be available in the
  2270. * audio -bit stream & not in-band.
  2271. */
  2272. u32 sample_rate;
  2273. /* Number of samples per second (in Hertz).
  2274. *
  2275. * Supported values: 8000, 11025, 12000, 16000, 22050, 24000, 32000,
  2276. * 44100, 48000
  2277. *
  2278. * This field must be equal to the sample rate of the AAC-LC
  2279. * decoder's output. - For MP4 or 3GP containers, this is indicated
  2280. * by the samplingFrequencyIndex field in the AudioSpecificConfig
  2281. * element. - For ADTS format, this is indicated by the
  2282. * samplingFrequencyIndex in the ADTS fixed header. - For ADIF
  2283. * format, this is indicated by the samplingFrequencyIndex in the
  2284. * program_config_element present in the ADIF header.
  2285. */
  2286. } __packed;
  2287. struct asm_aac_enc_cfg_v2 {
  2288. struct apr_hdr hdr;
  2289. struct asm_stream_cmd_set_encdec_param encdec;
  2290. struct asm_enc_cfg_blk_param_v2 encblk;
  2291. u32 bit_rate;
  2292. /* Encoding rate in bits per second. */
  2293. u32 enc_mode;
  2294. /* Encoding mode.
  2295. * Supported values:
  2296. * - #ASM_MEDIA_FMT_AAC_AOT_LC
  2297. * - #ASM_MEDIA_FMT_AAC_AOT_SBR
  2298. * - #ASM_MEDIA_FMT_AAC_AOT_PS
  2299. */
  2300. u16 aac_fmt_flag;
  2301. /* AAC format flag.
  2302. * Supported values:
  2303. * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
  2304. * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
  2305. */
  2306. u16 channel_cfg;
  2307. /* Number of channels to encode.
  2308. * Supported values:
  2309. * - 0 -- Native mode
  2310. * - 1 -- Mono
  2311. * - 2 -- Stereo
  2312. * - Other values are not supported.
  2313. * @note1hang The eAAC+ encoder mode supports only stereo.
  2314. * Native mode indicates that encoding must be performed with the
  2315. * number of channels at the input.
  2316. * The number of channels must not change during encoding.
  2317. */
  2318. u32 sample_rate;
  2319. /* Number of samples per second.
  2320. * Supported values: - 0 -- Native mode - For other values,
  2321. * Native mode indicates that encoding must be performed with the
  2322. * sampling rate at the input.
  2323. * The sampling rate must not change during encoding.
  2324. */
  2325. } __packed;
  2326. #define ASM_MEDIA_FMT_AMRNB_FS 0x00010BEB
  2327. /* Enumeration for 4.75 kbps AMR-NB Encoding mode. */
  2328. #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR475 0
  2329. /* Enumeration for 5.15 kbps AMR-NB Encoding mode. */
  2330. #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR515 1
  2331. /* Enumeration for 5.90 kbps AMR-NB Encoding mode. */
  2332. #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR59 2
  2333. /* Enumeration for 6.70 kbps AMR-NB Encoding mode. */
  2334. #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR67 3
  2335. /* Enumeration for 7.40 kbps AMR-NB Encoding mode. */
  2336. #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR74 4
  2337. /* Enumeration for 7.95 kbps AMR-NB Encoding mode. */
  2338. #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR795 5
  2339. /* Enumeration for 10.20 kbps AMR-NB Encoding mode. */
  2340. #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR102 6
  2341. /* Enumeration for 12.20 kbps AMR-NB Encoding mode. */
  2342. #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR122 7
  2343. /* Enumeration for AMR-NB Discontinuous Transmission mode off. */
  2344. #define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF 0
  2345. /* Enumeration for AMR-NB DTX mode VAD1. */
  2346. #define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1 1
  2347. /* Enumeration for AMR-NB DTX mode VAD2. */
  2348. #define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD2 2
  2349. /* Enumeration for AMR-NB DTX mode auto.
  2350. */
  2351. #define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_AUTO 3
  2352. struct asm_amrnb_enc_cfg {
  2353. struct apr_hdr hdr;
  2354. struct asm_stream_cmd_set_encdec_param encdec;
  2355. struct asm_enc_cfg_blk_param_v2 encblk;
  2356. u16 enc_mode;
  2357. /* AMR-NB encoding rate.
  2358. * Supported values:
  2359. * Use the ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_*
  2360. * macros
  2361. */
  2362. u16 dtx_mode;
  2363. /* Specifies whether DTX mode is disabled or enabled.
  2364. * Supported values:
  2365. * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF
  2366. * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1
  2367. */
  2368. } __packed;
  2369. #define ASM_MEDIA_FMT_AMRWB_FS 0x00010BEC
  2370. /* Enumeration for 6.6 kbps AMR-WB Encoding mode. */
  2371. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR66 0
  2372. /* Enumeration for 8.85 kbps AMR-WB Encoding mode. */
  2373. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR885 1
  2374. /* Enumeration for 12.65 kbps AMR-WB Encoding mode. */
  2375. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1265 2
  2376. /* Enumeration for 14.25 kbps AMR-WB Encoding mode. */
  2377. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1425 3
  2378. /* Enumeration for 15.85 kbps AMR-WB Encoding mode. */
  2379. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1585 4
  2380. /* Enumeration for 18.25 kbps AMR-WB Encoding mode. */
  2381. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1825 5
  2382. /* Enumeration for 19.85 kbps AMR-WB Encoding mode. */
  2383. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1985 6
  2384. /* Enumeration for 23.05 kbps AMR-WB Encoding mode. */
  2385. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2305 7
  2386. /* Enumeration for 23.85 kbps AMR-WB Encoding mode.
  2387. */
  2388. #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2385 8
  2389. struct asm_amrwb_enc_cfg {
  2390. struct apr_hdr hdr;
  2391. struct asm_stream_cmd_set_encdec_param encdec;
  2392. struct asm_enc_cfg_blk_param_v2 encblk;
  2393. u16 enc_mode;
  2394. /* AMR-WB encoding rate.
  2395. * Suupported values:
  2396. * Use the ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_*
  2397. * macros
  2398. */
  2399. u16 dtx_mode;
  2400. /* Specifies whether DTX mode is disabled or enabled.
  2401. * Supported values:
  2402. * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF
  2403. * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1
  2404. */
  2405. } __packed;
  2406. #define ASM_MEDIA_FMT_V13K_FS 0x00010BED
  2407. /* Enumeration for 14.4 kbps V13K Encoding mode. */
  2408. #define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 0
  2409. /* Enumeration for 12.2 kbps V13K Encoding mode. */
  2410. #define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220 1
  2411. /* Enumeration for 11.2 kbps V13K Encoding mode. */
  2412. #define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120 2
  2413. /* Enumeration for 9.0 kbps V13K Encoding mode. */
  2414. #define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90 3
  2415. /* Enumeration for 7.2 kbps V13K eEncoding mode. */
  2416. #define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720 4
  2417. /* Enumeration for 1/8 vocoder rate.*/
  2418. #define ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE 1
  2419. /* Enumeration for 1/4 vocoder rate. */
  2420. #define ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE 2
  2421. /* Enumeration for 1/2 vocoder rate. */
  2422. #define ASM_MEDIA_FMT_VOC_HALF_RATE 3
  2423. /* Enumeration for full vocoder rate.
  2424. */
  2425. #define ASM_MEDIA_FMT_VOC_FULL_RATE 4
  2426. struct asm_v13k_enc_cfg {
  2427. struct apr_hdr hdr;
  2428. struct asm_stream_cmd_set_encdec_param encdec;
  2429. struct asm_enc_cfg_blk_param_v2 encblk;
  2430. u16 max_rate;
  2431. /* Maximum allowed encoder frame rate.
  2432. * Supported values:
  2433. * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
  2434. * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
  2435. * - #ASM_MEDIA_FMT_VOC_HALF_RATE
  2436. * - #ASM_MEDIA_FMT_VOC_FULL_RATE
  2437. */
  2438. u16 min_rate;
  2439. /* Minimum allowed encoder frame rate.
  2440. * Supported values:
  2441. * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
  2442. * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
  2443. * - #ASM_MEDIA_FMT_VOC_HALF_RATE
  2444. * - #ASM_MEDIA_FMT_VOC_FULL_RATE
  2445. */
  2446. u16 reduced_rate_cmd;
  2447. /* Reduced rate command, used to change
  2448. * the average bitrate of the V13K
  2449. * vocoder.
  2450. * Supported values:
  2451. * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 (Default)
  2452. * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220
  2453. * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120
  2454. * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90
  2455. * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720
  2456. */
  2457. u16 rate_mod_cmd;
  2458. /* Rate modulation command. Default = 0.
  2459. *- If bit 0=1, rate control is enabled.
  2460. *- If bit 1=1, the maximum number of consecutive full rate
  2461. * frames is limited with numbers supplied in
  2462. * bits 2 to 10.
  2463. *- If bit 1=0, the minimum number of non-full rate frames
  2464. * in between two full rate frames is forced to
  2465. * the number supplied in bits 2 to 10. In both cases, if necessary,
  2466. * half rate is used to substitute full rate. - Bits 15 to 10 are
  2467. * reserved and must all be set to zero.
  2468. */
  2469. } __packed;
  2470. #define ASM_MEDIA_FMT_EVRC_FS 0x00010BEE
  2471. /* EVRC encoder configuration structure used in the
  2472. * #ASM_STREAM_CMD_OPEN_READ_V2 command.
  2473. */
  2474. struct asm_evrc_enc_cfg {
  2475. struct apr_hdr hdr;
  2476. struct asm_stream_cmd_set_encdec_param encdec;
  2477. struct asm_enc_cfg_blk_param_v2 encblk;
  2478. u16 max_rate;
  2479. /* Maximum allowed encoder frame rate.
  2480. * Supported values:
  2481. * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
  2482. * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
  2483. * - #ASM_MEDIA_FMT_VOC_HALF_RATE
  2484. * - #ASM_MEDIA_FMT_VOC_FULL_RATE
  2485. */
  2486. u16 min_rate;
  2487. /* Minimum allowed encoder frame rate.
  2488. * Supported values:
  2489. * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
  2490. * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
  2491. * - #ASM_MEDIA_FMT_VOC_HALF_RATE
  2492. * - #ASM_MEDIA_FMT_VOC_FULL_RATE
  2493. */
  2494. u16 rate_mod_cmd;
  2495. /* Rate modulation command. Default: 0.
  2496. * - If bit 0=1, rate control is enabled.
  2497. * - If bit 1=1, the maximum number of consecutive full rate frames
  2498. * is limited with numbers supplied in bits 2 to 10.
  2499. *
  2500. * - If bit 1=0, the minimum number of non-full rate frames in
  2501. * between two full rate frames is forced to the number supplied in
  2502. * bits 2 to 10. In both cases, if necessary, half rate is used to
  2503. * substitute full rate.
  2504. *
  2505. * - Bits 15 to 10 are reserved and must all be set to zero.
  2506. */
  2507. u16 reserved;
  2508. /* Reserved. Clients must set this field to zero. */
  2509. } __packed;
  2510. #define ASM_MEDIA_FMT_WMA_V10PRO_V2 0x00010DA7
  2511. struct asm_wmaprov10_fmt_blk_v2 {
  2512. struct apr_hdr hdr;
  2513. struct asm_data_cmd_media_fmt_update_v2 fmtblk;
  2514. u16 fmtag;
  2515. /* WMA format type.
  2516. * Supported values:
  2517. * - 0x162 -- WMA 9 Pro
  2518. * - 0x163 -- WMA 9 Pro Lossless
  2519. * - 0x166 -- WMA 10 Pro
  2520. * - 0x167 -- WMA 10 Pro Lossless
  2521. */
  2522. u16 num_channels;
  2523. /* Number of channels encoded in the input stream.
  2524. * Supported values: 1 to 8
  2525. */
  2526. u32 sample_rate;
  2527. /* Number of samples per second (in Hertz).
  2528. * Supported values: 11025, 16000, 22050, 32000, 44100, 48000,
  2529. * 88200, 96000
  2530. */
  2531. u32 avg_bytes_per_sec;
  2532. /* Bitrate expressed as the average bytes per second.
  2533. * Supported values: 2000 to 96000
  2534. */
  2535. u16 blk_align;
  2536. /* Size of the bitstream packet size in bytes. WMA Pro files
  2537. * have a payload of one block per bitstream packet.
  2538. * Supported values: @le 13376
  2539. */
  2540. u16 bits_per_sample;
  2541. /* Number of bits per sample in the encoded WMA stream.
  2542. * Supported values: 16, 24
  2543. */
  2544. u32 channel_mask;
  2545. /* Bit-packed double word (32-bits) that indicates the
  2546. * recommended speaker positions for each source channel.
  2547. */
  2548. u16 enc_options;
  2549. /* Bit-packed word with values that indicate whether certain
  2550. * features of the bitstream are used.
  2551. * Supported values: - 0x0001 -- ENCOPT3_PURE_LOSSLESS - 0x0006 --
  2552. * ENCOPT3_FRM_SIZE_MOD - 0x0038 -- ENCOPT3_SUBFRM_DIV - 0x0040 --
  2553. * ENCOPT3_WRITE_FRAMESIZE_IN_HDR - 0x0080 --
  2554. * ENCOPT3_GENERATE_DRC_PARAMS - 0x0100 -- ENCOPT3_RTMBITS
  2555. */
  2556. u16 usAdvancedEncodeOpt;
  2557. /* Advanced encoding option. */
  2558. u32 advanced_enc_options2;
  2559. /* Advanced encoding option 2. */
  2560. } __packed;
  2561. #define ASM_MEDIA_FMT_WMA_V9_V2 0x00010DA8
  2562. struct asm_wmastdv9_fmt_blk_v2 {
  2563. struct apr_hdr hdr;
  2564. struct asm_data_cmd_media_fmt_update_v2 fmtblk;
  2565. u16 fmtag;
  2566. /* WMA format tag.
  2567. * Supported values: 0x161 (WMA 9 standard)
  2568. */
  2569. u16 num_channels;
  2570. /* Number of channels in the stream.
  2571. * Supported values: 1, 2
  2572. */
  2573. u32 sample_rate;
  2574. /* Number of samples per second (in Hertz).
  2575. * Supported values: 48000
  2576. */
  2577. u32 avg_bytes_per_sec;
  2578. /* Bitrate expressed as the average bytes per second. */
  2579. u16 blk_align;
  2580. /* Block align. All WMA files with a maximum packet size of
  2581. * 13376 are supported.
  2582. */
  2583. u16 bits_per_sample;
  2584. /* Number of bits per sample in the output.
  2585. * Supported values: 16
  2586. */
  2587. u32 channel_mask;
  2588. /* Channel mask.
  2589. * Supported values:
  2590. * - 3 -- Stereo (front left/front right)
  2591. * - 4 -- Mono (center)
  2592. */
  2593. u16 enc_options;
  2594. /* Options used during encoding. */
  2595. u16 reserved;
  2596. } __packed;
  2597. #define ASM_MEDIA_FMT_WMA_V8 0x00010D91
  2598. struct asm_wmastdv8_enc_cfg {
  2599. struct apr_hdr hdr;
  2600. struct asm_stream_cmd_set_encdec_param encdec;
  2601. struct asm_enc_cfg_blk_param_v2 encblk;
  2602. u32 bit_rate;
  2603. /* Encoding rate in bits per second. */
  2604. u32 sample_rate;
  2605. /* Number of samples per second.
  2606. *
  2607. * Supported values:
  2608. * - 0 -- Native mode
  2609. * - Other Supported values are 22050, 32000, 44100, and 48000.
  2610. *
  2611. * Native mode indicates that encoding must be performed with the
  2612. * sampling rate at the input.
  2613. * The sampling rate must not change during encoding.
  2614. */
  2615. u16 channel_cfg;
  2616. /* Number of channels to encode.
  2617. * Supported values:
  2618. * - 0 -- Native mode
  2619. * - 1 -- Mono
  2620. * - 2 -- Stereo
  2621. * - Other values are not supported.
  2622. *
  2623. * Native mode indicates that encoding must be performed with the
  2624. * number of channels at the input.
  2625. * The number of channels must not change during encoding.
  2626. */
  2627. u16 reserved;
  2628. /* Reserved. Clients must set this field to zero.*/
  2629. } __packed;
  2630. #define ASM_MEDIA_FMT_AMR_WB_PLUS_V2 0x00010DA9
  2631. struct asm_amrwbplus_fmt_blk_v2 {
  2632. struct apr_hdr hdr;
  2633. struct asm_data_cmd_media_fmt_update_v2 fmtblk;
  2634. u32 amr_frame_fmt;
  2635. /* AMR frame format.
  2636. * Supported values:
  2637. * - 6 -- Transport Interface Format (TIF)
  2638. * - Any other value -- File storage format (FSF)
  2639. *
  2640. * TIF stream contains 2-byte header for each frame within the
  2641. * superframe. FSF stream contains one 2-byte header per superframe.
  2642. */
  2643. } __packed;
  2644. #define ASM_MEDIA_FMT_AC3_DEC 0x00010BF6
  2645. #define ASM_MEDIA_FMT_EAC3_DEC 0x00010C3C
  2646. #define ASM_MEDIA_FMT_DTS 0x00010D88
  2647. /* Media format ID for adaptive transform acoustic coding. This
  2648. * ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED command
  2649. * only.
  2650. */
  2651. #define ASM_MEDIA_FMT_ATRAC 0x00010D89
  2652. /* Media format ID for metadata-enhanced audio transmission.
  2653. * This ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED
  2654. * command only.
  2655. */
  2656. #define ASM_MEDIA_FMT_MAT 0x00010D8A
  2657. /* adsp_media_fmt.h */
  2658. #define ASM_DATA_CMD_WRITE_V2 0x00010DAB
  2659. struct asm_data_cmd_write_v2 {
  2660. struct apr_hdr hdr;
  2661. u32 buf_addr_lsw;
  2662. /* The 64 bit address msw-lsw should be a valid, mapped address.
  2663. * 64 bit address should be a multiple of 32 bytes
  2664. */
  2665. u32 buf_addr_msw;
  2666. /* The 64 bit address msw-lsw should be a valid, mapped address.
  2667. * 64 bit address should be a multiple of 32 bytes.
  2668. * -Address of the buffer containing the data to be decoded.
  2669. * The buffer should be aligned to a 32 byte boundary.
  2670. * -In the case of 32 bit Shared memory address, msw field must
  2671. * -be set to zero.
  2672. * -In the case of 36 bit shared memory address, bit 31 to bit 4
  2673. * -of msw must be set to zero.
  2674. */
  2675. u32 mem_map_handle;
  2676. /* memory map handle returned by DSP through
  2677. * ASM_CMD_SHARED_MEM_MAP_REGIONS command
  2678. */
  2679. u32 buf_size;
  2680. /* Number of valid bytes available in the buffer for decoding. The
  2681. * first byte starts at buf_addr.
  2682. */
  2683. u32 seq_id;
  2684. /* Optional buffer sequence ID. */
  2685. u32 timestamp_lsw;
  2686. /* Lower 32 bits of the 64-bit session time in microseconds of the
  2687. * first buffer sample.
  2688. */
  2689. u32 timestamp_msw;
  2690. /* Upper 32 bits of the 64-bit session time in microseconds of the
  2691. * first buffer sample.
  2692. */
  2693. u32 flags;
  2694. /* Bitfield of flags.
  2695. * Supported values for bit 31:
  2696. * - 1 -- Valid timestamp.
  2697. * - 0 -- Invalid timestamp.
  2698. * - Use #ASM_BIT_MASKIMESTAMP_VALID_FLAG as the bitmask and
  2699. * #ASM_SHIFTIMESTAMP_VALID_FLAG as the shift value to set this bit.
  2700. * Supported values for bit 30:
  2701. * - 1 -- Last buffer.
  2702. * - 0 -- Not the last buffer.
  2703. *
  2704. * Supported values for bit 29:
  2705. * - 1 -- Continue the timestamp from the previous buffer.
  2706. * - 0 -- Timestamp of the current buffer is not related
  2707. * to the timestamp of the previous buffer.
  2708. * - Use #ASM_BIT_MASKS_CONTINUE_FLAG and #ASM_SHIFTS_CONTINUE_FLAG
  2709. * to set this bit.
  2710. *
  2711. * Supported values for bit 4:
  2712. * - 1 -- End of the frame.
  2713. * - 0 -- Not the end of frame, or this information is not known.
  2714. * - Use #ASM_BIT_MASK_EOF_FLAG as the bitmask and #ASM_SHIFT_EOF_FLAG
  2715. * as the shift value to set this bit.
  2716. *
  2717. * All other bits are reserved and must be set to 0.
  2718. *
  2719. * If bit 31=0 and bit 29=1: The timestamp of the first sample in
  2720. * this buffer continues from the timestamp of the last sample in
  2721. * the previous buffer. If there is no previous buffer (i.e., this
  2722. * is the first buffer sent after opening the stream or after a
  2723. * flush operation), or if the previous buffer does not have a valid
  2724. * timestamp, the samples in the current buffer also do not have a
  2725. * valid timestamp. They are played out as soon as possible.
  2726. *
  2727. *
  2728. * If bit 31=0 and bit 29=0: No timestamp is associated with the
  2729. * first sample in this buffer. The samples are played out as soon
  2730. * as possible.
  2731. *
  2732. *
  2733. * If bit 31=1 and bit 29 is ignored: The timestamp specified in
  2734. * this payload is honored.
  2735. *
  2736. *
  2737. * If bit 30=0: Not the last buffer in the stream. This is useful
  2738. * in removing trailing samples.
  2739. *
  2740. *
  2741. * For bit 4: The client can set this flag for every buffer sent in
  2742. * which the last byte is the end of a frame. If this flag is set,
  2743. * the buffer can contain data from multiple frames, but it should
  2744. * always end at a frame boundary. Restrictions allow the aDSP to
  2745. * detect an end of frame without requiring additional processing.
  2746. */
  2747. } __packed;
  2748. #define ASM_DATA_CMD_READ_V2 0x00010DAC
  2749. struct asm_data_cmd_read_v2 {
  2750. struct apr_hdr hdr;
  2751. u32 buf_addr_lsw;
  2752. /* the 64 bit address msw-lsw should be a valid mapped address
  2753. * and should be a multiple of 32 bytes
  2754. */
  2755. u32 buf_addr_msw;
  2756. /* the 64 bit address msw-lsw should be a valid mapped address
  2757. * and should be a multiple of 32 bytes.
  2758. * - Address of the buffer where the DSP puts the encoded data,
  2759. * potentially, at an offset specified by the uOffset field in
  2760. * ASM_DATA_EVENT_READ_DONE structure. The buffer should be aligned
  2761. * to a 32 byte boundary.
  2762. *- In the case of 32 bit Shared memory address, msw field must
  2763. *- be set to zero.
  2764. *- In the case of 36 bit shared memory address, bit 31 to bit
  2765. *- 4 of msw must be set to zero.
  2766. */
  2767. u32 mem_map_handle;
  2768. /* memory map handle returned by DSP through
  2769. * ASM_CMD_SHARED_MEM_MAP_REGIONS command.
  2770. */
  2771. u32 buf_size;
  2772. /* Number of bytes available for the aDSP to write. The aDSP
  2773. * starts writing from buf_addr.
  2774. */
  2775. u32 seq_id;
  2776. /* Optional buffer sequence ID.
  2777. */
  2778. } __packed;
  2779. #define ASM_DATA_CMD_EOS 0x00010BDB
  2780. #define ASM_DATA_EVENT_RENDERED_EOS 0x00010C1C
  2781. #define ASM_DATA_EVENT_EOS 0x00010BDD
  2782. #define ASM_DATA_EVENT_WRITE_DONE_V2 0x00010D99
  2783. struct asm_data_event_write_done_v2 {
  2784. u32 buf_addr_lsw;
  2785. /* lsw of the 64 bit address */
  2786. u32 buf_addr_msw;
  2787. /* msw of the 64 bit address. address given by the client in
  2788. * ASM_DATA_CMD_WRITE_V2 command.
  2789. */
  2790. u32 mem_map_handle;
  2791. /* memory map handle in the ASM_DATA_CMD_WRITE_V2 */
  2792. u32 status;
  2793. /* Status message (error code) that indicates whether the
  2794. * referenced buffer has been successfully consumed.
  2795. * Supported values: Refer to @xhyperref{Q3,[Q3]}
  2796. */
  2797. } __packed;
  2798. #define ASM_DATA_EVENT_READ_DONE_V2 0x00010D9A
  2799. /* Definition of the frame metadata flag bitmask.*/
  2800. #define ASM_BIT_MASK_FRAME_METADATA_FLAG (0x40000000UL)
  2801. /* Definition of the frame metadata flag shift value. */
  2802. #define ASM_SHIFT_FRAME_METADATA_FLAG 30
  2803. struct asm_data_event_read_done_v2 {
  2804. u32 status;
  2805. /* Status message (error code).
  2806. * Supported values: Refer to @xhyperref{Q3,[Q3]}
  2807. */
  2808. u32 buf_addr_lsw;
  2809. /* 64 bit address msw-lsw is a valid, mapped address. 64 bit
  2810. * address is a multiple of 32 bytes.
  2811. */
  2812. u32 buf_addr_msw;
  2813. /* 64 bit address msw-lsw is a valid, mapped address. 64 bit
  2814. * address is a multiple of 32 bytes.
  2815. *
  2816. * -Same address provided by the client in ASM_DATA_CMD_READ_V2
  2817. * -In the case of 32 bit Shared memory address, msw field is set to
  2818. * zero.
  2819. * -In the case of 36 bit shared memory address, bit 31 to bit 4
  2820. * -of msw is set to zero.
  2821. */
  2822. u32 mem_map_handle;
  2823. /* memory map handle in the ASM_DATA_CMD_READ_V2 */
  2824. u32 enc_framesotal_size;
  2825. /* Total size of the encoded frames in bytes.
  2826. * Supported values: >0
  2827. */
  2828. u32 offset;
  2829. /* Offset (from buf_addr) to the first byte of the first encoded
  2830. * frame. All encoded frames are consecutive, starting from this
  2831. * offset.
  2832. * Supported values: > 0
  2833. */
  2834. u32 timestamp_lsw;
  2835. /* Lower 32 bits of the 64-bit session time in microseconds of
  2836. * the first sample in the buffer. If Bit 5 of mode_flags flag of
  2837. * ASM_STREAM_CMD_OPEN_READ_V2 is 1 then the 64 bit timestamp is
  2838. * absolute capture time otherwise it is relative session time. The
  2839. * absolute timestamp doesnt reset unless the system is reset.
  2840. */
  2841. u32 timestamp_msw;
  2842. /* Upper 32 bits of the 64-bit session time in microseconds of
  2843. * the first sample in the buffer.
  2844. */
  2845. u32 flags;
  2846. /* Bitfield of flags. Bit 30 indicates whether frame metadata is
  2847. * present. If frame metadata is present, num_frames consecutive
  2848. * instances of @xhyperref{hdr:FrameMetaData,Frame metadata} start
  2849. * at the buffer address.
  2850. * Supported values for bit 31:
  2851. * - 1 -- Timestamp is valid.
  2852. * - 0 -- Timestamp is invalid.
  2853. * - Use #ASM_BIT_MASKIMESTAMP_VALID_FLAG and
  2854. * #ASM_SHIFTIMESTAMP_VALID_FLAG to set this bit.
  2855. *
  2856. * Supported values for bit 30:
  2857. * - 1 -- Frame metadata is present.
  2858. * - 0 -- Frame metadata is absent.
  2859. * - Use #ASM_BIT_MASK_FRAME_METADATA_FLAG and
  2860. * #ASM_SHIFT_FRAME_METADATA_FLAG to set this bit.
  2861. *
  2862. * All other bits are reserved; the aDSP sets them to 0.
  2863. */
  2864. u32 num_frames;
  2865. /* Number of encoded frames in the buffer. */
  2866. u32 seq_id;
  2867. /* Optional buffer sequence ID. */
  2868. } __packed;
  2869. struct asm_data_read_buf_metadata_v2 {
  2870. u32 offset;
  2871. /* Offset from buf_addr in #ASM_DATA_EVENT_READ_DONE_PAYLOAD to
  2872. * the frame associated with this metadata.
  2873. * Supported values: > 0
  2874. */
  2875. u32 frm_size;
  2876. /* Size of the encoded frame in bytes.
  2877. * Supported values: > 0
  2878. */
  2879. u32 num_encoded_pcm_samples;
  2880. /* Number of encoded PCM samples (per channel) in the frame
  2881. * associated with this metadata.
  2882. * Supported values: > 0
  2883. */
  2884. u32 timestamp_lsw;
  2885. /* Lower 32 bits of the 64-bit session time in microseconds of the
  2886. * first sample for this frame.
  2887. * If Bit 5 of mode_flags flag of ASM_STREAM_CMD_OPEN_READ_V2 is 1
  2888. * then the 64 bit timestamp is absolute capture time otherwise it
  2889. * is relative session time. The absolute timestamp doesnt reset
  2890. * unless the system is reset.
  2891. */
  2892. u32 timestamp_msw;
  2893. /* Lower 32 bits of the 64-bit session time in microseconds of the
  2894. * first sample for this frame.
  2895. */
  2896. u32 flags;
  2897. /* Frame flags.
  2898. * Supported values for bit 31:
  2899. * - 1 -- Time stamp is valid
  2900. * - 0 -- Time stamp is not valid
  2901. * - All other bits are reserved; the aDSP sets them to 0.
  2902. */
  2903. } __packed;
  2904. /* Notifies the client of a change in the data sampling rate or
  2905. * Channel mode. This event is raised by the decoder service. The
  2906. * event is enabled through the mode flags of
  2907. * #ASM_STREAM_CMD_OPEN_WRITE_V2 or
  2908. * #ASM_STREAM_CMD_OPEN_READWRITE_V2. - The decoder detects a change
  2909. * in the output sampling frequency or the number/positioning of
  2910. * output channels, or if it is the first frame decoded.The new
  2911. * sampling frequency or the new channel configuration is
  2912. * communicated back to the client asynchronously.
  2913. */
  2914. #define ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY 0x00010C65
  2915. /* Payload of the #ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY event.
  2916. * This event is raised when the following conditions are both true:
  2917. * - The event is enabled through the mode_flags of
  2918. * #ASM_STREAM_CMD_OPEN_WRITE_V2 or
  2919. * #ASM_STREAM_CMD_OPEN_READWRITE_V2. - The decoder detects a change
  2920. * in either the output sampling frequency or the number/positioning
  2921. * of output channels, or if it is the first frame decoded.
  2922. * This event is not raised (even if enabled) if the decoder is
  2923. * MIDI, because
  2924. */
  2925. struct asm_data_event_sr_cm_change_notify {
  2926. u32 sample_rate;
  2927. /* New sampling rate (in Hertz) after detecting a change in the
  2928. * bitstream.
  2929. * Supported values: 2000 to 48000
  2930. */
  2931. u16 num_channels;
  2932. /* New number of channels after detecting a change in the
  2933. * bitstream.
  2934. * Supported values: 1 to 8
  2935. */
  2936. u16 reserved;
  2937. /* Reserved for future use. This field must be set to 0.*/
  2938. u8 channel_mapping[8];
  2939. } __packed;
  2940. /* Notifies the client of a data sampling rate or channel mode
  2941. * change. This event is raised by the encoder service.
  2942. * This event is raised when :
  2943. * - Native mode encoding was requested in the encoder
  2944. * configuration (i.e., the channel number was 0), the sample rate
  2945. * was 0, or both were 0.
  2946. *
  2947. * - The input data frame at the encoder is the first one, or the
  2948. * sampling rate/channel mode is different from the previous input
  2949. * data frame.
  2950. *
  2951. */
  2952. #define ASM_DATA_EVENT_ENC_SR_CM_CHANGE_NOTIFY 0x00010BDE
  2953. struct asm_data_event_enc_sr_cm_change_notify {
  2954. u32 sample_rate;
  2955. /* New sampling rate (in Hertz) after detecting a change in the
  2956. * input data.
  2957. * Supported values: 2000 to 48000
  2958. */
  2959. u16 num_channels;
  2960. /* New number of channels after detecting a change in the input
  2961. * data. Supported values: 1 to 8
  2962. */
  2963. u16 bits_per_sample;
  2964. /* New bits per sample after detecting a change in the input
  2965. * data.
  2966. * Supported values: 16, 24
  2967. */
  2968. u8 channel_mapping[8];
  2969. } __packed;
  2970. #define ASM_DATA_CMD_IEC_60958_FRAME_RATE 0x00010D87
  2971. /* Payload of the #ASM_DATA_CMD_IEC_60958_FRAME_RATE command,
  2972. * which is used to indicate the IEC 60958 frame rate of a given
  2973. * packetized audio stream.
  2974. */
  2975. struct asm_data_cmd_iec_60958_frame_rate {
  2976. u32 frame_rate;
  2977. /* IEC 60958 frame rate of the incoming IEC 61937 packetized stream.
  2978. * Supported values: Any valid frame rate
  2979. */
  2980. } __packed;
  2981. /* adsp_asm_data_commands.h*/
  2982. #define ASM_SVC_CMD_GET_STREAM_HANDLES 0x00010C0B
  2983. #define ASM_SVC_CMDRSP_GET_STREAM_HANDLES 0x00010C1B
  2984. /* Definition of the stream ID bitmask.*/
  2985. #define ASM_BIT_MASK_STREAM_ID (0x000000FFUL)
  2986. /* Definition of the stream ID shift value.*/
  2987. #define ASM_SHIFT_STREAM_ID 0
  2988. /* Definition of the session ID bitmask.*/
  2989. #define ASM_BIT_MASK_SESSION_ID (0x0000FF00UL)
  2990. /* Definition of the session ID shift value.*/
  2991. #define ASM_SHIFT_SESSION_ID 8
  2992. /* Definition of the service ID bitmask.*/
  2993. #define ASM_BIT_MASK_SERVICE_ID (0x00FF0000UL)
  2994. /* Definition of the service ID shift value.*/
  2995. #define ASM_SHIFT_SERVICE_ID 16
  2996. /* Definition of the domain ID bitmask.*/
  2997. #define ASM_BIT_MASK_DOMAIN_ID (0xFF000000UL)
  2998. /* Definition of the domain ID shift value.*/
  2999. #define ASM_SHIFT_DOMAIN_ID 24
  3000. /* Payload of the #ASM_SVC_CMDRSP_GET_STREAM_HANDLES message,
  3001. * which returns a list of currently active stream handles.
  3002. * Immediately following this structure are num_handles of uint32
  3003. * stream handles.
  3004. */
  3005. struct asm_svc_cmdrsp_get_stream_handles {
  3006. u32 num_handles;
  3007. /* Number of active stream handles. */
  3008. } __packed;
  3009. #define ASM_CMD_SHARED_MEM_MAP_REGIONS 0x00010D92
  3010. #define ASM_CMDRSP_SHARED_MEM_MAP_REGIONS 0x00010D93
  3011. #define ASM_CMD_SHARED_MEM_UNMAP_REGIONS 0x00010D94
  3012. /* adsp_asm_service_commands.h */
  3013. #define ASM_MAX_SESSION_ID (8)
  3014. /* Maximum number of sessions.*/
  3015. #define ASM_MAX_NUM_SESSIONS ASM_MAX_SESSION_ID
  3016. /* Maximum number of streams per session.*/
  3017. #define ASM_MAX_STREAMS_PER_SESSION (8)
  3018. #define ASM_SESSION_CMD_RUN_V2 0x00010DAA
  3019. #define ASM_SESSION_CMD_RUN_STARTIME_RUN_IMMEDIATE 0
  3020. #define ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_ABSOLUTEIME 1
  3021. #define ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_RELATIVEIME 2
  3022. #define ASM_SESSION_CMD_RUN_STARTIME_RUN_WITH_DELAY 3
  3023. #define ASM_BIT_MASK_RUN_STARTIME (0x00000003UL)
  3024. /* Bit shift value used to specify the start time for the
  3025. * ASM_SESSION_CMD_RUN_V2 command.
  3026. */
  3027. #define ASM_SHIFT_RUN_STARTIME 0
  3028. struct asm_session_cmd_run_v2 {
  3029. struct apr_hdr hdr;
  3030. u32 flags;
  3031. /* Specifies whether to run immediately or at a specific
  3032. * rendering time or with a specified delay. Run with delay is
  3033. * useful for delaying in case of ASM loopback opened through
  3034. * ASM_STREAM_CMD_OPEN_LOOPBACK_V2. Use #ASM_BIT_MASK_RUN_STARTIME
  3035. * and #ASM_SHIFT_RUN_STARTIME to set this 2-bit flag.
  3036. *
  3037. *
  3038. *Bits 0 and 1 can take one of four possible values:
  3039. *
  3040. *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_IMMEDIATE
  3041. *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_ABSOLUTEIME
  3042. *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_RELATIVEIME
  3043. *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_WITH_DELAY
  3044. *
  3045. *All other bits are reserved; clients must set them to zero.
  3046. */
  3047. u32 time_lsw;
  3048. /* Lower 32 bits of the time in microseconds used to align the
  3049. * session origin time. When bits 0-1 of flags is
  3050. * ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, time lsw is the lsw of
  3051. * the delay in us. For ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY,
  3052. * maximum value of the 64 bit delay is 150 ms.
  3053. */
  3054. u32 time_msw;
  3055. /* Upper 32 bits of the time in microseconds used to align the
  3056. * session origin time. When bits 0-1 of flags is
  3057. * ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, time msw is the msw of
  3058. * the delay in us. For ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY,
  3059. * maximum value of the 64 bit delay is 150 ms.
  3060. */
  3061. } __packed;
  3062. #define ASM_SESSION_CMD_PAUSE 0x00010BD3
  3063. #define ASM_SESSION_CMD_SUSPEND 0x00010DEC
  3064. #define ASM_SESSION_CMD_GET_SESSIONTIME_V3 0x00010D9D
  3065. #define ASM_SESSION_CMD_REGISTER_FOR_RX_UNDERFLOW_EVENTS 0x00010BD5
  3066. struct asm_session_cmd_rgstr_rx_underflow {
  3067. struct apr_hdr hdr;
  3068. u16 enable_flag;
  3069. /* Specifies whether a client is to receive events when an Rx
  3070. * session underflows.
  3071. * Supported values:
  3072. * - 0 -- Do not send underflow events
  3073. * - 1 -- Send underflow events
  3074. */
  3075. u16 reserved;
  3076. /* Reserved. This field must be set to zero.*/
  3077. } __packed;
  3078. #define ASM_SESSION_CMD_REGISTER_FORX_OVERFLOW_EVENTS 0x00010BD6
  3079. struct asm_session_cmd_regx_overflow {
  3080. struct apr_hdr hdr;
  3081. u16 enable_flag;
  3082. /* Specifies whether a client is to receive events when a Tx
  3083. * session overflows.
  3084. * Supported values:
  3085. * - 0 -- Do not send overflow events
  3086. * - 1 -- Send overflow events
  3087. */
  3088. u16 reserved;
  3089. /* Reserved. This field must be set to zero.*/
  3090. } __packed;
  3091. #define ASM_SESSION_EVENT_RX_UNDERFLOW 0x00010C17
  3092. #define ASM_SESSION_EVENTX_OVERFLOW 0x00010C18
  3093. #define ASM_SESSION_CMDRSP_GET_SESSIONTIME_V3 0x00010D9E
  3094. struct asm_session_cmdrsp_get_sessiontime_v3 {
  3095. u32 status;
  3096. /* Status message (error code).
  3097. * Supported values: Refer to @xhyperref{Q3,[Q3]}
  3098. */
  3099. u32 sessiontime_lsw;
  3100. /* Lower 32 bits of the current session time in microseconds.*/
  3101. u32 sessiontime_msw;
  3102. /* Upper 32 bits of the current session time in microseconds.*/
  3103. u32 absolutetime_lsw;
  3104. /* Lower 32 bits in micro seconds of the absolute time at which
  3105. * the * sample corresponding to the above session time gets
  3106. * rendered * to hardware. This absolute time may be slightly in the
  3107. * future or past.
  3108. */
  3109. u32 absolutetime_msw;
  3110. /* Upper 32 bits in micro seconds of the absolute time at which
  3111. * the * sample corresponding to the above session time gets
  3112. * rendered to * hardware. This absolute time may be slightly in the
  3113. * future or past.
  3114. */
  3115. } __packed;
  3116. #define ASM_SESSION_CMD_ADJUST_SESSION_CLOCK_V2 0x00010D9F
  3117. struct asm_session_cmd_adjust_session_clock_v2 {
  3118. struct apr_hdr hdr;
  3119. u32 adjustime_lsw;
  3120. /* Lower 32 bits of the signed 64-bit quantity that specifies the
  3121. * adjustment time in microseconds to the session clock.
  3122. *
  3123. * Positive values indicate advancement of the session clock.
  3124. * Negative values indicate delay of the session clock.
  3125. */
  3126. u32 adjustime_msw;
  3127. /* Upper 32 bits of the signed 64-bit quantity that specifies
  3128. * the adjustment time in microseconds to the session clock.
  3129. * Positive values indicate advancement of the session clock.
  3130. * Negative values indicate delay of the session clock.
  3131. */
  3132. } __packed;
  3133. #define ASM_SESSION_CMDRSP_ADJUST_SESSION_CLOCK_V2 0x00010DA0
  3134. struct asm_session_cmdrsp_adjust_session_clock_v2 {
  3135. u32 status;
  3136. /* Status message (error code).
  3137. * Supported values: Refer to @xhyperref{Q3,[Q3]}
  3138. * An error means the session clock is not adjusted. In this case,
  3139. * the next two fields are irrelevant.
  3140. */
  3141. u32 actual_adjustime_lsw;
  3142. /* Lower 32 bits of the signed 64-bit quantity that specifies
  3143. * the actual adjustment in microseconds performed by the aDSP.
  3144. * A positive value indicates advancement of the session clock. A
  3145. * negative value indicates delay of the session clock.
  3146. */
  3147. u32 actual_adjustime_msw;
  3148. /* Upper 32 bits of the signed 64-bit quantity that specifies
  3149. * the actual adjustment in microseconds performed by the aDSP.
  3150. * A positive value indicates advancement of the session clock. A
  3151. * negative value indicates delay of the session clock.
  3152. */
  3153. u32 cmd_latency_lsw;
  3154. /* Lower 32 bits of the unsigned 64-bit quantity that specifies
  3155. * the amount of time in microseconds taken to perform the session
  3156. * clock adjustment.
  3157. */
  3158. u32 cmd_latency_msw;
  3159. /* Upper 32 bits of the unsigned 64-bit quantity that specifies
  3160. * the amount of time in microseconds taken to perform the session
  3161. * clock adjustment.
  3162. */
  3163. } __packed;
  3164. #define ASM_SESSION_CMD_GET_PATH_DELAY_V2 0x00010DAF
  3165. #define ASM_SESSION_CMDRSP_GET_PATH_DELAY_V2 0x00010DB0
  3166. struct asm_session_cmdrsp_get_path_delay_v2 {
  3167. u32 status;
  3168. /* Status message (error code). Whether this get delay operation
  3169. * is successful or not. Delay value is valid only if status is
  3170. * success.
  3171. * Supported values: Refer to @xhyperref{Q5,[Q5]}
  3172. */
  3173. u32 audio_delay_lsw;
  3174. /* Upper 32 bits of the aDSP delay in microseconds. */
  3175. u32 audio_delay_msw;
  3176. /* Lower 32 bits of the aDSP delay in microseconds. */
  3177. } __packed;
  3178. /* adsp_asm_session_command.h*/
  3179. #define ASM_STREAM_CMD_OPEN_WRITE_V2 0x00010D8F
  3180. #define ASM_STREAM_CMD_OPEN_WRITE_V3 0x00010DB3
  3181. #define ASM_LOW_LATENCY_STREAM_SESSION 0x10000000
  3182. #define ASM_ULTRA_LOW_LATENCY_STREAM_SESSION 0x20000000
  3183. #define ASM_LEGACY_STREAM_SESSION 0
  3184. struct asm_stream_cmd_open_write_v3 {
  3185. struct apr_hdr hdr;
  3186. uint32_t mode_flags;
  3187. /* Mode flags that configure the stream to notify the client
  3188. * whenever it detects an SR/CM change at the input to its POPP.
  3189. * Supported values for bits 0 to 1:
  3190. * - Reserved; clients must set them to zero.
  3191. * Supported values for bit 2:
  3192. * - 0 -- SR/CM change notification event is disabled.
  3193. * - 1 -- SR/CM change notification event is enabled.
  3194. * - Use #ASM_BIT_MASK_SR_CM_CHANGE_NOTIFY_FLAG and
  3195. * #ASM_SHIFT_SR_CM_CHANGE_NOTIFY_FLAG to set or get this bit.
  3196. *
  3197. * Supported values for bit 31:
  3198. * - 0 -- Stream to be opened in on-Gapless mode.
  3199. * - 1 -- Stream to be opened in Gapless mode. In Gapless mode,
  3200. * successive streams must be opened with same session ID but
  3201. * different stream IDs.
  3202. *
  3203. * - Use #ASM_BIT_MASK_GAPLESS_MODE_FLAG and
  3204. * #ASM_SHIFT_GAPLESS_MODE_FLAG to set or get this bit.
  3205. *
  3206. *
  3207. * @note1hang MIDI and DTMF streams cannot be opened in Gapless mode.
  3208. */
  3209. uint16_t sink_endpointype;
  3210. /*< Sink point type.
  3211. * Supported values:
  3212. * - 0 -- Device matrix
  3213. * - Other values are reserved.
  3214. *
  3215. * The device matrix is the gateway to the hardware ports.
  3216. */
  3217. uint16_t bits_per_sample;
  3218. /*< Number of bits per sample processed by ASM modules.
  3219. * Supported values: 16 and 24 bits per sample
  3220. */
  3221. uint32_t postprocopo_id;
  3222. /*< Specifies the topology (order of processing) of
  3223. * postprocessing algorithms. <i>None</i> means no postprocessing.
  3224. * Supported values:
  3225. * - #ASM_STREAM_POSTPROCOPO_ID_DEFAULT
  3226. * - #ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL
  3227. * - #ASM_STREAM_POSTPROCOPO_ID_NONE
  3228. *
  3229. * This field can also be enabled through SetParams flags.
  3230. */
  3231. uint32_t dec_fmt_id;
  3232. /*< Configuration ID of the decoder media format.
  3233. *
  3234. * Supported values:
  3235. * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
  3236. * - #ASM_MEDIA_FMT_ADPCM
  3237. * - #ASM_MEDIA_FMT_MP3
  3238. * - #ASM_MEDIA_FMT_AAC_V2
  3239. * - #ASM_MEDIA_FMT_DOLBY_AAC
  3240. * - #ASM_MEDIA_FMT_AMRNB_FS
  3241. * - #ASM_MEDIA_FMT_AMRWB_FS
  3242. * - #ASM_MEDIA_FMT_AMR_WB_PLUS_V2
  3243. * - #ASM_MEDIA_FMT_V13K_FS
  3244. * - #ASM_MEDIA_FMT_EVRC_FS
  3245. * - #ASM_MEDIA_FMT_EVRCB_FS
  3246. * - #ASM_MEDIA_FMT_EVRCWB_FS
  3247. * - #ASM_MEDIA_FMT_SBC
  3248. * - #ASM_MEDIA_FMT_WMA_V10PRO_V2
  3249. * - #ASM_MEDIA_FMT_WMA_V9_V2
  3250. * - #ASM_MEDIA_FMT_AC3_DEC
  3251. * - #ASM_MEDIA_FMT_EAC3_DEC
  3252. * - #ASM_MEDIA_FMT_G711_ALAW_FS
  3253. * - #ASM_MEDIA_FMT_G711_MLAW_FS
  3254. * - #ASM_MEDIA_FMT_G729A_FS
  3255. * - #ASM_MEDIA_FMT_FR_FS
  3256. * - #ASM_MEDIA_FMT_VORBIS
  3257. * - #ASM_MEDIA_FMT_FLAC
  3258. * - #ASM_MEDIA_FMT_EXAMPLE
  3259. */
  3260. } __packed;
  3261. #define ASM_STREAM_CMD_OPEN_READ_V2 0x00010D8C
  3262. #define ASM_STREAM_CMD_OPEN_READ_V3 0x00010DB4
  3263. /* Definition of the timestamp type flag bitmask */
  3264. #define ASM_BIT_MASKIMESTAMPYPE_FLAG (0x00000020UL)
  3265. /* Definition of the timestamp type flag shift value. */
  3266. #define ASM_SHIFTIMESTAMPYPE_FLAG 5
  3267. /* Relative timestamp is identified by this value.*/
  3268. #define ASM_RELATIVEIMESTAMP 0
  3269. /* Absolute timestamp is identified by this value.*/
  3270. #define ASM_ABSOLUTEIMESTAMP 1
  3271. /* Bit value for Low Latency Tx stream subfield */
  3272. #define ASM_LOW_LATENCY_TX_STREAM_SESSION 1
  3273. /* Bit shift for the stream_perf_mode subfield. */
  3274. #define ASM_SHIFT_STREAM_PERF_MODE_FLAG_IN_OPEN_READ 29
  3275. struct asm_stream_cmd_open_read_v3 {
  3276. struct apr_hdr hdr;
  3277. u32 mode_flags;
  3278. /* Mode flags that indicate whether meta information per encoded
  3279. * frame is to be provided.
  3280. * Supported values for bit 4:
  3281. *
  3282. * - 0 -- Return data buffer contains all encoded frames only; it
  3283. * does not contain frame metadata.
  3284. *
  3285. * - 1 -- Return data buffer contains an array of metadata and
  3286. * encoded frames.
  3287. *
  3288. * - Use #ASM_BIT_MASK_META_INFO_FLAG as the bitmask and
  3289. * #ASM_SHIFT_META_INFO_FLAG as the shift value for this bit.
  3290. *
  3291. *
  3292. * Supported values for bit 5:
  3293. *
  3294. * - ASM_RELATIVEIMESTAMP -- ASM_DATA_EVENT_READ_DONE_V2 will have
  3295. * - relative time-stamp.
  3296. * - ASM_ABSOLUTEIMESTAMP -- ASM_DATA_EVENT_READ_DONE_V2 will
  3297. * - have absolute time-stamp.
  3298. *
  3299. * - Use #ASM_BIT_MASKIMESTAMPYPE_FLAG as the bitmask and
  3300. * #ASM_SHIFTIMESTAMPYPE_FLAG as the shift value for this bit.
  3301. *
  3302. * All other bits are reserved; clients must set them to zero.
  3303. */
  3304. u32 src_endpointype;
  3305. /* Specifies the endpoint providing the input samples.
  3306. * Supported values:
  3307. * - 0 -- Device matrix
  3308. * - All other values are reserved; clients must set them to zero.
  3309. * Otherwise, an error is returned.
  3310. * The device matrix is the gateway from the tunneled Tx ports.
  3311. */
  3312. u32 preprocopo_id;
  3313. /* Specifies the topology (order of processing) of preprocessing
  3314. * algorithms. <i>None</i> means no preprocessing.
  3315. * Supported values:
  3316. * - #ASM_STREAM_PREPROCOPO_ID_DEFAULT
  3317. * - #ASM_STREAM_PREPROCOPO_ID_NONE
  3318. *
  3319. * This field can also be enabled through SetParams flags.
  3320. */
  3321. u32 enc_cfg_id;
  3322. /* Media configuration ID for encoded output.
  3323. * Supported values:
  3324. * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
  3325. * - #ASM_MEDIA_FMT_AAC_V2
  3326. * - #ASM_MEDIA_FMT_AMRNB_FS
  3327. * - #ASM_MEDIA_FMT_AMRWB_FS
  3328. * - #ASM_MEDIA_FMT_V13K_FS
  3329. * - #ASM_MEDIA_FMT_EVRC_FS
  3330. * - #ASM_MEDIA_FMT_EVRCB_FS
  3331. * - #ASM_MEDIA_FMT_EVRCWB_FS
  3332. * - #ASM_MEDIA_FMT_SBC
  3333. * - #ASM_MEDIA_FMT_G711_ALAW_FS
  3334. * - #ASM_MEDIA_FMT_G711_MLAW_FS
  3335. * - #ASM_MEDIA_FMT_G729A_FS
  3336. * - #ASM_MEDIA_FMT_EXAMPLE
  3337. * - #ASM_MEDIA_FMT_WMA_V8
  3338. */
  3339. u16 bits_per_sample;
  3340. /* Number of bits per sample processed by ASM modules.
  3341. * Supported values: 16 and 24 bits per sample
  3342. */
  3343. u16 reserved;
  3344. /* Reserved for future use. This field must be set to zero.*/
  3345. } __packed;
  3346. #define ASM_POPP_OUTPUT_SR_NATIVE_RATE 0
  3347. /* Enumeration for the maximum sampling rate at the POPP output.*/
  3348. #define ASM_POPP_OUTPUT_SR_MAX_RATE 48000
  3349. #define ASM_STREAM_CMD_OPEN_READWRITE_V2 0x00010D8D
  3350. #define ASM_STREAM_CMD_OPEN_READWRITE_V2 0x00010D8D
  3351. #define ASM_STREAM_CMD_OPEN_READ_V2 0x00010D8C
  3352. struct asm_stream_cmd_open_readwrite_v2 {
  3353. struct apr_hdr hdr;
  3354. u32 mode_flags;
  3355. /* Mode flags.
  3356. * Supported values for bit 2:
  3357. * - 0 -- SR/CM change notification event is disabled.
  3358. * - 1 -- SR/CM change notification event is enabled. Use
  3359. * #ASM_BIT_MASK_SR_CM_CHANGE_NOTIFY_FLAG and
  3360. * #ASM_SHIFT_SR_CM_CHANGE_NOTIFY_FLAG to set or
  3361. * getting this flag.
  3362. *
  3363. * Supported values for bit 4:
  3364. * - 0 -- Return read data buffer contains all encoded frames only; it
  3365. * does not contain frame metadata.
  3366. * - 1 -- Return read data buffer contains an array of metadata and
  3367. * encoded frames.
  3368. *
  3369. * All other bits are reserved; clients must set them to zero.
  3370. */
  3371. u32 postprocopo_id;
  3372. /* Specifies the topology (order of processing) of postprocessing
  3373. * algorithms. <i>None</i> means no postprocessing.
  3374. *
  3375. * Supported values:
  3376. * - #ASM_STREAM_POSTPROCOPO_ID_DEFAULT
  3377. * - #ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL
  3378. * - #ASM_STREAM_POSTPROCOPO_ID_NONE
  3379. */
  3380. u32 dec_fmt_id;
  3381. /* Specifies the media type of the input data. PCM indicates that
  3382. * no decoding must be performed, e.g., this is an NT encoder
  3383. * session.
  3384. * Supported values:
  3385. * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
  3386. * - #ASM_MEDIA_FMT_ADPCM
  3387. * - #ASM_MEDIA_FMT_MP3
  3388. * - #ASM_MEDIA_FMT_AAC_V2
  3389. * - #ASM_MEDIA_FMT_DOLBY_AAC
  3390. * - #ASM_MEDIA_FMT_AMRNB_FS
  3391. * - #ASM_MEDIA_FMT_AMRWB_FS
  3392. * - #ASM_MEDIA_FMT_V13K_FS
  3393. * - #ASM_MEDIA_FMT_EVRC_FS
  3394. * - #ASM_MEDIA_FMT_EVRCB_FS
  3395. * - #ASM_MEDIA_FMT_EVRCWB_FS
  3396. * - #ASM_MEDIA_FMT_SBC
  3397. * - #ASM_MEDIA_FMT_WMA_V10PRO_V2
  3398. * - #ASM_MEDIA_FMT_WMA_V9_V2
  3399. * - #ASM_MEDIA_FMT_AMR_WB_PLUS_V2
  3400. * - #ASM_MEDIA_FMT_AC3_DEC
  3401. * - #ASM_MEDIA_FMT_G711_ALAW_FS
  3402. * - #ASM_MEDIA_FMT_G711_MLAW_FS
  3403. * - #ASM_MEDIA_FMT_G729A_FS
  3404. * - #ASM_MEDIA_FMT_EXAMPLE
  3405. */
  3406. u32 enc_cfg_id;
  3407. /* Specifies the media type for the output of the stream. PCM
  3408. * indicates that no encoding must be performed, e.g., this is an NT
  3409. * decoder session.
  3410. * Supported values:
  3411. * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
  3412. * - #ASM_MEDIA_FMT_AAC_V2
  3413. * - #ASM_MEDIA_FMT_AMRNB_FS
  3414. * - #ASM_MEDIA_FMT_AMRWB_FS
  3415. * - #ASM_MEDIA_FMT_V13K_FS
  3416. * - #ASM_MEDIA_FMT_EVRC_FS
  3417. * - #ASM_MEDIA_FMT_EVRCB_FS
  3418. * - #ASM_MEDIA_FMT_EVRCWB_FS
  3419. * - #ASM_MEDIA_FMT_SBC
  3420. * - #ASM_MEDIA_FMT_G711_ALAW_FS
  3421. * - #ASM_MEDIA_FMT_G711_MLAW_FS
  3422. * - #ASM_MEDIA_FMT_G729A_FS
  3423. * - #ASM_MEDIA_FMT_EXAMPLE
  3424. * - #ASM_MEDIA_FMT_WMA_V8
  3425. */
  3426. u16 bits_per_sample;
  3427. /* Number of bits per sample processed by ASM modules.
  3428. * Supported values: 16 and 24 bits per sample
  3429. */
  3430. u16 reserved;
  3431. /* Reserved for future use. This field must be set to zero.*/
  3432. } __packed;
  3433. #define ASM_STREAM_CMD_OPEN_LOOPBACK_V2 0x00010D8E
  3434. struct asm_stream_cmd_open_loopback_v2 {
  3435. struct apr_hdr hdr;
  3436. u32 mode_flags;
  3437. /* Mode flags.
  3438. * Bit 0-31: reserved; client should set these bits to 0
  3439. */
  3440. u16 src_endpointype;
  3441. /* Endpoint type. 0 = Tx Matrix */
  3442. u16 sink_endpointype;
  3443. /* Endpoint type. 0 = Rx Matrix */
  3444. u32 postprocopo_id;
  3445. /* Postprocessor topology ID. Specifies the topology of
  3446. * postprocessing algorithms.
  3447. */
  3448. u16 bits_per_sample;
  3449. /* The number of bits per sample processed by ASM modules
  3450. * Supported values: 16 and 24 bits per sample
  3451. */
  3452. u16 reserved;
  3453. /* Reserved for future use. This field must be set to zero. */
  3454. } __packed;
  3455. #define ASM_STREAM_CMD_CLOSE 0x00010BCD
  3456. #define ASM_STREAM_CMD_FLUSH 0x00010BCE
  3457. #define ASM_STREAM_CMD_FLUSH_READBUFS 0x00010C09
  3458. #define ASM_STREAM_CMD_SET_PP_PARAMS_V2 0x00010DA1
  3459. struct asm_stream_cmd_set_pp_params_v2 {
  3460. u32 data_payload_addr_lsw;
  3461. /* LSW of parameter data payload address. Supported values: any. */
  3462. u32 data_payload_addr_msw;
  3463. /* MSW of Parameter data payload address. Supported values: any.
  3464. * - Must be set to zero for in-band data.
  3465. * - In the case of 32 bit Shared memory address, msw field must be
  3466. * - set to zero.
  3467. * - In the case of 36 bit shared memory address, bit 31 to bit 4 of
  3468. * msw
  3469. *
  3470. * - must be set to zero.
  3471. */
  3472. u32 mem_map_handle;
  3473. /* Supported Values: Any.
  3474. * memory map handle returned by DSP through
  3475. * ASM_CMD_SHARED_MEM_MAP_REGIONS
  3476. * command.
  3477. * if mmhandle is NULL, the ParamData payloads are within the
  3478. * message payload (in-band).
  3479. * If mmhandle is non-NULL, the ParamData payloads begin at the
  3480. * address specified in the address msw and lsw (out-of-band).
  3481. */
  3482. u32 data_payload_size;
  3483. /* Size in bytes of the variable payload accompanying the
  3484. message, or in shared memory. This field is used for parsing the
  3485. parameter payload. */
  3486. } __packed;
  3487. struct asm_stream_param_data_v2 {
  3488. u32 module_id;
  3489. /* Unique module ID. */
  3490. u32 param_id;
  3491. /* Unique parameter ID. */
  3492. u16 param_size;
  3493. /* Data size of the param_id/module_id combination. This is
  3494. * a multiple of 4 bytes.
  3495. */
  3496. u16 reserved;
  3497. /* Reserved for future enhancements. This field must be set to
  3498. * zero.
  3499. */
  3500. } __packed;
  3501. #define ASM_STREAM_CMD_GET_PP_PARAMS_V2 0x00010DA2
  3502. struct asm_stream_cmd_get_pp_params_v2 {
  3503. u32 data_payload_addr_lsw;
  3504. /* LSW of the parameter data payload address. */
  3505. u32 data_payload_addr_msw;
  3506. /* MSW of the parameter data payload address.
  3507. * - Size of the shared memory, if specified, shall be large enough
  3508. * to contain the whole ParamData payload, including Module ID,
  3509. * Param ID, Param Size, and Param Values
  3510. * - Must be set to zero for in-band data
  3511. * - In the case of 32 bit Shared memory address, msw field must be
  3512. * set to zero.
  3513. * - In the case of 36 bit shared memory address, bit 31 to bit 4 of
  3514. * msw must be set to zero.
  3515. */
  3516. u32 mem_map_handle;
  3517. /* Supported Values: Any.
  3518. * memory map handle returned by DSP through ASM_CMD_SHARED_MEM_MAP_REGIONS
  3519. * command.
  3520. * if mmhandle is NULL, the ParamData payloads in the ACK are within the
  3521. * message payload (in-band).
  3522. * If mmhandle is non-NULL, the ParamData payloads in the ACK begin at the
  3523. * address specified in the address msw and lsw.
  3524. * (out-of-band).
  3525. */
  3526. u32 module_id;
  3527. /* Unique module ID. */
  3528. u32 param_id;
  3529. /* Unique parameter ID. */
  3530. u16 param_max_size;
  3531. /* Maximum data size of the module_id/param_id combination. This
  3532. * is a multiple of 4 bytes.
  3533. */
  3534. u16 reserved;
  3535. /* Reserved for backward compatibility. Clients must set this
  3536. * field to zero.
  3537. */
  3538. } __packed;
  3539. #define ASM_STREAM_CMD_SET_ENCDEC_PARAM 0x00010C10
  3540. #define ASM_PARAM_ID_ENCDEC_BITRATE 0x00010C13
  3541. struct asm_bitrate_param {
  3542. u32 bitrate;
  3543. /* Maximum supported bitrate. Only the AAC encoder is supported.*/
  3544. } __packed;
  3545. #define ASM_PARAM_ID_ENCDEC_ENC_CFG_BLK_V2 0x00010DA3
  3546. #define ASM_PARAM_ID_AAC_SBR_PS_FLAG 0x00010C63
  3547. /* Flag to turn off both SBR and PS processing, if they are
  3548. * present in the bitstream.
  3549. */
  3550. #define ASM_AAC_SBR_OFF_PS_OFF (2)
  3551. /* Flag to turn on SBR but turn off PS processing,if they are
  3552. * present in the bitstream.
  3553. */
  3554. #define ASM_AAC_SBR_ON_PS_OFF (1)
  3555. /* Flag to turn on both SBR and PS processing, if they are
  3556. * present in the bitstream (default behavior).
  3557. */
  3558. #define ASM_AAC_SBR_ON_PS_ON (0)
  3559. /* Structure for an AAC SBR PS processing flag. */
  3560. /* Payload of the #ASM_PARAM_ID_AAC_SBR_PS_FLAG parameter in the
  3561. * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
  3562. */
  3563. struct asm_aac_sbr_ps_flag_param {
  3564. struct apr_hdr hdr;
  3565. struct asm_stream_cmd_set_encdec_param encdec;
  3566. struct asm_enc_cfg_blk_param_v2 encblk;
  3567. u32 sbr_ps_flag;
  3568. /* Control parameter to enable or disable SBR/PS processing in
  3569. * the AAC bitstream. Use the following macros to set this field:
  3570. * - #ASM_AAC_SBR_OFF_PS_OFF -- Turn off both SBR and PS
  3571. * processing, if they are present in the bitstream.
  3572. * - #ASM_AAC_SBR_ON_PS_OFF -- Turn on SBR processing, but not PS
  3573. * processing, if they are present in the bitstream.
  3574. * - #ASM_AAC_SBR_ON_PS_ON -- Turn on both SBR and PS processing,
  3575. * if they are present in the bitstream (default behavior).
  3576. * - All other values are invalid.
  3577. * Changes are applied to the next decoded frame.
  3578. */
  3579. } __packed;
  3580. #define ASM_PARAM_ID_AAC_DUAL_MONO_MAPPING 0x00010C64
  3581. /* First single channel element in a dual mono bitstream.*/
  3582. #define ASM_AAC_DUAL_MONO_MAP_SCE_1 (1)
  3583. /* Second single channel element in a dual mono bitstream.*/
  3584. #define ASM_AAC_DUAL_MONO_MAP_SCE_2 (2)
  3585. /* Structure for AAC decoder dual mono channel mapping. */
  3586. struct asm_aac_dual_mono_mapping_param {
  3587. struct apr_hdr hdr;
  3588. struct asm_stream_cmd_set_encdec_param encdec;
  3589. u16 left_channel_sce;
  3590. u16 right_channel_sce;
  3591. } __packed;
  3592. #define ASM_STREAM_CMDRSP_GET_PP_PARAMS_V2 0x00010DA4
  3593. struct asm_stream_cmdrsp_get_pp_params_v2 {
  3594. u32 status;
  3595. } __packed;
  3596. #define ASM_PARAM_ID_AC3_KARAOKE_MODE 0x00010D73
  3597. /* Enumeration for both vocals in a karaoke stream.*/
  3598. #define AC3_KARAOKE_MODE_NO_VOCAL (0)
  3599. /* Enumeration for only the left vocal in a karaoke stream.*/
  3600. #define AC3_KARAOKE_MODE_LEFT_VOCAL (1)
  3601. /* Enumeration for only the right vocal in a karaoke stream.*/
  3602. #define AC3_KARAOKE_MODE_RIGHT_VOCAL (2)
  3603. /* Enumeration for both vocal channels in a karaoke stream.*/
  3604. #define AC3_KARAOKE_MODE_BOTH_VOCAL (3)
  3605. #define ASM_PARAM_ID_AC3_DRC_MODE 0x00010D74
  3606. /* Enumeration for the Custom Analog mode.*/
  3607. #define AC3_DRC_MODE_CUSTOM_ANALOG (0)
  3608. /* Enumeration for the Custom Digital mode.*/
  3609. #define AC3_DRC_MODE_CUSTOM_DIGITAL (1)
  3610. /* Enumeration for the Line Out mode (light compression).*/
  3611. #define AC3_DRC_MODE_LINE_OUT (2)
  3612. /* Enumeration for the RF remodulation mode (heavy compression).*/
  3613. #define AC3_DRC_MODE_RF_REMOD (3)
  3614. #define ASM_PARAM_ID_AC3_DUAL_MONO_MODE 0x00010D75
  3615. /* Enumeration for playing dual mono in stereo mode.*/
  3616. #define AC3_DUAL_MONO_MODE_STEREO (0)
  3617. /* Enumeration for playing left mono.*/
  3618. #define AC3_DUAL_MONO_MODE_LEFT_MONO (1)
  3619. /* Enumeration for playing right mono.*/
  3620. #define AC3_DUAL_MONO_MODE_RIGHT_MONO (2)
  3621. /* Enumeration for mixing both dual mono channels and playing them.*/
  3622. #define AC3_DUAL_MONO_MODE_MIXED_MONO (3)
  3623. #define ASM_PARAM_ID_AC3_STEREO_DOWNMIX_MODE 0x00010D76
  3624. /* Enumeration for using the Downmix mode indicated in the bitstream. */
  3625. #define AC3_STEREO_DOWNMIX_MODE_AUTO_DETECT (0)
  3626. /* Enumeration for Surround Compatible mode (preserves the
  3627. * surround information).
  3628. */
  3629. #define AC3_STEREO_DOWNMIX_MODE_LT_RT (1)
  3630. /* Enumeration for Mono Compatible mode (if the output is to be
  3631. * further downmixed to mono).
  3632. */
  3633. #define AC3_STEREO_DOWNMIX_MODE_LO_RO (2)
  3634. /* ID of the AC3 PCM scale factor parameter in the
  3635. * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
  3636. */
  3637. #define ASM_PARAM_ID_AC3_PCM_SCALEFACTOR 0x00010D78
  3638. /* ID of the AC3 DRC boost scale factor parameter in the
  3639. * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
  3640. */
  3641. #define ASM_PARAM_ID_AC3_DRC_BOOST_SCALEFACTOR 0x00010D79
  3642. /* ID of the AC3 DRC cut scale factor parameter in the
  3643. * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
  3644. */
  3645. #define ASM_PARAM_ID_AC3_DRC_CUT_SCALEFACTOR 0x00010D7A
  3646. /* Structure for AC3 Generic Parameter. */
  3647. /* Payload of the AC3 parameters in the
  3648. * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
  3649. */
  3650. struct asm_ac3_generic_param {
  3651. struct apr_hdr hdr;
  3652. struct asm_stream_cmd_set_encdec_param encdec;
  3653. struct asm_enc_cfg_blk_param_v2 encblk;
  3654. u32 generic_parameter;
  3655. /* AC3 generic parameter. Select from one of the following
  3656. * possible values.
  3657. *
  3658. * For #ASM_PARAM_ID_AC3_KARAOKE_MODE, supported values are:
  3659. * - AC3_KARAOKE_MODE_NO_VOCAL
  3660. * - AC3_KARAOKE_MODE_LEFT_VOCAL
  3661. * - AC3_KARAOKE_MODE_RIGHT_VOCAL
  3662. * - AC3_KARAOKE_MODE_BOTH_VOCAL
  3663. *
  3664. * For #ASM_PARAM_ID_AC3_DRC_MODE, supported values are:
  3665. * - AC3_DRC_MODE_CUSTOM_ANALOG
  3666. * - AC3_DRC_MODE_CUSTOM_DIGITAL
  3667. * - AC3_DRC_MODE_LINE_OUT
  3668. * - AC3_DRC_MODE_RF_REMOD
  3669. *
  3670. * For #ASM_PARAM_ID_AC3_DUAL_MONO_MODE, supported values are:
  3671. * - AC3_DUAL_MONO_MODE_STEREO
  3672. * - AC3_DUAL_MONO_MODE_LEFT_MONO
  3673. * - AC3_DUAL_MONO_MODE_RIGHT_MONO
  3674. * - AC3_DUAL_MONO_MODE_MIXED_MONO
  3675. *
  3676. * For #ASM_PARAM_ID_AC3_STEREO_DOWNMIX_MODE, supported values are:
  3677. * - AC3_STEREO_DOWNMIX_MODE_AUTO_DETECT
  3678. * - AC3_STEREO_DOWNMIX_MODE_LT_RT
  3679. * - AC3_STEREO_DOWNMIX_MODE_LO_RO
  3680. *
  3681. * For #ASM_PARAM_ID_AC3_PCM_SCALEFACTOR, supported values are
  3682. * 0 to 1 in Q31 format.
  3683. *
  3684. * For #ASM_PARAM_ID_AC3_DRC_BOOST_SCALEFACTOR, supported values are
  3685. * 0 to 1 in Q31 format.
  3686. *
  3687. * For #ASM_PARAM_ID_AC3_DRC_CUT_SCALEFACTOR, supported values are
  3688. * 0 to 1 in Q31 format.
  3689. */
  3690. } __packed;
  3691. /* Enumeration for Raw mode (no downmixing), which specifies
  3692. * that all channels in the bitstream are to be played out as is
  3693. * without any downmixing. (Default)
  3694. */
  3695. #define WMAPRO_CHANNEL_MASK_RAW (-1)
  3696. /* Enumeration for setting the channel mask to 0. The 7.1 mode
  3697. * (Home Theater) is assigned.
  3698. */
  3699. #define WMAPRO_CHANNEL_MASK_ZERO 0x0000
  3700. /* Speaker layout mask for one channel (Home Theater, mono).
  3701. * - Speaker front center
  3702. */
  3703. #define WMAPRO_CHANNEL_MASK_1_C 0x0004
  3704. /* Speaker layout mask for two channels (Home Theater, stereo).
  3705. * - Speaker front left
  3706. * - Speaker front right
  3707. */
  3708. #define WMAPRO_CHANNEL_MASK_2_L_R 0x0003
  3709. /* Speaker layout mask for three channels (Home Theater).
  3710. * - Speaker front left
  3711. * - Speaker front right
  3712. * - Speaker front center
  3713. */
  3714. #define WMAPRO_CHANNEL_MASK_3_L_C_R 0x0007
  3715. /* Speaker layout mask for two channels (stereo).
  3716. * - Speaker back left
  3717. * - Speaker back right
  3718. */
  3719. #define WMAPRO_CHANNEL_MASK_2_Bl_Br 0x0030
  3720. /* Speaker layout mask for four channels.
  3721. * - Speaker front left
  3722. * - Speaker front right
  3723. * - Speaker back left
  3724. * - Speaker back right
  3725. */
  3726. #define WMAPRO_CHANNEL_MASK_4_L_R_Bl_Br 0x0033
  3727. /* Speaker layout mask for four channels (Home Theater).
  3728. * - Speaker front left
  3729. * - Speaker front right
  3730. * - Speaker front center
  3731. * - Speaker back center
  3732. */
  3733. #define WMAPRO_CHANNEL_MASK_4_L_R_C_Bc_HT 0x0107
  3734. /* Speaker layout mask for five channels.
  3735. * - Speaker front left
  3736. * - Speaker front right
  3737. * - Speaker front center
  3738. * - Speaker back left
  3739. * - Speaker back right
  3740. */
  3741. #define WMAPRO_CHANNEL_MASK_5_L_C_R_Bl_Br 0x0037
  3742. /* Speaker layout mask for five channels (5 mode, Home Theater).
  3743. * - Speaker front left
  3744. * - Speaker front right
  3745. * - Speaker front center
  3746. * - Speaker side left
  3747. * - Speaker side right
  3748. */
  3749. #define WMAPRO_CHANNEL_MASK_5_L_C_R_Sl_Sr_HT 0x0607
  3750. /* Speaker layout mask for six channels (5.1 mode).
  3751. * - Speaker front left
  3752. * - Speaker front right
  3753. * - Speaker front center
  3754. * - Speaker low frequency
  3755. * - Speaker back left
  3756. * - Speaker back right
  3757. */
  3758. #define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Bl_Br_SLF 0x003F
  3759. /* Speaker layout mask for six channels (5.1 mode, Home Theater).
  3760. * - Speaker front left
  3761. * - Speaker front right
  3762. * - Speaker front center
  3763. * - Speaker low frequency
  3764. * - Speaker side left
  3765. * - Speaker side right
  3766. */
  3767. #define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Sl_Sr_SLF_HT 0x060F
  3768. /* Speaker layout mask for six channels (5.1 mode, no LFE).
  3769. * - Speaker front left
  3770. * - Speaker front right
  3771. * - Speaker front center
  3772. * - Speaker back left
  3773. * - Speaker back right
  3774. * - Speaker back center
  3775. */
  3776. #define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Bl_Br_Bc 0x0137
  3777. /* Speaker layout mask for six channels (5.1 mode, Home Theater,
  3778. * no LFE).
  3779. * - Speaker front left
  3780. * - Speaker front right
  3781. * - Speaker front center
  3782. * - Speaker back center
  3783. * - Speaker side left
  3784. * - Speaker side right
  3785. */
  3786. #define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Sl_Sr_Bc_HT 0x0707
  3787. /* Speaker layout mask for seven channels (6.1 mode).
  3788. * - Speaker front left
  3789. * - Speaker front right
  3790. * - Speaker front center
  3791. * - Speaker low frequency
  3792. * - Speaker back left
  3793. * - Speaker back right
  3794. * - Speaker back center
  3795. */
  3796. #define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Bl_Br_Bc_SLF 0x013F
  3797. /* Speaker layout mask for seven channels (6.1 mode, Home
  3798. * Theater).
  3799. * - Speaker front left
  3800. * - Speaker front right
  3801. * - Speaker front center
  3802. * - Speaker low frequency
  3803. * - Speaker back center
  3804. * - Speaker side left
  3805. * - Speaker side right
  3806. */
  3807. #define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Sl_Sr_Bc_SLF_HT 0x070F
  3808. /* Speaker layout mask for seven channels (6.1 mode, no LFE).
  3809. * - Speaker front left
  3810. * - Speaker front right
  3811. * - Speaker front center
  3812. * - Speaker back left
  3813. * - Speaker back right
  3814. * - Speaker front left of center
  3815. * - Speaker front right of center
  3816. */
  3817. #define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Bl_Br_SFLOC_SFROC 0x00F7
  3818. /* Speaker layout mask for seven channels (6.1 mode, Home
  3819. * Theater, no LFE).
  3820. * - Speaker front left
  3821. * - Speaker front right
  3822. * - Speaker front center
  3823. * - Speaker side left
  3824. * - Speaker side right
  3825. * - Speaker front left of center
  3826. * - Speaker front right of center
  3827. */
  3828. #define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Sl_Sr_SFLOC_SFROC_HT 0x0637
  3829. /* Speaker layout mask for eight channels (7.1 mode).
  3830. * - Speaker front left
  3831. * - Speaker front right
  3832. * - Speaker front center
  3833. * - Speaker back left
  3834. * - Speaker back right
  3835. * - Speaker low frequency
  3836. * - Speaker front left of center
  3837. * - Speaker front right of center
  3838. */
  3839. #define WMAPRO_CHANNEL_MASK_7DOT1_L_C_R_Bl_Br_SLF_SFLOC_SFROC \
  3840. 0x00FF
  3841. /* Speaker layout mask for eight channels (7.1 mode, Home Theater).
  3842. * - Speaker front left
  3843. * - Speaker front right
  3844. * - Speaker front center
  3845. * - Speaker side left
  3846. * - Speaker side right
  3847. * - Speaker low frequency
  3848. * - Speaker front left of center
  3849. * - Speaker front right of center
  3850. *
  3851. */
  3852. #define WMAPRO_CHANNEL_MASK_7DOT1_L_C_R_Sl_Sr_SLF_SFLOC_SFROC_HT \
  3853. 0x063F
  3854. #define ASM_PARAM_ID_DEC_OUTPUT_CHAN_MAP 0x00010D82
  3855. /* Maximum number of decoder output channels.*/
  3856. #define MAX_CHAN_MAP_CHANNELS 16
  3857. /* Structure for decoder output channel mapping. */
  3858. /* Payload of the #ASM_PARAM_ID_DEC_OUTPUT_CHAN_MAP parameter in the
  3859. * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
  3860. */
  3861. struct asm_dec_out_chan_map_param {
  3862. struct apr_hdr hdr;
  3863. struct asm_stream_cmd_set_encdec_param encdec;
  3864. u32 num_channels;
  3865. /* Number of decoder output channels.
  3866. * Supported values: 0 to #MAX_CHAN_MAP_CHANNELS
  3867. *
  3868. * A value of 0 indicates native channel mapping, which is valid
  3869. * only for NT mode. This means the output of the decoder is to be
  3870. * preserved as is.
  3871. */
  3872. u8 channel_mapping[MAX_CHAN_MAP_CHANNELS];
  3873. } __packed;
  3874. #define ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED 0x00010D84
  3875. /* Bitmask for the IEC 61937 enable flag.*/
  3876. #define ASM_BIT_MASK_IEC_61937_STREAM_FLAG (0x00000001UL)
  3877. /* Shift value for the IEC 61937 enable flag.*/
  3878. #define ASM_SHIFT_IEC_61937_STREAM_FLAG 0
  3879. /* Bitmask for the IEC 60958 enable flag.*/
  3880. #define ASM_BIT_MASK_IEC_60958_STREAM_FLAG (0x00000002UL)
  3881. /* Shift value for the IEC 60958 enable flag.*/
  3882. #define ASM_SHIFT_IEC_60958_STREAM_FLAG 1
  3883. /* Payload format for open write compressed comand */
  3884. /* Payload format for the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED
  3885. * comand, which opens a stream for a given session ID and stream ID
  3886. * to be rendered in the compressed format.
  3887. */
  3888. struct asm_stream_cmd_open_write_compressed {
  3889. struct apr_hdr hdr;
  3890. u32 flags;
  3891. /* Mode flags that configure the stream for a specific format.
  3892. * Supported values:
  3893. * - Bit 0 -- IEC 61937 compatibility
  3894. * - 0 -- Stream is not in IEC 61937 format
  3895. * - 1 -- Stream is in IEC 61937 format
  3896. * - Bit 1 -- IEC 60958 compatibility
  3897. * - 0 -- Stream is not in IEC 60958 format
  3898. * - 1 -- Stream is in IEC 60958 format
  3899. * - Bits 2 to 31 -- 0 (Reserved)
  3900. *
  3901. * For the same stream, bit 0 cannot be set to 0 and bit 1 cannot
  3902. * be set to 1. A compressed stream connot have IEC 60958
  3903. * packetization applied without IEC 61937 packetization.
  3904. * @note1hang Currently, IEC 60958 packetized input streams are not
  3905. * supported.
  3906. */
  3907. u32 fmt_id;
  3908. /* Specifies the media type of the HDMI stream to be opened.
  3909. * Supported values:
  3910. * - #ASM_MEDIA_FMT_AC3_DEC
  3911. * - #ASM_MEDIA_FMT_EAC3_DEC
  3912. * - #ASM_MEDIA_FMT_DTS
  3913. * - #ASM_MEDIA_FMT_ATRAC
  3914. * - #ASM_MEDIA_FMT_MAT
  3915. *
  3916. * @note1hang This field must be set to a valid media type even if
  3917. * IEC 61937 packetization is not performed by the aDSP.
  3918. */
  3919. } __packed;
  3920. /*
  3921. Indicates the number of samples per channel to be removed from the
  3922. beginning of the stream.
  3923. */
  3924. #define ASM_DATA_CMD_REMOVE_INITIAL_SILENCE 0x00010D67
  3925. /*
  3926. Indicates the number of samples per channel to be removed from
  3927. the end of the stream.
  3928. */
  3929. #define ASM_DATA_CMD_REMOVE_TRAILING_SILENCE 0x00010D68
  3930. struct asm_data_cmd_remove_silence {
  3931. struct apr_hdr hdr;
  3932. u32 num_samples_to_remove;
  3933. /**< Number of samples per channel to be removed.
  3934. @values 0 to (2@sscr{32}-1) */
  3935. } __packed;
  3936. #define ASM_STREAM_CMD_OPEN_READ_COMPRESSED 0x00010D95
  3937. struct asm_stream_cmd_open_read_compressed {
  3938. struct apr_hdr hdr;
  3939. u32 mode_flags;
  3940. /* Mode flags that indicate whether meta information per encoded
  3941. * frame is to be provided.
  3942. * Supported values for bit 4:
  3943. * - 0 -- Return data buffer contains all encoded frames only; it does
  3944. * not contain frame metadata.
  3945. * - 1 -- Return data buffer contains an array of metadata and encoded
  3946. * frames.
  3947. * - Use #ASM_BIT_MASK_META_INFO_FLAG to set the bitmask and
  3948. * #ASM_SHIFT_META_INFO_FLAG to set the shift value for this bit.
  3949. * All other bits are reserved; clients must set them to zero.
  3950. */
  3951. u32 frames_per_buf;
  3952. /* Indicates the number of frames that need to be returned per
  3953. * read buffer
  3954. * Supported values: should be greater than 0
  3955. */
  3956. } __packed;
  3957. /* adsp_asm_stream_commands.h*/
  3958. /* adsp_asm_api.h (no changes)*/
  3959. #define ASM_STREAM_POSTPROCOPO_ID_DEFAULT \
  3960. 0x00010BE4
  3961. #define ASM_STREAM_POSTPROCOPO_ID_PEAKMETER \
  3962. 0x00010D83
  3963. #define ASM_STREAM_POSTPROCOPO_ID_NONE \
  3964. 0x00010C68
  3965. #define ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL \
  3966. 0x00010D8B
  3967. #define ASM_STREAM_PREPROCOPO_ID_DEFAULT \
  3968. ASM_STREAM_POSTPROCOPO_ID_DEFAULT
  3969. #define ASM_STREAM_PREPROCOPO_ID_NONE \
  3970. ASM_STREAM_POSTPROCOPO_ID_NONE
  3971. #define ADM_CMD_COPP_OPENOPOLOGY_ID_NONE_AUDIO_COPP \
  3972. 0x00010312
  3973. #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MONO_AUDIO_COPP \
  3974. 0x00010313
  3975. #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP \
  3976. 0x00010314
  3977. #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_IIR_AUDIO_COPP\
  3978. 0x00010704
  3979. #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MONO_AUDIO_COPP_MBDRCV2\
  3980. 0x0001070D
  3981. #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP_MBDRCV2\
  3982. 0x0001070E
  3983. #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_IIR_AUDIO_COPP_MBDRCV2\
  3984. 0x0001070F
  3985. #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MCH_PEAK_VOL \
  3986. 0x0001031B
  3987. #define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_MONO_AUDIO_COPP 0x00010315
  3988. #define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_STEREO_AUDIO_COPP 0x00010316
  3989. #define AUDPROC_COPPOPOLOGY_ID_MCHAN_IIR_AUDIO 0x00010715
  3990. #define ADM_CMD_COPP_OPENOPOLOGY_ID_DEFAULT_AUDIO_COPP 0x00010BE3
  3991. #define ADM_CMD_COPP_OPENOPOLOGY_ID_PEAKMETER_AUDIO_COPP 0x00010317
  3992. #define AUDPROC_MODULE_ID_AIG 0x00010716
  3993. #define AUDPROC_PARAM_ID_AIG_ENABLE 0x00010717
  3994. #define AUDPROC_PARAM_ID_AIG_CONFIG 0x00010718
  3995. struct Audio_AigParam {
  3996. uint16_t mode;
  3997. /*< Mode word for enabling AIG/SIG mode .
  3998. * Byte offset: 0
  3999. */
  4000. int16_t staticGainL16Q12;
  4001. /*< Static input gain when aigMode is set to 1.
  4002. * Byte offset: 2
  4003. */
  4004. int16_t initialGainDBL16Q7;
  4005. /*<Initial value that the adaptive gain update starts from dB
  4006. * Q7 Byte offset: 4
  4007. */
  4008. int16_t idealRMSDBL16Q7;
  4009. /*<Average RMS level that AIG attempts to achieve Q8.7
  4010. * Byte offset: 6
  4011. */
  4012. int32_t noiseGateL32;
  4013. /*Threshold below which signal is considered as noise and AIG
  4014. * Byte offset: 8
  4015. */
  4016. int32_t minGainL32Q15;
  4017. /*Minimum gain that can be provided by AIG Q16.15
  4018. * Byte offset: 12
  4019. */
  4020. int32_t maxGainL32Q15;
  4021. /*Maximum gain that can be provided by AIG Q16.15
  4022. * Byte offset: 16
  4023. */
  4024. uint32_t gainAtRtUL32Q31;
  4025. /*Attack/release time for AIG update Q1.31
  4026. * Byte offset: 20
  4027. */
  4028. uint32_t longGainAtRtUL32Q31;
  4029. /*Long attack/release time while updating gain for
  4030. * noise/silence Q1.31 Byte offset: 24
  4031. */
  4032. uint32_t rmsTavUL32Q32;
  4033. /* RMS smoothing time constant used for long-term RMS estimate
  4034. * Q0.32 Byte offset: 28
  4035. */
  4036. uint32_t gainUpdateStartTimMsUL32Q0;
  4037. /* The waiting time before which AIG starts to apply adaptive
  4038. * gain update Q32.0 Byte offset: 32
  4039. */
  4040. } __packed;
  4041. #define ADM_MODULE_ID_EANS 0x00010C4A
  4042. #define ADM_PARAM_ID_EANS_ENABLE 0x00010C4B
  4043. #define ADM_PARAM_ID_EANS_PARAMS 0x00010C4C
  4044. struct adm_eans_enable {
  4045. uint32_t enable_flag;
  4046. /*< Specifies whether EANS is disabled (0) or enabled
  4047. * (nonzero).
  4048. * This is supported only for sampling rates of 8, 12, 16, 24, 32,
  4049. * and 48 kHz. It is not supported for sampling rates of 11.025,
  4050. * 22.05, or 44.1 kHz.
  4051. */
  4052. } __packed;
  4053. struct adm_eans_params {
  4054. int16_t eans_mode;
  4055. /*< Mode word for enabling/disabling submodules.
  4056. * Byte offset: 0
  4057. */
  4058. int16_t eans_input_gain;
  4059. /*< Q2.13 input gain to the EANS module.
  4060. * Byte offset: 2
  4061. */
  4062. int16_t eans_output_gain;
  4063. /*< Q2.13 output gain to the EANS module.
  4064. * Byte offset: 4
  4065. */
  4066. int16_t eansarget_ns;
  4067. /*< Target noise suppression level in dB.
  4068. * Byte offset: 6
  4069. */
  4070. int16_t eans_s_alpha;
  4071. /*< Q3.12 over-subtraction factor for stationary noise
  4072. * suppression.
  4073. * Byte offset: 8
  4074. */
  4075. int16_t eans_n_alpha;
  4076. /* < Q3.12 over-subtraction factor for nonstationary noise
  4077. * suppression.
  4078. * Byte offset: 10
  4079. */
  4080. int16_t eans_n_alphamax;
  4081. /*< Q3.12 maximum over-subtraction factor for nonstationary
  4082. * noise suppression.
  4083. * Byte offset: 12
  4084. */
  4085. int16_t eans_e_alpha;
  4086. /*< Q15 scaling factor for excess noise suppression.
  4087. * Byte offset: 14
  4088. */
  4089. int16_t eans_ns_snrmax;
  4090. /*< Upper boundary in dB for SNR estimation.
  4091. * Byte offset: 16
  4092. */
  4093. int16_t eans_sns_block;
  4094. /*< Quarter block size for stationary noise suppression.
  4095. * Byte offset: 18
  4096. */
  4097. int16_t eans_ns_i;
  4098. /*< Initialization block size for noise suppression.
  4099. * Byte offset: 20
  4100. */
  4101. int16_t eans_np_scale;
  4102. /*< Power scale factor for nonstationary noise update.
  4103. * Byte offset: 22
  4104. */
  4105. int16_t eans_n_lambda;
  4106. /*< Smoothing factor for higher level nonstationary noise
  4107. * update.
  4108. * Byte offset: 24
  4109. */
  4110. int16_t eans_n_lambdaf;
  4111. /*< Medium averaging factor for noise update.
  4112. * Byte offset: 26
  4113. */
  4114. int16_t eans_gs_bias;
  4115. /*< Bias factor in dB for gain calculation.
  4116. * Byte offset: 28
  4117. */
  4118. int16_t eans_gs_max;
  4119. /*< SNR lower boundary in dB for aggressive gain calculation.
  4120. * Byte offset: 30
  4121. */
  4122. int16_t eans_s_alpha_hb;
  4123. /*< Q3.12 over-subtraction factor for high-band stationary
  4124. * noise suppression.
  4125. * Byte offset: 32
  4126. */
  4127. int16_t eans_n_alphamax_hb;
  4128. /*< Q3.12 maximum over-subtraction factor for high-band
  4129. * nonstationary noise suppression.
  4130. * Byte offset: 34
  4131. */
  4132. int16_t eans_e_alpha_hb;
  4133. /*< Q15 scaling factor for high-band excess noise suppression.
  4134. * Byte offset: 36
  4135. */
  4136. int16_t eans_n_lambda0;
  4137. /*< Smoothing factor for nonstationary noise update during
  4138. * speech activity.
  4139. * Byte offset: 38
  4140. */
  4141. int16_t thresh;
  4142. /*< Threshold for generating a binary VAD decision.
  4143. * Byte offset: 40
  4144. */
  4145. int16_t pwr_scale;
  4146. /*< Indirect lower boundary of the noise level estimate.
  4147. * Byte offset: 42
  4148. */
  4149. int16_t hangover_max;
  4150. /*< Avoids mid-speech clipping and reliably detects weak speech
  4151. * bursts at the end of speech activity.
  4152. * Byte offset: 44
  4153. */
  4154. int16_t alpha_snr;
  4155. /*< Controls responsiveness of the VAD.
  4156. * Byte offset: 46
  4157. */
  4158. int16_t snr_diff_max;
  4159. /*< Maximum SNR difference. Decreasing this parameter value may
  4160. * help in making correct decisions during abrupt changes; however,
  4161. * decreasing too much may increase false alarms during long
  4162. * pauses/silences.
  4163. * Byte offset: 48
  4164. */
  4165. int16_t snr_diff_min;
  4166. /*< Minimum SNR difference. Decreasing this parameter value may
  4167. * help in making correct decisions during abrupt changes; however,
  4168. * decreasing too much may increase false alarms during long
  4169. * pauses/silences.
  4170. * Byte offset: 50
  4171. */
  4172. int16_t init_length;
  4173. /*< Defines the number of frames for which a noise level
  4174. * estimate is set to a fixed value.
  4175. * Byte offset: 52
  4176. */
  4177. int16_t max_val;
  4178. /*< Defines the upper limit of the noise level.
  4179. * Byte offset: 54
  4180. */
  4181. int16_t init_bound;
  4182. /*< Defines the initial bounding value for the noise level
  4183. * estimate. This is used during the initial segment defined by the
  4184. * init_length parameter.
  4185. * Byte offset: 56
  4186. */
  4187. int16_t reset_bound;
  4188. /*< Reset boundary for noise tracking.
  4189. * Byte offset: 58
  4190. */
  4191. int16_t avar_scale;
  4192. /*< Defines the bias factor in noise estimation.
  4193. * Byte offset: 60
  4194. */
  4195. int16_t sub_nc;
  4196. /*< Defines the window length for noise estimation.
  4197. * Byte offset: 62
  4198. */
  4199. int16_t spow_min;
  4200. /*< Defines the minimum signal power required to update the
  4201. * boundaries for the noise floor estimate.
  4202. * Byte offset: 64
  4203. */
  4204. int16_t eans_gs_fast;
  4205. /*< Fast smoothing factor for postprocessor gain.
  4206. * Byte offset: 66
  4207. */
  4208. int16_t eans_gs_med;
  4209. /*< Medium smoothing factor for postprocessor gain.
  4210. * Byte offset: 68
  4211. */
  4212. int16_t eans_gs_slow;
  4213. /*< Slow smoothing factor for postprocessor gain.
  4214. * Byte offset: 70
  4215. */
  4216. int16_t eans_swb_salpha;
  4217. /*< Q3.12 super wideband aggressiveness factor for stationary
  4218. * noise suppression.
  4219. * Byte offset: 72
  4220. */
  4221. int16_t eans_swb_nalpha;
  4222. /*< Q3.12 super wideband aggressiveness factor for
  4223. * nonstationary noise suppression.
  4224. * Byte offset: 74
  4225. */
  4226. } __packed;
  4227. #define ADM_MODULE_IDX_MIC_GAIN_CTRL 0x00010C35
  4228. /* @addtogroup audio_pp_param_ids
  4229. * ID of the Tx mic gain control parameter used by the
  4230. * #ADM_MODULE_IDX_MIC_GAIN_CTRL module.
  4231. * @messagepayload
  4232. * @structure{admx_mic_gain}
  4233. * @tablespace
  4234. * @inputtable{Audio_Postproc_ADM_PARAM_IDX_MIC_GAIN.tex}
  4235. */
  4236. #define ADM_PARAM_IDX_MIC_GAIN 0x00010C36
  4237. /* Structure for a Tx mic gain parameter for the mic gain
  4238. * control module.
  4239. */
  4240. /* @brief Payload of the #ADM_PARAM_IDX_MIC_GAIN parameter in the
  4241. * Tx Mic Gain Control module.
  4242. */
  4243. struct admx_mic_gain {
  4244. uint16_t tx_mic_gain;
  4245. /*< Linear gain in Q13 format. */
  4246. uint16_t reserved;
  4247. /*< Clients must set this field to zero. */
  4248. } __packed;
  4249. /* end_addtogroup audio_pp_param_ids */
  4250. /* @ingroup audio_pp_module_ids
  4251. * ID of the Rx Codec Gain Control module.
  4252. *
  4253. * This module supports the following parameter ID:
  4254. * - #ADM_PARAM_ID_RX_CODEC_GAIN
  4255. */
  4256. #define ADM_MODULE_ID_RX_CODEC_GAIN_CTRL 0x00010C37
  4257. /* @addtogroup audio_pp_param_ids
  4258. * ID of the Rx codec gain control parameter used by the
  4259. * #ADM_MODULE_ID_RX_CODEC_GAIN_CTRL module.
  4260. *
  4261. * @messagepayload
  4262. * @structure{adm_rx_codec_gain}
  4263. * @tablespace
  4264. * @inputtable{Audio_Postproc_ADM_PARAM_ID_RX_CODEC_GAIN.tex}
  4265. */
  4266. #define ADM_PARAM_ID_RX_CODEC_GAIN 0x00010C38
  4267. /* Structure for the Rx common codec gain control module. */
  4268. /* @brief Payload of the #ADM_PARAM_ID_RX_CODEC_GAIN parameter
  4269. * in the Rx Codec Gain Control module.
  4270. */
  4271. struct adm_rx_codec_gain {
  4272. uint16_t rx_codec_gain;
  4273. /*< Linear gain in Q13 format. */
  4274. uint16_t reserved;
  4275. /*< Clients must set this field to zero.*/
  4276. } __packed;
  4277. /* end_addtogroup audio_pp_param_ids */
  4278. /* @ingroup audio_pp_module_ids
  4279. * ID of the HPF Tuning Filter module on the Tx path.
  4280. * This module supports the following parameter IDs:
  4281. * - #ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG
  4282. * - #ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN
  4283. * - #ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS
  4284. */
  4285. #define ADM_MODULE_ID_HPF_IIRX_FILTER 0x00010C3D
  4286. /* @addtogroup audio_pp_param_ids */
  4287. /* ID of the Tx HPF IIR filter enable parameter used by the
  4288. * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
  4289. * @parspace Message payload
  4290. * @structure{adm_hpfx_iir_filter_enable_cfg}
  4291. * @tablespace
  4292. * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG.tex}
  4293. */
  4294. #define ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG 0x00010C3E
  4295. /* ID of the Tx HPF IIR filter pregain parameter used by the
  4296. * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
  4297. * @parspace Message payload
  4298. * @structure{adm_hpfx_iir_filter_pre_gain}
  4299. * @tablespace
  4300. * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN.tex}
  4301. */
  4302. #define ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN 0x00010C3F
  4303. /* ID of the Tx HPF IIR filter configuration parameters used by the
  4304. * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
  4305. * @parspace Message payload
  4306. * @structure{adm_hpfx_iir_filter_cfg_params}
  4307. * @tablespace
  4308. * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PA
  4309. * RAMS.tex}
  4310. */
  4311. #define ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS 0x00010C40
  4312. /* Structure for enabling a configuration parameter for
  4313. * the HPF IIR tuning filter module on the Tx path.
  4314. */
  4315. /* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG
  4316. * parameter in the Tx path HPF Tuning Filter module.
  4317. */
  4318. struct adm_hpfx_iir_filter_enable_cfg {
  4319. uint32_t enable_flag;
  4320. /*< Specifies whether the HPF tuning filter is disabled (0) or
  4321. * enabled (nonzero).
  4322. */
  4323. } __packed;
  4324. /* Structure for the pregain parameter for the HPF
  4325. IIR tuning filter module on the Tx path. */
  4326. /* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN parameter
  4327. * in the Tx path HPF Tuning Filter module.
  4328. */
  4329. struct adm_hpfx_iir_filter_pre_gain {
  4330. uint16_t pre_gain;
  4331. /*< Linear gain in Q13 format. */
  4332. uint16_t reserved;
  4333. /*< Clients must set this field to zero.*/
  4334. } __packed;
  4335. /* Structure for the configuration parameter for the
  4336. HPF IIR tuning filter module on the Tx path. */
  4337. /* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS
  4338. * parameters in the Tx path HPF Tuning Filter module. \n
  4339. * \n
  4340. * This structure is followed by tuning filter coefficients as follows: \n
  4341. * - Sequence of int32_t FilterCoeffs.
  4342. * Each band has five coefficients, each in int32_t format in the order of
  4343. * b0, b1, b2, a1, a2.
  4344. * - Sequence of int16_t NumShiftFactor.
  4345. * One int16_t per band. The numerator shift factor is related to the Q
  4346. * factor of the filter coefficients.
  4347. * - Sequence of uint16_t PanSetting.
  4348. * One uint16_t for each band to indicate application of the filter to
  4349. * left (0), right (1), or both (2) channels.
  4350. */
  4351. struct adm_hpfx_iir_filter_cfg_params {
  4352. uint16_t num_biquad_stages;
  4353. /*< Number of bands.
  4354. * Supported values: 0 to 20
  4355. */
  4356. uint16_t reserved;
  4357. /*< Clients must set this field to zero.*/
  4358. } __packed;
  4359. /* end_addtogroup audio_pp_module_ids */
  4360. /* @addtogroup audio_pp_module_ids */
  4361. /* ID of the Tx path IIR Tuning Filter module.
  4362. * This module supports the following parameter IDs:
  4363. * - #ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG
  4364. */
  4365. #define ADM_MODULE_IDX_IIR_FILTER 0x00010C41
  4366. /* ID of the Rx path IIR Tuning Filter module for the left channel.
  4367. * The parameter IDs of the IIR tuning filter module
  4368. * (#ASM_MODULE_ID_IIRUNING_FILTER) are used for the left IIR Rx tuning
  4369. * filter.
  4370. *
  4371. * Pan parameters are not required for this per-channel IIR filter; the pan
  4372. * parameters are ignored by this module.
  4373. */
  4374. #define ADM_MODULE_ID_LEFT_IIRUNING_FILTER 0x00010705
  4375. /* ID of the the Rx path IIR Tuning Filter module for the right
  4376. * channel.
  4377. * The parameter IDs of the IIR tuning filter module
  4378. * (#ASM_MODULE_ID_IIRUNING_FILTER) are used for the right IIR Rx
  4379. * tuning filter.
  4380. *
  4381. * Pan parameters are not required for this per-channel IIR filter;
  4382. * the pan parameters are ignored by this module.
  4383. */
  4384. #define ADM_MODULE_ID_RIGHT_IIRUNING_FILTER 0x00010706
  4385. /* end_addtogroup audio_pp_module_ids */
  4386. /* @addtogroup audio_pp_param_ids */
  4387. /* ID of the Tx IIR filter enable parameter used by the
  4388. * #ADM_MODULE_IDX_IIR_FILTER module.
  4389. * @parspace Message payload
  4390. * @structure{admx_iir_filter_enable_cfg}
  4391. * @tablespace
  4392. * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG.tex}
  4393. */
  4394. #define ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG 0x00010C42
  4395. /* ID of the Tx IIR filter pregain parameter used by the
  4396. * #ADM_MODULE_IDX_IIR_FILTER module.
  4397. * @parspace Message payload
  4398. * @structure{admx_iir_filter_pre_gain}
  4399. * @tablespace
  4400. * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN.tex}
  4401. */
  4402. #define ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN 0x00010C43
  4403. /* ID of the Tx IIR filter configuration parameters used by the
  4404. * #ADM_MODULE_IDX_IIR_FILTER module.
  4405. * @parspace Message payload
  4406. * @structure{admx_iir_filter_cfg_params}
  4407. * @tablespace
  4408. * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS.tex}
  4409. */
  4410. #define ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS 0x00010C44
  4411. /* Structure for enabling the configuration parameter for the
  4412. * IIR filter module on the Tx path.
  4413. */
  4414. /* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG
  4415. * parameter in the Tx Path IIR Tuning Filter module.
  4416. */
  4417. struct admx_iir_filter_enable_cfg {
  4418. uint32_t enable_flag;
  4419. /*< Specifies whether the IIR tuning filter is disabled (0) or
  4420. * enabled (nonzero).
  4421. */
  4422. } __packed;
  4423. /* Structure for the pregain parameter for the
  4424. * IIR filter module on the Tx path.
  4425. */
  4426. /* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN
  4427. * parameter in the Tx Path IIR Tuning Filter module.
  4428. */
  4429. struct admx_iir_filter_pre_gain {
  4430. uint16_t pre_gain;
  4431. /*< Linear gain in Q13 format. */
  4432. uint16_t reserved;
  4433. /*< Clients must set this field to zero.*/
  4434. } __packed;
  4435. /* Structure for the configuration parameter for the
  4436. * IIR filter module on the Tx path.
  4437. */
  4438. /* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS
  4439. * parameter in the Tx Path IIR Tuning Filter module. \n
  4440. * \n
  4441. * This structure is followed by the HPF IIR filter coefficients on
  4442. * the Tx path as follows: \n
  4443. * - Sequence of int32_t ulFilterCoeffs. Each band has five
  4444. * coefficients, each in int32_t format in the order of b0, b1, b2,
  4445. * a1, a2.
  4446. * - Sequence of int16_t sNumShiftFactor. One int16_t per band. The
  4447. * numerator shift factor is related to the Q factor of the filter
  4448. * coefficients.
  4449. * - Sequence of uint16_t usPanSetting. One uint16_t for each band
  4450. * to indicate if the filter is applied to left (0), right (1), or
  4451. * both (2) channels.
  4452. */
  4453. struct admx_iir_filter_cfg_params {
  4454. uint16_t num_biquad_stages;
  4455. /*< Number of bands.
  4456. * Supported values: 0 to 20
  4457. */
  4458. uint16_t reserved;
  4459. /*< Clients must set this field to zero.*/
  4460. } __packed;
  4461. /* end_addtogroup audio_pp_module_ids */
  4462. /* @ingroup audio_pp_module_ids
  4463. * ID of the QEnsemble module.
  4464. * This module supports the following parameter IDs:
  4465. * - #ADM_PARAM_ID_QENSEMBLE_ENABLE
  4466. * - #ADM_PARAM_ID_QENSEMBLE_BACKGAIN
  4467. * - #ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE
  4468. */
  4469. #define ADM_MODULE_ID_QENSEMBLE 0x00010C59
  4470. /* @addtogroup audio_pp_param_ids */
  4471. /* ID of the QEnsemble enable parameter used by the
  4472. * #ADM_MODULE_ID_QENSEMBLE module.
  4473. * @messagepayload
  4474. * @structure{adm_qensemble_enable}
  4475. * @tablespace
  4476. * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_ENABLE.tex}
  4477. */
  4478. #define ADM_PARAM_ID_QENSEMBLE_ENABLE 0x00010C60
  4479. /* ID of the QEnsemble back gain parameter used by the
  4480. * #ADM_MODULE_ID_QENSEMBLE module.
  4481. * @messagepayload
  4482. * @structure{adm_qensemble_param_backgain}
  4483. * @tablespace
  4484. * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_BACKGAIN.tex}
  4485. */
  4486. #define ADM_PARAM_ID_QENSEMBLE_BACKGAIN 0x00010C61
  4487. /* ID of the QEnsemble new angle parameter used by the
  4488. * #ADM_MODULE_ID_QENSEMBLE module.
  4489. * @messagepayload
  4490. * @structure{adm_qensemble_param_set_new_angle}
  4491. * @tablespace
  4492. * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE.tex}
  4493. */
  4494. #define ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE 0x00010C62
  4495. /* Structure for enabling the configuration parameter for the
  4496. * QEnsemble module.
  4497. */
  4498. /* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_ENABLE
  4499. * parameter used by the QEnsemble module.
  4500. */
  4501. struct adm_qensemble_enable {
  4502. uint32_t enable_flag;
  4503. /*< Specifies whether the QEnsemble module is disabled (0) or enabled
  4504. * (nonzero).
  4505. */
  4506. } __packed;
  4507. /* Structure for the background gain for the QEnsemble module. */
  4508. /* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_BACKGAIN
  4509. * parameter used by
  4510. * the QEnsemble module.
  4511. */
  4512. struct adm_qensemble_param_backgain {
  4513. int16_t back_gain;
  4514. /*< Linear gain in Q15 format.
  4515. * Supported values: 0 to 32767
  4516. */
  4517. uint16_t reserved;
  4518. /*< Clients must set this field to zero.*/
  4519. } __packed;
  4520. /* Structure for setting a new angle for the QEnsemble module. */
  4521. /* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE
  4522. * parameter used
  4523. * by the QEnsemble module.
  4524. */
  4525. struct adm_qensemble_param_set_new_angle {
  4526. int16_t new_angle;
  4527. /*< New angle in degrees.
  4528. * Supported values: 0 to 359
  4529. */
  4530. int16_t time_ms;
  4531. /*< Transition time in milliseconds to set the new angle.
  4532. * Supported values: 0 to 32767
  4533. */
  4534. } __packed;
  4535. /* end_addtogroup audio_pp_module_ids */
  4536. /* @ingroup audio_pp_module_ids
  4537. * ID of the Volume Control module pre/postprocessing block.
  4538. * This module supports the following parameter IDs:
  4539. * - #ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN
  4540. * - #ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN
  4541. * - #ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG
  4542. * - #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
  4543. * - #ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS
  4544. * - #ASM_PARAM_ID_MULTICHANNEL_GAIN
  4545. * - #ASM_PARAM_ID_MULTICHANNEL_MUTE
  4546. */
  4547. #define ASM_MODULE_ID_VOL_CTRL 0x00010BFE
  4548. /* @addtogroup audio_pp_param_ids */
  4549. /* ID of the master gain parameter used by the #ASM_MODULE_ID_VOL_CTRL
  4550. * module.
  4551. * @messagepayload
  4552. * @structure{asm_volume_ctrl_master_gain}
  4553. * @tablespace
  4554. * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN.tex}
  4555. */
  4556. #define ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN 0x00010BFF
  4557. /* ID of the left/right channel gain parameter used by the
  4558. * #ASM_MODULE_ID_VOL_CTRL module.
  4559. * @messagepayload
  4560. * @structure{asm_volume_ctrl_lr_chan_gain}
  4561. * @tablespace
  4562. * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN.tex}
  4563. */
  4564. #define ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN 0x00010C00
  4565. /* ID of the mute configuration parameter used by the
  4566. * #ASM_MODULE_ID_VOL_CTRL module.
  4567. * @messagepayload
  4568. * @structure{asm_volume_ctrl_mute_config}
  4569. * @tablespace
  4570. * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG.tex}
  4571. */
  4572. #define ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG 0x00010C01
  4573. /* ID of the soft stepping volume parameters used by the
  4574. * #ASM_MODULE_ID_VOL_CTRL module.
  4575. * @messagepayload
  4576. * @structure{asm_soft_step_volume_params}
  4577. * @tablespace
  4578. * @inputtable{Audio_Postproc_ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMET
  4579. * ERS.tex}
  4580. */
  4581. #define ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS 0x00010C29
  4582. /* ID of the soft pause parameters used by the #ASM_MODULE_ID_VOL_CTRL
  4583. * module.
  4584. */
  4585. #define ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS 0x00010D6A
  4586. /* ID of the multiple-channel volume control parameters used by the
  4587. * #ASM_MODULE_ID_VOL_CTRL module.
  4588. */
  4589. #define ASM_PARAM_ID_MULTICHANNEL_GAIN 0x00010713
  4590. /* ID of the multiple-channel mute configuration parameters used by the
  4591. * #ASM_MODULE_ID_VOL_CTRL module.
  4592. */
  4593. #define ASM_PARAM_ID_MULTICHANNEL_MUTE 0x00010714
  4594. /* Structure for the master gain parameter for a volume control
  4595. * module.
  4596. */
  4597. /* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN
  4598. * parameter used by the Volume Control module.
  4599. */
  4600. struct asm_volume_ctrl_master_gain {
  4601. struct apr_hdr hdr;
  4602. struct asm_stream_cmd_set_pp_params_v2 param;
  4603. struct asm_stream_param_data_v2 data;
  4604. uint16_t master_gain;
  4605. /*< Linear gain in Q13 format. */
  4606. uint16_t reserved;
  4607. /*< Clients must set this field to zero.
  4608. */
  4609. } __packed;
  4610. /* Structure for the left/right channel gain parameter for a
  4611. * volume control module.
  4612. */
  4613. /* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN
  4614. * parameters used by the Volume Control module.
  4615. */
  4616. struct asm_volume_ctrl_lr_chan_gain {
  4617. struct apr_hdr hdr;
  4618. struct asm_stream_cmd_set_pp_params_v2 param;
  4619. struct asm_stream_param_data_v2 data;
  4620. uint16_t l_chan_gain;
  4621. /*< Linear gain in Q13 format for the left channel. */
  4622. uint16_t r_chan_gain;
  4623. /*< Linear gain in Q13 format for the right channel.*/
  4624. } __packed;
  4625. /* Structure for the mute configuration parameter for a
  4626. volume control module. */
  4627. /* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG
  4628. * parameter used by the Volume Control module.
  4629. */
  4630. struct asm_volume_ctrl_mute_config {
  4631. struct apr_hdr hdr;
  4632. struct asm_stream_cmd_set_pp_params_v2 param;
  4633. struct asm_stream_param_data_v2 data;
  4634. uint32_t mute_flag;
  4635. /*< Specifies whether mute is disabled (0) or enabled (nonzero).*/
  4636. } __packed;
  4637. /*
  4638. * Supported parameters for a soft stepping linear ramping curve.
  4639. */
  4640. #define ASM_PARAM_SVC_RAMPINGCURVE_LINEAR 0
  4641. /*
  4642. * Exponential ramping curve.
  4643. */
  4644. #define ASM_PARAM_SVC_RAMPINGCURVE_EXP 1
  4645. /*
  4646. * Logarithmic ramping curve.
  4647. */
  4648. #define ASM_PARAM_SVC_RAMPINGCURVE_LOG 2
  4649. /* Structure for holding soft stepping volume parameters. */
  4650. /* Payload of the #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
  4651. * parameters used by the Volume Control module.
  4652. */
  4653. struct asm_soft_step_volume_params {
  4654. struct apr_hdr hdr;
  4655. struct asm_stream_cmd_set_pp_params_v2 param;
  4656. struct asm_stream_param_data_v2 data;
  4657. uint32_t period;
  4658. /*< Period in milliseconds.
  4659. * Supported values: 0 to 15000
  4660. */
  4661. uint32_t step;
  4662. /*< Step in microseconds.
  4663. * Supported values: 0 to 15000000
  4664. */
  4665. uint32_t ramping_curve;
  4666. /*< Ramping curve type.
  4667. * Supported values:
  4668. * - #ASM_PARAM_SVC_RAMPINGCURVE_LINEAR
  4669. * - #ASM_PARAM_SVC_RAMPINGCURVE_EXP
  4670. * - #ASM_PARAM_SVC_RAMPINGCURVE_LOG
  4671. */
  4672. } __packed;
  4673. /* Structure for holding soft pause parameters. */
  4674. /* Payload of the #ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS
  4675. * parameters used by the Volume Control module.
  4676. */
  4677. struct asm_soft_pause_params {
  4678. struct apr_hdr hdr;
  4679. struct asm_stream_cmd_set_pp_params_v2 param;
  4680. struct asm_stream_param_data_v2 data;
  4681. uint32_t enable_flag;
  4682. /*< Specifies whether soft pause is disabled (0) or enabled
  4683. * (nonzero).
  4684. */
  4685. uint32_t period;
  4686. /*< Period in milliseconds.
  4687. * Supported values: 0 to 15000
  4688. */
  4689. uint32_t step;
  4690. /*< Step in microseconds.
  4691. * Supported values: 0 to 15000000
  4692. */
  4693. uint32_t ramping_curve;
  4694. /*< Ramping curve.
  4695. * Supported values:
  4696. * - #ASM_PARAM_SVC_RAMPINGCURVE_LINEAR
  4697. * - #ASM_PARAM_SVC_RAMPINGCURVE_EXP
  4698. * - #ASM_PARAM_SVC_RAMPINGCURVE_LOG
  4699. */
  4700. } __packed;
  4701. /* Maximum number of channels.*/
  4702. #define VOLUME_CONTROL_MAX_CHANNELS 8
  4703. /* Structure for holding one channel type - gain pair. */
  4704. /* Payload of the #ASM_PARAM_ID_MULTICHANNEL_GAIN channel
  4705. * type/gain pairs used by the Volume Control module. \n \n This
  4706. * structure immediately follows the
  4707. * asm_volume_ctrl_multichannel_gain structure.
  4708. */
  4709. struct asm_volume_ctrl_channelype_gain_pair {
  4710. struct apr_hdr hdr;
  4711. struct asm_stream_cmd_set_pp_params_v2 param;
  4712. struct asm_stream_param_data_v2 data;
  4713. uint8_t channelype;
  4714. /*< Channel type for which the gain setting is to be applied.
  4715. * Supported values:
  4716. * - #PCM_CHANNEL_L
  4717. * - #PCM_CHANNEL_R
  4718. * - #PCM_CHANNEL_C
  4719. * - #PCM_CHANNEL_LS
  4720. * - #PCM_CHANNEL_RS
  4721. * - #PCM_CHANNEL_LFE
  4722. * - #PCM_CHANNEL_CS
  4723. * - #PCM_CHANNEL_LB
  4724. * - #PCM_CHANNEL_RB
  4725. * - #PCM_CHANNELS
  4726. * - #PCM_CHANNEL_CVH
  4727. * - #PCM_CHANNEL_MS
  4728. * - #PCM_CHANNEL_FLC
  4729. * - #PCM_CHANNEL_FRC
  4730. * - #PCM_CHANNEL_RLC
  4731. * - #PCM_CHANNEL_RRC
  4732. */
  4733. uint8_t reserved1;
  4734. /*< Clients must set this field to zero. */
  4735. uint8_t reserved2;
  4736. /*< Clients must set this field to zero. */
  4737. uint8_t reserved3;
  4738. /*< Clients must set this field to zero. */
  4739. uint32_t gain;
  4740. /*< Gain value for this channel in Q28 format.
  4741. * Supported values: Any
  4742. */
  4743. } __packed;
  4744. /* Structure for the multichannel gain command */
  4745. /* Payload of the #ASM_PARAM_ID_MULTICHANNEL_GAIN
  4746. * parameters used by the Volume Control module.
  4747. */
  4748. struct asm_volume_ctrl_multichannel_gain {
  4749. struct apr_hdr hdr;
  4750. struct asm_stream_cmd_set_pp_params_v2 param;
  4751. struct asm_stream_param_data_v2 data;
  4752. uint32_t num_channels;
  4753. /*< Number of channels for which gain values are provided. Any
  4754. * channels present in the data for which gain is not provided are
  4755. * set to unity gain.
  4756. * Supported values: 1 to 8
  4757. */
  4758. struct asm_volume_ctrl_channelype_gain_pair
  4759. gain_data[VOLUME_CONTROL_MAX_CHANNELS];
  4760. /*< Array of channel type/gain pairs.*/
  4761. } __packed;
  4762. /* Structure for holding one channel type - mute pair. */
  4763. /* Payload of the #ASM_PARAM_ID_MULTICHANNEL_MUTE channel
  4764. * type/mute setting pairs used by the Volume Control module. \n \n
  4765. * This structure immediately follows the
  4766. * asm_volume_ctrl_multichannel_mute structure.
  4767. */
  4768. struct asm_volume_ctrl_channelype_mute_pair {
  4769. struct apr_hdr hdr;
  4770. struct asm_stream_cmd_set_pp_params_v2 param;
  4771. struct asm_stream_param_data_v2 data;
  4772. uint8_t channelype;
  4773. /*< Channel type for which the mute setting is to be applied.
  4774. * Supported values:
  4775. * - #PCM_CHANNEL_L
  4776. * - #PCM_CHANNEL_R
  4777. * - #PCM_CHANNEL_C
  4778. * - #PCM_CHANNEL_LS
  4779. * - #PCM_CHANNEL_RS
  4780. * - #PCM_CHANNEL_LFE
  4781. * - #PCM_CHANNEL_CS
  4782. * - #PCM_CHANNEL_LB
  4783. * - #PCM_CHANNEL_RB
  4784. * - #PCM_CHANNELS
  4785. * - #PCM_CHANNEL_CVH
  4786. * - #PCM_CHANNEL_MS
  4787. * - #PCM_CHANNEL_FLC
  4788. * - #PCM_CHANNEL_FRC
  4789. * - #PCM_CHANNEL_RLC
  4790. * - #PCM_CHANNEL_RRC
  4791. */
  4792. uint8_t reserved1;
  4793. /*< Clients must set this field to zero. */
  4794. uint8_t reserved2;
  4795. /*< Clients must set this field to zero. */
  4796. uint8_t reserved3;
  4797. /*< Clients must set this field to zero. */
  4798. uint32_t mute;
  4799. /*< Mute setting for this channel.
  4800. * Supported values:
  4801. * - 0 = Unmute
  4802. * - Nonzero = Mute
  4803. */
  4804. } __packed;
  4805. /* Structure for the multichannel mute command */
  4806. /* @brief Payload of the #ASM_PARAM_ID_MULTICHANNEL_MUTE
  4807. * parameters used by the Volume Control module.
  4808. */
  4809. struct asm_volume_ctrl_multichannel_mute {
  4810. struct apr_hdr hdr;
  4811. struct asm_stream_cmd_set_pp_params_v2 param;
  4812. struct asm_stream_param_data_v2 data;
  4813. uint32_t num_channels;
  4814. /*< Number of channels for which mute configuration is
  4815. * provided. Any channels present in the data for which mute
  4816. * configuration is not provided are set to unmute.
  4817. * Supported values: 1 to 8
  4818. */
  4819. struct asm_volume_ctrl_channelype_mute_pair
  4820. mute_data[VOLUME_CONTROL_MAX_CHANNELS];
  4821. /*< Array of channel type/mute setting pairs.*/
  4822. } __packed;
  4823. /* end_addtogroup audio_pp_param_ids */
  4824. /* audio_pp_module_ids
  4825. * ID of the IIR Tuning Filter module.
  4826. * This module supports the following parameter IDs:
  4827. * - #ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG
  4828. * - #ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN
  4829. * - #ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS
  4830. */
  4831. #define ASM_MODULE_ID_IIRUNING_FILTER 0x00010C02
  4832. /* @addtogroup audio_pp_param_ids */
  4833. /* ID of the IIR tuning filter enable parameter used by the
  4834. * #ASM_MODULE_ID_IIRUNING_FILTER module.
  4835. * @messagepayload
  4836. * @structure{asm_iiruning_filter_enable}
  4837. * @tablespace
  4838. * @inputtable{Audio_Postproc_ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CO
  4839. * NFIG.tex}
  4840. */
  4841. #define ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG 0x00010C03
  4842. /* ID of the IIR tuning filter pregain parameter used by the
  4843. * #ASM_MODULE_ID_IIRUNING_FILTER module.
  4844. */
  4845. #define ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN 0x00010C04
  4846. /* ID of the IIR tuning filter configuration parameters used by the
  4847. * #ASM_MODULE_ID_IIRUNING_FILTER module.
  4848. */
  4849. #define ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS 0x00010C05
  4850. /* Structure for an enable configuration parameter for an
  4851. * IIR tuning filter module.
  4852. */
  4853. /* @brief Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG
  4854. * parameter used by the IIR Tuning Filter module.
  4855. */
  4856. struct asm_iiruning_filter_enable {
  4857. uint32_t enable_flag;
  4858. /*< Specifies whether the IIR tuning filter is disabled (0) or
  4859. * enabled (1).
  4860. */
  4861. } __packed;
  4862. /* Structure for the pregain parameter for an IIR tuning filter module. */
  4863. /* Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN
  4864. * parameters used by the IIR Tuning Filter module.
  4865. */
  4866. struct asm_iiruning_filter_pregain {
  4867. uint16_t pregain;
  4868. /*< Linear gain in Q13 format. */
  4869. uint16_t reserved;
  4870. /*< Clients must set this field to zero.*/
  4871. } __packed;
  4872. /* Structure for the configuration parameter for an IIR tuning filter
  4873. * module.
  4874. */
  4875. /* @brief Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS
  4876. * parameters used by the IIR Tuning Filter module. \n
  4877. * \n
  4878. * This structure is followed by the IIR filter coefficients: \n
  4879. * - Sequence of int32_t FilterCoeffs \n
  4880. * Five coefficients for each band. Each coefficient is in int32_t format, in
  4881. * the order of b0, b1, b2, a1, a2.
  4882. * - Sequence of int16_t NumShiftFactor \n
  4883. * One int16_t per band. The numerator shift factor is related to the Q
  4884. * factor of the filter coefficients.
  4885. * - Sequence of uint16_t PanSetting \n
  4886. * One uint16_t per band, indicating if the filter is applied to left (0),
  4887. * right (1), or both (2) channels.
  4888. */
  4889. struct asm_iir_filter_config_params {
  4890. uint16_t num_biquad_stages;
  4891. /*< Number of bands.
  4892. * Supported values: 0 to 20
  4893. */
  4894. uint16_t reserved;
  4895. /*< Clients must set this field to zero.*/
  4896. } __packed;
  4897. /* audio_pp_module_ids
  4898. * ID of the Multiband Dynamic Range Control (MBDRC) module on the Tx/Rx
  4899. * paths.
  4900. * This module supports the following parameter IDs:
  4901. * - #ASM_PARAM_ID_MBDRC_ENABLE
  4902. * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS
  4903. */
  4904. #define ASM_MODULE_ID_MBDRC 0x00010C06
  4905. /* audio_pp_param_ids */
  4906. /* ID of the MBDRC enable parameter used by the #ASM_MODULE_ID_MBDRC module.
  4907. * @messagepayload
  4908. * @structure{asm_mbdrc_enable}
  4909. * @tablespace
  4910. * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_ENABLE.tex}
  4911. */
  4912. #define ASM_PARAM_ID_MBDRC_ENABLE 0x00010C07
  4913. /* ID of the MBDRC configuration parameters used by the
  4914. * #ASM_MODULE_ID_MBDRC module.
  4915. * @messagepayload
  4916. * @structure{asm_mbdrc_config_params}
  4917. * @tablespace
  4918. * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_CONFIG_PARAMS.tex}
  4919. *
  4920. * @parspace Sub-band DRC configuration parameters
  4921. * @structure{asm_subband_drc_config_params}
  4922. * @tablespace
  4923. * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_subband_DRC.tex}
  4924. *
  4925. * @keep{6}
  4926. * To obtain legacy ADRC from MBDRC, use the calibration tool to:
  4927. *
  4928. * - Enable MBDRC (EnableFlag = TRUE)
  4929. * - Set number of bands to 1 (uiNumBands = 1)
  4930. * - Enable the first MBDRC band (DrcMode[0] = DRC_ENABLED = 1)
  4931. * - Clear the first band mute flag (MuteFlag[0] = 0)
  4932. * - Set the first band makeup gain to unity (compMakeUpGain[0] = 0x2000)
  4933. * - Use the legacy ADRC parameters to calibrate the rest of the MBDRC
  4934. * parameters.
  4935. */
  4936. #define ASM_PARAM_ID_MBDRC_CONFIG_PARAMS 0x00010C08
  4937. /* end_addtogroup audio_pp_param_ids */
  4938. /* audio_pp_module_ids
  4939. * ID of the MMBDRC module version 2 pre/postprocessing block.
  4940. * This module differs from the original MBDRC (#ASM_MODULE_ID_MBDRC) in
  4941. * the length of the filters used in each sub-band.
  4942. * This module supports the following parameter ID:
  4943. * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_IMPROVED_FILTBANK_V2
  4944. */
  4945. #define ASM_MODULE_ID_MBDRCV2 0x0001070B
  4946. /* @addtogroup audio_pp_param_ids */
  4947. /* ID of the configuration parameters used by the
  4948. * #ASM_MODULE_ID_MBDRCV2 module for the improved filter structure
  4949. * of the MBDRC v2 pre/postprocessing block.
  4950. * The update to this configuration structure from the original
  4951. * MBDRC is the number of filter coefficients in the filter
  4952. * structure. The sequence for is as follows:
  4953. * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
  4954. * - 2 bands = 141 FIR coefficients + 2 mute flags + uint16_t padding
  4955. * - 3 bands = 141+81 FIR coefficients + 3 mute flags + uint16_t padding
  4956. * - 4 bands = 141+81+61 FIR coefficients + 4 mute flags + uint16_t
  4957. * padding
  4958. * - 5 bands = 141+81+61+61 FIR coefficients + 5 mute flags +
  4959. * uint16_t padding
  4960. * This block uses the same parameter structure as
  4961. * #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS.
  4962. */
  4963. #define ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_IMPROVED_FILTBANK_V2 \
  4964. 0x0001070C
  4965. /* Structure for the enable parameter for an MBDRC module. */
  4966. /* Payload of the #ASM_PARAM_ID_MBDRC_ENABLE parameter used by the
  4967. * MBDRC module.
  4968. */
  4969. struct asm_mbdrc_enable {
  4970. uint32_t enable_flag;
  4971. /*< Specifies whether MBDRC is disabled (0) or enabled (nonzero).*/
  4972. } __packed;
  4973. /* Structure for the configuration parameters for an MBDRC module. */
  4974. /* Payload of the #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS
  4975. * parameters used by the MBDRC module. \n \n Following this
  4976. * structure is the payload for sub-band DRC configuration
  4977. * parameters (asm_subband_drc_config_params). This sub-band
  4978. * structure must be repeated for each band.
  4979. */
  4980. struct asm_mbdrc_config_params {
  4981. uint16_t num_bands;
  4982. /*< Number of bands.
  4983. * Supported values: 1 to 5
  4984. */
  4985. int16_t limiterhreshold;
  4986. /*< Threshold in decibels for the limiter output.
  4987. * Supported values: -72 to 18 \n
  4988. * Recommended value: 3994 (-0.22 db in Q3.12 format)
  4989. */
  4990. int16_t limiter_makeup_gain;
  4991. /*< Makeup gain in decibels for the limiter output.
  4992. * Supported values: -42 to 42 \n
  4993. * Recommended value: 256 (0 dB in Q7.8 format)
  4994. */
  4995. int16_t limiter_gc;
  4996. /*< Limiter gain recovery coefficient.
  4997. * Supported values: 0.5 to 0.99 \n
  4998. * Recommended value: 32440 (0.99 in Q15 format)
  4999. */
  5000. int16_t limiter_delay;
  5001. /*< Limiter delay in samples.
  5002. * Supported values: 0 to 10 \n
  5003. * Recommended value: 262 (0.008 samples in Q15 format)
  5004. */
  5005. int16_t limiter_max_wait;
  5006. /*< Maximum limiter waiting time in samples.
  5007. * Supported values: 0 to 10 \n
  5008. * Recommended value: 262 (0.008 samples in Q15 format)
  5009. */
  5010. } __packed;
  5011. /* DRC configuration structure for each sub-band of an MBDRC module. */
  5012. /* Payload of the #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS DRC
  5013. * configuration parameters for each sub-band in the MBDRC module.
  5014. * After this DRC structure is configured for valid bands, the next
  5015. * MBDRC setparams expects the sequence of sub-band MBDRC filter
  5016. * coefficients (the length depends on the number of bands) plus the
  5017. * mute flag for that band plus uint16_t padding.
  5018. *
  5019. * @keep{10}
  5020. * The filter coefficient and mute flag are of type int16_t:
  5021. * - FIR coefficient = int16_t firFilter
  5022. * - Mute flag = int16_t fMuteFlag
  5023. *
  5024. * The sequence is as follows:
  5025. * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
  5026. * - 2 bands = 97 FIR coefficients + 2 mute flags + uint16_t padding
  5027. * - 3 bands = 97+33 FIR coefficients + 3 mute flags + uint16_t padding
  5028. * - 4 bands = 97+33+33 FIR coefficients + 4 mute flags + uint16_t padding
  5029. * - 5 bands = 97+33+33+33 FIR coefficients + 5 mute flags + uint16_t padding
  5030. *
  5031. * For improved filterbank, the sequence is as follows:
  5032. * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
  5033. * - 2 bands = 141 FIR coefficients + 2 mute flags + uint16_t padding
  5034. * - 3 bands = 141+81 FIR coefficients + 3 mute flags + uint16_t padding
  5035. * - 4 bands = 141+81+61 FIR coefficients + 4 mute flags + uint16_t padding
  5036. * - 5 bands = 141+81+61+61 FIR coefficients + 5 mute flags + uint16_t padding
  5037. */
  5038. struct asm_subband_drc_config_params {
  5039. int16_t drc_stereo_linked_flag;
  5040. /*< Specifies whether all stereo channels have the same applied
  5041. * dynamics (1) or if they process their dynamics independently (0).
  5042. * Supported values:
  5043. * - 0 -- Not linked
  5044. * - 1 -- Linked
  5045. */
  5046. int16_t drc_mode;
  5047. /*< Specifies whether DRC mode is bypassed for sub-bands.
  5048. * Supported values:
  5049. * - 0 -- Disabled
  5050. * - 1 -- Enabled
  5051. */
  5052. int16_t drc_down_sample_level;
  5053. /*< DRC down sample level.
  5054. * Supported values: @ge 1
  5055. */
  5056. int16_t drc_delay;
  5057. /*< DRC delay in samples.
  5058. * Supported values: 0 to 1200
  5059. */
  5060. uint16_t drc_rmsime_avg_const;
  5061. /*< RMS signal energy time-averaging constant.
  5062. * Supported values: 0 to 2^16-1
  5063. */
  5064. uint16_t drc_makeup_gain;
  5065. /*< DRC makeup gain in decibels.
  5066. * Supported values: 258 to 64917
  5067. */
  5068. /* Down expander settings */
  5069. int16_t down_expdrhreshold;
  5070. /*< Down expander threshold.
  5071. * Supported Q7 format values: 1320 to up_cmpsrhreshold
  5072. */
  5073. int16_t down_expdr_slope;
  5074. /*< Down expander slope.
  5075. * Supported Q8 format values: -32768 to 0.
  5076. */
  5077. uint32_t down_expdr_attack;
  5078. /*< Down expander attack constant.
  5079. * Supported Q31 format values: 196844 to 2^31.
  5080. */
  5081. uint32_t down_expdr_release;
  5082. /*< Down expander release constant.
  5083. * Supported Q31 format values: 19685 to 2^31
  5084. */
  5085. uint16_t down_expdr_hysteresis;
  5086. /*< Down expander hysteresis constant.
  5087. * Supported Q14 format values: 1 to 32690
  5088. */
  5089. uint16_t reserved;
  5090. /*< Clients must set this field to zero. */
  5091. int32_t down_expdr_min_gain_db;
  5092. /*< Down expander minimum gain.
  5093. * Supported Q23 format values: -805306368 to 0.
  5094. */
  5095. /* Up compressor settings */
  5096. int16_t up_cmpsrhreshold;
  5097. /*< Up compressor threshold.
  5098. * Supported Q7 format values: down_expdrhreshold to
  5099. * down_cmpsrhreshold.
  5100. */
  5101. uint16_t up_cmpsr_slope;
  5102. /*< Up compressor slope.
  5103. * Supported Q16 format values: 0 to 64881.
  5104. */
  5105. uint32_t up_cmpsr_attack;
  5106. /*< Up compressor attack constant.
  5107. * Supported Q31 format values: 196844 to 2^31.
  5108. */
  5109. uint32_t up_cmpsr_release;
  5110. /*< Up compressor release constant.
  5111. * Supported Q31 format values: 19685 to 2^31.
  5112. */
  5113. uint16_t up_cmpsr_hysteresis;
  5114. /*< Up compressor hysteresis constant.
  5115. * Supported Q14 format values: 1 to 32690.
  5116. */
  5117. /* Down compressor settings */
  5118. int16_t down_cmpsrhreshold;
  5119. /*< Down compressor threshold.
  5120. * Supported Q7 format values: up_cmpsrhreshold to 11560.
  5121. */
  5122. uint16_t down_cmpsr_slope;
  5123. /*< Down compressor slope.
  5124. * Supported Q16 format values: 0 to 64881.
  5125. */
  5126. uint16_t reserved1;
  5127. /*< Clients must set this field to zero. */
  5128. uint32_t down_cmpsr_attack;
  5129. /*< Down compressor attack constant.
  5130. * Supported Q31 format values: 196844 to 2^31.
  5131. */
  5132. uint32_t down_cmpsr_release;
  5133. /*< Down compressor release constant.
  5134. * Supported Q31 format values: 19685 to 2^31.
  5135. */
  5136. uint16_t down_cmpsr_hysteresis;
  5137. /*< Down compressor hysteresis constant.
  5138. * Supported Q14 values: 1 to 32690.
  5139. */
  5140. uint16_t reserved2;
  5141. /*< Clients must set this field to zero.*/
  5142. } __packed;
  5143. #define ASM_MODULE_ID_EQUALIZER 0x00010C27
  5144. #define ASM_PARAM_ID_EQUALIZER_PARAMETERS 0x00010C28
  5145. #define ASM_MAX_EQ_BANDS 12
  5146. struct asm_eq_per_band_params {
  5147. uint32_t band_idx;
  5148. /*< Band index.
  5149. * Supported values: 0 to 11
  5150. */
  5151. uint32_t filterype;
  5152. /*< Type of filter.
  5153. * Supported values:
  5154. * - #ASM_PARAM_EQYPE_NONE
  5155. * - #ASM_PARAM_EQ_BASS_BOOST
  5156. * - #ASM_PARAM_EQ_BASS_CUT
  5157. * - #ASM_PARAM_EQREBLE_BOOST
  5158. * - #ASM_PARAM_EQREBLE_CUT
  5159. * - #ASM_PARAM_EQ_BAND_BOOST
  5160. * - #ASM_PARAM_EQ_BAND_CUT
  5161. */
  5162. uint32_t center_freq_hz;
  5163. /*< Filter band center frequency in Hertz. */
  5164. int32_t filter_gain;
  5165. /*< Filter band initial gain.
  5166. * Supported values: +12 to -12 dB in 1 dB increments
  5167. */
  5168. int32_t q_factor;
  5169. /*< Filter band quality factor expressed as a Q8 number, i.e., a
  5170. * fixed-point number with q factor of 8. For example, 3000/(2^8).
  5171. */
  5172. } __packed;
  5173. struct asm_eq_params {
  5174. struct apr_hdr hdr;
  5175. struct asm_stream_cmd_set_pp_params_v2 param;
  5176. struct asm_stream_param_data_v2 data;
  5177. uint32_t enable_flag;
  5178. /*< Specifies whether the equalizer module is disabled (0) or enabled
  5179. * (nonzero).
  5180. */
  5181. uint32_t num_bands;
  5182. /*< Number of bands.
  5183. * Supported values: 1 to 12
  5184. */
  5185. struct asm_eq_per_band_params eq_bands[ASM_MAX_EQ_BANDS];
  5186. } __packed;
  5187. /* No equalizer effect.*/
  5188. #define ASM_PARAM_EQYPE_NONE 0
  5189. /* Bass boost equalizer effect.*/
  5190. #define ASM_PARAM_EQ_BASS_BOOST 1
  5191. /*Bass cut equalizer effect.*/
  5192. #define ASM_PARAM_EQ_BASS_CUT 2
  5193. /* Treble boost equalizer effect */
  5194. #define ASM_PARAM_EQREBLE_BOOST 3
  5195. /* Treble cut equalizer effect.*/
  5196. #define ASM_PARAM_EQREBLE_CUT 4
  5197. /* Band boost equalizer effect.*/
  5198. #define ASM_PARAM_EQ_BAND_BOOST 5
  5199. /* Band cut equalizer effect.*/
  5200. #define ASM_PARAM_EQ_BAND_CUT 6
  5201. /* Voice get & set params */
  5202. #define VOICE_CMD_SET_PARAM 0x0001133D
  5203. #define VOICE_CMD_GET_PARAM 0x0001133E
  5204. #define VOICE_EVT_GET_PARAM_ACK 0x00011008
  5205. /** ID of the Bass Boost module.
  5206. This module supports the following parameter IDs:
  5207. - #AUDPROC_PARAM_ID_BASS_BOOST_ENABLE
  5208. - #AUDPROC_PARAM_ID_BASS_BOOST_MODE
  5209. - #AUDPROC_PARAM_ID_BASS_BOOST_STRENGTH
  5210. */
  5211. #define AUDPROC_MODULE_ID_BASS_BOOST 0x000108A1
  5212. /** ID of the Bass Boost enable parameter used by
  5213. AUDPROC_MODULE_ID_BASS_BOOST.
  5214. */
  5215. #define AUDPROC_PARAM_ID_BASS_BOOST_ENABLE 0x000108A2
  5216. /** ID of the Bass Boost mode parameter used by
  5217. AUDPROC_MODULE_ID_BASS_BOOST.
  5218. */
  5219. #define AUDPROC_PARAM_ID_BASS_BOOST_MODE 0x000108A3
  5220. /** ID of the Bass Boost strength parameter used by
  5221. AUDPROC_MODULE_ID_BASS_BOOST.
  5222. */
  5223. #define AUDPROC_PARAM_ID_BASS_BOOST_STRENGTH 0x000108A4
  5224. /** ID of the Virtualizer module. This module supports the
  5225. following parameter IDs:
  5226. - #AUDPROC_PARAM_ID_VIRTUALIZER_ENABLE
  5227. - #AUDPROC_PARAM_ID_VIRTUALIZER_STRENGTH
  5228. - #AUDPROC_PARAM_ID_VIRTUALIZER_OUT_TYPE
  5229. - #AUDPROC_PARAM_ID_VIRTUALIZER_GAIN_ADJUST
  5230. */
  5231. #define AUDPROC_MODULE_ID_VIRTUALIZER 0x000108A5
  5232. /** ID of the Virtualizer enable parameter used by
  5233. AUDPROC_MODULE_ID_VIRTUALIZER.
  5234. */
  5235. #define AUDPROC_PARAM_ID_VIRTUALIZER_ENABLE 0x000108A6
  5236. /** ID of the Virtualizer strength parameter used by
  5237. AUDPROC_MODULE_ID_VIRTUALIZER.
  5238. */
  5239. #define AUDPROC_PARAM_ID_VIRTUALIZER_STRENGTH 0x000108A7
  5240. /** ID of the Virtualizer out type parameter used by
  5241. AUDPROC_MODULE_ID_VIRTUALIZER.
  5242. */
  5243. #define AUDPROC_PARAM_ID_VIRTUALIZER_OUT_TYPE 0x000108A8
  5244. /** ID of the Virtualizer out type parameter used by
  5245. AUDPROC_MODULE_ID_VIRTUALIZER.
  5246. */
  5247. #define AUDPROC_PARAM_ID_VIRTUALIZER_GAIN_ADJUST 0x000108A9
  5248. /** ID of the Reverb module. This module supports the following
  5249. parameter IDs:
  5250. - #AUDPROC_PARAM_ID_REVERB_ENABLE
  5251. - #AUDPROC_PARAM_ID_REVERB_MODE
  5252. - #AUDPROC_PARAM_ID_REVERB_PRESET
  5253. - #AUDPROC_PARAM_ID_REVERB_WET_MIX
  5254. - #AUDPROC_PARAM_ID_REVERB_GAIN_ADJUST
  5255. - #AUDPROC_PARAM_ID_REVERB_ROOM_LEVEL
  5256. - #AUDPROC_PARAM_ID_REVERB_ROOM_HF_LEVEL
  5257. - #AUDPROC_PARAM_ID_REVERB_DECAY_TIME
  5258. - #AUDPROC_PARAM_ID_REVERB_DECAY_HF_RATIO
  5259. - #AUDPROC_PARAM_ID_REVERB_REFLECTIONS_LEVEL
  5260. - #AUDPROC_PARAM_ID_REVERB_REFLECTIONS_DELAY
  5261. - #AUDPROC_PARAM_ID_REVERB_LEVEL
  5262. - #AUDPROC_PARAM_ID_REVERB_DELAY
  5263. - #AUDPROC_PARAM_ID_REVERB_DIFFUSION
  5264. - #AUDPROC_PARAM_ID_REVERB_DENSITY
  5265. */
  5266. #define AUDPROC_MODULE_ID_REVERB 0x000108AA
  5267. /** ID of the Reverb enable parameter used by
  5268. AUDPROC_MODULE_ID_REVERB.
  5269. */
  5270. #define AUDPROC_PARAM_ID_REVERB_ENABLE 0x000108AB
  5271. /** ID of the Reverb mode parameter used by
  5272. AUDPROC_MODULE_ID_REVERB.
  5273. */
  5274. #define AUDPROC_PARAM_ID_REVERB_MODE 0x000108AC
  5275. /** ID of the Reverb preset parameter used by
  5276. AUDPROC_MODULE_ID_REVERB.
  5277. */
  5278. #define AUDPROC_PARAM_ID_REVERB_PRESET 0x000108AD
  5279. /** ID of the Reverb wet mix parameter used by
  5280. AUDPROC_MODULE_ID_REVERB.
  5281. */
  5282. #define AUDPROC_PARAM_ID_REVERB_WET_MIX 0x000108AE
  5283. /** ID of the Reverb gain adjust parameter used by
  5284. AUDPROC_MODULE_ID_REVERB.
  5285. */
  5286. #define AUDPROC_PARAM_ID_REVERB_GAIN_ADJUST 0x000108AF
  5287. /** ID of the Reverb room level parameter used by
  5288. AUDPROC_MODULE_ID_REVERB.
  5289. */
  5290. #define AUDPROC_PARAM_ID_REVERB_ROOM_LEVEL 0x000108B0
  5291. /** ID of the Reverb room hf level parameter used by
  5292. AUDPROC_MODULE_ID_REVERB.
  5293. */
  5294. #define AUDPROC_PARAM_ID_REVERB_ROOM_HF_LEVEL 0x000108B1
  5295. /** ID of the Reverb decay time parameter used by
  5296. AUDPROC_MODULE_ID_REVERB.
  5297. */
  5298. #define AUDPROC_PARAM_ID_REVERB_DECAY_TIME 0x000108B2
  5299. /** ID of the Reverb decay hf ratio parameter used by
  5300. AUDPROC_MODULE_ID_REVERB.
  5301. */
  5302. #define AUDPROC_PARAM_ID_REVERB_DECAY_HF_RATIO 0x000108B3
  5303. /** ID of the Reverb reflections level parameter used by
  5304. AUDPROC_MODULE_ID_REVERB.
  5305. */
  5306. #define AUDPROC_PARAM_ID_REVERB_REFLECTIONS_LEVEL 0x000108B4
  5307. /** ID of the Reverb reflections delay parameter used by
  5308. AUDPROC_MODULE_ID_REVERB.
  5309. */
  5310. #define AUDPROC_PARAM_ID_REVERB_REFLECTIONS_DELAY 0x000108B5
  5311. /** ID of the Reverb level parameter used by
  5312. AUDPROC_MODULE_ID_REVERB.
  5313. */
  5314. #define AUDPROC_PARAM_ID_REVERB_LEVEL 0x000108B6
  5315. /** ID of the Reverb delay parameter used by
  5316. AUDPROC_MODULE_ID_REVERB.
  5317. */
  5318. #define AUDPROC_PARAM_ID_REVERB_DELAY 0x000108B7
  5319. /** ID of the Reverb diffusion parameter used by
  5320. AUDPROC_MODULE_ID_REVERB.
  5321. */
  5322. #define AUDPROC_PARAM_ID_REVERB_DIFFUSION 0x000108B8
  5323. /** ID of the Reverb density parameter used by
  5324. AUDPROC_MODULE_ID_REVERB.
  5325. */
  5326. #define AUDPROC_PARAM_ID_REVERB_DENSITY 0x000108B9
  5327. /** ID of the Popless Equalizer module. This module supports the
  5328. following parameter IDs:
  5329. - #AUDPROC_PARAM_ID_EQ_ENABLE
  5330. - #AUDPROC_PARAM_ID_EQ_CONFIG
  5331. - #AUDPROC_PARAM_ID_EQ_NUM_BANDS
  5332. - #AUDPROC_PARAM_ID_EQ_BAND_LEVELS
  5333. - #AUDPROC_PARAM_ID_EQ_BAND_LEVEL_RANGE
  5334. - #AUDPROC_PARAM_ID_EQ_BAND_FREQS
  5335. - #AUDPROC_PARAM_ID_EQ_SINGLE_BAND_FREQ_RANGE
  5336. - #AUDPROC_PARAM_ID_EQ_SINGLE_BAND_FREQ
  5337. - #AUDPROC_PARAM_ID_EQ_BAND_INDEX
  5338. - #AUDPROC_PARAM_ID_EQ_PRESET_ID
  5339. - #AUDPROC_PARAM_ID_EQ_NUM_PRESETS
  5340. - #AUDPROC_PARAM_ID_EQ_GET_PRESET_NAME
  5341. */
  5342. #define AUDPROC_MODULE_ID_POPLESS_EQUALIZER 0x000108BA
  5343. /** ID of the Popless Equalizer enable parameter used by
  5344. AUDPROC_MODULE_ID_POPLESS_EQUALIZER.
  5345. */
  5346. #define AUDPROC_PARAM_ID_EQ_ENABLE 0x000108BB
  5347. /** ID of the Popless Equalizer config parameter used by
  5348. AUDPROC_MODULE_ID_POPLESS_EQUALIZER.
  5349. */
  5350. #define AUDPROC_PARAM_ID_EQ_CONFIG 0x000108BC
  5351. /** ID of the Popless Equalizer number of bands parameter used
  5352. by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is
  5353. used for get param only.
  5354. */
  5355. #define AUDPROC_PARAM_ID_EQ_NUM_BANDS 0x000108BD
  5356. /** ID of the Popless Equalizer band levels parameter used by
  5357. AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is
  5358. used for get param only.
  5359. */
  5360. #define AUDPROC_PARAM_ID_EQ_BAND_LEVELS 0x000108BE
  5361. /** ID of the Popless Equalizer band level range parameter used
  5362. by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is
  5363. used for get param only.
  5364. */
  5365. #define AUDPROC_PARAM_ID_EQ_BAND_LEVEL_RANGE 0x000108BF
  5366. /** ID of the Popless Equalizer band frequencies parameter used
  5367. by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is
  5368. used for get param only.
  5369. */
  5370. #define AUDPROC_PARAM_ID_EQ_BAND_FREQS 0x000108C0
  5371. /** ID of the Popless Equalizer single band frequency range
  5372. parameter used by AUDPROC_MODULE_ID_POPLESS_EQUALIZER.
  5373. This param ID is used for get param only.
  5374. */
  5375. #define AUDPROC_PARAM_ID_EQ_SINGLE_BAND_FREQ_RANGE 0x000108C1
  5376. /** ID of the Popless Equalizer single band frequency parameter
  5377. used by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID
  5378. is used for set param only.
  5379. */
  5380. #define AUDPROC_PARAM_ID_EQ_SINGLE_BAND_FREQ 0x000108C2
  5381. /** ID of the Popless Equalizer band index parameter used by
  5382. AUDPROC_MODULE_ID_POPLESS_EQUALIZER.
  5383. */
  5384. #define AUDPROC_PARAM_ID_EQ_BAND_INDEX 0x000108C3
  5385. /** ID of the Popless Equalizer preset id parameter used by
  5386. AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is used
  5387. for get param only.
  5388. */
  5389. #define AUDPROC_PARAM_ID_EQ_PRESET_ID 0x000108C4
  5390. /** ID of the Popless Equalizer number of presets parameter used
  5391. by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is used
  5392. for get param only.
  5393. */
  5394. #define AUDPROC_PARAM_ID_EQ_NUM_PRESETS 0x000108C5
  5395. /** ID of the Popless Equalizer preset name parameter used by
  5396. AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is used
  5397. for get param only.
  5398. */
  5399. #define AUDPROC_PARAM_ID_EQ_PRESET_NAME 0x000108C6
  5400. /* Set Q6 topologies */
  5401. #define ASM_CMD_ADD_TOPOLOGIES 0x00010DBE
  5402. #define ADM_CMD_ADD_TOPOLOGIES 0x00010335
  5403. /* structure used for both ioctls */
  5404. struct cmd_set_topologies {
  5405. struct apr_hdr hdr;
  5406. u32 payload_addr_lsw;
  5407. /* LSW of parameter data payload address.*/
  5408. u32 payload_addr_msw;
  5409. /* MSW of parameter data payload address.*/
  5410. u32 mem_map_handle;
  5411. /* Memory map handle returned by mem map command */
  5412. u32 payload_size;
  5413. /* Size in bytes of the variable payload in shared memory */
  5414. } __packed;
  5415. /* This module represents the Rx processing of Feedback speaker protection.
  5416. * It contains the excursion control, thermal protection,
  5417. * analog clip manager features in it.
  5418. * This module id will support following param ids.
  5419. * - AFE_PARAM_ID_FBSP_MODE_RX_CFG
  5420. */
  5421. #define AFE_MODULE_FB_SPKR_PROT_RX 0x0001021C
  5422. #define AFE_PARAM_ID_FBSP_MODE_RX_CFG 0x0001021D
  5423. struct asm_fbsp_mode_rx_cfg {
  5424. uint32_t minor_version;
  5425. uint32_t mode;
  5426. } __packed;
  5427. /* This module represents the VI processing of feedback speaker protection.
  5428. * It will receive Vsens and Isens from codec and generates necessary
  5429. * parameters needed by Rx processing.
  5430. * This module id will support following param ids.
  5431. * - AFE_PARAM_ID_SPKR_CALIB_VI_PROC_CFG
  5432. * - AFE_PARAM_ID_CALIB_RES_CFG
  5433. * - AFE_PARAM_ID_FEEDBACK_PATH_CFG
  5434. */
  5435. #define AFE_MODULE_FB_SPKR_PROT_VI_PROC 0x00010226
  5436. #define AFE_PARAM_ID_SPKR_CALIB_VI_PROC_CFG 0x0001022A
  5437. struct asm_spkr_calib_vi_proc_cfg {
  5438. uint32_t minor_version;
  5439. int32_t r0_cali_q24;
  5440. int16_t t0_cali_q6;
  5441. int16_t reserved;
  5442. } __packed;
  5443. #define AFE_PARAM_ID_CALIB_RES_CFG 0x0001022B
  5444. struct asm_calib_res_cfg {
  5445. uint32_t minor_version;
  5446. int32_t r0_cali_q24;
  5447. uint32_t th_vi_ca_state;
  5448. } __packed;
  5449. #define AFE_PARAM_ID_FEEDBACK_PATH_CFG 0x0001022C
  5450. struct asm_feedback_path_cfg {
  5451. uint32_t minor_version;
  5452. int32_t dst_portid;
  5453. int32_t num_channels;
  5454. int32_t chan_info[4];
  5455. } __packed;
  5456. #define AFE_PARAM_ID_MODE_VI_PROC_CFG 0x00010227
  5457. struct asm_mode_vi_proc_cfg {
  5458. uint32_t minor_version;
  5459. uint32_t cal_mode;
  5460. } __packed;
  5461. union afe_spkr_prot_config {
  5462. struct asm_fbsp_mode_rx_cfg mode_rx_cfg;
  5463. struct asm_spkr_calib_vi_proc_cfg vi_proc_cfg;
  5464. struct asm_feedback_path_cfg feedback_path_cfg;
  5465. struct asm_mode_vi_proc_cfg mode_vi_proc_cfg;
  5466. } __packed;
  5467. struct afe_spkr_prot_config_command {
  5468. struct apr_hdr hdr;
  5469. struct afe_port_cmd_set_param_v2 param;
  5470. struct afe_port_param_data_v2 pdata;
  5471. union afe_spkr_prot_config prot_config;
  5472. } __packed;
  5473. struct afe_spkr_prot_get_vi_calib {
  5474. struct afe_port_cmd_get_param_v2 get_param;
  5475. struct afe_port_param_data_v2 pdata;
  5476. struct asm_calib_res_cfg res_cfg;
  5477. } __packed;
  5478. struct afe_spkr_prot_calib_get_resp {
  5479. uint32_t status;
  5480. struct afe_port_param_data_v2 pdata;
  5481. struct asm_calib_res_cfg res_cfg;
  5482. } __packed;
  5483. /* SRS TRUMEDIA start */
  5484. /* topology */
  5485. #define SRS_TRUMEDIA_TOPOLOGY_ID 0x00010D90
  5486. /* module */
  5487. #define SRS_TRUMEDIA_MODULE_ID 0x10005010
  5488. /* parameters */
  5489. #define SRS_TRUMEDIA_PARAMS 0x10005011
  5490. #define SRS_TRUMEDIA_PARAMS_WOWHD 0x10005012
  5491. #define SRS_TRUMEDIA_PARAMS_CSHP 0x10005013
  5492. #define SRS_TRUMEDIA_PARAMS_HPF 0x10005014
  5493. #define SRS_TRUMEDIA_PARAMS_PEQ 0x10005015
  5494. #define SRS_TRUMEDIA_PARAMS_HL 0x10005016
  5495. #define SRS_ID_GLOBAL 0x00000001
  5496. #define SRS_ID_WOWHD 0x00000002
  5497. #define SRS_ID_CSHP 0x00000003
  5498. #define SRS_ID_HPF 0x00000004
  5499. #define SRS_ID_PEQ 0x00000005
  5500. #define SRS_ID_HL 0x00000006
  5501. #define SRS_CMD_UPLOAD 0x7FFF0000
  5502. #define SRS_PARAM_INDEX_MASK 0x80000000
  5503. #define SRS_PARAM_OFFSET_MASK 0x3FFF0000
  5504. #define SRS_PARAM_VALUE_MASK 0x0000FFFF
  5505. struct srs_trumedia_params_GLOBAL {
  5506. uint8_t v1;
  5507. uint8_t v2;
  5508. uint8_t v3;
  5509. uint8_t v4;
  5510. uint8_t v5;
  5511. uint8_t v6;
  5512. uint8_t v7;
  5513. uint8_t v8;
  5514. } __packed;
  5515. struct srs_trumedia_params_WOWHD {
  5516. uint32_t v1;
  5517. uint16_t v2;
  5518. uint16_t v3;
  5519. uint16_t v4;
  5520. uint16_t v5;
  5521. uint16_t v6;
  5522. uint16_t v7;
  5523. uint16_t v8;
  5524. uint16_t v____A1;
  5525. uint32_t v9;
  5526. uint16_t v10;
  5527. uint16_t v11;
  5528. uint32_t v12[16];
  5529. } __packed;
  5530. struct srs_trumedia_params_CSHP {
  5531. uint32_t v1;
  5532. uint16_t v2;
  5533. uint16_t v3;
  5534. uint16_t v4;
  5535. uint16_t v5;
  5536. uint16_t v6;
  5537. uint16_t v____A1;
  5538. uint32_t v7;
  5539. uint16_t v8;
  5540. uint16_t v9;
  5541. uint32_t v10[16];
  5542. } __packed;
  5543. struct srs_trumedia_params_HPF {
  5544. uint32_t v1;
  5545. uint32_t v2[26];
  5546. } __packed;
  5547. struct srs_trumedia_params_PEQ {
  5548. uint32_t v1;
  5549. uint16_t v2;
  5550. uint16_t v3;
  5551. uint16_t v4;
  5552. uint16_t v____A1;
  5553. uint32_t v5[26];
  5554. uint32_t v6[26];
  5555. } __packed;
  5556. struct srs_trumedia_params_HL {
  5557. uint16_t v1;
  5558. uint16_t v2;
  5559. uint16_t v3;
  5560. uint16_t v____A1;
  5561. int32_t v4;
  5562. uint32_t v5;
  5563. uint16_t v6;
  5564. uint16_t v____A2;
  5565. uint32_t v7;
  5566. } __packed;
  5567. struct srs_trumedia_params {
  5568. struct srs_trumedia_params_GLOBAL global;
  5569. struct srs_trumedia_params_WOWHD wowhd;
  5570. struct srs_trumedia_params_CSHP cshp;
  5571. struct srs_trumedia_params_HPF hpf;
  5572. struct srs_trumedia_params_PEQ peq;
  5573. struct srs_trumedia_params_HL hl;
  5574. } __packed;
  5575. /* SRS TruMedia end */
  5576. /* LSM Specific */
  5577. #define VW_FEAT_DIM (39)
  5578. #define APRV2_IDS_SERVICE_ID_ADSP_LSM_V (0xD)
  5579. #define APRV2_IDS_DOMAIN_ID_ADSP_V (0x4)
  5580. #define APRV2_IDS_DOMAIN_ID_APPS_V (0x5)
  5581. #define LSM_SESSION_CMD_SHARED_MEM_MAP_REGIONS (0x00012A7F)
  5582. #define LSM_SESSION_CMDRSP_SHARED_MEM_MAP_REGIONS (0x00012A80)
  5583. #define LSM_SESSION_CMD_SHARED_MEM_UNMAP_REGIONS (0x00012A81)
  5584. #define LSM_SESSION_CMD_OPEN_TX (0x00012A82)
  5585. #define LSM_SESSION_CMD_CLOSE_TX (0x00012A88)
  5586. #define LSM_SESSION_CMD_SET_PARAMS (0x00012A83)
  5587. #define LSM_SESSION_CMD_REGISTER_SOUND_MODEL (0x00012A84)
  5588. #define LSM_SESSION_CMD_DEREGISTER_SOUND_MODEL (0x00012A85)
  5589. #define LSM_SESSION_CMD_START (0x00012A86)
  5590. #define LSM_SESSION_CMD_STOP (0x00012A87)
  5591. #define LSM_SESSION_EVENT_DETECTION_STATUS (0x00012B00)
  5592. #define LSM_MODULE_ID_VOICE_WAKEUP (0x00012C00)
  5593. #define LSM_PARAM_ID_ENDPOINT_DETECT_THRESHOLD (0x00012C01)
  5594. #define LSM_PARAM_ID_OPERATION_MODE (0x00012C02)
  5595. #define LSM_PARAM_ID_GAIN (0x00012C03)
  5596. #define LSM_PARAM_ID_CONNECT_TO_PORT (0x00012C04)
  5597. #define LSM_PARAM_ID_KEYWORD_DETECT_SENSITIVITY (0x00012C05)
  5598. #define LSM_PARAM_ID_USER_DETECT_SENSITIVITY (0x00012C06)
  5599. #define LSM_PARAM_ID_FEATURE_COMPENSATION_DATA (0x00012C07)
  5600. /* HW MAD specific */
  5601. #define AFE_MODULE_HW_MAD (0x00010230)
  5602. #define AFE_PARAM_ID_HW_MAD_CFG (0x00010231)
  5603. #define AFE_PARAM_ID_HW_MAD_CTRL (0x00010232)
  5604. #define AFE_PARAM_ID_SLIMBUS_SLAVE_PORT_CFG (0x00010233)
  5605. /* SW MAD specific */
  5606. #define AFE_MODULE_SW_MAD (0x0001022D)
  5607. #define AFE_PARAM_ID_SW_MAD_CFG (0x0001022E)
  5608. #define AFE_PARAM_ID_SVM_MODEL (0x0001022F)
  5609. /* Commands/Params to pass the codec/slimbus data to DSP */
  5610. #define AFE_SVC_CMD_SET_PARAM (0x000100f3)
  5611. #define AFE_MODULE_CDC_DEV_CFG (0x00010234)
  5612. #define AFE_PARAM_ID_CDC_SLIMBUS_SLAVE_CFG (0x00010235)
  5613. #define AFE_PARAM_ID_CDC_REG_CFG (0x00010236)
  5614. #define AFE_PARAM_ID_CDC_REG_CFG_INIT (0x00010237)
  5615. #define AFE_MAX_CDC_REGISTERS_TO_CONFIG (20)
  5616. /* AANC Port Config Specific */
  5617. #define AFE_PARAM_ID_AANC_PORT_CONFIG (0x00010215)
  5618. #define AFE_API_VERSION_AANC_PORT_CONFIG (0x1)
  5619. #define AANC_TX_MIC_UNUSED (0)
  5620. #define AANC_TX_VOICE_MIC (1)
  5621. #define AANC_TX_ERROR_MIC (2)
  5622. #define AANC_TX_NOISE_MIC (3)
  5623. #define AFE_PORT_MAX_CHANNEL_CNT (8)
  5624. #define AFE_MODULE_AANC (0x00010214)
  5625. #define AFE_PARAM_ID_CDC_AANC_VERSION (0x0001023A)
  5626. #define AFE_API_VERSION_CDC_AANC_VERSION (0x1)
  5627. #define AANC_HW_BLOCK_VERSION_1 (1)
  5628. #define AANC_HW_BLOCK_VERSION_2 (2)
  5629. /*Clip bank selection*/
  5630. #define AFE_API_VERSION_CLIP_BANK_SEL_CFG 0x1
  5631. #define AFE_CLIP_MAX_BANKS 4
  5632. #define AFE_PARAM_ID_CLIP_BANK_SEL_CFG 0x00010242
  5633. struct afe_param_aanc_port_cfg {
  5634. /* Minor version used for tracking the version of the module's
  5635. * source port configuration.
  5636. */
  5637. uint32_t aanc_port_cfg_minor_version;
  5638. /* Sampling rate of the source Tx port. 8k - 192k*/
  5639. uint32_t tx_port_sample_rate;
  5640. /* Channel mapping for the Tx port signal carrying Noise (X),
  5641. * Error (E), and Voice (V) signals.
  5642. */
  5643. uint8_t tx_port_channel_map[AFE_PORT_MAX_CHANNEL_CNT];
  5644. /* Number of channels on the source Tx port. */
  5645. uint16_t tx_port_num_channels;
  5646. /* Port ID of the Rx path reference signal. */
  5647. uint16_t rx_path_ref_port_id;
  5648. /* Sampling rate of the reference port. 8k - 192k*/
  5649. uint32_t ref_port_sample_rate;
  5650. } __packed;
  5651. struct afe_param_id_cdc_aanc_version {
  5652. /* Minor version used for tracking the version of the module's
  5653. * hw version
  5654. */
  5655. uint32_t cdc_aanc_minor_version;
  5656. /* HW version. */
  5657. uint32_t aanc_hw_version;
  5658. } __packed;
  5659. struct afe_param_id_clip_bank_sel {
  5660. /* Minor version used for tracking the version of the module's
  5661. * hw version
  5662. */
  5663. uint32_t minor_version;
  5664. /* Number of banks to be read */
  5665. uint32_t num_banks;
  5666. uint32_t bank_map[AFE_CLIP_MAX_BANKS];
  5667. } __packed;
  5668. /* ERROR CODES */
  5669. /* Success. The operation completed with no errors. */
  5670. #define ADSP_EOK 0x00000000
  5671. /* General failure. */
  5672. #define ADSP_EFAILED 0x00000001
  5673. /* Bad operation parameter. */
  5674. #define ADSP_EBADPARAM 0x00000002
  5675. /* Unsupported routine or operation. */
  5676. #define ADSP_EUNSUPPORTED 0x00000003
  5677. /* Unsupported version. */
  5678. #define ADSP_EVERSION 0x00000004
  5679. /* Unexpected problem encountered. */
  5680. #define ADSP_EUNEXPECTED 0x00000005
  5681. /* Unhandled problem occurred. */
  5682. #define ADSP_EPANIC 0x00000006
  5683. /* Unable to allocate resource. */
  5684. #define ADSP_ENORESOURCE 0x00000007
  5685. /* Invalid handle. */
  5686. #define ADSP_EHANDLE 0x00000008
  5687. /* Operation is already processed. */
  5688. #define ADSP_EALREADY 0x00000009
  5689. /* Operation is not ready to be processed. */
  5690. #define ADSP_ENOTREADY 0x0000000A
  5691. /* Operation is pending completion. */
  5692. #define ADSP_EPENDING 0x0000000B
  5693. /* Operation could not be accepted or processed. */
  5694. #define ADSP_EBUSY 0x0000000C
  5695. /* Operation aborted due to an error. */
  5696. #define ADSP_EABORTED 0x0000000D
  5697. /* Operation preempted by a higher priority. */
  5698. #define ADSP_EPREEMPTED 0x0000000E
  5699. /* Operation requests intervention to complete. */
  5700. #define ADSP_ECONTINUE 0x0000000F
  5701. /* Operation requests immediate intervention to complete. */
  5702. #define ADSP_EIMMEDIATE 0x00000010
  5703. /* Operation is not implemented. */
  5704. #define ADSP_ENOTIMPL 0x00000011
  5705. /* Operation needs more data or resources. */
  5706. #define ADSP_ENEEDMORE 0x00000012
  5707. /* Operation does not have memory. */
  5708. #define ADSP_ENOMEMORY 0x00000014
  5709. /* Item does not exist. */
  5710. #define ADSP_ENOTEXIST 0x00000015
  5711. /* Operation is finished. */
  5712. #define ADSP_ETERMINATED 0x00011174
  5713. /*bharath, adsp_error_codes.h */
  5714. /* LPASS clock for I2S Interface */
  5715. /* Supported OSR clock values */
  5716. #define Q6AFE_LPASS_OSR_CLK_12_P288_MHZ 0xBB8000
  5717. #define Q6AFE_LPASS_OSR_CLK_8_P192_MHZ 0x7D0000
  5718. #define Q6AFE_LPASS_OSR_CLK_6_P144_MHZ 0x5DC000
  5719. #define Q6AFE_LPASS_OSR_CLK_4_P096_MHZ 0x3E8000
  5720. #define Q6AFE_LPASS_OSR_CLK_3_P072_MHZ 0x2EE000
  5721. #define Q6AFE_LPASS_OSR_CLK_2_P048_MHZ 0x1F4000
  5722. #define Q6AFE_LPASS_OSR_CLK_1_P536_MHZ 0x177000
  5723. #define Q6AFE_LPASS_OSR_CLK_1_P024_MHZ 0xFA000
  5724. #define Q6AFE_LPASS_OSR_CLK_768_kHZ 0xBB800
  5725. #define Q6AFE_LPASS_OSR_CLK_512_kHZ 0x7D000
  5726. #define Q6AFE_LPASS_OSR_CLK_DISABLE 0x0
  5727. /* Supported Bit clock values */
  5728. #define Q6AFE_LPASS_IBIT_CLK_8_P192_MHZ 0x7D0000
  5729. #define Q6AFE_LPASS_IBIT_CLK_6_P144_MHZ 0x5DC000
  5730. #define Q6AFE_LPASS_IBIT_CLK_4_P096_MHZ 0x3E8000
  5731. #define Q6AFE_LPASS_IBIT_CLK_3_P072_MHZ 0x2EE000
  5732. #define Q6AFE_LPASS_IBIT_CLK_2_P048_MHZ 0x1F4000
  5733. #define Q6AFE_LPASS_IBIT_CLK_1_P536_MHZ 0x177000
  5734. #define Q6AFE_LPASS_IBIT_CLK_1_P024_MHZ 0xFA000
  5735. #define Q6AFE_LPASS_IBIT_CLK_768_KHZ 0xBB800
  5736. #define Q6AFE_LPASS_IBIT_CLK_512_KHZ 0x7D000
  5737. #define Q6AFE_LPASS_IBIT_CLK_256_KHZ 0x3E800
  5738. #define Q6AFE_LPASS_IBIT_CLK_DISABLE 0x0
  5739. /* Supported LPASS CLK sources */
  5740. #define Q6AFE_LPASS_CLK_SRC_EXTERNAL 0
  5741. #define Q6AFE_LPASS_CLK_SRC_INTERNAL 1
  5742. /* Supported LPASS CLK root*/
  5743. #define Q6AFE_LPASS_CLK_ROOT_DEFAULT 0
  5744. enum afe_lpass_clk_mode {
  5745. Q6AFE_LPASS_MODE_BOTH_INVALID,
  5746. Q6AFE_LPASS_MODE_CLK1_VALID,
  5747. Q6AFE_LPASS_MODE_CLK2_VALID,
  5748. Q6AFE_LPASS_MODE_BOTH_VALID,
  5749. } __packed;
  5750. struct afe_clk_cfg {
  5751. /* Minor version used for tracking the version of the I2S
  5752. * configuration interface.
  5753. * Supported values: #AFE_API_VERSION_I2S_CONFIG
  5754. */
  5755. u32 i2s_cfg_minor_version;
  5756. /* clk value 1 in MHz. */
  5757. u32 clk_val1;
  5758. /* clk value 2 in MHz. */
  5759. u32 clk_val2;
  5760. /* clk_src
  5761. * #Q6AFE_LPASS_CLK_SRC_EXTERNAL
  5762. * #Q6AFE_LPASS_CLK_SRC_INTERNAL
  5763. */
  5764. u16 clk_src;
  5765. /* clk_root -0 for default */
  5766. u16 clk_root;
  5767. /* clk_set_mode
  5768. * #Q6AFE_LPASS_MODE_BOTH_INVALID
  5769. * #Q6AFE_LPASS_MODE_CLK1_VALID
  5770. * #Q6AFE_LPASS_MODE_CLK2_VALID
  5771. * #Q6AFE_LPASS_MODE_BOTH_VALID
  5772. */
  5773. u16 clk_set_mode;
  5774. /* This param id is used to configure I2S clk */
  5775. u16 reserved;
  5776. } __packed;
  5777. /* This param id is used to configure I2S clk */
  5778. #define AFE_PARAM_ID_LPAIF_CLK_CONFIG 0x00010238
  5779. struct afe_lpass_clk_config_command {
  5780. struct apr_hdr hdr;
  5781. struct afe_port_cmd_set_param_v2 param;
  5782. struct afe_port_param_data_v2 pdata;
  5783. struct afe_clk_cfg clk_cfg;
  5784. } __packed;
  5785. enum afe_lpass_digital_clk_src {
  5786. Q6AFE_LPASS_DIGITAL_ROOT_INVALID,
  5787. Q6AFE_LPASS_DIGITAL_ROOT_PRI_MI2S_OSR,
  5788. Q6AFE_LPASS_DIGITAL_ROOT_SEC_MI2S_OSR,
  5789. Q6AFE_LPASS_DIGITAL_ROOT_TER_MI2S_OSR,
  5790. Q6AFE_LPASS_DIGITAL_ROOT_QUAD_MI2S_OSR,
  5791. Q6AFE_LPASS_DIGITAL_ROOT_CDC_ROOT_CLK,
  5792. } __packed;
  5793. /* This param id is used to configure internal clk */
  5794. #define AFE_PARAM_ID_INTERNAL_DIGIATL_CDC_CLK_CONFIG 0x00010239
  5795. struct afe_digital_clk_cfg {
  5796. /* Minor version used for tracking the version of the I2S
  5797. * configuration interface.
  5798. * Supported values: #AFE_API_VERSION_I2S_CONFIG
  5799. */
  5800. u32 i2s_cfg_minor_version;
  5801. /* clk value in MHz. */
  5802. u32 clk_val;
  5803. /* INVALID
  5804. * PRI_MI2S_OSR
  5805. * SEC_MI2S_OSR
  5806. * TER_MI2S_OSR
  5807. * QUAD_MI2S_OSR
  5808. * DIGT_CDC_ROOT
  5809. */
  5810. u16 clk_root;
  5811. /* This field must be set to zero. */
  5812. u16 reserved;
  5813. } __packed;
  5814. struct afe_lpass_digital_clk_config_command {
  5815. struct apr_hdr hdr;
  5816. struct afe_port_cmd_set_param_v2 param;
  5817. struct afe_port_param_data_v2 pdata;
  5818. struct afe_digital_clk_cfg clk_cfg;
  5819. } __packed;
  5820. #define ASM_MODULE_ID_PP_SA 0x10001fa0
  5821. #define ASM_PARAM_ID_PP_SA_PARAMS 0x10001fa1
  5822. //#define ASM_MODULE_ID_PP_SA_VOL 0x10001fa3
  5823. //#define ASM_PARAM_ID_PP_SA_VOLUME 0x10001fa4
  5824. #define ASM_MODULE_ID_PP_SA_VSP 0x10001fb0
  5825. #define ASM_PARAM_ID_PP_SA_VSP_PARAMS 0x10001fb1
  5826. #define ASM_MODULE_ID_PP_DHA 0x10001fc0
  5827. #define ASM_PARAM_ID_PP_DHA_PARAMS 0x10001fc1
  5828. #define ASM_MODULE_ID_PP_LRSM 0x10001fe0
  5829. #define ASM_PARAM_ID_PP_LRSM_PARAMS 0x10001fe1
  5830. #define ASM_MODULE_ID_PP_SA_EP 0x10001fd0
  5831. #define ASM_PARAM_ID_PP_SA_EP_PARAMS 0x10001fd1
  5832. #define ASM_PARAM_ID_PP_SA_EP_GET_PARAMS 0x10001fd2
  5833. #define ASM_MODULE_ID_PP_SA_MSP 0x10001ff0
  5834. #define ASM_MODULE_ID_PP_SA_MSP_PARAM 0x10001ff1
  5835. struct sa_params {
  5836. int16_t OutDevice;
  5837. int16_t Preset;
  5838. int32_t EqLev[7];
  5839. int16_t m3Dlevel;
  5840. int16_t BElevel;
  5841. int16_t CHlevel;
  5842. int16_t CHRoomSize;
  5843. int16_t Clalevel;
  5844. int16_t volume;
  5845. int16_t Sqrow;
  5846. int16_t Sqcol;
  5847. int16_t TabInfo;
  5848. int16_t NewUI;
  5849. } __packed;
  5850. struct vsp_params {
  5851. uint32_t speed_int;
  5852. } __packed ;
  5853. struct dha_params {
  5854. int32_t enable;
  5855. int16_t gain[2][6];
  5856. } __packed ;
  5857. struct lrsm_params {
  5858. int16_t sm;
  5859. int16_t lr;
  5860. } __packed ;
  5861. struct sa_ep_params {
  5862. int32_t enable;
  5863. int32_t score;
  5864. } __packed ;
  5865. struct asm_stream_cmd_set_pp_params_sa {
  5866. struct apr_hdr hdr;
  5867. struct asm_stream_cmd_set_pp_params_v2 param;
  5868. struct asm_stream_param_data_v2 data;
  5869. struct sa_params sa_param;
  5870. } __packed;
  5871. struct asm_stream_cmd_set_pp_params_vsp {
  5872. struct apr_hdr hdr;
  5873. struct asm_stream_cmd_set_pp_params_v2 param;
  5874. struct asm_stream_param_data_v2 data;
  5875. uint32_t speed_int;
  5876. } __packed;
  5877. struct asm_stream_cmd_set_pp_params_dha {
  5878. struct apr_hdr hdr;
  5879. struct asm_stream_cmd_set_pp_params_v2 param;
  5880. struct asm_stream_param_data_v2 data;
  5881. int32_t enable;
  5882. int16_t gain[2][6];
  5883. } __packed;
  5884. struct asm_stream_cmd_set_pp_params_lrsm {
  5885. struct apr_hdr hdr;
  5886. struct asm_stream_cmd_set_pp_params_v2 param;
  5887. struct asm_stream_param_data_v2 data;
  5888. int16_t sm;
  5889. int16_t lr;
  5890. } __packed;
  5891. struct asm_stream_cmd_set_pp_params_msp {
  5892. struct apr_hdr hdr;
  5893. struct asm_stream_cmd_set_pp_params_v2 param;
  5894. struct asm_stream_param_data_v2 data;
  5895. uint32_t msp_int;
  5896. } __packed;
  5897. struct asm_stream_cmd_set_pp_params_sa_ep {
  5898. struct apr_hdr hdr;
  5899. struct asm_stream_cmd_set_pp_params_v2 param;
  5900. struct asm_stream_param_data_v2 data;
  5901. int32_t enable;
  5902. int32_t score;
  5903. } __packed;
  5904. /*
  5905. * Opcode for AFE to start DTMF.
  5906. */
  5907. #define AFE_PORTS_CMD_DTMF_CTL 0x00010102
  5908. /** DTMF payload.*/
  5909. struct afe_dtmf_generation_command {
  5910. struct apr_hdr hdr;
  5911. /*
  5912. * Duration of the DTMF tone in ms.
  5913. * -1 -> continuous,
  5914. * 0 -> disable
  5915. */
  5916. int64_t duration_in_ms;
  5917. /*
  5918. * The DTMF high tone frequency.
  5919. */
  5920. uint16_t high_freq;
  5921. /*
  5922. * The DTMF low tone frequency.
  5923. */
  5924. uint16_t low_freq;
  5925. /*
  5926. * The DTMF volume setting
  5927. */
  5928. uint16_t gain;
  5929. /*
  5930. * The number of ports to enable/disable on.
  5931. */
  5932. uint16_t num_ports;
  5933. /*
  5934. * The Destination ports - array .
  5935. * For DTMF on multiple ports, portIds needs to
  5936. * be populated numPorts times.
  5937. */
  5938. uint16_t port_ids;
  5939. /*
  5940. * variable for 32 bit alignment of APR packet.
  5941. */
  5942. uint16_t reserved;
  5943. } __packed;
  5944. enum afe_config_type {
  5945. AFE_SLIMBUS_SLAVE_PORT_CONFIG,
  5946. AFE_SLIMBUS_SLAVE_CONFIG,
  5947. AFE_CDC_REGISTERS_CONFIG,
  5948. AFE_AANC_VERSION,
  5949. AFE_CDC_CLIP_REGISTERS_CONFIG,
  5950. AFE_CLIP_BANK_SEL,
  5951. AFE_MAX_CONFIG_TYPES,
  5952. };
  5953. struct afe_param_slimbus_slave_port_cfg {
  5954. uint32_t minor_version;
  5955. uint16_t slimbus_dev_id;
  5956. uint16_t slave_dev_pgd_la;
  5957. uint16_t slave_dev_intfdev_la;
  5958. uint16_t bit_width;
  5959. uint16_t data_format;
  5960. uint16_t num_channels;
  5961. uint16_t slave_port_mapping[AFE_PORT_MAX_AUDIO_CHAN_CNT];
  5962. } __packed;
  5963. struct afe_param_cdc_slimbus_slave_cfg {
  5964. uint32_t minor_version;
  5965. uint32_t device_enum_addr_lsw;
  5966. uint32_t device_enum_addr_msw;
  5967. uint16_t tx_slave_port_offset;
  5968. uint16_t rx_slave_port_offset;
  5969. } __packed;
  5970. struct afe_param_cdc_reg_cfg {
  5971. uint32_t minor_version;
  5972. uint32_t reg_logical_addr;
  5973. uint32_t reg_field_type;
  5974. uint32_t reg_field_bit_mask;
  5975. uint16_t reg_bit_width;
  5976. uint16_t reg_offset_scale;
  5977. } __packed;
  5978. struct afe_param_cdc_reg_cfg_data {
  5979. uint32_t num_registers;
  5980. struct afe_param_cdc_reg_cfg *reg_data;
  5981. } __packed;
  5982. struct afe_svc_cmd_set_param {
  5983. uint32_t payload_size;
  5984. uint32_t payload_address_lsw;
  5985. uint32_t payload_address_msw;
  5986. uint32_t mem_map_handle;
  5987. } __packed;
  5988. struct afe_param_hw_mad_ctrl {
  5989. uint32_t minor_version;
  5990. uint16_t mad_type;
  5991. uint16_t mad_enable;
  5992. } __packed;
  5993. struct afe_cmd_hw_mad_ctrl {
  5994. struct apr_hdr hdr;
  5995. struct afe_port_cmd_set_param_v2 param;
  5996. struct afe_port_param_data_v2 pdata;
  5997. struct afe_param_hw_mad_ctrl payload;
  5998. } __packed;
  5999. struct afe_cmd_hw_mad_slimbus_slave_port_cfg {
  6000. struct apr_hdr hdr;
  6001. struct afe_port_cmd_set_param_v2 param;
  6002. struct afe_port_param_data_v2 pdata;
  6003. struct afe_param_slimbus_slave_port_cfg sb_port_cfg;
  6004. } __packed;
  6005. struct afe_cmd_sw_mad_enable {
  6006. struct apr_hdr hdr;
  6007. struct afe_port_cmd_set_param_v2 param;
  6008. struct afe_port_param_data_v2 pdata;
  6009. } __packed;
  6010. struct afe_param_cdc_reg_cfg_payload {
  6011. struct afe_port_param_data_v2 common;
  6012. struct afe_param_cdc_reg_cfg reg_cfg;
  6013. } __packed;
  6014. /*
  6015. * reg_data's size can be up to AFE_MAX_CDC_REGISTERS_TO_CONFIG
  6016. */
  6017. struct afe_svc_cmd_cdc_reg_cfg {
  6018. struct apr_hdr hdr;
  6019. struct afe_svc_cmd_set_param param;
  6020. struct afe_param_cdc_reg_cfg_payload reg_data[0];
  6021. } __packed;
  6022. struct afe_svc_cmd_init_cdc_reg_cfg {
  6023. struct apr_hdr hdr;
  6024. struct afe_svc_cmd_set_param param;
  6025. struct afe_port_param_data_v2 init;
  6026. } __packed;
  6027. struct afe_svc_cmd_sb_slave_cfg {
  6028. struct apr_hdr hdr;
  6029. struct afe_svc_cmd_set_param param;
  6030. struct afe_port_param_data_v2 pdata;
  6031. struct afe_param_cdc_slimbus_slave_cfg sb_slave_cfg;
  6032. } __packed;
  6033. struct afe_svc_cmd_cdc_aanc_version {
  6034. struct apr_hdr hdr;
  6035. struct afe_svc_cmd_set_param param;
  6036. struct afe_port_param_data_v2 pdata;
  6037. struct afe_param_id_cdc_aanc_version version;
  6038. } __packed;
  6039. struct afe_port_cmd_set_aanc_param {
  6040. struct apr_hdr hdr;
  6041. struct afe_port_cmd_set_param_v2 param;
  6042. struct afe_port_param_data_v2 pdata;
  6043. union {
  6044. struct afe_param_aanc_port_cfg aanc_port_cfg;
  6045. struct afe_mod_enable_param mod_enable;
  6046. } __packed data;
  6047. } __packed;
  6048. struct afe_port_cmd_set_aanc_acdb_table {
  6049. struct apr_hdr hdr;
  6050. struct afe_port_cmd_set_param_v2 param;
  6051. } __packed;
  6052. /* Dolby DAP topology */
  6053. #define DOLBY_ADM_COPP_TOPOLOGY_ID 0x0001033B
  6054. /* RMS value from DSP */
  6055. #define RMS_MODULEID_APPI_PASSTHRU 0x10009011
  6056. #define RMS_PARAM_FIRST_SAMPLE 0x10009012
  6057. #define RMS_PAYLOAD_LEN 4
  6058. struct afe_svc_cmd_set_clip_bank_selection {
  6059. struct apr_hdr hdr;
  6060. struct afe_svc_cmd_set_param param;
  6061. struct afe_port_param_data_v2 pdata;
  6062. struct afe_param_id_clip_bank_sel bank_sel;
  6063. } __packed;
  6064. /* Ultrasound supported formats */
  6065. #define US_POINT_EPOS_FORMAT_V2 0x0001272D
  6066. #define US_RAW_FORMAT_V2 0x0001272C
  6067. #define US_PROX_FORMAT_V4 0x0001273B
  6068. #define US_RAW_SYNC_FORMAT 0x0001272F
  6069. #define US_GES_SYNC_FORMAT 0x00012730
  6070. #ifdef CONFIG_SND_SOC_MAXIM_DSM
  6071. struct afe_dsm_filter_set_params_t {
  6072. uint32_t dcResistance;
  6073. uint32_t coilTemp;
  6074. uint32_t qualityfactor;
  6075. uint32_t resonanceFreq;
  6076. uint32_t excursionMeasure;
  6077. uint32_t rdcroomtemp;
  6078. uint32_t releasetime;
  6079. uint32_t coilthermallimit;
  6080. uint32_t excursionlimit;
  6081. uint32_t dsmenabled;
  6082. uint32_t staticgain;
  6083. uint32_t lfxgain;
  6084. uint32_t pilotgain;
  6085. uint32_t flagToWrite;
  6086. uint32_t featureSetEnable;
  6087. uint32_t smooFacVoltClip;
  6088. uint32_t highPassCutOffFactor;
  6089. uint32_t leadResistance;
  6090. uint32_t rmsSmooFac;
  6091. uint32_t clipLimit;
  6092. uint32_t thermalCoeff;
  6093. uint32_t qSpk;
  6094. uint32_t excurLoggingThresh;
  6095. uint32_t coilTempLoggingThresh;
  6096. uint32_t resFreq;
  6097. uint32_t resFreqGuardBand;
  6098. uint32_t Ambient_Temp;
  6099. uint32_t STL_attack_time;
  6100. uint32_t STL_release_time;
  6101. uint32_t STL_Admittance_a1;
  6102. uint32_t STL_Admittance_a2;
  6103. uint32_t STL_Admittance_b0;
  6104. uint32_t STL_Admittance_b1;
  6105. uint32_t STL_Admittance_b2;
  6106. uint32_t Tch1;
  6107. uint32_t Rth1;
  6108. uint32_t Tch2;
  6109. uint32_t Rth2;
  6110. uint32_t STL_Attenuation_Gain;
  6111. uint32_t SPT_rampDownFrames;
  6112. uint32_t SPT_Threshold;
  6113. uint32_t T_horizon;
  6114. uint32_t LFX_Admittance_a1;
  6115. uint32_t LFX_Admittance_a2;
  6116. uint32_t LFX_Admittance_b0;
  6117. uint32_t LFX_Admittance_b1;
  6118. uint32_t LFX_Admittance_b2;
  6119. uint32_t X_Max;
  6120. uint32_t SPK_FS;
  6121. uint32_t Q_GUARD_BAND;
  6122. uint32_t STImpedModel_a1;
  6123. uint32_t STImpedModel_a2;
  6124. uint32_t STImpedModel_b0;
  6125. uint32_t STImpedModel_b1;
  6126. uint32_t STImpedModel_b2;
  6127. uint32_t STImpedModel_Flag;
  6128. uint32_t Q_Notch;
  6129. uint32_t Reserve_0;
  6130. uint32_t Reserve_1;
  6131. uint32_t Reserve_2;
  6132. uint32_t Reserve_3;
  6133. uint32_t Reserve_4;
  6134. } __packed;
  6135. union afe_dsm_spkr_prot_config {
  6136. struct asm_fbsp_mode_rx_cfg mode_rx_cfg;
  6137. struct asm_spkr_calib_vi_proc_cfg vi_proc_cfg;
  6138. struct asm_feedback_path_cfg feedback_path_cfg;
  6139. struct asm_mode_vi_proc_cfg mode_vi_proc_cfg;
  6140. struct afe_dsm_filter_set_params_t mode_dsm_proc_cfg;
  6141. } __packed;
  6142. struct afe_dsm_spkr_prot_config_command {
  6143. struct apr_hdr hdr;
  6144. struct afe_port_cmd_set_param_v2 param;
  6145. struct afe_port_param_data_v2 pdata;
  6146. union afe_dsm_spkr_prot_config prot_config;
  6147. } __packed;
  6148. struct afe_dsm_filter_get_params_t {
  6149. uint32_t dcResistance;
  6150. uint32_t coilTemp;
  6151. uint32_t qualityfactor;
  6152. uint32_t resonanceFreq;
  6153. uint32_t excursionMeasure;
  6154. uint32_t rdcroomtemp;
  6155. uint32_t releasetime;
  6156. uint32_t coilthermallimit;
  6157. uint32_t excursionlimit;
  6158. uint32_t dsmenabled;
  6159. uint32_t staticgain;
  6160. uint32_t lfxgain;
  6161. uint32_t pilotgain;
  6162. uint32_t flagToWrite;
  6163. uint32_t featureSetEnable;
  6164. uint32_t smooFacVoltClip;
  6165. uint32_t highPassCutOffFactor;
  6166. uint32_t leadResistance;
  6167. uint32_t rmsSmooFac;
  6168. uint32_t clipLimit;
  6169. uint32_t thermalCoeff;
  6170. uint32_t qSpk;
  6171. uint32_t excurLoggingThresh;
  6172. uint32_t coilTempLoggingThresh;
  6173. uint32_t resFreq;
  6174. uint32_t resFreqGuardBand;
  6175. uint32_t Ambient_Temp;
  6176. uint32_t STL_attack_time;
  6177. uint32_t STL_release_time;
  6178. uint32_t STL_Admittance_a1;
  6179. uint32_t STL_Admittance_a2;
  6180. uint32_t STL_Admittance_b0;
  6181. uint32_t STL_Admittance_b1;
  6182. uint32_t STL_Admittance_b2;
  6183. uint32_t Tch1;
  6184. uint32_t Rth1;
  6185. uint32_t Tch2;
  6186. uint32_t Rth2;
  6187. uint32_t STL_Attenuation_Gain;
  6188. uint32_t SPT_rampDownFrames;
  6189. uint32_t SPT_Threshold;
  6190. uint32_t T_horizon;
  6191. uint32_t LFX_Admittance_a1;
  6192. uint32_t LFX_Admittance_a2;
  6193. uint32_t LFX_Admittance_b0;
  6194. uint32_t LFX_Admittance_b1;
  6195. uint32_t LFX_Admittance_b2;
  6196. uint32_t X_Max;
  6197. uint32_t SPK_FS;
  6198. uint32_t Q_GUARD_BAND;
  6199. uint32_t STImpedModel_a1;
  6200. uint32_t STImpedModel_a2;
  6201. uint32_t STImpedModel_b0;
  6202. uint32_t STImpedModel_b1;
  6203. uint32_t STImpedModel_b2;
  6204. uint32_t STImpedModel_Flag;
  6205. uint32_t Q_Notch;
  6206. uint32_t Reserve_0;
  6207. uint32_t Reserve_1;
  6208. uint32_t Reserve_2;
  6209. uint32_t Reserve_3;
  6210. uint32_t Reserve_4;
  6211. #ifdef USE_DSM_LOG
  6212. uint8_t byteLogArray[BEFORE_BUFSIZE];
  6213. uint32_t intLogArray[BEFORE_BUFSIZE];
  6214. uint8_t afterProbByteLogArray[AFTER_BUFSIZE];
  6215. uint32_t afterProbIntLogArray[AFTER_BUFSIZE];
  6216. #endif /* USE_DSM_LOG */
  6217. } __packed;
  6218. struct afe_dsm_spkr_prot_get_vi_calib {
  6219. struct afe_port_cmd_get_param_v2 get_param;
  6220. struct afe_port_param_data_v2 pdata;
  6221. struct afe_dsm_filter_get_params_t res_cfg;
  6222. } __packed;
  6223. struct afe_dsm_spkr_prot_calib_get_resp {
  6224. uint32_t status;
  6225. struct afe_port_param_data_v2 pdata;
  6226. struct afe_dsm_filter_get_params_t res_cfg;
  6227. } __packed;
  6228. #endif /* CONFIG_SND_SOC_MAXIM_DSM */
  6229. #endif /*_APR_AUDIO_V2_H_ */