| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394 |
- // SPDX-License-Identifier: GPL-2.0
- /*
- * camss.c
- *
- * Qualcomm MSM Camera Subsystem - Core
- *
- * Copyright (c) 2015, The Linux Foundation. All rights reserved.
- * Copyright (C) 2015-2018 Linaro Ltd.
- */
- #include <linux/clk.h>
- #include <linux/interconnect.h>
- #include <linux/media-bus-format.h>
- #include <linux/media.h>
- #include <linux/module.h>
- #include <linux/platform_device.h>
- #include <linux/of.h>
- #include <linux/of_device.h>
- #include <linux/of_graph.h>
- #include <linux/pm_runtime.h>
- #include <linux/pm_domain.h>
- #include <linux/slab.h>
- #include <linux/videodev2.h>
- #include <media/media-device.h>
- #include <media/v4l2-async.h>
- #include <media/v4l2-device.h>
- #include <media/v4l2-mc.h>
- #include <media/v4l2-fwnode.h>
- #include "camss.h"
- #define CAMSS_CLOCK_MARGIN_NUMERATOR 105
- #define CAMSS_CLOCK_MARGIN_DENOMINATOR 100
- static const struct parent_dev_ops vfe_parent_dev_ops;
- static const struct camss_subdev_resources csiphy_res_8x16[] = {
- /* CSIPHY0 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ispif_ahb", "ahb", "csiphy0_timer" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000 } },
- .reg = { "csiphy0", "csiphy0_clk_mux" },
- .interrupt = { "csiphy0" },
- .csiphy = {
- .id = 0,
- .hw_ops = &csiphy_ops_2ph_1_0,
- .formats = &csiphy_formats_8x16
- }
- },
- /* CSIPHY1 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ispif_ahb", "ahb", "csiphy1_timer" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000 } },
- .reg = { "csiphy1", "csiphy1_clk_mux" },
- .interrupt = { "csiphy1" },
- .csiphy = {
- .id = 1,
- .hw_ops = &csiphy_ops_2ph_1_0,
- .formats = &csiphy_formats_8x16
- }
- }
- };
- static const struct camss_subdev_resources csid_res_8x16[] = {
- /* CSID0 */
- {
- .regulators = {
- { .supply = "vdda", .init_load_uA = 40000 }
- },
- .clock = { "top_ahb", "ispif_ahb", "csi0_ahb", "ahb",
- "csi0", "csi0_phy", "csi0_pix", "csi0_rdi" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid0" },
- .interrupt = { "csid0" },
- .csid = {
- .hw_ops = &csid_ops_4_1,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_4_1
- }
- },
- /* CSID1 */
- {
- .regulators = {
- { .supply = "vdda", .init_load_uA = 40000 }
- },
- .clock = { "top_ahb", "ispif_ahb", "csi1_ahb", "ahb",
- "csi1", "csi1_phy", "csi1_pix", "csi1_rdi" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid1" },
- .interrupt = { "csid1" },
- .csid = {
- .hw_ops = &csid_ops_4_1,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_4_1
- }
- },
- };
- static const struct camss_subdev_resources ispif_res_8x16 = {
- /* ISPIF */
- .clock = { "top_ahb", "ahb", "ispif_ahb",
- "csi0", "csi0_pix", "csi0_rdi",
- "csi1", "csi1_pix", "csi1_rdi" },
- .clock_for_reset = { "vfe0", "csi_vfe0" },
- .reg = { "ispif", "csi_clk_mux" },
- .interrupt = { "ispif" },
- };
- static const struct camss_subdev_resources vfe_res_8x16[] = {
- /* VFE0 */
- {
- .regulators = {},
- .clock = { "top_ahb", "vfe0", "csi_vfe0",
- "vfe_ahb", "vfe_axi", "ahb" },
- .clock_rate = { { 0 },
- { 50000000, 80000000, 100000000, 160000000,
- 177780000, 200000000, 266670000, 320000000,
- 400000000, 465000000 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "vfe0" },
- .interrupt = { "vfe0" },
- .vfe = {
- .line_num = 3,
- .hw_ops = &vfe_ops_4_1,
- .formats_rdi = &vfe_formats_rdi_8x16,
- .formats_pix = &vfe_formats_pix_8x16
- }
- }
- };
- static const struct camss_subdev_resources csiphy_res_8x39[] = {
- /* CSIPHY0 */
- {
- .regulators = {
- { .supply = "vdda", .init_load_uA = 40000 }
- },
- .clock = { "top_ahb", "ispif_ahb", "ahb", "csiphy0_timer" },
- .clock_rate = { { 0 },
- { 40000000, 80000000 },
- { 0 },
- { 100000000, 200000000 } },
- .reg = { "csiphy0", "csiphy0_clk_mux" },
- .interrupt = { "csiphy0" },
- .csiphy = {
- .id = 0,
- .hw_ops = &csiphy_ops_2ph_1_0,
- .formats = &csiphy_formats_8x16
- }
- },
- /* CSIPHY1 */
- {
- .regulators = {
- { .supply = "vdda", .init_load_uA = 40000 }
- },
- .clock = { "top_ahb", "ispif_ahb", "ahb", "csiphy1_timer" },
- .clock_rate = { { 0 },
- { 40000000, 80000000 },
- { 0 },
- { 100000000, 200000000 } },
- .reg = { "csiphy1", "csiphy1_clk_mux" },
- .interrupt = { "csiphy1" },
- .csiphy = {
- .id = 1,
- .hw_ops = &csiphy_ops_2ph_1_0,
- .formats = &csiphy_formats_8x16
- }
- }
- };
- static const struct camss_subdev_resources csid_res_8x39[] = {
- /* CSID0 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ispif_ahb", "csi0_ahb", "ahb",
- "csi0", "csi0_phy", "csi0_pix", "csi0_rdi" },
- .clock_rate = { { 0 },
- { 40000000, 80000000 },
- { 0 },
- { 0 },
- { 100000000, 200000000 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid0" },
- .interrupt = { "csid0" },
- .csid = {
- .hw_ops = &csid_ops_4_1,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_4_1
- }
- },
- /* CSID1 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ispif_ahb", "csi1_ahb", "ahb",
- "csi1", "csi1_phy", "csi1_pix", "csi1_rdi" },
- .clock_rate = { { 0 },
- { 40000000, 80000000 },
- { 0 },
- { 0 },
- { 100000000, 200000000 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid1" },
- .interrupt = { "csid1" },
- .csid = {
- .hw_ops = &csid_ops_4_1,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_4_1
- }
- },
- /* CSID2 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ispif_ahb", "csi2_ahb", "ahb",
- "csi2", "csi2_phy", "csi2_pix", "csi2_rdi" },
- .clock_rate = { { 0 },
- { 40000000, 80000000 },
- { 0 },
- { 0 },
- { 100000000, 200000000 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid2" },
- .interrupt = { "csid2" },
- .csid = {
- .hw_ops = &csid_ops_4_1,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_4_1
- }
- },
- };
- static const struct camss_subdev_resources ispif_res_8x39 = {
- /* ISPIF */
- .clock = { "top_ahb", "ispif_ahb", "ahb",
- "csi0", "csi0_pix", "csi0_rdi",
- "csi1", "csi1_pix", "csi1_rdi",
- "csi2", "csi2_pix", "csi2_rdi" },
- .clock_for_reset = { "vfe0", "csi_vfe0" },
- .reg = { "ispif", "csi_clk_mux" },
- .interrupt = { "ispif" },
- };
- static const struct camss_subdev_resources vfe_res_8x39[] = {
- /* VFE0 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ispif_ahb", "vfe0", "csi_vfe0",
- "vfe_ahb", "vfe_axi", "ahb" },
- .clock_rate = { { 0 },
- { 40000000, 80000000 },
- { 50000000, 80000000, 100000000, 160000000,
- 177780000, 200000000, 266670000, 320000000,
- 400000000, 465000000, 480000000, 600000000 },
- { 0 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "vfe0" },
- .interrupt = { "vfe0" },
- .vfe = {
- .line_num = 3,
- .has_vbif = true,
- .vbif_name = "vfe0_vbif",
- .hw_ops = &vfe_ops_4_1,
- .formats_rdi = &vfe_formats_rdi_8x16,
- .formats_pix = &vfe_formats_pix_8x16
- }
- }
- };
- static const struct camss_subdev_resources csid_res_8x53[] = {
- /* CSID0 */
- {
- .regulators = {
- { .supply = "vdda", .init_load_uA = 9900 }
- },
- .clock = { "top_ahb", "ispif_ahb", "csi0_ahb", "ahb",
- "csi0", "csi0_phy", "csi0_pix", "csi0_rdi" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 310000000,
- 400000000, 465000000 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid0" },
- .interrupt = { "csid0" },
- .csid = {
- .hw_ops = &csid_ops_4_7,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_4_7
- }
- },
- /* CSID1 */
- {
- .regulators = {
- { .supply = "vdda", .init_load_uA = 9900 }
- },
- .clock = { "top_ahb", "ispif_ahb", "csi1_ahb", "ahb",
- "csi1", "csi1_phy", "csi1_pix", "csi1_rdi" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 310000000,
- 400000000, 465000000 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid1" },
- .interrupt = { "csid1" },
- .csid = {
- .hw_ops = &csid_ops_4_7,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_4_7
- }
- },
- /* CSID2 */
- {
- .regulators = {
- { .supply = "vdda", .init_load_uA = 9900 }
- },
- .clock = { "top_ahb", "ispif_ahb", "csi2_ahb", "ahb",
- "csi2", "csi2_phy", "csi2_pix", "csi2_rdi" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 310000000,
- 400000000, 465000000 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid2" },
- .interrupt = { "csid2" },
- .csid = {
- .hw_ops = &csid_ops_4_7,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_4_7
- }
- },
- };
- static const struct camss_subdev_resources ispif_res_8x53 = {
- /* ISPIF */
- .clock = { "top_ahb", "ahb", "ispif_ahb",
- "csi0", "csi0_pix", "csi0_rdi",
- "csi1", "csi1_pix", "csi1_rdi",
- "csi2", "csi2_pix", "csi2_rdi" },
- .clock_for_reset = { "vfe0", "csi_vfe0", "vfe1", "csi_vfe1" },
- .reg = { "ispif", "csi_clk_mux" },
- .interrupt = { "ispif" },
- };
- static const struct camss_subdev_resources vfe_res_8x53[] = {
- /* VFE0 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ahb", "ispif_ahb",
- "vfe0", "csi_vfe0", "vfe0_ahb", "vfe0_axi" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 50000000, 100000000, 133330000,
- 160000000, 200000000, 266670000,
- 310000000, 400000000, 465000000 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "vfe0" },
- .interrupt = { "vfe0" },
- .vfe = {
- .line_num = 3,
- .has_pd = true,
- .pd_name = "vfe0",
- .hw_ops = &vfe_ops_4_1,
- .formats_rdi = &vfe_formats_rdi_8x16,
- .formats_pix = &vfe_formats_pix_8x16
- }
- },
- /* VFE1 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ahb", "ispif_ahb",
- "vfe1", "csi_vfe1", "vfe1_ahb", "vfe1_axi" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 50000000, 100000000, 133330000,
- 160000000, 200000000, 266670000,
- 310000000, 400000000, 465000000 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "vfe1" },
- .interrupt = { "vfe1" },
- .vfe = {
- .line_num = 3,
- .has_pd = true,
- .pd_name = "vfe1",
- .hw_ops = &vfe_ops_4_1,
- .formats_rdi = &vfe_formats_rdi_8x16,
- .formats_pix = &vfe_formats_pix_8x16
- }
- }
- };
- static const struct resources_icc icc_res_8x53[] = {
- {
- .name = "cam_ahb",
- .icc_bw_tbl.avg = 38400,
- .icc_bw_tbl.peak = 76800,
- },
- {
- .name = "cam_vfe0_mem",
- .icc_bw_tbl.avg = 939524,
- .icc_bw_tbl.peak = 1342177,
- },
- {
- .name = "cam_vfe1_mem",
- .icc_bw_tbl.avg = 939524,
- .icc_bw_tbl.peak = 1342177,
- },
- };
- static const struct camss_subdev_resources csiphy_res_8x96[] = {
- /* CSIPHY0 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ispif_ahb", "ahb", "csiphy0_timer" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 266666667 } },
- .reg = { "csiphy0", "csiphy0_clk_mux" },
- .interrupt = { "csiphy0" },
- .csiphy = {
- .id = 0,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_8x96
- }
- },
- /* CSIPHY1 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ispif_ahb", "ahb", "csiphy1_timer" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 266666667 } },
- .reg = { "csiphy1", "csiphy1_clk_mux" },
- .interrupt = { "csiphy1" },
- .csiphy = {
- .id = 1,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_8x96
- }
- },
- /* CSIPHY2 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ispif_ahb", "ahb", "csiphy2_timer" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 266666667 } },
- .reg = { "csiphy2", "csiphy2_clk_mux" },
- .interrupt = { "csiphy2" },
- .csiphy = {
- .id = 2,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_8x96
- }
- }
- };
- static const struct camss_subdev_resources csid_res_8x96[] = {
- /* CSID0 */
- {
- .regulators = {
- { .supply = "vdda", .init_load_uA = 80160 }
- },
- .clock = { "top_ahb", "ispif_ahb", "csi0_ahb", "ahb",
- "csi0", "csi0_phy", "csi0_pix", "csi0_rdi" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 266666667 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid0" },
- .interrupt = { "csid0" },
- .csid = {
- .hw_ops = &csid_ops_4_7,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_4_7
- }
- },
- /* CSID1 */
- {
- .regulators = {
- { .supply = "vdda", .init_load_uA = 80160 }
- },
- .clock = { "top_ahb", "ispif_ahb", "csi1_ahb", "ahb",
- "csi1", "csi1_phy", "csi1_pix", "csi1_rdi" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 266666667 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid1" },
- .interrupt = { "csid1" },
- .csid = {
- .hw_ops = &csid_ops_4_7,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_4_7
- }
- },
- /* CSID2 */
- {
- .regulators = {
- { .supply = "vdda", .init_load_uA = 80160 }
- },
- .clock = { "top_ahb", "ispif_ahb", "csi2_ahb", "ahb",
- "csi2", "csi2_phy", "csi2_pix", "csi2_rdi" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 266666667 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid2" },
- .interrupt = { "csid2" },
- .csid = {
- .hw_ops = &csid_ops_4_7,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_4_7
- }
- },
- /* CSID3 */
- {
- .regulators = {
- { .supply = "vdda", .init_load_uA = 80160 }
- },
- .clock = { "top_ahb", "ispif_ahb", "csi3_ahb", "ahb",
- "csi3", "csi3_phy", "csi3_pix", "csi3_rdi" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 266666667 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid3" },
- .interrupt = { "csid3" },
- .csid = {
- .hw_ops = &csid_ops_4_7,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_4_7
- }
- }
- };
- static const struct camss_subdev_resources ispif_res_8x96 = {
- /* ISPIF */
- .clock = { "top_ahb", "ahb", "ispif_ahb",
- "csi0", "csi0_pix", "csi0_rdi",
- "csi1", "csi1_pix", "csi1_rdi",
- "csi2", "csi2_pix", "csi2_rdi",
- "csi3", "csi3_pix", "csi3_rdi" },
- .clock_for_reset = { "vfe0", "csi_vfe0", "vfe1", "csi_vfe1" },
- .reg = { "ispif", "csi_clk_mux" },
- .interrupt = { "ispif" },
- };
- static const struct camss_subdev_resources vfe_res_8x96[] = {
- /* VFE0 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ahb", "vfe0", "csi_vfe0", "vfe_ahb",
- "vfe0_ahb", "vfe_axi", "vfe0_stream"},
- .clock_rate = { { 0 },
- { 0 },
- { 75000000, 100000000, 300000000,
- 320000000, 480000000, 600000000 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "vfe0" },
- .interrupt = { "vfe0" },
- .vfe = {
- .line_num = 3,
- .has_pd = true,
- .hw_ops = &vfe_ops_4_7,
- .formats_rdi = &vfe_formats_rdi_8x96,
- .formats_pix = &vfe_formats_pix_8x96
- }
- },
- /* VFE1 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ahb", "vfe1", "csi_vfe1", "vfe_ahb",
- "vfe1_ahb", "vfe_axi", "vfe1_stream"},
- .clock_rate = { { 0 },
- { 0 },
- { 75000000, 100000000, 300000000,
- 320000000, 480000000, 600000000 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "vfe1" },
- .interrupt = { "vfe1" },
- .vfe = {
- .line_num = 3,
- .has_pd = true,
- .hw_ops = &vfe_ops_4_7,
- .formats_rdi = &vfe_formats_rdi_8x96,
- .formats_pix = &vfe_formats_pix_8x96
- }
- }
- };
- static const struct camss_subdev_resources csiphy_res_2290[] = {
- /* CSIPHY0 */
- {
- .regulators = {
- { .supply = "vdd-csiphy-1p2", .init_load_uA = 26700 },
- { .supply = "vdd-csiphy-1p8", .init_load_uA = 2600 }
- },
- .clock = { "top_ahb", "ahb", "csiphy0", "csiphy0_timer" },
- .clock_rate = { { 0 },
- { 0 },
- { 240000000, 341330000, 384000000 },
- { 100000000, 200000000, 268800000 } },
- .reg = { "csiphy0" },
- .interrupt = { "csiphy0" },
- .csiphy = {
- .id = 0,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY1 */
- {
- .regulators = {
- { .supply = "vdd-csiphy-1p2", .init_load_uA = 26700 },
- { .supply = "vdd-csiphy-1p8", .init_load_uA = 2600 }
- },
- .clock = { "top_ahb", "ahb", "csiphy1", "csiphy1_timer" },
- .clock_rate = { { 0 },
- { 0 },
- { 240000000, 341330000, 384000000 },
- { 100000000, 200000000, 268800000 } },
- .reg = { "csiphy1" },
- .interrupt = { "csiphy1" },
- .csiphy = {
- .id = 1,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- }
- };
- static const struct camss_subdev_resources csid_res_2290[] = {
- /* CSID0 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ahb", "csi0", "vfe0_cphy_rx", "vfe0" },
- .clock_rate = { { 0 },
- { 0 },
- { 192000000, 240000000, 384000000, 426400000 },
- { 0 },
- { 0 } },
- .reg = { "csid0" },
- .interrupt = { "csid0" },
- .csid = {
- .hw_ops = &csid_ops_340,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID1 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ahb", "csi1", "vfe1_cphy_rx", "vfe1" },
- .clock_rate = { { 0 },
- { 0 },
- { 192000000, 240000000, 384000000, 426400000 },
- { 0 },
- { 0 } },
- .reg = { "csid1" },
- .interrupt = { "csid1" },
- .csid = {
- .hw_ops = &csid_ops_340,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- }
- };
- static const struct camss_subdev_resources vfe_res_2290[] = {
- /* VFE0 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ahb", "axi", "vfe0", "camnoc_rt_axi", "camnoc_nrt_axi" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 19200000, 153600000, 192000000, 256000000, 384000000, 460800000 },
- { 0 },
- { 0 }, },
- .reg = { "vfe0" },
- .interrupt = { "vfe0" },
- .vfe = {
- .line_num = 4,
- .hw_ops = &vfe_ops_340,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE1 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ahb", "axi", "vfe1", "camnoc_rt_axi", "camnoc_nrt_axi" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 19200000, 153600000, 192000000, 256000000, 384000000, 460800000 },
- { 0 },
- { 0 }, },
- .reg = { "vfe1" },
- .interrupt = { "vfe1" },
- .vfe = {
- .line_num = 4,
- .hw_ops = &vfe_ops_340,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- };
- static const struct resources_icc icc_res_2290[] = {
- {
- .name = "ahb",
- .icc_bw_tbl.avg = 150000,
- .icc_bw_tbl.peak = 300000,
- },
- {
- .name = "hf_mnoc",
- .icc_bw_tbl.avg = 2097152,
- .icc_bw_tbl.peak = 3000000,
- },
- {
- .name = "sf_mnoc",
- .icc_bw_tbl.avg = 2097152,
- .icc_bw_tbl.peak = 3000000,
- },
- };
- static const struct camss_subdev_resources csiphy_res_660[] = {
- /* CSIPHY0 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ispif_ahb", "ahb", "csiphy0_timer",
- "csi0_phy", "csiphy_ahb2crif" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 269333333 },
- { 0 } },
- .reg = { "csiphy0", "csiphy0_clk_mux" },
- .interrupt = { "csiphy0" },
- .csiphy = {
- .id = 0,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_8x96
- }
- },
- /* CSIPHY1 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ispif_ahb", "ahb", "csiphy1_timer",
- "csi1_phy", "csiphy_ahb2crif" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 269333333 },
- { 0 } },
- .reg = { "csiphy1", "csiphy1_clk_mux" },
- .interrupt = { "csiphy1" },
- .csiphy = {
- .id = 1,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_8x96
- }
- },
- /* CSIPHY2 */
- {
- .regulators = {},
- .clock = { "top_ahb", "ispif_ahb", "ahb", "csiphy2_timer",
- "csi2_phy", "csiphy_ahb2crif" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 269333333 },
- { 0 } },
- .reg = { "csiphy2", "csiphy2_clk_mux" },
- .interrupt = { "csiphy2" },
- .csiphy = {
- .id = 2,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_8x96
- }
- }
- };
- static const struct camss_subdev_resources csid_res_660[] = {
- /* CSID0 */
- {
- .regulators = {
- { .supply = "vdda", .init_load_uA = 0 },
- { .supply = "vdd_sec", .init_load_uA = 0 }
- },
- .clock = { "top_ahb", "ispif_ahb", "csi0_ahb", "ahb",
- "csi0", "csi0_phy", "csi0_pix", "csi0_rdi",
- "cphy_csid0" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 310000000,
- 404000000, 465000000 },
- { 0 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid0" },
- .interrupt = { "csid0" },
- .csid = {
- .hw_ops = &csid_ops_4_7,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_4_7
- }
- },
- /* CSID1 */
- {
- .regulators = {
- { .supply = "vdda", .init_load_uA = 0 },
- { .supply = "vdd_sec", .init_load_uA = 0 }
- },
- .clock = { "top_ahb", "ispif_ahb", "csi1_ahb", "ahb",
- "csi1", "csi1_phy", "csi1_pix", "csi1_rdi",
- "cphy_csid1" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 310000000,
- 404000000, 465000000 },
- { 0 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid1" },
- .interrupt = { "csid1" },
- .csid = {
- .hw_ops = &csid_ops_4_7,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_4_7
- }
- },
- /* CSID2 */
- {
- .regulators = {
- { .supply = "vdda", .init_load_uA = 0 },
- { .supply = "vdd_sec", .init_load_uA = 0 }
- },
- .clock = { "top_ahb", "ispif_ahb", "csi2_ahb", "ahb",
- "csi2", "csi2_phy", "csi2_pix", "csi2_rdi",
- "cphy_csid2" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 310000000,
- 404000000, 465000000 },
- { 0 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid2" },
- .interrupt = { "csid2" },
- .csid = {
- .hw_ops = &csid_ops_4_7,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_4_7
- }
- },
- /* CSID3 */
- {
- .regulators = {
- { .supply = "vdda", .init_load_uA = 0 },
- { .supply = "vdd_sec", .init_load_uA = 0 }
- },
- .clock = { "top_ahb", "ispif_ahb", "csi3_ahb", "ahb",
- "csi3", "csi3_phy", "csi3_pix", "csi3_rdi",
- "cphy_csid3" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 310000000,
- 404000000, 465000000 },
- { 0 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid3" },
- .interrupt = { "csid3" },
- .csid = {
- .hw_ops = &csid_ops_4_7,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_4_7
- }
- }
- };
- static const struct camss_subdev_resources ispif_res_660 = {
- /* ISPIF */
- .clock = { "top_ahb", "ahb", "ispif_ahb",
- "csi0", "csi0_pix", "csi0_rdi",
- "csi1", "csi1_pix", "csi1_rdi",
- "csi2", "csi2_pix", "csi2_rdi",
- "csi3", "csi3_pix", "csi3_rdi" },
- .clock_for_reset = { "vfe0", "csi_vfe0", "vfe1", "csi_vfe1" },
- .reg = { "ispif", "csi_clk_mux" },
- .interrupt = { "ispif" },
- };
- static const struct camss_subdev_resources vfe_res_660[] = {
- /* VFE0 */
- {
- .regulators = {},
- .clock = { "throttle_axi", "top_ahb", "ahb", "vfe0",
- "csi_vfe0", "vfe_ahb", "vfe0_ahb", "vfe_axi",
- "vfe0_stream"},
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 120000000, 200000000, 256000000,
- 300000000, 404000000, 480000000,
- 540000000, 576000000 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "vfe0" },
- .interrupt = { "vfe0" },
- .vfe = {
- .line_num = 3,
- .has_pd = true,
- .hw_ops = &vfe_ops_4_8,
- .formats_rdi = &vfe_formats_rdi_8x96,
- .formats_pix = &vfe_formats_pix_8x96
- }
- },
- /* VFE1 */
- {
- .regulators = {},
- .clock = { "throttle_axi", "top_ahb", "ahb", "vfe1",
- "csi_vfe1", "vfe_ahb", "vfe1_ahb", "vfe_axi",
- "vfe1_stream"},
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 120000000, 200000000, 256000000,
- 300000000, 404000000, 480000000,
- 540000000, 576000000 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "vfe1" },
- .interrupt = { "vfe1" },
- .vfe = {
- .line_num = 3,
- .has_pd = true,
- .hw_ops = &vfe_ops_4_8,
- .formats_rdi = &vfe_formats_rdi_8x96,
- .formats_pix = &vfe_formats_pix_8x96
- }
- }
- };
- static const struct camss_subdev_resources csiphy_res_670[] = {
- /* CSIPHY0 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 42800 },
- { .supply = "vdda-pll", .init_load_uA = 13900 }
- },
- .clock = { "soc_ahb", "cpas_ahb",
- "csiphy0", "csiphy0_timer" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 19200000, 240000000, 269333333 } },
- .reg = { "csiphy0" },
- .interrupt = { "csiphy0" },
- .csiphy = {
- .id = 0,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY1 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 42800 },
- { .supply = "vdda-pll", .init_load_uA = 13900 }
- },
- .clock = { "soc_ahb", "cpas_ahb",
- "csiphy1", "csiphy1_timer" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 19200000, 240000000, 269333333 } },
- .reg = { "csiphy1" },
- .interrupt = { "csiphy1" },
- .csiphy = {
- .id = 1,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY2 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 42800 },
- { .supply = "vdda-pll", .init_load_uA = 13900 }
- },
- .clock = { "soc_ahb", "cpas_ahb",
- "csiphy2", "csiphy2_timer" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 19200000, 240000000, 269333333 } },
- .reg = { "csiphy2" },
- .interrupt = { "csiphy2" },
- .csiphy = {
- .id = 2,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- }
- };
- static const struct camss_subdev_resources csid_res_670[] = {
- /* CSID0 */
- {
- .regulators = {},
- .clock = { "cpas_ahb", "soc_ahb", "vfe0",
- "vfe0_cphy_rx", "csi0" },
- .clock_rate = { { 0 },
- { 0 },
- { 100000000, 320000000, 404000000, 480000000, 600000000 },
- { 384000000 },
- { 19200000, 75000000, 384000000, 538666667 } },
- .reg = { "csid0" },
- .interrupt = { "csid0" },
- .csid = {
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID1 */
- {
- .regulators = {},
- .clock = { "cpas_ahb", "soc_ahb", "vfe1",
- "vfe1_cphy_rx", "csi1" },
- .clock_rate = { { 0 },
- { 0 },
- { 100000000, 320000000, 404000000, 480000000, 600000000 },
- { 384000000 },
- { 19200000, 75000000, 384000000, 538666667 } },
- .reg = { "csid1" },
- .interrupt = { "csid1" },
- .csid = {
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID2 */
- {
- .regulators = {},
- .clock = { "cpas_ahb", "soc_ahb", "vfe_lite",
- "vfe_lite_cphy_rx", "csi2" },
- .clock_rate = { { 0 },
- { 0 },
- { 100000000, 320000000, 404000000, 480000000, 600000000 },
- { 384000000 },
- { 19200000, 75000000, 384000000, 538666667 } },
- .reg = { "csid2" },
- .interrupt = { "csid2" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- }
- };
- static const struct camss_subdev_resources vfe_res_670[] = {
- /* VFE0 */
- {
- .regulators = {},
- .clock = { "camnoc_axi", "cpas_ahb", "soc_ahb",
- "vfe0", "vfe0_axi" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 100000000, 320000000, 404000000, 480000000, 600000000 },
- { 0 } },
- .reg = { "vfe0" },
- .interrupt = { "vfe0" },
- .vfe = {
- .line_num = 4,
- .has_pd = true,
- .pd_name = "ife0",
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE1 */
- {
- .regulators = {},
- .clock = { "camnoc_axi", "cpas_ahb", "soc_ahb",
- "vfe1", "vfe1_axi" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 100000000, 320000000, 404000000, 480000000, 600000000 },
- { 0 } },
- .reg = { "vfe1" },
- .interrupt = { "vfe1" },
- .vfe = {
- .line_num = 4,
- .has_pd = true,
- .pd_name = "ife1",
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE-lite */
- {
- .regulators = {},
- .clock = { "camnoc_axi", "cpas_ahb", "soc_ahb",
- "vfe_lite" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 100000000, 320000000, 404000000, 480000000, 600000000 } },
- .reg = { "vfe_lite" },
- .interrupt = { "vfe_lite" },
- .vfe = {
- .is_lite = true,
- .line_num = 4,
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- }
- };
- static const struct camss_subdev_resources csiphy_res_845[] = {
- /* CSIPHY0 */
- {
- .regulators = {},
- .clock = { "camnoc_axi", "soc_ahb", "slow_ahb_src",
- "cpas_ahb", "cphy_rx_src", "csiphy0",
- "csiphy0_timer_src", "csiphy0_timer" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 19200000, 240000000, 269333333 } },
- .reg = { "csiphy0" },
- .interrupt = { "csiphy0" },
- .csiphy = {
- .id = 0,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY1 */
- {
- .regulators = {},
- .clock = { "camnoc_axi", "soc_ahb", "slow_ahb_src",
- "cpas_ahb", "cphy_rx_src", "csiphy1",
- "csiphy1_timer_src", "csiphy1_timer" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 19200000, 240000000, 269333333 } },
- .reg = { "csiphy1" },
- .interrupt = { "csiphy1" },
- .csiphy = {
- .id = 1,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY2 */
- {
- .regulators = {},
- .clock = { "camnoc_axi", "soc_ahb", "slow_ahb_src",
- "cpas_ahb", "cphy_rx_src", "csiphy2",
- "csiphy2_timer_src", "csiphy2_timer" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 19200000, 240000000, 269333333 } },
- .reg = { "csiphy2" },
- .interrupt = { "csiphy2" },
- .csiphy = {
- .id = 2,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY3 */
- {
- .regulators = {},
- .clock = { "camnoc_axi", "soc_ahb", "slow_ahb_src",
- "cpas_ahb", "cphy_rx_src", "csiphy3",
- "csiphy3_timer_src", "csiphy3_timer" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 19200000, 240000000, 269333333 } },
- .reg = { "csiphy3" },
- .interrupt = { "csiphy3" },
- .csiphy = {
- .id = 3,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- }
- };
- static const struct camss_subdev_resources csid_res_845[] = {
- /* CSID0 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 0 },
- { .supply = "vdda-pll", .init_load_uA = 0 }
- },
- .clock = { "cpas_ahb", "cphy_rx_src", "slow_ahb_src",
- "soc_ahb", "vfe0", "vfe0_src",
- "vfe0_cphy_rx", "csi0",
- "csi0_src" },
- .clock_rate = { { 0 },
- { 384000000 },
- { 80000000 },
- { 0 },
- { 19200000, 100000000, 320000000, 404000000, 480000000, 600000000 },
- { 320000000 },
- { 0 },
- { 19200000, 75000000, 384000000, 538666667 },
- { 384000000 } },
- .reg = { "csid0" },
- .interrupt = { "csid0" },
- .csid = {
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID1 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 0 },
- { .supply = "vdda-pll", .init_load_uA = 0 }
- },
- .clock = { "cpas_ahb", "cphy_rx_src", "slow_ahb_src",
- "soc_ahb", "vfe1", "vfe1_src",
- "vfe1_cphy_rx", "csi1",
- "csi1_src" },
- .clock_rate = { { 0 },
- { 384000000 },
- { 80000000 },
- { 0 },
- { 19200000, 100000000, 320000000, 404000000, 480000000, 600000000 },
- { 320000000 },
- { 0 },
- { 19200000, 75000000, 384000000, 538666667 },
- { 384000000 } },
- .reg = { "csid1" },
- .interrupt = { "csid1" },
- .csid = {
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID2 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 0 },
- { .supply = "vdda-pll", .init_load_uA = 0 }
- },
- .clock = { "cpas_ahb", "cphy_rx_src", "slow_ahb_src",
- "soc_ahb", "vfe_lite", "vfe_lite_src",
- "vfe_lite_cphy_rx", "csi2",
- "csi2_src" },
- .clock_rate = { { 0 },
- { 384000000 },
- { 80000000 },
- { 0 },
- { 19200000, 100000000, 320000000, 404000000, 480000000, 600000000 },
- { 320000000 },
- { 0 },
- { 19200000, 75000000, 384000000, 538666667 },
- { 384000000 } },
- .reg = { "csid2" },
- .interrupt = { "csid2" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- }
- };
- static const struct camss_subdev_resources vfe_res_845[] = {
- /* VFE0 */
- {
- .regulators = {},
- .clock = { "camnoc_axi", "cpas_ahb", "slow_ahb_src",
- "soc_ahb", "vfe0", "vfe0_axi",
- "vfe0_src", "csi0",
- "csi0_src"},
- .clock_rate = { { 0 },
- { 0 },
- { 80000000 },
- { 0 },
- { 19200000, 100000000, 320000000, 404000000, 480000000, 600000000 },
- { 0 },
- { 320000000 },
- { 19200000, 75000000, 384000000, 538666667 },
- { 384000000 } },
- .reg = { "vfe0" },
- .interrupt = { "vfe0" },
- .vfe = {
- .line_num = 4,
- .pd_name = "ife0",
- .has_pd = true,
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE1 */
- {
- .regulators = {},
- .clock = { "camnoc_axi", "cpas_ahb", "slow_ahb_src",
- "soc_ahb", "vfe1", "vfe1_axi",
- "vfe1_src", "csi1",
- "csi1_src"},
- .clock_rate = { { 0 },
- { 0 },
- { 80000000 },
- { 0 },
- { 19200000, 100000000, 320000000, 404000000, 480000000, 600000000 },
- { 0 },
- { 320000000 },
- { 19200000, 75000000, 384000000, 538666667 },
- { 384000000 } },
- .reg = { "vfe1" },
- .interrupt = { "vfe1" },
- .vfe = {
- .line_num = 4,
- .pd_name = "ife1",
- .has_pd = true,
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE-lite */
- {
- .regulators = {},
- .clock = { "camnoc_axi", "cpas_ahb", "slow_ahb_src",
- "soc_ahb", "vfe_lite",
- "vfe_lite_src", "csi2",
- "csi2_src"},
- .clock_rate = { { 0 },
- { 0 },
- { 80000000 },
- { 0 },
- { 19200000, 100000000, 320000000, 404000000, 480000000, 600000000 },
- { 320000000 },
- { 19200000, 75000000, 384000000, 538666667 },
- { 384000000 } },
- .reg = { "vfe_lite" },
- .interrupt = { "vfe_lite" },
- .vfe = {
- .is_lite = true,
- .line_num = 4,
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- }
- };
- static const struct camss_subdev_resources csiphy_res_sm6150[] = {
- /* CSIPHY0 */
- {
- .regulators = {
- { .supply = "vdd-csiphy-1p2", .init_load_uA = 35000 },
- { .supply = "vdd-csiphy-1p8", .init_load_uA = 5000 }
- },
- .clock = { "csiphy0", "csiphy0_timer" },
- .clock_rate = { { 269333333, 384000000 },
- { 269333333 } },
- .reg = { "csiphy0" },
- .interrupt = { "csiphy0" },
- .csiphy = {
- .id = 0,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY1 */
- {
- .regulators = {
- { .supply = "vdd-csiphy-1p2", .init_load_uA = 35000 },
- { .supply = "vdd-csiphy-1p8", .init_load_uA = 5000 }
- },
- .clock = { "csiphy1", "csiphy1_timer" },
- .clock_rate = { { 269333333, 384000000 },
- { 269333333 } },
- .reg = { "csiphy1" },
- .interrupt = { "csiphy1" },
- .csiphy = {
- .id = 1,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY2 */
- {
- .regulators = {
- { .supply = "vdd-csiphy-1p2", .init_load_uA = 35000 },
- { .supply = "vdd-csiphy-1p8", .init_load_uA = 5000 }
- },
- .clock = { "csiphy2", "csiphy2_timer" },
- .clock_rate = { { 269333333, 384000000 },
- { 269333333 } },
- .reg = { "csiphy2" },
- .interrupt = { "csiphy2" },
- .csiphy = {
- .id = 2,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- };
- static const struct camss_subdev_resources csid_res_sm6150[] = {
- /* CSID0 */
- {
- .regulators = {},
- .clock = { "vfe0_cphy_rx", "vfe0_csid" },
- .clock_rate = { { 269333333, 384000000 },
- { 320000000, 540000000 } },
- .reg = { "csid0" },
- .interrupt = { "csid0" },
- .csid = {
- .is_lite = false,
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID1 */
- {
- .regulators = {},
- .clock = { "vfe1_cphy_rx", "vfe1_csid" },
- .clock_rate = { { 269333333, 384000000 },
- { 320000000, 540000000 } },
- .reg = { "csid1" },
- .interrupt = { "csid1" },
- .csid = {
- .is_lite = false,
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID2 */
- {
- .regulators = {},
- .clock = { "vfe_lite_cphy_rx", "vfe_lite_csid" },
- .clock_rate = { { 269333333, 384000000 },
- { 320000000, 540000000 } },
- .reg = { "csid_lite" },
- .interrupt = { "csid_lite" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- };
- static const struct camss_subdev_resources vfe_res_sm6150[] = {
- /* VFE0 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "camnoc_axi", "cpas_ahb", "soc_ahb",
- "vfe0", "vfe0_axi"},
- .clock_rate = { { 0 },
- { 0 },
- { 80000000 },
- { 37500000, 40000000 },
- { 360000000, 432000000, 540000000, 600000000 },
- { 265000000, 426000000 } },
- .reg = { "vfe0" },
- .interrupt = { "vfe0" },
- .vfe = {
- .line_num = 3,
- .is_lite = false,
- .has_pd = true,
- .pd_name = "ife0",
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE1 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "camnoc_axi", "cpas_ahb", "soc_ahb",
- "vfe1", "vfe1_axi"},
- .clock_rate = { { 0 },
- { 0 },
- { 80000000 },
- { 37500000, 40000000 },
- { 360000000, 432000000, 540000000, 600000000 },
- { 265000000, 426000000 } },
- .reg = { "vfe1" },
- .interrupt = { "vfe1" },
- .vfe = {
- .line_num = 3,
- .is_lite = false,
- .has_pd = true,
- .pd_name = "ife1",
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE2 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "camnoc_axi", "cpas_ahb", "soc_ahb",
- "vfe_lite" },
- .clock_rate = { { 0 },
- { 0 },
- { 80000000 },
- { 37500000, 40000000 },
- { 360000000, 432000000, 540000000, 600000000 } },
- .reg = { "vfe_lite" },
- .interrupt = { "vfe_lite" },
- .vfe = {
- .line_num = 4,
- .is_lite = true,
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- };
- static const struct resources_icc icc_res_sm6150[] = {
- {
- .name = "ahb",
- .icc_bw_tbl.avg = 38400,
- .icc_bw_tbl.peak = 76800,
- },
- {
- .name = "hf_0",
- .icc_bw_tbl.avg = 2097152,
- .icc_bw_tbl.peak = 2097152,
- },
- };
- static const struct camss_subdev_resources csiphy_res_8250[] = {
- /* CSIPHY0 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 17500 },
- { .supply = "vdda-pll", .init_load_uA = 10000 }
- },
- .clock = { "csiphy0", "csiphy0_timer" },
- .clock_rate = { { 400000000 },
- { 300000000 } },
- .reg = { "csiphy0" },
- .interrupt = { "csiphy0" },
- .csiphy = {
- .id = 0,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY1 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 17500 },
- { .supply = "vdda-pll", .init_load_uA = 10000 }
- },
- .clock = { "csiphy1", "csiphy1_timer" },
- .clock_rate = { { 400000000 },
- { 300000000 } },
- .reg = { "csiphy1" },
- .interrupt = { "csiphy1" },
- .csiphy = {
- .id = 1,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY2 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 17500 },
- { .supply = "vdda-pll", .init_load_uA = 10000 }
- },
- .clock = { "csiphy2", "csiphy2_timer" },
- .clock_rate = { { 400000000 },
- { 300000000 } },
- .reg = { "csiphy2" },
- .interrupt = { "csiphy2" },
- .csiphy = {
- .id = 2,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY3 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 17500 },
- { .supply = "vdda-pll", .init_load_uA = 10000 }
- },
- .clock = { "csiphy3", "csiphy3_timer" },
- .clock_rate = { { 400000000 },
- { 300000000 } },
- .reg = { "csiphy3" },
- .interrupt = { "csiphy3" },
- .csiphy = {
- .id = 3,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY4 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 17500 },
- { .supply = "vdda-pll", .init_load_uA = 10000 }
- },
- .clock = { "csiphy4", "csiphy4_timer" },
- .clock_rate = { { 400000000 },
- { 300000000 } },
- .reg = { "csiphy4" },
- .interrupt = { "csiphy4" },
- .csiphy = {
- .id = 4,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY5 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 17500 },
- { .supply = "vdda-pll", .init_load_uA = 10000 }
- },
- .clock = { "csiphy5", "csiphy5_timer" },
- .clock_rate = { { 400000000 },
- { 300000000 } },
- .reg = { "csiphy5" },
- .interrupt = { "csiphy5" },
- .csiphy = {
- .id = 5,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- }
- };
- static const struct camss_subdev_resources csid_res_8250[] = {
- /* CSID0 */
- {
- .regulators = {},
- .clock = { "vfe0_csid", "vfe0_cphy_rx", "vfe0", "vfe0_areg", "vfe0_ahb" },
- .clock_rate = { { 400000000 },
- { 400000000 },
- { 350000000, 475000000, 576000000, 720000000 },
- { 100000000, 200000000, 300000000, 400000000 },
- { 0 } },
- .reg = { "csid0" },
- .interrupt = { "csid0" },
- .csid = {
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID1 */
- {
- .regulators = {},
- .clock = { "vfe1_csid", "vfe1_cphy_rx", "vfe1", "vfe1_areg", "vfe1_ahb" },
- .clock_rate = { { 400000000 },
- { 400000000 },
- { 350000000, 475000000, 576000000, 720000000 },
- { 100000000, 200000000, 300000000, 400000000 },
- { 0 } },
- .reg = { "csid1" },
- .interrupt = { "csid1" },
- .csid = {
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID2 */
- {
- .regulators = {},
- .clock = { "vfe_lite_csid", "vfe_lite_cphy_rx", "vfe_lite", "vfe_lite_ahb" },
- .clock_rate = { { 400000000 },
- { 400000000 },
- { 400000000, 480000000 },
- { 0 } },
- .reg = { "csid2" },
- .interrupt = { "csid2" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID3 */
- {
- .regulators = {},
- .clock = { "vfe_lite_csid", "vfe_lite_cphy_rx", "vfe_lite", "vfe_lite_ahb" },
- .clock_rate = { { 400000000 },
- { 400000000 },
- { 400000000, 480000000 },
- { 0 } },
- .reg = { "csid3" },
- .interrupt = { "csid3" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- }
- };
- static const struct camss_subdev_resources vfe_res_8250[] = {
- /* VFE0 */
- {
- .regulators = {},
- .clock = { "camnoc_axi_src", "slow_ahb_src", "cpas_ahb",
- "camnoc_axi", "vfe0_ahb", "vfe0_areg", "vfe0",
- "vfe0_axi", "cam_hf_axi" },
- .clock_rate = { { 19200000, 300000000, 400000000, 480000000 },
- { 19200000, 80000000 },
- { 19200000 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 300000000, 400000000 },
- { 350000000, 475000000, 576000000, 720000000 },
- { 0 },
- { 0 } },
- .reg = { "vfe0" },
- .interrupt = { "vfe0" },
- .vfe = {
- .line_num = 3,
- .has_pd = true,
- .pd_name = "ife0",
- .hw_ops = &vfe_ops_480,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE1 */
- {
- .regulators = {},
- .clock = { "camnoc_axi_src", "slow_ahb_src", "cpas_ahb",
- "camnoc_axi", "vfe1_ahb", "vfe1_areg", "vfe1",
- "vfe1_axi", "cam_hf_axi" },
- .clock_rate = { { 19200000, 300000000, 400000000, 480000000 },
- { 19200000, 80000000 },
- { 19200000 },
- { 0 },
- { 0 },
- { 100000000, 200000000, 300000000, 400000000 },
- { 350000000, 475000000, 576000000, 720000000 },
- { 0 },
- { 0 } },
- .reg = { "vfe1" },
- .interrupt = { "vfe1" },
- .vfe = {
- .line_num = 3,
- .has_pd = true,
- .pd_name = "ife1",
- .hw_ops = &vfe_ops_480,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE2 (lite) */
- {
- .regulators = {},
- .clock = { "camnoc_axi_src", "slow_ahb_src", "cpas_ahb",
- "camnoc_axi", "vfe_lite_ahb", "vfe_lite_axi",
- "vfe_lite", "cam_hf_axi" },
- .clock_rate = { { 19200000, 300000000, 400000000, 480000000 },
- { 19200000, 80000000 },
- { 19200000 },
- { 0 },
- { 0 },
- { 0 },
- { 400000000, 480000000 },
- { 0 } },
- .reg = { "vfe_lite0" },
- .interrupt = { "vfe_lite0" },
- .vfe = {
- .is_lite = true,
- .line_num = 4,
- .hw_ops = &vfe_ops_480,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE3 (lite) */
- {
- .regulators = {},
- .clock = { "camnoc_axi_src", "slow_ahb_src", "cpas_ahb",
- "camnoc_axi", "vfe_lite_ahb", "vfe_lite_axi",
- "vfe_lite", "cam_hf_axi" },
- .clock_rate = { { 19200000, 300000000, 400000000, 480000000 },
- { 19200000, 80000000 },
- { 19200000 },
- { 0 },
- { 0 },
- { 0 },
- { 400000000, 480000000 },
- { 0 } },
- .reg = { "vfe_lite1" },
- .interrupt = { "vfe_lite1" },
- .vfe = {
- .is_lite = true,
- .line_num = 4,
- .hw_ops = &vfe_ops_480,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- };
- static const struct resources_icc icc_res_sm8250[] = {
- {
- .name = "cam_ahb",
- .icc_bw_tbl.avg = 38400,
- .icc_bw_tbl.peak = 76800,
- },
- {
- .name = "cam_hf_0_mnoc",
- .icc_bw_tbl.avg = 2097152,
- .icc_bw_tbl.peak = 2097152,
- },
- {
- .name = "cam_sf_0_mnoc",
- .icc_bw_tbl.avg = 0,
- .icc_bw_tbl.peak = 2097152,
- },
- {
- .name = "cam_sf_icp_mnoc",
- .icc_bw_tbl.avg = 2097152,
- .icc_bw_tbl.peak = 2097152,
- },
- };
- static const struct camss_subdev_resources csiphy_res_7280[] = {
- /* CSIPHY0 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 16100 },
- { .supply = "vdda-pll", .init_load_uA = 9000 }
- },
- .clock = { "csiphy0", "csiphy0_timer" },
- .clock_rate = { { 300000000, 400000000 },
- { 300000000 } },
- .reg = { "csiphy0" },
- .interrupt = { "csiphy0" },
- .csiphy = {
- .id = 0,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845,
- }
- },
- /* CSIPHY1 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 16100 },
- { .supply = "vdda-pll", .init_load_uA = 9000 }
- },
- .clock = { "csiphy1", "csiphy1_timer" },
- .clock_rate = { { 300000000, 400000000 },
- { 300000000 } },
- .reg = { "csiphy1" },
- .interrupt = { "csiphy1" },
- .csiphy = {
- .id = 1,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845,
- }
- },
- /* CSIPHY2 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 16100 },
- { .supply = "vdda-pll", .init_load_uA = 9000 }
- },
- .clock = { "csiphy2", "csiphy2_timer" },
- .clock_rate = { { 300000000, 400000000 },
- { 300000000 } },
- .reg = { "csiphy2" },
- .interrupt = { "csiphy2" },
- .csiphy = {
- .id = 2,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845,
- }
- },
- /* CSIPHY3 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 16100 },
- { .supply = "vdda-pll", .init_load_uA = 9000 }
- },
- .clock = { "csiphy3", "csiphy3_timer" },
- .clock_rate = { { 300000000, 400000000 },
- { 300000000 } },
- .reg = { "csiphy3" },
- .interrupt = { "csiphy3" },
- .csiphy = {
- .id = 3,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845,
- }
- },
- /* CSIPHY4 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 16100 },
- { .supply = "vdda-pll", .init_load_uA = 9000 }
- },
- .clock = { "csiphy4", "csiphy4_timer" },
- .clock_rate = { { 300000000, 400000000 },
- { 300000000 } },
- .reg = { "csiphy4" },
- .interrupt = { "csiphy4" },
- .csiphy = {
- .id = 4,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845,
- }
- },
- };
- static const struct camss_subdev_resources csid_res_7280[] = {
- /* CSID0 */
- {
- .regulators = {},
- .clock = { "vfe0_csid", "vfe0_cphy_rx", "vfe0" },
- .clock_rate = { { 300000000, 400000000 },
- { 0 },
- { 380000000, 510000000, 637000000, 760000000 }
- },
- .reg = { "csid0" },
- .interrupt = { "csid0" },
- .csid = {
- .is_lite = false,
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID1 */
- {
- .regulators = {},
- .clock = { "vfe1_csid", "vfe1_cphy_rx", "vfe1" },
- .clock_rate = { { 300000000, 400000000 },
- { 0 },
- { 380000000, 510000000, 637000000, 760000000 }
- },
- .reg = { "csid1" },
- .interrupt = { "csid1" },
- .csid = {
- .is_lite = false,
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID2 */
- {
- .regulators = {},
- .clock = { "vfe2_csid", "vfe2_cphy_rx", "vfe2" },
- .clock_rate = { { 300000000, 400000000 },
- { 0 },
- { 380000000, 510000000, 637000000, 760000000 }
- },
- .reg = { "csid2" },
- .interrupt = { "csid2" },
- .csid = {
- .is_lite = false,
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID3 */
- {
- .regulators = {},
- .clock = { "vfe_lite0_csid", "vfe_lite0_cphy_rx", "vfe_lite0" },
- .clock_rate = { { 300000000, 400000000 },
- { 0 },
- { 320000000, 400000000, 480000000, 600000000 }
- },
- .reg = { "csid_lite0" },
- .interrupt = { "csid_lite0" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID4 */
- {
- .regulators = {},
- .clock = { "vfe_lite1_csid", "vfe_lite1_cphy_rx", "vfe_lite1" },
- .clock_rate = { { 300000000, 400000000 },
- { 0 },
- { 320000000, 400000000, 480000000, 600000000 }
- },
- .reg = { "csid_lite1" },
- .interrupt = { "csid_lite1" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- };
- static const struct camss_subdev_resources vfe_res_7280[] = {
- /* VFE0 */
- {
- .regulators = {},
- .clock = { "camnoc_axi", "cpas_ahb", "icp_ahb", "vfe0",
- "vfe0_axi", "gcc_axi_hf", "gcc_axi_sf" },
- .clock_rate = { { 150000000, 240000000, 320000000, 400000000, 480000000 },
- { 80000000 },
- { 0 },
- { 380000000, 510000000, 637000000, 760000000 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "vfe0" },
- .interrupt = { "vfe0" },
- .vfe = {
- .line_num = 3,
- .is_lite = false,
- .has_pd = true,
- .pd_name = "ife0",
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE1 */
- {
- .regulators = {},
- .clock = { "camnoc_axi", "cpas_ahb", "icp_ahb", "vfe1",
- "vfe1_axi", "gcc_axi_hf", "gcc_axi_sf" },
- .clock_rate = { { 150000000, 240000000, 320000000, 400000000, 480000000 },
- { 80000000 },
- { 0 },
- { 380000000, 510000000, 637000000, 760000000 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "vfe1" },
- .interrupt = { "vfe1" },
- .vfe = {
- .line_num = 3,
- .is_lite = false,
- .has_pd = true,
- .pd_name = "ife1",
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE2 */
- {
- .regulators = {},
- .clock = { "camnoc_axi", "cpas_ahb", "icp_ahb", "vfe2",
- "vfe2_axi", "gcc_axi_hf", "gcc_axi_sf" },
- .clock_rate = { { 150000000, 240000000, 320000000, 400000000, 480000000 },
- { 80000000 },
- { 0 },
- { 380000000, 510000000, 637000000, 760000000 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "vfe2" },
- .interrupt = { "vfe2" },
- .vfe = {
- .line_num = 3,
- .is_lite = false,
- .hw_ops = &vfe_ops_170,
- .has_pd = true,
- .pd_name = "ife2",
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE3 (lite) */
- {
- .clock = { "camnoc_axi", "cpas_ahb", "icp_ahb",
- "vfe_lite0", "gcc_axi_hf", "gcc_axi_sf" },
- .clock_rate = { { 150000000, 240000000, 320000000, 400000000, 480000000 },
- { 80000000 },
- { 0 },
- { 320000000, 400000000, 480000000, 600000000 },
- { 0 },
- { 0 } },
- .regulators = {},
- .reg = { "vfe_lite0" },
- .interrupt = { "vfe_lite0" },
- .vfe = {
- .line_num = 4,
- .is_lite = true,
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE4 (lite) */
- {
- .clock = { "camnoc_axi", "cpas_ahb", "icp_ahb",
- "vfe_lite1", "gcc_axi_hf", "gcc_axi_sf" },
- .clock_rate = { { 150000000, 240000000, 320000000, 400000000, 480000000 },
- { 80000000 },
- { 0 },
- { 320000000, 400000000, 480000000, 600000000 },
- { 0 },
- { 0 } },
- .regulators = {},
- .reg = { "vfe_lite1" },
- .interrupt = { "vfe_lite1" },
- .vfe = {
- .line_num = 4,
- .is_lite = true,
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- };
- static const struct resources_icc icc_res_sc7280[] = {
- {
- .name = "ahb",
- .icc_bw_tbl.avg = 38400,
- .icc_bw_tbl.peak = 76800,
- },
- {
- .name = "hf_0",
- .icc_bw_tbl.avg = 2097152,
- .icc_bw_tbl.peak = 2097152,
- },
- };
- static const struct camss_subdev_resources csiphy_res_sc8280xp[] = {
- /* CSIPHY0 */
- {
- .regulators = {},
- .clock = { "csiphy0", "csiphy0_timer" },
- .clock_rate = { { 400000000 },
- { 300000000 } },
- .reg = { "csiphy0" },
- .interrupt = { "csiphy0" },
- .csiphy = {
- .id = 0,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY1 */
- {
- .regulators = {},
- .clock = { "csiphy1", "csiphy1_timer" },
- .clock_rate = { { 400000000 },
- { 300000000 } },
- .reg = { "csiphy1" },
- .interrupt = { "csiphy1" },
- .csiphy = {
- .id = 1,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY2 */
- {
- .regulators = {},
- .clock = { "csiphy2", "csiphy2_timer" },
- .clock_rate = { { 400000000 },
- { 300000000 } },
- .reg = { "csiphy2" },
- .interrupt = { "csiphy2" },
- .csiphy = {
- .id = 2,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY3 */
- {
- .regulators = {},
- .clock = { "csiphy3", "csiphy3_timer" },
- .clock_rate = { { 400000000 },
- { 300000000 } },
- .reg = { "csiphy3" },
- .interrupt = { "csiphy3" },
- .csiphy = {
- .id = 3,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- };
- static const struct camss_subdev_resources csid_res_sc8280xp[] = {
- /* CSID0 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 0 },
- { .supply = "vdda-pll", .init_load_uA = 0 }
- },
- .clock = { "vfe0_csid", "vfe0_cphy_rx", "vfe0", "vfe0_axi" },
- .clock_rate = { { 400000000, 480000000, 600000000 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid0" },
- .interrupt = { "csid0" },
- .csid = {
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID1 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 0 },
- { .supply = "vdda-pll", .init_load_uA = 0 }
- },
- .clock = { "vfe1_csid", "vfe1_cphy_rx", "vfe1", "vfe1_axi" },
- .clock_rate = { { 400000000, 480000000, 600000000 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid1" },
- .interrupt = { "csid1" },
- .csid = {
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID2 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 0 },
- { .supply = "vdda-pll", .init_load_uA = 0 }
- },
- .clock = { "vfe2_csid", "vfe2_cphy_rx", "vfe2", "vfe2_axi" },
- .clock_rate = { { 400000000, 480000000, 600000000 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid2" },
- .interrupt = { "csid2" },
- .csid = {
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID3 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 0 },
- { .supply = "vdda-pll", .init_load_uA = 0 }
- },
- .clock = { "vfe3_csid", "vfe3_cphy_rx", "vfe3", "vfe3_axi" },
- .clock_rate = { { 400000000, 480000000, 600000000 },
- { 0 },
- { 0 },
- { 0 } },
- .reg = { "csid3" },
- .interrupt = { "csid3" },
- .csid = {
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID_LITE0 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 0 },
- { .supply = "vdda-pll", .init_load_uA = 0 }
- },
- .clock = { "vfe_lite0_csid", "vfe_lite0_cphy_rx", "vfe_lite0" },
- .clock_rate = { { 400000000, 480000000, 600000000 },
- { 0 },
- { 0 }, },
- .reg = { "csid0_lite" },
- .interrupt = { "csid0_lite" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID_LITE1 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 0 },
- { .supply = "vdda-pll", .init_load_uA = 0 }
- },
- .clock = { "vfe_lite1_csid", "vfe_lite1_cphy_rx", "vfe_lite1" },
- .clock_rate = { { 400000000, 480000000, 600000000 },
- { 0 },
- { 0 }, },
- .reg = { "csid1_lite" },
- .interrupt = { "csid1_lite" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID_LITE2 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 0 },
- { .supply = "vdda-pll", .init_load_uA = 0 }
- },
- .clock = { "vfe_lite2_csid", "vfe_lite2_cphy_rx", "vfe_lite2" },
- .clock_rate = { { 400000000, 480000000, 600000000 },
- { 0 },
- { 0 }, },
- .reg = { "csid2_lite" },
- .interrupt = { "csid2_lite" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID_LITE3 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 0 },
- { .supply = "vdda-pll", .init_load_uA = 0 }
- },
- .clock = { "vfe_lite3_csid", "vfe_lite3_cphy_rx", "vfe_lite3" },
- .clock_rate = { { 400000000, 480000000, 600000000 },
- { 0 },
- { 0 }, },
- .reg = { "csid3_lite" },
- .interrupt = { "csid3_lite" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_gen2,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- }
- };
- static const struct camss_subdev_resources vfe_res_sc8280xp[] = {
- /* VFE0 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb", "camnoc_axi", "vfe0", "vfe0_axi" },
- .clock_rate = { { 0 },
- { 0 },
- { 19200000, 80000000},
- { 19200000, 150000000, 266666667, 320000000, 400000000, 480000000 },
- { 400000000, 558000000, 637000000, 760000000 },
- { 0 }, },
- .reg = { "vfe0" },
- .interrupt = { "vfe0" },
- .vfe = {
- .line_num = 4,
- .pd_name = "ife0",
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE1 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb", "camnoc_axi", "vfe1", "vfe1_axi" },
- .clock_rate = { { 0 },
- { 0 },
- { 19200000, 80000000},
- { 19200000, 150000000, 266666667, 320000000, 400000000, 480000000 },
- { 400000000, 558000000, 637000000, 760000000 },
- { 0 }, },
- .reg = { "vfe1" },
- .interrupt = { "vfe1" },
- .vfe = {
- .line_num = 4,
- .pd_name = "ife1",
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE2 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb", "camnoc_axi", "vfe2", "vfe2_axi" },
- .clock_rate = { { 0 },
- { 0 },
- { 19200000, 80000000},
- { 19200000, 150000000, 266666667, 320000000, 400000000, 480000000 },
- { 400000000, 558000000, 637000000, 760000000 },
- { 0 }, },
- .reg = { "vfe2" },
- .interrupt = { "vfe2" },
- .vfe = {
- .line_num = 4,
- .pd_name = "ife2",
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE3 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb", "camnoc_axi", "vfe3", "vfe3_axi" },
- .clock_rate = { { 0 },
- { 0 },
- { 19200000, 80000000},
- { 19200000, 150000000, 266666667, 320000000, 400000000, 480000000 },
- { 400000000, 558000000, 637000000, 760000000 },
- { 0 }, },
- .reg = { "vfe3" },
- .interrupt = { "vfe3" },
- .vfe = {
- .line_num = 4,
- .pd_name = "ife3",
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE_LITE_0 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb", "camnoc_axi", "vfe_lite0" },
- .clock_rate = { { 0 },
- { 0 },
- { 19200000, 80000000},
- { 19200000, 150000000, 266666667, 320000000, 400000000, 480000000 },
- { 320000000, 400000000, 480000000, 600000000 }, },
- .reg = { "vfe_lite0" },
- .interrupt = { "vfe_lite0" },
- .vfe = {
- .is_lite = true,
- .line_num = 4,
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE_LITE_1 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb", "camnoc_axi", "vfe_lite1" },
- .clock_rate = { { 0 },
- { 0 },
- { 19200000, 80000000},
- { 19200000, 150000000, 266666667, 320000000, 400000000, 480000000 },
- { 320000000, 400000000, 480000000, 600000000 }, },
- .reg = { "vfe_lite1" },
- .interrupt = { "vfe_lite1" },
- .vfe = {
- .is_lite = true,
- .line_num = 4,
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE_LITE_2 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb", "camnoc_axi", "vfe_lite2" },
- .clock_rate = { { 0 },
- { 0 },
- { 19200000, 80000000},
- { 19200000, 150000000, 266666667, 320000000, 400000000, 480000000 },
- { 320000000, 400000000, 480000000, 600000000, }, },
- .reg = { "vfe_lite2" },
- .interrupt = { "vfe_lite2" },
- .vfe = {
- .is_lite = true,
- .line_num = 4,
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE_LITE_3 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb", "camnoc_axi", "vfe_lite3" },
- .clock_rate = { { 0 },
- { 0 },
- { 19200000, 80000000},
- { 19200000, 150000000, 266666667, 320000000, 400000000, 480000000 },
- { 320000000, 400000000, 480000000, 600000000 }, },
- .reg = { "vfe_lite3" },
- .interrupt = { "vfe_lite3" },
- .vfe = {
- .is_lite = true,
- .line_num = 4,
- .hw_ops = &vfe_ops_170,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- };
- static const struct resources_icc icc_res_sc8280xp[] = {
- {
- .name = "cam_ahb",
- .icc_bw_tbl.avg = 150000,
- .icc_bw_tbl.peak = 300000,
- },
- {
- .name = "cam_hf_mnoc",
- .icc_bw_tbl.avg = 2097152,
- .icc_bw_tbl.peak = 2097152,
- },
- {
- .name = "cam_sf_mnoc",
- .icc_bw_tbl.avg = 2097152,
- .icc_bw_tbl.peak = 2097152,
- },
- {
- .name = "cam_sf_icp_mnoc",
- .icc_bw_tbl.avg = 2097152,
- .icc_bw_tbl.peak = 2097152,
- },
- };
- static const struct camss_subdev_resources csiphy_res_8550[] = {
- /* CSIPHY0 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 32200 },
- { .supply = "vdda-pll", .init_load_uA = 18000 }
- },
- .clock = { "csiphy0", "csiphy0_timer" },
- .clock_rate = { { 400000000, 480000000 },
- { 400000000 } },
- .reg = { "csiphy0" },
- .interrupt = { "csiphy0" },
- .csiphy = {
- .id = 0,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY1 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 32200 },
- { .supply = "vdda-pll", .init_load_uA = 18000 }
- },
- .clock = { "csiphy1", "csiphy1_timer" },
- .clock_rate = { { 400000000, 480000000 },
- { 400000000 } },
- .reg = { "csiphy1" },
- .interrupt = { "csiphy1" },
- .csiphy = {
- .id = 1,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY2 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 32200 },
- { .supply = "vdda-pll", .init_load_uA = 18000 }
- },
- .clock = { "csiphy2", "csiphy2_timer" },
- .clock_rate = { { 400000000, 480000000 },
- { 400000000 } },
- .reg = { "csiphy2" },
- .interrupt = { "csiphy2" },
- .csiphy = {
- .id = 2,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY3 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 32200 },
- { .supply = "vdda-pll", .init_load_uA = 18000 }
- },
- .clock = { "csiphy3", "csiphy3_timer" },
- .clock_rate = { { 400000000, 480000000 },
- { 400000000 } },
- .reg = { "csiphy3" },
- .interrupt = { "csiphy3" },
- .csiphy = {
- .id = 3,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY4 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 37900 },
- { .supply = "vdda-pll", .init_load_uA = 18600 }
- },
- .clock = { "csiphy4", "csiphy4_timer" },
- .clock_rate = { { 400000000, 480000000 },
- { 400000000 } },
- .reg = { "csiphy4" },
- .interrupt = { "csiphy4" },
- .csiphy = {
- .id = 4,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY5 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 32200 },
- { .supply = "vdda-pll", .init_load_uA = 18000 }
- },
- .clock = { "csiphy5", "csiphy5_timer" },
- .clock_rate = { { 400000000, 480000000 },
- { 400000000 } },
- .reg = { "csiphy5" },
- .interrupt = { "csiphy5" },
- .csiphy = {
- .id = 5,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY6 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 37900 },
- { .supply = "vdda-pll", .init_load_uA = 18600 }
- },
- .clock = { "csiphy6", "csiphy6_timer" },
- .clock_rate = { { 400000000, 480000000 },
- { 400000000 } },
- .reg = { "csiphy6" },
- .interrupt = { "csiphy6" },
- .csiphy = {
- .id = 6,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY7 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 32200 },
- { .supply = "vdda-pll", .init_load_uA = 18000 }
- },
- .clock = { "csiphy7", "csiphy7_timer" },
- .clock_rate = { { 400000000, 480000000 },
- { 400000000 } },
- .reg = { "csiphy7" },
- .interrupt = { "csiphy7" },
- .csiphy = {
- .id = 7,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- }
- };
- static const struct resources_wrapper csid_wrapper_res_sm8550 = {
- .reg = "csid_wrapper",
- };
- static const struct camss_subdev_resources csid_res_8550[] = {
- /* CSID0 */
- {
- .regulators = {},
- .clock = { "csid", "csiphy_rx" },
- .clock_rate = { { 400000000, 480000000 },
- { 400000000, 480000000 } },
- .reg = { "csid0" },
- .interrupt = { "csid0" },
- .csid = {
- .is_lite = false,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .hw_ops = &csid_ops_gen3,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID1 */
- {
- .regulators = {},
- .clock = { "csid", "csiphy_rx" },
- .clock_rate = { { 400000000, 480000000 },
- { 400000000, 480000000 } },
- .reg = { "csid1" },
- .interrupt = { "csid1" },
- .csid = {
- .is_lite = false,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .hw_ops = &csid_ops_gen3,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID2 */
- {
- .regulators = {},
- .clock = { "csid", "csiphy_rx" },
- .clock_rate = { { 400000000, 480000000 },
- { 400000000, 480000000 } },
- .reg = { "csid2" },
- .interrupt = { "csid2" },
- .csid = {
- .is_lite = false,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .hw_ops = &csid_ops_gen3,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID3 */
- {
- .regulators = {},
- .clock = { "vfe_lite_csid", "vfe_lite_cphy_rx" },
- .clock_rate = { { 400000000, 480000000 },
- { 400000000, 480000000 } },
- .reg = { "csid_lite0" },
- .interrupt = { "csid_lite0" },
- .csid = {
- .is_lite = true,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .hw_ops = &csid_ops_gen3,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID4 */
- {
- .regulators = {},
- .clock = { "vfe_lite_csid", "vfe_lite_cphy_rx" },
- .clock_rate = { { 400000000, 480000000 },
- { 400000000, 480000000 } },
- .reg = { "csid_lite1" },
- .interrupt = { "csid_lite1" },
- .csid = {
- .is_lite = true,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .hw_ops = &csid_ops_gen3,
- .formats = &csid_formats_gen2
- }
- }
- };
- static const struct camss_subdev_resources vfe_res_8550[] = {
- /* VFE0 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb_clk", "vfe0_fast_ahb",
- "vfe0", "cpas_vfe0", "camnoc_axi" },
- .clock_rate = { { 0 },
- { 80000000 },
- { 300000000, 400000000 },
- { 300000000, 400000000 },
- { 466000000, 594000000, 675000000, 785000000 },
- { 300000000, 400000000 },
- { 300000000, 400000000 } },
- .reg = { "vfe0" },
- .interrupt = { "vfe0" },
- .vfe = {
- .line_num = 3,
- .is_lite = false,
- .has_pd = true,
- .pd_name = "ife0",
- .hw_ops = &vfe_ops_gen3,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE1 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb_clk", "vfe1_fast_ahb",
- "vfe1", "cpas_vfe1", "camnoc_axi" },
- .clock_rate = { { 0 },
- { 80000000 },
- { 300000000, 400000000 },
- { 300000000, 400000000 },
- { 466000000, 594000000, 675000000, 785000000 },
- { 300000000, 400000000 },
- { 300000000, 400000000 } },
- .reg = { "vfe1" },
- .interrupt = { "vfe1" },
- .vfe = {
- .line_num = 3,
- .is_lite = false,
- .has_pd = true,
- .pd_name = "ife1",
- .hw_ops = &vfe_ops_gen3,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE2 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb_clk", "vfe2_fast_ahb",
- "vfe2", "cpas_vfe2", "camnoc_axi" },
- .clock_rate = { { 0 },
- { 80000000 },
- { 300000000, 400000000 },
- { 300000000, 400000000 },
- { 466000000, 594000000, 675000000, 785000000 },
- { 300000000, 400000000 },
- { 300000000, 400000000 } },
- .reg = { "vfe2" },
- .interrupt = { "vfe2" },
- .vfe = {
- .line_num = 3,
- .is_lite = false,
- .has_pd = true,
- .pd_name = "ife2",
- .hw_ops = &vfe_ops_gen3,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE3 lite */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "cpas_ahb", "vfe_lite_ahb",
- "vfe_lite", "cpas_ife_lite", "camnoc_axi" },
- .clock_rate = { { 0 },
- { 80000000 },
- { 300000000, 400000000 },
- { 400000000, 480000000 },
- { 300000000, 400000000 },
- { 300000000, 400000000 } },
- .reg = { "vfe_lite0" },
- .interrupt = { "vfe_lite0" },
- .vfe = {
- .line_num = 4,
- .is_lite = true,
- .hw_ops = &vfe_ops_gen3,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE4 lite */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "cpas_ahb", "vfe_lite_ahb",
- "vfe_lite", "cpas_ife_lite", "camnoc_axi" },
- .clock_rate = { { 0 },
- { 80000000 },
- { 300000000, 400000000 },
- { 400000000, 480000000 },
- { 300000000, 400000000 },
- { 300000000, 400000000 } },
- .reg = { "vfe_lite1" },
- .interrupt = { "vfe_lite1" },
- .vfe = {
- .line_num = 4,
- .is_lite = true,
- .hw_ops = &vfe_ops_gen3,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- };
- static const struct resources_icc icc_res_sm8550[] = {
- {
- .name = "ahb",
- .icc_bw_tbl.avg = 2097152,
- .icc_bw_tbl.peak = 2097152,
- },
- {
- .name = "hf_0_mnoc",
- .icc_bw_tbl.avg = 2097152,
- .icc_bw_tbl.peak = 2097152,
- },
- };
- static const struct camss_subdev_resources csiphy_res_sm8650[] = {
- /* CSIPHY0 */
- {
- .regulators = {
- { .supply = "vdd-csiphy01-0p9", .init_load_uA = 88000 },
- { .supply = "vdd-csiphy01-1p2", .init_load_uA = 17800 },
- },
- .clock = { "csiphy0", "csiphy0_timer" },
- .clock_rate = { { 400000000 },
- { 400000000 } },
- .reg = { "csiphy0" },
- .interrupt = { "csiphy0" },
- .csiphy = {
- .id = 0,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845,
- },
- },
- /* CSIPHY1 */
- {
- .regulators = {
- { .supply = "vdd-csiphy01-0p9", .init_load_uA = 88000 },
- { .supply = "vdd-csiphy01-1p2", .init_load_uA = 17800 },
- },
- .clock = { "csiphy1", "csiphy1_timer" },
- .clock_rate = { { 400000000 },
- { 400000000 } },
- .reg = { "csiphy1" },
- .interrupt = { "csiphy1" },
- .csiphy = {
- .id = 1,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845,
- },
- },
- /* CSIPHY2 */
- {
- .regulators = {
- { .supply = "vdd-csiphy24-0p9", .init_load_uA = 147000 },
- { .supply = "vdd-csiphy24-1p2", .init_load_uA = 24400 },
- },
- .clock = { "csiphy2", "csiphy2_timer" },
- .clock_rate = { { 400000000 },
- { 400000000 } },
- .reg = { "csiphy2" },
- .interrupt = { "csiphy2" },
- .csiphy = {
- .id = 2,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845,
- },
- },
- /* CSIPHY3 */
- {
- .regulators = {
- { .supply = "vdd-csiphy35-0p9", .init_load_uA = 88000 },
- { .supply = "vdd-csiphy35-1p2", .init_load_uA = 17800 },
- },
- .clock = { "csiphy3", "csiphy3_timer" },
- .clock_rate = { { 400000000 },
- { 400000000 } },
- .reg = { "csiphy3" },
- .interrupt = { "csiphy3" },
- .csiphy = {
- .id = 3,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845,
- },
- },
- /* CSIPHY4 */
- {
- .regulators = {
- { .supply = "vdd-csiphy24-0p9", .init_load_uA = 147000 },
- { .supply = "vdd-csiphy24-1p2", .init_load_uA = 24400 },
- },
- .clock = { "csiphy4", "csiphy4_timer" },
- .clock_rate = { { 400000000 },
- { 400000000 } },
- .reg = { "csiphy4" },
- .interrupt = { "csiphy4" },
- .csiphy = {
- .id = 4,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845,
- },
- },
- /* CSIPHY5 */
- {
- .regulators = {
- { .supply = "vdd-csiphy35-0p9", .init_load_uA = 88000 },
- { .supply = "vdd-csiphy35-1p2", .init_load_uA = 17800 },
- },
- .clock = { "csiphy5", "csiphy5_timer" },
- .clock_rate = { { 400000000 },
- { 400000000 } },
- .reg = { "csiphy5" },
- .interrupt = { "csiphy5" },
- .csiphy = {
- .id = 5,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845,
- },
- },
- };
- static const struct camss_subdev_resources csid_res_sm8650[] = {
- /* CSID0 */
- {
- .regulators = { },
- .clock = { "csid", "csiphy_rx" },
- .clock_rate = { { 400000000 },
- { 400000000, 480000000 } },
- .reg = { "csid0" },
- .interrupt = { "csid0" },
- .csid = {
- .parent_dev_ops = &vfe_parent_dev_ops,
- .hw_ops = &csid_ops_gen3,
- .formats = &csid_formats_gen2,
- },
- },
- /* CSID1 */
- {
- .regulators = { },
- .clock = { "csid", "csiphy_rx" },
- .clock_rate = { { 400000000 },
- { 400000000, 480000000 } },
- .reg = { "csid1" },
- .interrupt = { "csid1" },
- .csid = {
- .parent_dev_ops = &vfe_parent_dev_ops,
- .hw_ops = &csid_ops_gen3,
- .formats = &csid_formats_gen2,
- },
- },
- /* CSID2 */
- {
- .regulators = { },
- .clock = { "csid", "csiphy_rx" },
- .clock_rate = { { 400000000 },
- { 400000000, 480000000 } },
- .reg = { "csid2" },
- .interrupt = { "csid2" },
- .csid = {
- .parent_dev_ops = &vfe_parent_dev_ops,
- .hw_ops = &csid_ops_gen3,
- .formats = &csid_formats_gen2,
- },
- },
- /* CSID3 lite */
- {
- .regulators = { },
- .clock = { "vfe_lite_ahb", "vfe_lite_csid", "vfe_lite_cphy_rx" },
- .clock_rate = { { 0 },
- { 400000000, 480000000 },
- { 0 } },
- .reg = { "csid_lite0" },
- .interrupt = { "csid_lite0" },
- .csid = {
- .is_lite = true,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .hw_ops = &csid_ops_gen3,
- .formats = &csid_formats_gen2,
- },
- },
- /* CSID4 lite */
- {
- .regulators = { },
- .clock = { "vfe_lite_ahb", "vfe_lite_csid", "vfe_lite_cphy_rx" },
- .clock_rate = { { 0 },
- { 400000000, 480000000 },
- { 0 } },
- .reg = { "csid_lite1" },
- .interrupt = { "csid_lite1" },
- .csid = {
- .is_lite = true,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .hw_ops = &csid_ops_gen3,
- .formats = &csid_formats_gen2,
- },
- },
- };
- static const struct camss_subdev_resources vfe_res_sm8650[] = {
- /* VFE0 */
- {
- .regulators = { },
- .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb",
- "camnoc_axi", "vfe0_fast_ahb", "vfe0", "cpas_vfe0",
- "qdss_debug_xo",
- },
- .clock_rate = { { 0 },
- { 80000000 },
- { 300000000, 400000000 },
- { 300000000, 400000000 },
- { 0 },
- { 466000000, 594000000, 675000000, 785000000 },
- { 0 },
- { 0 },
- },
- .reg = { "vfe0" },
- .interrupt = { "vfe0" },
- .vfe = {
- .line_num = 3,
- .has_pd = true,
- .pd_name = "ife0",
- .hw_ops = &vfe_ops_gen3,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- },
- },
- /* VFE1 */
- {
- .regulators = { },
- .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb",
- "camnoc_axi", "vfe1_fast_ahb", "vfe1", "cpas_vfe1",
- "qdss_debug_xo",
- },
- .clock_rate = { { 0 },
- { 80000000 },
- { 300000000, 400000000 },
- { 300000000, 400000000 },
- { 0 },
- { 466000000, 594000000, 675000000, 785000000 },
- { 0 },
- { 0 },
- },
- .reg = { "vfe1" },
- .interrupt = { "vfe1" },
- .vfe = {
- .line_num = 3,
- .has_pd = true,
- .pd_name = "ife1",
- .hw_ops = &vfe_ops_gen3,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- },
- },
- /* VFE2 */
- {
- .regulators = { },
- .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb",
- "camnoc_axi", "vfe2_fast_ahb", "vfe2", "cpas_vfe2",
- "qdss_debug_xo",
- },
- .clock_rate = { { 0 },
- { 80000000 },
- { 300000000, 400000000 },
- { 300000000, 400000000 },
- { 0 },
- { 466000000, 594000000, 675000000, 785000000 },
- { 0 },
- { 0 },
- },
- .reg = { "vfe2" },
- .interrupt = { "vfe2" },
- .vfe = {
- .line_num = 3,
- .has_pd = true,
- .pd_name = "ife2",
- .hw_ops = &vfe_ops_gen3,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- },
- },
- /* VFE3 lite */
- {
- .regulators = { },
- .clock = { "gcc_axi_hf", "cpas_ahb", "camnoc_axi",
- "vfe_lite_ahb", "vfe_lite", "cpas_vfe_lite",
- "qdss_debug_xo",
- },
- .clock_rate = { { 0 },
- { 80000000 },
- { 300000000, 400000000 },
- { 0 },
- { 400000000, 480000000 },
- { 0 },
- { 0 },
- },
- .reg = { "vfe_lite0" },
- .interrupt = { "vfe_lite0" },
- .vfe = {
- .line_num = 4,
- .is_lite = true,
- .hw_ops = &vfe_ops_gen3,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- },
- },
- /* VFE4 lite */
- {
- .regulators = { },
- .clock = { "gcc_axi_hf", "cpas_ahb", "camnoc_axi",
- "vfe_lite_ahb", "vfe_lite", "cpas_vfe_lite",
- "qdss_debug_xo",
- },
- .clock_rate = { { 0 },
- { 80000000 },
- { 300000000, 400000000 },
- { 0 },
- { 400000000, 480000000 },
- { 0 },
- { 0 },
- },
- .reg = { "vfe_lite1" },
- .interrupt = { "vfe_lite1" },
- .vfe = {
- .line_num = 4,
- .is_lite = true,
- .hw_ops = &vfe_ops_gen3,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- },
- },
- };
- static const struct resources_icc icc_res_sm8650[] = {
- {
- .name = "ahb",
- .icc_bw_tbl.avg = 38400,
- .icc_bw_tbl.peak = 76800,
- },
- {
- .name = "hf_mnoc",
- .icc_bw_tbl.avg = 2097152,
- .icc_bw_tbl.peak = 2097152,
- },
- };
- static const struct camss_subdev_resources csiphy_res_8300[] = {
- /* CSIPHY0 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 15900 },
- { .supply = "vdda-pll", .init_load_uA = 8900 }
- },
- .clock = { "csiphy_rx", "csiphy0", "csiphy0_timer" },
- .clock_rate = {
- { 400000000 },
- { 0 },
- { 400000000 },
- },
- .reg = { "csiphy0" },
- .interrupt = { "csiphy0" },
- .csiphy = {
- .id = 0,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845,
- }
- },
- /* CSIPHY1 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 15900 },
- { .supply = "vdda-pll", .init_load_uA = 8900 }
- },
- .clock = { "csiphy_rx", "csiphy1", "csiphy1_timer" },
- .clock_rate = {
- { 400000000 },
- { 0 },
- { 400000000 },
- },
- .reg = { "csiphy1" },
- .interrupt = { "csiphy1" },
- .csiphy = {
- .id = 1,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845,
- }
- },
- /* CSIPHY2 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 15900 },
- { .supply = "vdda-pll", .init_load_uA = 8900 }
- },
- .clock = { "csiphy_rx", "csiphy2", "csiphy2_timer" },
- .clock_rate = {
- { 400000000 },
- { 0 },
- { 400000000 },
- },
- .reg = { "csiphy2" },
- .interrupt = { "csiphy2" },
- .csiphy = {
- .id = 2,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845,
- }
- },
- };
- static const struct camss_subdev_resources csiphy_res_8775p[] = {
- /* CSIPHY0 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 15900 },
- { .supply = "vdda-pll", .init_load_uA = 8900 }
- },
- .clock = { "csiphy_rx", "csiphy0", "csiphy0_timer"},
- .clock_rate = {
- { 400000000 },
- { 0 },
- { 400000000 },
- },
- .reg = { "csiphy0" },
- .interrupt = { "csiphy0" },
- .csiphy = {
- .id = 0,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY1 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 15900 },
- { .supply = "vdda-pll", .init_load_uA = 8900 }
- },
- .clock = { "csiphy_rx", "csiphy1", "csiphy1_timer"},
- .clock_rate = {
- { 400000000 },
- { 0 },
- { 400000000 },
- },
- .reg = { "csiphy1" },
- .interrupt = { "csiphy1" },
- .csiphy = {
- .id = 1,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY2 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 15900 },
- { .supply = "vdda-pll", .init_load_uA = 8900 }
- },
- .clock = { "csiphy_rx", "csiphy2", "csiphy2_timer"},
- .clock_rate = {
- { 400000000 },
- { 0 },
- { 400000000 },
- },
- .reg = { "csiphy2" },
- .interrupt = { "csiphy2" },
- .csiphy = {
- .id = 2,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- /* CSIPHY3 */
- {
- .regulators = {
- { .supply = "vdda-phy", .init_load_uA = 15900 },
- { .supply = "vdda-pll", .init_load_uA = 8900 }
- },
- .clock = { "csiphy_rx", "csiphy3", "csiphy3_timer"},
- .clock_rate = {
- { 400000000 },
- { 0 },
- { 400000000 },
- },
- .reg = { "csiphy3" },
- .interrupt = { "csiphy3" },
- .csiphy = {
- .id = 3,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- }
- },
- };
- static const struct camss_subdev_resources csid_res_8775p[] = {
- /* CSID0 */
- {
- .regulators = {},
- .clock = { "csid", "csiphy_rx"},
- .clock_rate = {
- { 400000000, 400000000},
- { 400000000, 400000000}
- },
- .reg = { "csid0" },
- .interrupt = { "csid0" },
- .csid = {
- .is_lite = false,
- .hw_ops = &csid_ops_gen3,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID1 */
- {
- .regulators = {},
- .clock = { "csid", "csiphy_rx"},
- .clock_rate = {
- { 400000000, 400000000},
- { 400000000, 400000000}
- },
- .reg = { "csid1" },
- .interrupt = { "csid1" },
- .csid = {
- .is_lite = false,
- .hw_ops = &csid_ops_gen3,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID2 (lite) */
- {
- .regulators = {},
- .clock = { "cpas_vfe_lite", "vfe_lite_ahb",
- "vfe_lite_csid", "vfe_lite_cphy_rx",
- "vfe_lite"},
- .clock_rate = {
- { 0, 0, 400000000, 400000000, 0},
- { 0, 0, 400000000, 480000000, 0}
- },
- .reg = { "csid_lite0" },
- .interrupt = { "csid_lite0" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_gen3,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID3 (lite) */
- {
- .regulators = {},
- .clock = { "cpas_vfe_lite", "vfe_lite_ahb",
- "vfe_lite_csid", "vfe_lite_cphy_rx",
- "vfe_lite"},
- .clock_rate = {
- { 0, 0, 400000000, 400000000, 0},
- { 0, 0, 400000000, 480000000, 0}
- },
- .reg = { "csid_lite1" },
- .interrupt = { "csid_lite1" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_gen3,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID4 (lite) */
- {
- .regulators = {},
- .clock = { "cpas_vfe_lite", "vfe_lite_ahb",
- "vfe_lite_csid", "vfe_lite_cphy_rx",
- "vfe_lite"},
- .clock_rate = {
- { 0, 0, 400000000, 400000000, 0},
- { 0, 0, 400000000, 480000000, 0}
- },
- .reg = { "csid_lite2" },
- .interrupt = { "csid_lite2" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_gen3,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID5 (lite) */
- {
- .regulators = {},
- .clock = { "cpas_vfe_lite", "vfe_lite_ahb",
- "vfe_lite_csid", "vfe_lite_cphy_rx",
- "vfe_lite"},
- .clock_rate = {
- { 0, 0, 400000000, 400000000, 0},
- { 0, 0, 400000000, 480000000, 0}
- },
- .reg = { "csid_lite3" },
- .interrupt = { "csid_lite3" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_gen3,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID6 (lite) */
- {
- .regulators = {},
- .clock = { "cpas_vfe_lite", "vfe_lite_ahb",
- "vfe_lite_csid", "vfe_lite_cphy_rx",
- "vfe_lite"},
- .clock_rate = {
- { 0, 0, 400000000, 400000000, 0},
- { 0, 0, 400000000, 480000000, 0}
- },
- .reg = { "csid_lite4" },
- .interrupt = { "csid_lite4" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_gen3,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- };
- static const struct camss_subdev_resources vfe_res_8775p[] = {
- /* VFE0 */
- {
- .regulators = {},
- .clock = { "cpas_vfe0", "vfe0", "vfe0_fast_ahb",
- "cpas_ahb", "gcc_axi_hf",
- "cpas_fast_ahb_clk",
- "camnoc_axi"},
- .clock_rate = {
- { 0 },
- { 480000000 },
- { 300000000, 400000000 },
- { 300000000, 400000000 },
- { 0 },
- { 300000000, 400000000 },
- { 400000000 },
- },
- .reg = { "vfe0" },
- .interrupt = { "vfe0" },
- .vfe = {
- .line_num = 3,
- .is_lite = false,
- .has_pd = false,
- .pd_name = NULL,
- .hw_ops = &vfe_ops_gen3,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE1 */
- {
- .regulators = {},
- .clock = { "cpas_vfe1", "vfe1", "vfe1_fast_ahb",
- "cpas_ahb", "gcc_axi_hf",
- "cpas_fast_ahb_clk",
- "camnoc_axi"},
- .clock_rate = {
- { 0 },
- { 480000000 },
- { 300000000, 400000000 },
- { 300000000, 400000000 },
- { 0 },
- { 300000000, 400000000 },
- { 400000000 },
- },
- .reg = { "vfe1" },
- .interrupt = { "vfe1" },
- .vfe = {
- .line_num = 3,
- .is_lite = false,
- .has_pd = false,
- .pd_name = NULL,
- .hw_ops = &vfe_ops_gen3,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE2 (lite) */
- {
- .regulators = {},
- .clock = { "cpas_vfe_lite", "vfe_lite_ahb",
- "vfe_lite_csid", "vfe_lite_cphy_rx",
- "vfe_lite"},
- .clock_rate = {
- { 0, 0, 0, 0 },
- { 300000000, 400000000, 400000000, 400000000 },
- { 400000000, 400000000, 400000000, 400000000 },
- { 400000000, 400000000, 400000000, 400000000 },
- { 480000000, 600000000, 600000000, 600000000 },
- },
- .reg = { "vfe_lite0" },
- .interrupt = { "vfe_lite0" },
- .vfe = {
- .line_num = 4,
- .is_lite = true,
- .hw_ops = &vfe_ops_gen3,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE3 (lite) */
- {
- .regulators = {},
- .clock = { "cpas_vfe_lite", "vfe_lite_ahb",
- "vfe_lite_csid", "vfe_lite_cphy_rx",
- "vfe_lite"},
- .clock_rate = {
- { 0, 0, 0, 0 },
- { 300000000, 400000000, 400000000, 400000000 },
- { 400000000, 400000000, 400000000, 400000000 },
- { 400000000, 400000000, 400000000, 400000000 },
- { 480000000, 600000000, 600000000, 600000000 },
- },
- .reg = { "vfe_lite1" },
- .interrupt = { "vfe_lite1" },
- .vfe = {
- .line_num = 4,
- .is_lite = true,
- .hw_ops = &vfe_ops_gen3,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE4 (lite) */
- {
- .regulators = {},
- .clock = { "cpas_vfe_lite", "vfe_lite_ahb",
- "vfe_lite_csid", "vfe_lite_cphy_rx",
- "vfe_lite"},
- .clock_rate = {
- { 0, 0, 0, 0 },
- { 300000000, 400000000, 400000000, 400000000 },
- { 400000000, 400000000, 400000000, 400000000 },
- { 400000000, 400000000, 400000000, 400000000 },
- { 480000000, 600000000, 600000000, 600000000 },
- },
- .reg = { "vfe_lite2" },
- .interrupt = { "vfe_lite2" },
- .vfe = {
- .line_num = 4,
- .is_lite = true,
- .hw_ops = &vfe_ops_gen3,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE5 (lite) */
- {
- .regulators = {},
- .clock = { "cpas_vfe_lite", "vfe_lite_ahb",
- "vfe_lite_csid", "vfe_lite_cphy_rx",
- "vfe_lite"},
- .clock_rate = {
- { 0, 0, 0, 0 },
- { 300000000, 400000000, 400000000, 400000000 },
- { 400000000, 400000000, 400000000, 400000000 },
- { 400000000, 400000000, 400000000, 400000000 },
- { 480000000, 600000000, 600000000, 600000000 },
- },
- .reg = { "vfe_lite3" },
- .interrupt = { "vfe_lite3" },
- .vfe = {
- .line_num = 4,
- .is_lite = true,
- .hw_ops = &vfe_ops_gen3,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- /* VFE6 (lite) */
- {
- .regulators = {},
- .clock = { "cpas_vfe_lite", "vfe_lite_ahb",
- "vfe_lite_csid", "vfe_lite_cphy_rx",
- "vfe_lite"},
- .clock_rate = {
- { 0, 0, 0, 0 },
- { 300000000, 400000000, 400000000, 400000000 },
- { 400000000, 400000000, 400000000, 400000000 },
- { 400000000, 400000000, 400000000, 400000000 },
- { 480000000, 600000000, 600000000, 600000000 },
- },
- .reg = { "vfe_lite4" },
- .interrupt = { "vfe_lite4" },
- .vfe = {
- .line_num = 4,
- .is_lite = true,
- .hw_ops = &vfe_ops_gen3,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- }
- },
- };
- static const struct resources_icc icc_res_qcs8300[] = {
- {
- .name = "ahb",
- .icc_bw_tbl.avg = 38400,
- .icc_bw_tbl.peak = 76800,
- },
- {
- .name = "hf_0",
- .icc_bw_tbl.avg = 2097152,
- .icc_bw_tbl.peak = 2097152,
- },
- };
- static const struct resources_icc icc_res_sa8775p[] = {
- {
- .name = "ahb",
- .icc_bw_tbl.avg = 38400,
- .icc_bw_tbl.peak = 76800,
- },
- {
- .name = "hf_0",
- .icc_bw_tbl.avg = 2097152,
- .icc_bw_tbl.peak = 2097152,
- },
- };
- static const struct camss_subdev_resources csiphy_res_x1e80100[] = {
- /* CSIPHY0 */
- {
- .regulators = {
- { .supply = "vdd-csiphy-0p8", .init_load_uA = 105000 },
- { .supply = "vdd-csiphy-1p2", .init_load_uA = 58900 }
- },
- .clock = { "csiphy0", "csiphy0_timer" },
- .clock_rate = { { 300000000, 400000000, 480000000 },
- { 266666667, 400000000 } },
- .reg = { "csiphy0" },
- .interrupt = { "csiphy0" },
- .csiphy = {
- .id = 0,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- },
- },
- /* CSIPHY1 */
- {
- .regulators = {
- { .supply = "vdd-csiphy-0p8", .init_load_uA = 105000 },
- { .supply = "vdd-csiphy-1p2", .init_load_uA = 58900 }
- },
- .clock = { "csiphy1", "csiphy1_timer" },
- .clock_rate = { { 300000000, 400000000, 480000000 },
- { 266666667, 400000000 } },
- .reg = { "csiphy1" },
- .interrupt = { "csiphy1" },
- .csiphy = {
- .id = 1,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- },
- },
- /* CSIPHY2 */
- {
- .regulators = {
- { .supply = "vdd-csiphy-0p8", .init_load_uA = 105000 },
- { .supply = "vdd-csiphy-1p2", .init_load_uA = 58900 }
- },
- .clock = { "csiphy2", "csiphy2_timer" },
- .clock_rate = { { 300000000, 400000000, 480000000 },
- { 266666667, 400000000 } },
- .reg = { "csiphy2" },
- .interrupt = { "csiphy2" },
- .csiphy = {
- .id = 2,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- },
- },
- /* CSIPHY4 */
- {
- .regulators = {
- { .supply = "vdd-csiphy-0p8", .init_load_uA = 105000 },
- { .supply = "vdd-csiphy-1p2", .init_load_uA = 58900 }
- },
- .clock = { "csiphy4", "csiphy4_timer" },
- .clock_rate = { { 300000000, 400000000, 480000000 },
- { 266666667, 400000000 } },
- .reg = { "csiphy4" },
- .interrupt = { "csiphy4" },
- .csiphy = {
- .id = 4,
- .hw_ops = &csiphy_ops_3ph_1_0,
- .formats = &csiphy_formats_sdm845
- },
- },
- };
- static const struct camss_subdev_resources csid_res_x1e80100[] = {
- /* CSID0 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb",
- "cpas_fast_ahb", "csid", "csid_csiphy_rx" },
- .clock_rate = { { 0 },
- { 0 },
- { 64000000, 80000000 },
- { 80000000, 100000000, 200000000,
- 300000000, 400000000 },
- { 300000000, 400000000, 480000000 },
- { 300000000, 400000000, 480000000 }, },
- .reg = { "csid0" },
- .interrupt = { "csid0" },
- .csid = {
- .hw_ops = &csid_ops_680,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- },
- },
- /* CSID1 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb",
- "cpas_fast_ahb", "csid", "csid_csiphy_rx" },
- .clock_rate = { { 0 },
- { 0 },
- { 64000000, 80000000 },
- { 80000000, 100000000, 200000000,
- 300000000, 400000000 },
- { 300000000, 400000000, 480000000 },
- { 300000000, 400000000, 480000000 }, },
- .reg = { "csid1" },
- .interrupt = { "csid1" },
- .csid = {
- .hw_ops = &csid_ops_680,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- },
- },
- /* CSID2 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb",
- "cpas_fast_ahb", "csid", "csid_csiphy_rx" },
- .clock_rate = { { 0 },
- { 0 },
- { 64000000, 80000000 },
- { 80000000, 100000000, 200000000,
- 300000000, 400000000 },
- { 300000000, 400000000, 480000000 },
- { 300000000, 400000000, 480000000 }, },
- .reg = { "csid2" },
- .interrupt = { "csid2" },
- .csid = {
- .hw_ops = &csid_ops_680,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- },
- },
- /* CSID_LITE0 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb",
- "cpas_fast_ahb", "csid", "csid_csiphy_rx" },
- .clock_rate = { { 0 },
- { 0 },
- { 64000000, 80000000 },
- { 80000000, 100000000, 200000000,
- 300000000, 400000000 },
- { 300000000, 400000000, 480000000 },
- { 300000000, 400000000, 480000000 }, },
- .reg = { "csid_lite0" },
- .interrupt = { "csid_lite0" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_680,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- /* CSID_LITE1 */
- {
- .regulators = {},
- .clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb",
- "cpas_fast_ahb", "csid", "csid_csiphy_rx" },
- .clock_rate = { { 0 },
- { 0 },
- { 64000000, 80000000 },
- { 80000000, 100000000, 200000000,
- 300000000, 400000000 },
- { 300000000, 400000000, 480000000 },
- { 300000000, 400000000, 480000000 }, },
- .reg = { "csid_lite1" },
- .interrupt = { "csid_lite1" },
- .csid = {
- .is_lite = true,
- .hw_ops = &csid_ops_680,
- .parent_dev_ops = &vfe_parent_dev_ops,
- .formats = &csid_formats_gen2
- }
- },
- };
- static const struct camss_subdev_resources vfe_res_x1e80100[] = {
- /* IFE0 */
- {
- .regulators = {},
- .clock = {"camnoc_rt_axi", "camnoc_nrt_axi", "cpas_ahb",
- "cpas_fast_ahb", "cpas_vfe0", "vfe0_fast_ahb",
- "vfe0" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 345600000, 432000000, 594000000, 675000000,
- 727000000 }, },
- .reg = { "vfe0" },
- .interrupt = { "vfe0" },
- .vfe = {
- .line_num = 4,
- .pd_name = "ife0",
- .hw_ops = &vfe_ops_680,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- },
- },
- /* IFE1 */
- {
- .regulators = {},
- .clock = { "camnoc_rt_axi", "camnoc_nrt_axi", "cpas_ahb",
- "cpas_fast_ahb", "cpas_vfe1", "vfe1_fast_ahb",
- "vfe1" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 345600000, 432000000, 594000000, 675000000,
- 727000000 }, },
- .reg = { "vfe1" },
- .interrupt = { "vfe1" },
- .vfe = {
- .line_num = 4,
- .pd_name = "ife1",
- .hw_ops = &vfe_ops_680,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- },
- },
- /* IFE_LITE_0 */
- {
- .regulators = {},
- .clock = { "camnoc_rt_axi", "camnoc_nrt_axi", "cpas_ahb",
- "vfe_lite_ahb", "cpas_vfe_lite", "vfe_lite",
- "vfe_lite_csid" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 266666667, 400000000, 480000000 },
- { 266666667, 400000000, 480000000 }, },
- .reg = { "vfe_lite0" },
- .interrupt = { "vfe_lite0" },
- .vfe = {
- .is_lite = true,
- .line_num = 4,
- .hw_ops = &vfe_ops_680,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- },
- },
- /* IFE_LITE_1 */
- {
- .regulators = {},
- .clock = { "camnoc_rt_axi", "camnoc_nrt_axi", "cpas_ahb",
- "vfe_lite_ahb", "cpas_vfe_lite", "vfe_lite",
- "vfe_lite_csid" },
- .clock_rate = { { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 266666667, 400000000, 480000000 },
- { 266666667, 400000000, 480000000 }, },
- .reg = { "vfe_lite1" },
- .interrupt = { "vfe_lite1" },
- .vfe = {
- .is_lite = true,
- .line_num = 4,
- .hw_ops = &vfe_ops_680,
- .formats_rdi = &vfe_formats_rdi_845,
- .formats_pix = &vfe_formats_pix_845
- },
- },
- };
- static const struct resources_icc icc_res_x1e80100[] = {
- {
- .name = "ahb",
- .icc_bw_tbl.avg = 150000,
- .icc_bw_tbl.peak = 300000,
- },
- {
- .name = "hf_mnoc",
- .icc_bw_tbl.avg = 2097152,
- .icc_bw_tbl.peak = 2097152,
- },
- {
- .name = "sf_mnoc",
- .icc_bw_tbl.avg = 2097152,
- .icc_bw_tbl.peak = 2097152,
- },
- {
- .name = "sf_icp_mnoc",
- .icc_bw_tbl.avg = 2097152,
- .icc_bw_tbl.peak = 2097152,
- },
- };
- static const struct resources_wrapper csid_wrapper_res_x1e80100 = {
- .reg = "csid_wrapper",
- };
- /*
- * camss_add_clock_margin - Add margin to clock frequency rate
- * @rate: Clock frequency rate
- *
- * When making calculations with physical clock frequency values
- * some safety margin must be added. Add it.
- */
- inline void camss_add_clock_margin(u64 *rate)
- {
- *rate *= CAMSS_CLOCK_MARGIN_NUMERATOR;
- *rate = div_u64(*rate, CAMSS_CLOCK_MARGIN_DENOMINATOR);
- }
- /*
- * camss_enable_clocks - Enable multiple clocks
- * @nclocks: Number of clocks in clock array
- * @clock: Clock array
- * @dev: Device
- *
- * Return 0 on success or a negative error code otherwise
- */
- int camss_enable_clocks(int nclocks, struct camss_clock *clock,
- struct device *dev)
- {
- int ret;
- int i;
- for (i = 0; i < nclocks; i++) {
- ret = clk_prepare_enable(clock[i].clk);
- if (ret) {
- dev_err(dev, "clock enable failed: %d\n", ret);
- goto error;
- }
- }
- return 0;
- error:
- for (i--; i >= 0; i--)
- clk_disable_unprepare(clock[i].clk);
- return ret;
- }
- /*
- * camss_disable_clocks - Disable multiple clocks
- * @nclocks: Number of clocks in clock array
- * @clock: Clock array
- */
- void camss_disable_clocks(int nclocks, struct camss_clock *clock)
- {
- int i;
- for (i = nclocks - 1; i >= 0; i--)
- clk_disable_unprepare(clock[i].clk);
- }
- /*
- * camss_find_sensor_pad - Find the media pad via which the sensor is linked
- * @entity: Media entity to start searching from
- *
- * Return a pointer to sensor media pad or NULL if not found
- */
- struct media_pad *camss_find_sensor_pad(struct media_entity *entity)
- {
- struct media_pad *pad;
- while (1) {
- pad = &entity->pads[0];
- if (!(pad->flags & MEDIA_PAD_FL_SINK))
- return NULL;
- pad = media_pad_remote_pad_first(pad);
- if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
- return NULL;
- entity = pad->entity;
- if (entity->function == MEDIA_ENT_F_CAM_SENSOR)
- return pad;
- }
- }
- /**
- * camss_get_link_freq - Get link frequency from sensor
- * @entity: Media entity in the current pipeline
- * @bpp: Number of bits per pixel for the current format
- * @lanes: Number of lanes in the link to the sensor
- *
- * Return link frequency on success or a negative error code otherwise
- */
- s64 camss_get_link_freq(struct media_entity *entity, unsigned int bpp,
- unsigned int lanes)
- {
- struct media_pad *sensor_pad;
- sensor_pad = camss_find_sensor_pad(entity);
- if (!sensor_pad)
- return -ENODEV;
- return v4l2_get_link_freq(sensor_pad, bpp, 2 * lanes);
- }
- /*
- * camss_get_pixel_clock - Get pixel clock rate from sensor
- * @entity: Media entity in the current pipeline
- * @pixel_clock: Received pixel clock value
- *
- * Return 0 on success or a negative error code otherwise
- */
- int camss_get_pixel_clock(struct media_entity *entity, u64 *pixel_clock)
- {
- struct media_pad *sensor_pad;
- struct v4l2_subdev *subdev;
- struct v4l2_ctrl *ctrl;
- sensor_pad = camss_find_sensor_pad(entity);
- if (!sensor_pad)
- return -ENODEV;
- subdev = media_entity_to_v4l2_subdev(sensor_pad->entity);
- ctrl = v4l2_ctrl_find(subdev->ctrl_handler, V4L2_CID_PIXEL_RATE);
- if (!ctrl)
- return -EINVAL;
- *pixel_clock = v4l2_ctrl_g_ctrl_int64(ctrl);
- return 0;
- }
- int camss_pm_domain_on(struct camss *camss, int id)
- {
- int ret = 0;
- if (id < camss->res->vfe_num) {
- struct vfe_device *vfe = &camss->vfe[id];
- ret = vfe->res->hw_ops->pm_domain_on(vfe);
- }
- return ret;
- }
- void camss_pm_domain_off(struct camss *camss, int id)
- {
- if (id < camss->res->vfe_num) {
- struct vfe_device *vfe = &camss->vfe[id];
- vfe->res->hw_ops->pm_domain_off(vfe);
- }
- }
- static int vfe_parent_dev_ops_get(struct camss *camss, int id)
- {
- int ret = -EINVAL;
- if (id < camss->res->vfe_num) {
- struct vfe_device *vfe = &camss->vfe[id];
- ret = vfe_get(vfe);
- }
- return ret;
- }
- static int vfe_parent_dev_ops_put(struct camss *camss, int id)
- {
- if (id < camss->res->vfe_num) {
- struct vfe_device *vfe = &camss->vfe[id];
- vfe_put(vfe);
- }
- return 0;
- }
- static void __iomem
- *vfe_parent_dev_ops_get_base_address(struct camss *camss, int id)
- {
- if (id < camss->res->vfe_num) {
- struct vfe_device *vfe = &camss->vfe[id];
- return vfe->base;
- }
- return NULL;
- }
- static const struct parent_dev_ops vfe_parent_dev_ops = {
- .get = vfe_parent_dev_ops_get,
- .put = vfe_parent_dev_ops_put,
- .get_base_address = vfe_parent_dev_ops_get_base_address
- };
- /*
- * camss_parse_endpoint_node - Parse port endpoint node
- * @dev: CAMSS device
- * @ep: Device endpoint to be parsed
- * @csd: Parsed data from port endpoint node
- *
- * Return 0 on success or a negative error code on failure
- */
- static int camss_parse_endpoint_node(struct device *dev,
- struct fwnode_handle *ep,
- struct camss_async_subdev *csd)
- {
- struct csiphy_lanes_cfg *lncfg = &csd->interface.csi2.lane_cfg;
- struct v4l2_mbus_config_mipi_csi2 *mipi_csi2;
- struct v4l2_fwnode_endpoint vep = { { 0 } };
- unsigned int i;
- int ret;
- ret = v4l2_fwnode_endpoint_parse(ep, &vep);
- if (ret)
- return ret;
- /*
- * Most SoCs support both D-PHY and C-PHY standards, but currently only
- * D-PHY is supported in the driver.
- */
- if (vep.bus_type != V4L2_MBUS_CSI2_DPHY) {
- dev_err(dev, "Unsupported bus type %d\n", vep.bus_type);
- return -EINVAL;
- }
- csd->interface.csiphy_id = vep.base.port;
- mipi_csi2 = &vep.bus.mipi_csi2;
- lncfg->clk.pos = mipi_csi2->clock_lane;
- lncfg->clk.pol = mipi_csi2->lane_polarities[0];
- lncfg->num_data = mipi_csi2->num_data_lanes;
- lncfg->data = devm_kcalloc(dev,
- lncfg->num_data, sizeof(*lncfg->data),
- GFP_KERNEL);
- if (!lncfg->data)
- return -ENOMEM;
- for (i = 0; i < lncfg->num_data; i++) {
- lncfg->data[i].pos = mipi_csi2->data_lanes[i];
- lncfg->data[i].pol = mipi_csi2->lane_polarities[i + 1];
- }
- return 0;
- }
- /*
- * camss_parse_ports - Parse ports node
- * @dev: CAMSS device
- *
- * Return 0 on success or a negative error code on failure
- */
- static int camss_parse_ports(struct camss *camss)
- {
- struct device *dev = camss->dev;
- struct fwnode_handle *fwnode = dev_fwnode(dev), *ep;
- int ret;
- fwnode_graph_for_each_endpoint(fwnode, ep) {
- struct camss_async_subdev *csd;
- csd = v4l2_async_nf_add_fwnode_remote(&camss->notifier, ep,
- typeof(*csd));
- if (IS_ERR(csd)) {
- ret = PTR_ERR(csd);
- goto err_cleanup;
- }
- ret = camss_parse_endpoint_node(dev, ep, csd);
- if (ret < 0)
- goto err_cleanup;
- }
- return 0;
- err_cleanup:
- fwnode_handle_put(ep);
- return ret;
- }
- /*
- * camss_init_subdevices - Initialize subdev structures and resources
- * @camss: CAMSS device
- *
- * Return 0 on success or a negative error code on failure
- */
- static int camss_init_subdevices(struct camss *camss)
- {
- struct platform_device *pdev = to_platform_device(camss->dev);
- const struct camss_resources *res = camss->res;
- unsigned int i;
- int ret;
- for (i = 0; i < camss->res->csiphy_num; i++) {
- ret = msm_csiphy_subdev_init(camss, &camss->csiphy[i],
- &res->csiphy_res[i],
- res->csiphy_res[i].csiphy.id);
- if (ret < 0) {
- dev_err(camss->dev,
- "Failed to init csiphy%d sub-device: %d\n",
- i, ret);
- return ret;
- }
- }
- /* note: SM8250 requires VFE to be initialized before CSID */
- for (i = 0; i < camss->res->vfe_num; i++) {
- ret = msm_vfe_subdev_init(camss, &camss->vfe[i],
- &res->vfe_res[i], i);
- if (ret < 0) {
- dev_err(camss->dev,
- "Fail to init vfe%d sub-device: %d\n", i, ret);
- return ret;
- }
- }
- /* Get optional CSID wrapper regs shared between CSID devices */
- if (res->csid_wrapper_res) {
- char *reg = res->csid_wrapper_res->reg;
- void __iomem *base;
- base = devm_platform_ioremap_resource_byname(pdev, reg);
- if (IS_ERR(base))
- return PTR_ERR(base);
- camss->csid_wrapper_base = base;
- }
- for (i = 0; i < camss->res->csid_num; i++) {
- ret = msm_csid_subdev_init(camss, &camss->csid[i],
- &res->csid_res[i], i);
- if (ret < 0) {
- dev_err(camss->dev,
- "Failed to init csid%d sub-device: %d\n",
- i, ret);
- return ret;
- }
- }
- ret = msm_ispif_subdev_init(camss, res->ispif_res);
- if (ret < 0) {
- dev_err(camss->dev, "Failed to init ispif sub-device: %d\n",
- ret);
- return ret;
- }
- return 0;
- }
- /*
- * camss_link_err - print error in case link creation fails
- * @src_name: name for source of the link
- * @sink_name: name for sink of the link
- */
- inline void camss_link_err(struct camss *camss,
- const char *src_name,
- const char *sink_name,
- int ret)
- {
- dev_err(camss->dev,
- "Failed to link %s->%s entities: %d\n",
- src_name,
- sink_name,
- ret);
- }
- /*
- * camss_link_entities - Register subdev nodes and create links
- * @camss: CAMSS device
- *
- * Return 0 on success or a negative error code on failure
- */
- static int camss_link_entities(struct camss *camss)
- {
- int i, j, k;
- int ret;
- for (i = 0; i < camss->res->csiphy_num; i++) {
- for (j = 0; j < camss->res->csid_num; j++) {
- ret = media_create_pad_link(&camss->csiphy[i].subdev.entity,
- MSM_CSIPHY_PAD_SRC,
- &camss->csid[j].subdev.entity,
- MSM_CSID_PAD_SINK,
- 0);
- if (ret < 0) {
- camss_link_err(camss,
- camss->csiphy[i].subdev.entity.name,
- camss->csid[j].subdev.entity.name,
- ret);
- return ret;
- }
- }
- }
- if (camss->ispif) {
- for (i = 0; i < camss->res->csid_num; i++) {
- for (j = 0; j < camss->ispif->line_num; j++) {
- ret = media_create_pad_link(&camss->csid[i].subdev.entity,
- MSM_CSID_PAD_SRC,
- &camss->ispif->line[j].subdev.entity,
- MSM_ISPIF_PAD_SINK,
- 0);
- if (ret < 0) {
- camss_link_err(camss,
- camss->csid[i].subdev.entity.name,
- camss->ispif->line[j].subdev.entity.name,
- ret);
- return ret;
- }
- }
- }
- for (i = 0; i < camss->ispif->line_num; i++)
- for (k = 0; k < camss->res->vfe_num; k++)
- for (j = 0; j < camss->vfe[k].res->line_num; j++) {
- struct v4l2_subdev *ispif = &camss->ispif->line[i].subdev;
- struct v4l2_subdev *vfe = &camss->vfe[k].line[j].subdev;
- ret = media_create_pad_link(&ispif->entity,
- MSM_ISPIF_PAD_SRC,
- &vfe->entity,
- MSM_VFE_PAD_SINK,
- 0);
- if (ret < 0) {
- camss_link_err(camss, ispif->entity.name,
- vfe->entity.name,
- ret);
- return ret;
- }
- }
- } else {
- for (i = 0; i < camss->res->csid_num; i++)
- for (k = 0; k < camss->res->vfe_num; k++)
- for (j = 0; j < camss->vfe[k].res->line_num; j++) {
- struct v4l2_subdev *csid = &camss->csid[i].subdev;
- struct v4l2_subdev *vfe = &camss->vfe[k].line[j].subdev;
- ret = media_create_pad_link(&csid->entity,
- MSM_CSID_PAD_FIRST_SRC + j,
- &vfe->entity,
- MSM_VFE_PAD_SINK,
- 0);
- if (ret < 0) {
- camss_link_err(camss, csid->entity.name,
- vfe->entity.name,
- ret);
- return ret;
- }
- }
- }
- return 0;
- }
- void camss_reg_update(struct camss *camss, int hw_id, int port_id, bool is_clear)
- {
- struct csid_device *csid;
- if (hw_id < camss->res->csid_num) {
- csid = &camss->csid[hw_id];
- csid->res->hw_ops->reg_update(csid, port_id, is_clear);
- }
- }
- void camss_buf_done(struct camss *camss, int hw_id, int port_id)
- {
- struct vfe_device *vfe;
- if (hw_id < camss->res->vfe_num) {
- vfe = &camss->vfe[hw_id];
- vfe->res->hw_ops->vfe_buf_done(vfe, port_id);
- }
- }
- /*
- * camss_register_entities - Register subdev nodes and create links
- * @camss: CAMSS device
- *
- * Return 0 on success or a negative error code on failure
- */
- static int camss_register_entities(struct camss *camss)
- {
- int i;
- int ret;
- for (i = 0; i < camss->res->csiphy_num; i++) {
- ret = msm_csiphy_register_entity(&camss->csiphy[i],
- &camss->v4l2_dev);
- if (ret < 0) {
- dev_err(camss->dev,
- "Failed to register csiphy%d entity: %d\n",
- i, ret);
- goto err_reg_csiphy;
- }
- }
- for (i = 0; i < camss->res->csid_num; i++) {
- ret = msm_csid_register_entity(&camss->csid[i],
- &camss->v4l2_dev);
- if (ret < 0) {
- dev_err(camss->dev,
- "Failed to register csid%d entity: %d\n",
- i, ret);
- goto err_reg_csid;
- }
- }
- ret = msm_ispif_register_entities(camss->ispif,
- &camss->v4l2_dev);
- if (ret < 0) {
- dev_err(camss->dev, "Failed to register ispif entities: %d\n", ret);
- goto err_reg_ispif;
- }
- for (i = 0; i < camss->res->vfe_num; i++) {
- ret = msm_vfe_register_entities(&camss->vfe[i],
- &camss->v4l2_dev);
- if (ret < 0) {
- dev_err(camss->dev,
- "Failed to register vfe%d entities: %d\n",
- i, ret);
- goto err_reg_vfe;
- }
- }
- return 0;
- err_reg_vfe:
- for (i--; i >= 0; i--)
- msm_vfe_unregister_entities(&camss->vfe[i]);
- err_reg_ispif:
- msm_ispif_unregister_entities(camss->ispif);
- i = camss->res->csid_num;
- err_reg_csid:
- for (i--; i >= 0; i--)
- msm_csid_unregister_entity(&camss->csid[i]);
- i = camss->res->csiphy_num;
- err_reg_csiphy:
- for (i--; i >= 0; i--)
- msm_csiphy_unregister_entity(&camss->csiphy[i]);
- return ret;
- }
- /*
- * camss_unregister_entities - Unregister subdev nodes
- * @camss: CAMSS device
- *
- * Return 0 on success or a negative error code on failure
- */
- static void camss_unregister_entities(struct camss *camss)
- {
- unsigned int i;
- for (i = 0; i < camss->res->csiphy_num; i++)
- msm_csiphy_unregister_entity(&camss->csiphy[i]);
- for (i = 0; i < camss->res->csid_num; i++)
- msm_csid_unregister_entity(&camss->csid[i]);
- msm_ispif_unregister_entities(camss->ispif);
- for (i = 0; i < camss->res->vfe_num; i++)
- msm_vfe_unregister_entities(&camss->vfe[i]);
- }
- static int camss_subdev_notifier_bound(struct v4l2_async_notifier *async,
- struct v4l2_subdev *subdev,
- struct v4l2_async_connection *asd)
- {
- struct camss *camss = container_of(async, struct camss, notifier);
- struct camss_async_subdev *csd =
- container_of(asd, struct camss_async_subdev, asd);
- u8 id = csd->interface.csiphy_id;
- struct csiphy_device *csiphy = &camss->csiphy[id];
- csiphy->cfg.csi2 = &csd->interface.csi2;
- subdev->host_priv = csiphy;
- return 0;
- }
- static int camss_subdev_notifier_complete(struct v4l2_async_notifier *async)
- {
- struct camss *camss = container_of(async, struct camss, notifier);
- struct v4l2_device *v4l2_dev = &camss->v4l2_dev;
- struct v4l2_subdev *sd;
- list_for_each_entry(sd, &v4l2_dev->subdevs, list) {
- struct csiphy_device *csiphy = sd->host_priv;
- struct media_entity *input, *sensor;
- unsigned int i;
- int ret;
- if (!csiphy)
- continue;
- input = &csiphy->subdev.entity;
- sensor = &sd->entity;
- for (i = 0; i < sensor->num_pads; i++) {
- if (sensor->pads[i].flags & MEDIA_PAD_FL_SOURCE)
- break;
- }
- if (i == sensor->num_pads) {
- dev_err(camss->dev,
- "No source pad in external entity\n");
- return -EINVAL;
- }
- ret = media_create_pad_link(sensor, i, input,
- MSM_CSIPHY_PAD_SINK,
- MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED);
- if (ret < 0) {
- camss_link_err(camss, sensor->name, input->name, ret);
- return ret;
- }
- }
- return v4l2_device_register_subdev_nodes(&camss->v4l2_dev);
- }
- static const struct v4l2_async_notifier_operations camss_subdev_notifier_ops = {
- .bound = camss_subdev_notifier_bound,
- .complete = camss_subdev_notifier_complete,
- };
- static const struct media_device_ops camss_media_ops = {
- .link_notify = v4l2_pipeline_link_notify,
- };
- static int camss_configure_pd(struct camss *camss)
- {
- const struct camss_resources *res = camss->res;
- struct device *dev = camss->dev;
- int vfepd_num;
- int i;
- int ret;
- camss->genpd_num = of_count_phandle_with_args(dev->of_node,
- "power-domains",
- "#power-domain-cells");
- if (camss->genpd_num < 0) {
- dev_err(dev, "Power domains are not defined for camss\n");
- return camss->genpd_num;
- }
- /*
- * If a platform device has just one power domain, then it is attached
- * at platform_probe() level, thus there shall be no need and even no
- * option to attach it again, this is the case for CAMSS on MSM8916.
- */
- if (camss->genpd_num == 1)
- return 0;
- /* count the # of VFEs which have flagged power-domain */
- for (vfepd_num = i = 0; i < camss->res->vfe_num; i++) {
- if (res->vfe_res[i].vfe.has_pd)
- vfepd_num++;
- }
- /*
- * If the number of power-domains is greater than the number of VFEs
- * then the additional power-domain is for the entire CAMSS block.
- */
- if (!(camss->genpd_num > vfepd_num))
- return 0;
- /*
- * If a power-domain name is defined try to use it.
- * It is possible we are running a new kernel with an old dtb so
- * fallback to indexes even if a pd_name is defined but not found.
- */
- if (camss->res->pd_name) {
- camss->genpd = dev_pm_domain_attach_by_name(camss->dev,
- camss->res->pd_name);
- if (IS_ERR(camss->genpd))
- return PTR_ERR(camss->genpd);
- }
- if (!camss->genpd) {
- /*
- * Legacy magic index. TITAN_TOP GDSC must be the last
- * item in the power-domain list.
- */
- camss->genpd = dev_pm_domain_attach_by_id(camss->dev,
- camss->genpd_num - 1);
- if (IS_ERR(camss->genpd))
- return PTR_ERR(camss->genpd);
- }
- if (!camss->genpd)
- return -ENODEV;
- camss->genpd_link = device_link_add(camss->dev, camss->genpd,
- DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME |
- DL_FLAG_RPM_ACTIVE);
- if (!camss->genpd_link) {
- ret = -EINVAL;
- goto fail_pm;
- }
- return 0;
- fail_pm:
- dev_pm_domain_detach(camss->genpd, true);
- return ret;
- }
- static int camss_icc_get(struct camss *camss)
- {
- const struct resources_icc *icc_res;
- int i;
- icc_res = camss->res->icc_res;
- for (i = 0; i < camss->res->icc_path_num; i++) {
- camss->icc_path[i] = devm_of_icc_get(camss->dev,
- icc_res[i].name);
- if (IS_ERR(camss->icc_path[i]))
- return PTR_ERR(camss->icc_path[i]);
- }
- return 0;
- }
- static void camss_genpd_subdevice_cleanup(struct camss *camss)
- {
- int i;
- for (i = 0; i < camss->res->vfe_num; i++)
- msm_vfe_genpd_cleanup(&camss->vfe[i]);
- }
- static void camss_genpd_cleanup(struct camss *camss)
- {
- if (camss->genpd_num == 1)
- return;
- camss_genpd_subdevice_cleanup(camss);
- if (camss->genpd_link)
- device_link_del(camss->genpd_link);
- dev_pm_domain_detach(camss->genpd, true);
- }
- /*
- * camss_probe - Probe CAMSS platform device
- * @pdev: Pointer to CAMSS platform device
- *
- * Return 0 on success or a negative error code on failure
- */
- static int camss_probe(struct platform_device *pdev)
- {
- struct device *dev = &pdev->dev;
- struct camss *camss;
- int ret;
- camss = devm_kzalloc(dev, sizeof(*camss), GFP_KERNEL);
- if (!camss)
- return -ENOMEM;
- camss->res = of_device_get_match_data(dev);
- atomic_set(&camss->ref_count, 0);
- camss->dev = dev;
- platform_set_drvdata(pdev, camss);
- camss->csiphy = devm_kcalloc(dev, camss->res->csiphy_num,
- sizeof(*camss->csiphy), GFP_KERNEL);
- if (!camss->csiphy)
- return -ENOMEM;
- camss->csid = devm_kcalloc(dev, camss->res->csid_num, sizeof(*camss->csid),
- GFP_KERNEL);
- if (!camss->csid)
- return -ENOMEM;
- if (camss->res->version == CAMSS_8x16 ||
- camss->res->version == CAMSS_8x39 ||
- camss->res->version == CAMSS_8x53 ||
- camss->res->version == CAMSS_8x96) {
- camss->ispif = devm_kcalloc(dev, 1, sizeof(*camss->ispif), GFP_KERNEL);
- if (!camss->ispif)
- return -ENOMEM;
- }
- camss->vfe = devm_kcalloc(dev, camss->res->vfe_num,
- sizeof(*camss->vfe), GFP_KERNEL);
- if (!camss->vfe)
- return -ENOMEM;
- ret = camss_icc_get(camss);
- if (ret < 0)
- return ret;
- ret = camss_configure_pd(camss);
- if (ret < 0) {
- dev_err(dev, "Failed to configure power domains: %d\n", ret);
- return ret;
- }
- ret = camss_init_subdevices(camss);
- if (ret < 0)
- goto err_genpd_cleanup;
- ret = dma_set_mask_and_coherent(dev, 0xffffffff);
- if (ret)
- goto err_genpd_cleanup;
- camss->media_dev.dev = camss->dev;
- strscpy(camss->media_dev.model, "Qualcomm Camera Subsystem",
- sizeof(camss->media_dev.model));
- camss->media_dev.ops = &camss_media_ops;
- media_device_init(&camss->media_dev);
- camss->v4l2_dev.mdev = &camss->media_dev;
- ret = v4l2_device_register(camss->dev, &camss->v4l2_dev);
- if (ret < 0) {
- dev_err(dev, "Failed to register V4L2 device: %d\n", ret);
- goto err_media_device_cleanup;
- }
- v4l2_async_nf_init(&camss->notifier, &camss->v4l2_dev);
- pm_runtime_enable(dev);
- ret = camss_parse_ports(camss);
- if (ret < 0)
- goto err_v4l2_device_unregister;
- ret = camss_register_entities(camss);
- if (ret < 0)
- goto err_v4l2_device_unregister;
- ret = camss_link_entities(camss);
- if (ret < 0)
- goto err_register_subdevs;
- ret = media_device_register(&camss->media_dev);
- if (ret < 0) {
- dev_err(dev, "Failed to register media device: %d\n", ret);
- goto err_register_subdevs;
- }
- camss->notifier.ops = &camss_subdev_notifier_ops;
- ret = v4l2_async_nf_register(&camss->notifier);
- if (ret) {
- dev_err(dev,
- "Failed to register async subdev nodes: %d\n", ret);
- goto err_media_device_unregister;
- }
- return 0;
- err_media_device_unregister:
- media_device_unregister(&camss->media_dev);
- err_register_subdevs:
- camss_unregister_entities(camss);
- err_v4l2_device_unregister:
- v4l2_device_unregister(&camss->v4l2_dev);
- v4l2_async_nf_cleanup(&camss->notifier);
- pm_runtime_disable(dev);
- err_media_device_cleanup:
- media_device_cleanup(&camss->media_dev);
- err_genpd_cleanup:
- camss_genpd_cleanup(camss);
- return ret;
- }
- void camss_delete(struct camss *camss)
- {
- v4l2_device_unregister(&camss->v4l2_dev);
- media_device_unregister(&camss->media_dev);
- media_device_cleanup(&camss->media_dev);
- pm_runtime_disable(camss->dev);
- }
- /*
- * camss_remove - Remove CAMSS platform device
- * @pdev: Pointer to CAMSS platform device
- *
- * Always returns 0.
- */
- static void camss_remove(struct platform_device *pdev)
- {
- struct camss *camss = platform_get_drvdata(pdev);
- v4l2_async_nf_unregister(&camss->notifier);
- v4l2_async_nf_cleanup(&camss->notifier);
- camss_unregister_entities(camss);
- if (atomic_read(&camss->ref_count) == 0)
- camss_delete(camss);
- camss_genpd_cleanup(camss);
- }
- static const struct camss_resources msm8916_resources = {
- .version = CAMSS_8x16,
- .csiphy_res = csiphy_res_8x16,
- .csid_res = csid_res_8x16,
- .ispif_res = &ispif_res_8x16,
- .vfe_res = vfe_res_8x16,
- .csiphy_num = ARRAY_SIZE(csiphy_res_8x16),
- .csid_num = ARRAY_SIZE(csid_res_8x16),
- .vfe_num = ARRAY_SIZE(vfe_res_8x16),
- };
- static const struct camss_resources msm8939_resources = {
- .version = CAMSS_8x39,
- .csiphy_res = csiphy_res_8x39,
- .csid_res = csid_res_8x39,
- .ispif_res = &ispif_res_8x39,
- .vfe_res = vfe_res_8x39,
- .csiphy_num = ARRAY_SIZE(csiphy_res_8x39),
- .csid_num = ARRAY_SIZE(csid_res_8x39),
- .vfe_num = ARRAY_SIZE(vfe_res_8x39),
- };
- static const struct camss_resources msm8953_resources = {
- .version = CAMSS_8x53,
- .icc_res = icc_res_8x53,
- .icc_path_num = ARRAY_SIZE(icc_res_8x53),
- .csiphy_res = csiphy_res_8x96,
- .csid_res = csid_res_8x53,
- .ispif_res = &ispif_res_8x53,
- .vfe_res = vfe_res_8x53,
- .csiphy_num = ARRAY_SIZE(csiphy_res_8x96),
- .csid_num = ARRAY_SIZE(csid_res_8x53),
- .vfe_num = ARRAY_SIZE(vfe_res_8x53),
- };
- static const struct camss_resources msm8996_resources = {
- .version = CAMSS_8x96,
- .csiphy_res = csiphy_res_8x96,
- .csid_res = csid_res_8x96,
- .ispif_res = &ispif_res_8x96,
- .vfe_res = vfe_res_8x96,
- .csiphy_num = ARRAY_SIZE(csiphy_res_8x96),
- .csid_num = ARRAY_SIZE(csid_res_8x96),
- .vfe_num = ARRAY_SIZE(vfe_res_8x96),
- };
- static const struct camss_resources qcm2290_resources = {
- .version = CAMSS_2290,
- .csiphy_res = csiphy_res_2290,
- .csid_res = csid_res_2290,
- .vfe_res = vfe_res_2290,
- .icc_res = icc_res_2290,
- .icc_path_num = ARRAY_SIZE(icc_res_2290),
- .csiphy_num = ARRAY_SIZE(csiphy_res_2290),
- .csid_num = ARRAY_SIZE(csid_res_2290),
- .vfe_num = ARRAY_SIZE(vfe_res_2290),
- };
- static const struct camss_resources qcs8300_resources = {
- .version = CAMSS_8300,
- .pd_name = "top",
- .csiphy_res = csiphy_res_8300,
- .csid_res = csid_res_8775p,
- .csid_wrapper_res = &csid_wrapper_res_sm8550,
- .vfe_res = vfe_res_8775p,
- .icc_res = icc_res_qcs8300,
- .csiphy_num = ARRAY_SIZE(csiphy_res_8300),
- .csid_num = ARRAY_SIZE(csid_res_8775p),
- .vfe_num = ARRAY_SIZE(vfe_res_8775p),
- .icc_path_num = ARRAY_SIZE(icc_res_qcs8300),
- };
- static const struct camss_resources sa8775p_resources = {
- .version = CAMSS_8775P,
- .pd_name = "top",
- .csiphy_res = csiphy_res_8775p,
- .csid_res = csid_res_8775p,
- .csid_wrapper_res = &csid_wrapper_res_sm8550,
- .vfe_res = vfe_res_8775p,
- .icc_res = icc_res_sa8775p,
- .csiphy_num = ARRAY_SIZE(csiphy_res_8775p),
- .csid_num = ARRAY_SIZE(csid_res_8775p),
- .vfe_num = ARRAY_SIZE(vfe_res_8775p),
- .icc_path_num = ARRAY_SIZE(icc_res_sa8775p),
- };
- static const struct camss_resources sdm660_resources = {
- .version = CAMSS_660,
- .csiphy_res = csiphy_res_660,
- .csid_res = csid_res_660,
- .ispif_res = &ispif_res_660,
- .vfe_res = vfe_res_660,
- .csiphy_num = ARRAY_SIZE(csiphy_res_660),
- .csid_num = ARRAY_SIZE(csid_res_660),
- .vfe_num = ARRAY_SIZE(vfe_res_660),
- };
- static const struct camss_resources sdm670_resources = {
- .version = CAMSS_845,
- .csiphy_res = csiphy_res_670,
- .csid_res = csid_res_670,
- .vfe_res = vfe_res_670,
- .csiphy_num = ARRAY_SIZE(csiphy_res_670),
- .csid_num = ARRAY_SIZE(csid_res_670),
- .vfe_num = ARRAY_SIZE(vfe_res_670),
- };
- static const struct camss_resources sdm845_resources = {
- .version = CAMSS_845,
- .pd_name = "top",
- .csiphy_res = csiphy_res_845,
- .csid_res = csid_res_845,
- .vfe_res = vfe_res_845,
- .csiphy_num = ARRAY_SIZE(csiphy_res_845),
- .csid_num = ARRAY_SIZE(csid_res_845),
- .vfe_num = ARRAY_SIZE(vfe_res_845),
- };
- static const struct camss_resources sm6150_resources = {
- .version = CAMSS_6150,
- .pd_name = "top",
- .csiphy_res = csiphy_res_sm6150,
- .csid_res = csid_res_sm6150,
- .vfe_res = vfe_res_sm6150,
- .icc_res = icc_res_sm6150,
- .icc_path_num = ARRAY_SIZE(icc_res_sm6150),
- .csiphy_num = ARRAY_SIZE(csiphy_res_sm6150),
- .csid_num = ARRAY_SIZE(csid_res_sm6150),
- .vfe_num = ARRAY_SIZE(vfe_res_sm6150),
- };
- static const struct camss_resources sm8250_resources = {
- .version = CAMSS_8250,
- .pd_name = "top",
- .csiphy_res = csiphy_res_8250,
- .csid_res = csid_res_8250,
- .vfe_res = vfe_res_8250,
- .icc_res = icc_res_sm8250,
- .icc_path_num = ARRAY_SIZE(icc_res_sm8250),
- .csiphy_num = ARRAY_SIZE(csiphy_res_8250),
- .csid_num = ARRAY_SIZE(csid_res_8250),
- .vfe_num = ARRAY_SIZE(vfe_res_8250),
- };
- static const struct camss_resources sc8280xp_resources = {
- .version = CAMSS_8280XP,
- .pd_name = "top",
- .csiphy_res = csiphy_res_sc8280xp,
- .csid_res = csid_res_sc8280xp,
- .ispif_res = NULL,
- .vfe_res = vfe_res_sc8280xp,
- .icc_res = icc_res_sc8280xp,
- .icc_path_num = ARRAY_SIZE(icc_res_sc8280xp),
- .csiphy_num = ARRAY_SIZE(csiphy_res_sc8280xp),
- .csid_num = ARRAY_SIZE(csid_res_sc8280xp),
- .vfe_num = ARRAY_SIZE(vfe_res_sc8280xp),
- };
- static const struct camss_resources sc7280_resources = {
- .version = CAMSS_7280,
- .pd_name = "top",
- .csiphy_res = csiphy_res_7280,
- .csid_res = csid_res_7280,
- .vfe_res = vfe_res_7280,
- .icc_res = icc_res_sc7280,
- .icc_path_num = ARRAY_SIZE(icc_res_sc7280),
- .csiphy_num = ARRAY_SIZE(csiphy_res_7280),
- .csid_num = ARRAY_SIZE(csid_res_7280),
- .vfe_num = ARRAY_SIZE(vfe_res_7280),
- };
- static const struct camss_resources sm8550_resources = {
- .version = CAMSS_8550,
- .pd_name = "top",
- .csiphy_res = csiphy_res_8550,
- .csid_res = csid_res_8550,
- .vfe_res = vfe_res_8550,
- .csid_wrapper_res = &csid_wrapper_res_sm8550,
- .icc_res = icc_res_sm8550,
- .icc_path_num = ARRAY_SIZE(icc_res_sm8550),
- .csiphy_num = ARRAY_SIZE(csiphy_res_8550),
- .csid_num = ARRAY_SIZE(csid_res_8550),
- .vfe_num = ARRAY_SIZE(vfe_res_8550),
- };
- static const struct camss_resources sm8650_resources = {
- .version = CAMSS_8650,
- .pd_name = "top",
- .csiphy_res = csiphy_res_sm8650,
- .csid_res = csid_res_sm8650,
- .csid_wrapper_res = &csid_wrapper_res_sm8550,
- .vfe_res = vfe_res_sm8650,
- .icc_res = icc_res_sm8650,
- .icc_path_num = ARRAY_SIZE(icc_res_sm8650),
- .csiphy_num = ARRAY_SIZE(csiphy_res_sm8650),
- .csid_num = ARRAY_SIZE(csid_res_sm8650),
- .vfe_num = ARRAY_SIZE(vfe_res_sm8650),
- };
- static const struct camss_resources x1e80100_resources = {
- .version = CAMSS_X1E80100,
- .pd_name = "top",
- .csiphy_res = csiphy_res_x1e80100,
- .csid_res = csid_res_x1e80100,
- .vfe_res = vfe_res_x1e80100,
- .csid_wrapper_res = &csid_wrapper_res_x1e80100,
- .icc_res = icc_res_x1e80100,
- .icc_path_num = ARRAY_SIZE(icc_res_x1e80100),
- .csiphy_num = ARRAY_SIZE(csiphy_res_x1e80100),
- .csid_num = ARRAY_SIZE(csid_res_x1e80100),
- .vfe_num = ARRAY_SIZE(vfe_res_x1e80100),
- };
- static const struct of_device_id camss_dt_match[] = {
- { .compatible = "qcom,msm8916-camss", .data = &msm8916_resources },
- { .compatible = "qcom,msm8939-camss", .data = &msm8939_resources },
- { .compatible = "qcom,msm8953-camss", .data = &msm8953_resources },
- { .compatible = "qcom,msm8996-camss", .data = &msm8996_resources },
- { .compatible = "qcom,qcm2290-camss", .data = &qcm2290_resources },
- { .compatible = "qcom,qcs8300-camss", .data = &qcs8300_resources },
- { .compatible = "qcom,sa8775p-camss", .data = &sa8775p_resources },
- { .compatible = "qcom,sc7280-camss", .data = &sc7280_resources },
- { .compatible = "qcom,sc8280xp-camss", .data = &sc8280xp_resources },
- { .compatible = "qcom,sdm660-camss", .data = &sdm660_resources },
- { .compatible = "qcom,sdm670-camss", .data = &sdm670_resources },
- { .compatible = "qcom,sdm845-camss", .data = &sdm845_resources },
- { .compatible = "qcom,sm6150-camss", .data = &sm6150_resources },
- { .compatible = "qcom,sm8250-camss", .data = &sm8250_resources },
- { .compatible = "qcom,sm8550-camss", .data = &sm8550_resources },
- { .compatible = "qcom,sm8650-camss", .data = &sm8650_resources },
- { .compatible = "qcom,x1e80100-camss", .data = &x1e80100_resources },
- { }
- };
- MODULE_DEVICE_TABLE(of, camss_dt_match);
- static int __maybe_unused camss_runtime_suspend(struct device *dev)
- {
- struct camss *camss = dev_get_drvdata(dev);
- int i;
- int ret;
- for (i = 0; i < camss->res->icc_path_num; i++) {
- ret = icc_set_bw(camss->icc_path[i], 0, 0);
- if (ret)
- return ret;
- }
- return 0;
- }
- static int __maybe_unused camss_runtime_resume(struct device *dev)
- {
- struct camss *camss = dev_get_drvdata(dev);
- const struct resources_icc *icc_res = camss->res->icc_res;
- int i;
- int ret;
- for (i = 0; i < camss->res->icc_path_num; i++) {
- ret = icc_set_bw(camss->icc_path[i],
- icc_res[i].icc_bw_tbl.avg,
- icc_res[i].icc_bw_tbl.peak);
- if (ret)
- return ret;
- }
- return 0;
- }
- static const struct dev_pm_ops camss_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
- pm_runtime_force_resume)
- SET_RUNTIME_PM_OPS(camss_runtime_suspend, camss_runtime_resume, NULL)
- };
- static struct platform_driver qcom_camss_driver = {
- .probe = camss_probe,
- .remove = camss_remove,
- .driver = {
- .name = "qcom-camss",
- .of_match_table = camss_dt_match,
- .pm = &camss_pm_ops,
- },
- };
- module_platform_driver(qcom_camss_driver);
- MODULE_DESCRIPTION("Qualcomm Camera Subsystem driver");
- MODULE_AUTHOR("Todor Tomov <todor.tomov@linaro.org>");
- MODULE_LICENSE("GPL v2");
|