1 Star 5 Fork 3

风漠兮 / 立创泰山派智能投影机-CXN0102

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
projector.patch 200.71 KB
一键复制 编辑 原始数据 按行查看 历史
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031
project RKTools/
diff --git a/linux/Linux_Pack_Firmware/rockdev/mkupdate_rk356x_box_tspi.sh b/linux/Linux_Pack_Firmware/rockdev/mkupdate_rk356x_box_tspi.sh
new file mode 100755
index 0000000..31ed1fc
--- /dev/null
+++ b/linux/Linux_Pack_Firmware/rockdev/mkupdate_rk356x_box_tspi.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+pause()
+{
+echo "Press any key to quit:"
+read -n1 -s key
+exit 1
+}
+echo "start to make update.img..."
+if [ ! -f "Image/parameter.txt" ]; then
+ echo "Error:No found parameter!"
+# pause
+fi
+if [ ! -f "package-file-rk356x" ]; then
+ echo "Error:No found package-file!"
+# pause
+fi
+./afptool -pack ./ Image/update.img ./package-file-rk356x-box || pause
+./rkImageMaker -RK3568 Image/MiniLoaderAll.bin Image/update.img update.img -os_type:androidos || pause
+echo "Making update.img OK."
+#echo "Press any key to quit:"
+#read -n1 -s key
+exit 0
project device/rockchip/rk356x_box/
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
index ef2b341..2f25d60 100644
--- a/AndroidProducts.mk
+++ b/AndroidProducts.mk
@@ -16,10 +16,13 @@
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/rk356x_box/rk356x_box.mk \
- $(LOCAL_DIR)/rk356x_box_32/rk356x_box_32.mk
+ $(LOCAL_DIR)/rk356x_box_32/rk356x_box_32.mk \
+ $(LOCAL_DIR)/rk356x_box_tspi/rk356x_box_tspi.mk
COMMON_LUNCH_CHOICES := \
rk356x_box-user \
rk356x_box-userdebug \
rk356x_box_32-user \
- rk356x_box_32-userdebug
+ rk356x_box_32-userdebug \
+ rk356x_box_tspi-userdebug \
+ rk356x_box_tspi-user
diff --git a/init.rk356x.rc b/init.rk356x.rc
index c6dd0c7..1a3aeca 100644
--- a/init.rk356x.rc
+++ b/init.rk356x.rc
@@ -20,6 +20,23 @@ on boot
chown system system /sys/devices/platform/fe8a0000.usb2-phy/otg_mode
chmod 0660 /sys/devices/platform/fe8a0000.usb2-phy/otg_mode
+ chmod 0666 /sys/devices/platform/fe5a0000.i2c/i2c-1/1-0077/fan
+ chmod 0666 /sys/devices/platform/fe5a0000.i2c/i2c-1/1-0077/state
+ chmod 0666 /sys/devices/platform/fe5a0000.i2c/i2c-1/1-0077/sn
+ chmod 0666 /sys/devices/platform/fe5a0000.i2c/i2c-1/1-0077/temperature
+ chmod 0666 /sys/devices/platform/fe5a0000.i2c/i2c-1/1-0077/version
+ chmod 0666 /sys/devices/platform/fe5a0000.i2c/i2c-1/1-0077/pq
+ chmod 0666 /sys/devices/platform/fe5a0000.i2c/i2c-1/1-0077/contrast
+ chmod 0666 /sys/devices/platform/fe5a0000.i2c/i2c-1/1-0077/brightness
+ chmod 0666 /sys/devices/platform/fe5a0000.i2c/i2c-1/1-0077/hue
+ chmod 0666 /sys/devices/platform/fe5a0000.i2c/i2c-1/1-0077/saturation
+ chmod 0666 /sys/devices/platform/fe5a0000.i2c/i2c-1/1-0077/sharpness
+ chmod 0666 /sys/devices/platform/fe5a0000.i2c/i2c-1/1-0077/position
+ chmod 0666 /sys/devices/platform/fe5a0000.i2c/i2c-1/1-0077/biphase
+ chmod 0666 /sys/devices/platform/fe5a0000.i2c/i2c-1/1-0077/biphase_ctl
+ chmod 0666 /sys/devices/platform/fe5a0000.i2c/i2c-1/1-0077/optical_alignment
+ chmod 0666 /sys/devices/platform/fe5a0000.i2c/i2c-1/1-0077/opt_adj_ctl
+ chmod 0666 /sys/devices/platform/fe5a0000.i2c/i2c-1/1-0077/user_param_ctl
on init
# Increased power consumption and CPU in exchange for memory
diff --git a/rk356x_box_tspi/Android.mk b/rk356x_box_tspi/Android.mk
new file mode 100644
index 0000000..7a16792
--- /dev/null
+++ b/rk356x_box_tspi/Android.mk
@@ -0,0 +1,3 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/rk356x_box_tspi/AndroidBoard.mk b/rk356x_box_tspi/AndroidBoard.mk
new file mode 100644
index 0000000..a6e66b0
--- /dev/null
+++ b/rk356x_box_tspi/AndroidBoard.mk
@@ -0,0 +1,7 @@
+# generate fstab file for device
+-include device/rockchip/common/build/rockchip/RebuildFstab.mk
+
+# generate dtbo image for device
+-include device/rockchip/common/build/rockchip/RebuildDtboImg.mk
+# generate parameter.txt for device
+-include device/rockchip/common/build/rockchip/RebuildParameter.mk
diff --git a/rk356x_box_tspi/BoardConfig.mk b/rk356x_box_tspi/BoardConfig.mk
new file mode 100755
index 0000000..b471972
--- /dev/null
+++ b/rk356x_box_tspi/BoardConfig.mk
@@ -0,0 +1,34 @@
+#
+# Copyright 2014 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+include device/rockchip/rk356x_box/CommonBoardConfig.mk
+BUILD_WITH_GO_OPT := false
+
+BOARD_SELINUX_ENFORCING := false
+
+# AB image definition
+BOARD_USES_AB_IMAGE := false
+BOARD_ROCKCHIP_VIRTUAL_AB_ENABLE := false
+
+ifeq ($(strip $(BOARD_USES_AB_IMAGE)), true)
+ include device/rockchip/common/BoardConfig_AB.mk
+ TARGET_RECOVERY_FSTAB := device/rockchip/rk356x_box/rk356x_box_tspi/recovery.fstab_AB
+endif
+
+PRODUCT_UBOOT_CONFIG := rk3566
+PRODUCT_KERNEL_DTS := tspi-rk3566-user-v10
+BOARD_GSENSOR_MXC6655XA_SUPPORT := true
+BOARD_CAMERA_SUPPORT_EXT := true
+BOARD_HS_ETHERNET := true
diff --git a/rk356x_box_tspi/bt_vendor.conf b/rk356x_box_tspi/bt_vendor.conf
new file mode 100644
index 0000000..e09f556
--- /dev/null
+++ b/rk356x_box_tspi/bt_vendor.conf
@@ -0,0 +1,5 @@
+# UART device port where Bluetooth controller is attached
+UartPort = /dev/ttyS1
+
+# Firmware patch file location
+FwPatchFilePath = /vendor/etc/firmware/
diff --git a/rk356x_box_tspi/config.cfg b/rk356x_box_tspi/config.cfg
new file mode 100755
index 0000000..e69de29
diff --git a/rk356x_box_tspi/dt-overlay.in b/rk356x_box_tspi/dt-overlay.in
new file mode 100644
index 0000000..382291e
--- /dev/null
+++ b/rk356x_box_tspi/dt-overlay.in
@@ -0,0 +1,15 @@
+/dts-v1/;
+/plugin/;
+
+&chosen {
+ bootargs_ext = "androidboot.boot_devices=${_boot_device}";
+};
+
+&reboot_mode {
+ mode-bootloader = <0x5242C309>;
+ mode-charge = <0x5242C30B>;
+ mode-fastboot = <0x5242C303>;
+ mode-loader = <0x5242C301>;
+ mode-normal = <0x5242C300>;
+ mode-recovery = <0x5242C303>;
+};
diff --git a/rk356x_box_tspi/manifest.xml b/rk356x_box_tspi/manifest.xml
new file mode 100644
index 0000000..6f8b05b
--- /dev/null
+++ b/rk356x_box_tspi/manifest.xml
@@ -0,0 +1,80 @@
+<manifest version="1.0" type="device" target-level="5">
+ <hal format="hidl">
+ <name>android.hardware.audio</name>
+ <transport>hwbinder</transport>
+ <version>6.0</version>
+ <interface>
+ <name>IDevicesFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.audio.effect</name>
+ <transport>hwbinder</transport>
+ <version>6.0</version>
+ <interface>
+ <name>IEffectsFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.bluetooth</name>
+ <transport>hwbinder</transport>
+ <version>1.0</version>
+ <interface>
+ <name>IBluetoothHci</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.graphics.composer</name>
+ <transport>hwbinder</transport>
+ <version>2.1</version>
+ <interface>
+ <name>IComposer</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.health</name>
+ <transport>hwbinder</transport>
+ <version>2.1</version>
+ <interface>
+ <name>IHealth</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.media.omx</name>
+ <transport>hwbinder</transport>
+ <version>1.0</version>
+ <interface>
+ <name>IOmx</name>
+ <instance>default</instance>
+ </interface>
+ <interface>
+ <name>IOmxStore</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.tv.cec</name>
+ <transport>hwbinder</transport>
+ <version>1.0</version>
+ <interface>
+ <name>IHdmiCec</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.memtrack</name>
+ <transport>hwbinder</transport>
+ <version>1.0</version>
+ <interface>
+ <name>IMemtrack</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <kernel target-level="5"/>
+</manifest>
+
diff --git a/rk356x_box_tspi/media_profiles_default.xml b/rk356x_box_tspi/media_profiles_default.xml
new file mode 100755
index 0000000..fd03524
--- /dev/null
+++ b/rk356x_box_tspi/media_profiles_default.xml
@@ -0,0 +1,689 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!DOCTYPE MediaSettings [
+<!ELEMENT MediaSettings (CamcorderProfiles,
+ EncoderOutputFileFormat+,
+ VideoEncoderCap+,
+ AudioEncoderCap+,
+ VideoDecoderCap,
+ AudioDecoderCap)>
+<!ELEMENT CamcorderProfiles (EncoderProfile+, ImageEncoding+, ImageDecoding, Camera)>
+<!ELEMENT EncoderProfile (Video, Audio)>
+<!ATTLIST EncoderProfile quality (high|low) #REQUIRED>
+<!ATTLIST EncoderProfile fileFormat (mp4|3gp) #REQUIRED>
+<!ATTLIST EncoderProfile duration (30|60) #REQUIRED>
+<!ATTLIST EncoderProfile cameraId (0|1) #REQUIRED>
+<!ELEMENT Video EMPTY>
+<!ATTLIST Video codec (h264|h263|m4v) #REQUIRED>
+<!ATTLIST Video bitRate CDATA #REQUIRED>
+<!ATTLIST Video width CDATA #REQUIRED>
+<!ATTLIST Video height CDATA #REQUIRED>
+<!ATTLIST Video frameRate CDATA #REQUIRED>
+<!ELEMENT Audio EMPTY>
+<!ATTLIST Audio codec (amrnb|amrwb|aac) #REQUIRED>
+<!ATTLIST Audio bitRate CDATA #REQUIRED>
+<!ATTLIST Audio sampleRate CDATA #REQUIRED>
+<!ATTLIST Audio channels (1|2) #REQUIRED>
+<!ELEMENT ImageEncoding EMPTY>
+<!ATTLIST ImageEncoding quality (90|80|70|60|50|40) #REQUIRED>
+<!ELEMENT ImageDecoding EMPTY>
+<!ATTLIST ImageDecoding memCap CDATA #REQUIRED>
+<!ELEMENT Camera EMPTY>
+<!ELEMENT EncoderOutputFileFormat EMPTY>
+<!ATTLIST EncoderOutputFileFormat name (mp4|3gp) #REQUIRED>
+<!ELEMENT VideoEncoderCap EMPTY>
+<!ATTLIST VideoEncoderCap name (h264|h263|m4v|wmv) #REQUIRED>
+<!ATTLIST VideoEncoderCap enabled (true|false) #REQUIRED>
+<!ATTLIST VideoEncoderCap minBitRate CDATA #REQUIRED>
+<!ATTLIST VideoEncoderCap maxBitRate CDATA #REQUIRED>
+<!ATTLIST VideoEncoderCap minFrameWidth CDATA #REQUIRED>
+<!ATTLIST VideoEncoderCap maxFrameWidth CDATA #REQUIRED>
+<!ATTLIST VideoEncoderCap minFrameHeight CDATA #REQUIRED>
+<!ATTLIST VideoEncoderCap maxFrameHeight CDATA #REQUIRED>
+<!ATTLIST VideoEncoderCap minFrameRate CDATA #REQUIRED>
+<!ATTLIST VideoEncoderCap maxFrameRate CDATA #REQUIRED>
+<!ELEMENT AudioEncoderCap EMPTY>
+<!ATTLIST AudioEncoderCap name (amrnb|amrwb|aac|wma) #REQUIRED>
+<!ATTLIST AudioEncoderCap enabled (true|false) #REQUIRED>
+<!ATTLIST AudioEncoderCap minBitRate CDATA #REQUIRED>
+<!ATTLIST AudioEncoderCap maxBitRate CDATA #REQUIRED>
+<!ATTLIST AudioEncoderCap minSampleRate CDATA #REQUIRED>
+<!ATTLIST AudioEncoderCap maxSampleRate CDATA #REQUIRED>
+<!ATTLIST AudioEncoderCap minChannels (1|2) #REQUIRED>
+<!ATTLIST AudioEncoderCap maxChannels (1|2) #REQUIRED>
+<!ELEMENT VideoDecoderCap EMPTY>
+<!ATTLIST VideoDecoderCap name (wmv) #REQUIRED>
+<!ATTLIST VideoDecoderCap enabled (true|false) #REQUIRED>
+<!ELEMENT AudioDecoderCap EMPTY>
+<!ATTLIST AudioDecoderCap name (wma) #REQUIRED>
+<!ATTLIST AudioDecoderCap enabled (true|false) #REQUIRED>
+<!ELEMENT VideoEditorCap EMPTY>
+<!ATTLIST VideoEditorCap maxInputFrameWidth CDATA #REQUIRED>
+<!ATTLIST VideoEditorCap maxInputFrameHeight CDATA #REQUIRED>
+<!ATTLIST VideoEditorCap maxOutputFrameWidth CDATA #REQUIRED>
+<!ATTLIST VideoEditorCap maxOutputFrameHeight CDATA #REQUIRED>
+<!ATTLIST VideoEditorCap maxPrefetchYUVFrames CDATA #REQUIRED>
+<!ELEMENT ExportVideoProfile EMPTY>
+<!ATTLIST ExportVideoProfile name (h264|h263|m4v) #REQUIRED>
+<!ATTLIST ExportVideoProfile profile CDATA #REQUIRED>
+<!ATTLIST ExportVideoProfile level CDATA #REQUIRED>
+]>
+<!--
+ This file is used to declare the multimedia profiles and capabilities
+ on an android-powered device.
+-->
+<MediaSettings>
+ <!-- Each camcorder profile defines a set of predefined configuration parameters -->
+ <CamcorderProfiles cameraId="0">
+
+
+ <EncoderProfile quality="qcif" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="128000"
+ width="176"
+ height="144"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+
+ </EncoderProfile>
+
+ <EncoderProfile quality="qvga" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="256000"
+ width="320"
+ height="240"
+ frameRate="30" />
+ <Audio codec="amrnb"
+ bitRate="12200"
+ sampleRate="8000"
+ channels="1" />
+ </EncoderProfile>
+
+ <!--
+ <EncoderProfile quality="cif" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="1200000"
+ width="352"
+ height="288"
+ frameRate="30" />
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+ -->
+ <!-- If your sensor driver don't support 720p and 480p stream, Please fill this element according as
+ your sensor max resolution for preview(Not Capture resolution) -->
+ <EncoderProfile quality="480p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="3000000"
+ width="640"
+ height="480"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+
+ <!-- If your sensor driver don't support 480p stream, Please turn off this element -->
+
+ <!--
+ <EncoderProfile quality="480p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="3000000"
+ width="720"
+ height="480"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+
+ -->
+ <!-- If your sensor driver don't support 480p stream, Please turn off this element -->
+
+<!--
+ <EncoderProfile quality="480p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="3000000"
+ width="800"
+ height="600"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+
+-->
+ <!-- If your sensor driver don't support 576p stream, Please turn off this element -->
+
+<!--
+ <EncoderProfile quality="576p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="3000000"
+ width="720"
+ height="576"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+-->
+
+ <!-- If your sensor driver don't support 720p stream, Please turn off this element -->
+<!--
+ <EncoderProfile quality="720p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="6000000"
+ width="1280"
+ height="720"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+ -->
+ <!-- If your sensor driver don't support 1080p stream, Please turn off this element -->
+
+
+ <EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="192000"
+ width="176"
+ height="144"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="timelapseqvga" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="128000"
+ width="320"
+ height="240"
+ frameRate="30" />
+ <Audio codec="amrnb"
+ bitRate="12200"
+ sampleRate="8000"
+ channels="1" />
+ </EncoderProfile>
+ <!--
+ <EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="1200000"
+ width="352"
+ height="288"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+
+ -->
+ <!-- If your sensor driver don't support 720p and 480p stream, Please fill this element according as
+ your sensor max resolution for preview(Not Capture resolution) -->
+ <EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="1200000"
+ width="640"
+ height="480"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+
+ <!-- If your sensor driver don't support 480p stream, Please turn off this element -->
+
+ <!--
+ <EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="256000"
+ width="720"
+ height="480"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+
+ -->
+ <!-- If your sensor driver don't support 480p stream, Please turn off this element -->
+
+<!--
+ <EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="256000"
+ width="800"
+ height="600"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+-->
+
+ <!-- If your sensor driver don't support 720p and 480p stream, Please fill this element according as
+ your sensor max resolution for preview(Not Capture resolution) -->
+<!--
+ <EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="1200000"
+ width="800"
+ height="600"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+-->
+
+ <!-- If your sensor driver don't support 576p stream, Please fill this element according as
+ your sensor max resolution for preview(Not Capture resolution) -->
+<!--
+ <EncoderProfile quality="timelapse576p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="1200000"
+ width="720"
+ height="576"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+-->
+
+ <!-- If your sensor driver don't support 720p stream, Please turn off this element -->
+<!--
+ <EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="3000000"
+ width="1280"
+ height="720"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+-->
+ <!-- If your sensor driver don't support 108p stream, Please turn off this element -->
+
+ <ImageEncoding quality="90" />
+ <ImageEncoding quality="80" />
+ <ImageEncoding quality="70" />
+ <ImageDecoding memCap="20000000" />
+
+ </CamcorderProfiles>
+
+ <CamcorderProfiles cameraId="1">
+
+
+ <EncoderProfile quality="qcif" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="128000"
+ width="176"
+ height="144"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+
+ </EncoderProfile>
+
+ <EncoderProfile quality="qvga" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="256000"
+ width="320"
+ height="240"
+ frameRate="30" />
+ <Audio codec="amrnb"
+ bitRate="12200"
+ sampleRate="8000"
+ channels="1" />
+ </EncoderProfile>
+
+ <!--
+ <EncoderProfile quality="cif" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="1200000"
+ width="352"
+ height="288"
+ frameRate="30" />
+ <Audio codec="aac"
+ bitRate="96000"
+ sampleRate="48000"
+ channels="1" />
+ </EncoderProfile>
+ -->
+ <!-- If your sensor driver don't support 720p and 480p stream, Please fill this element according as
+ your sensor max resolution for preview(Not Capture resolution) -->
+ <EncoderProfile quality="480p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="3000000"
+ width="640"
+ height="480"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+
+ <!-- If your sensor driver don't support 480p stream, Please turn on this element -->
+
+<!--
+ <EncoderProfile quality="480p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="3000000"
+ width="720"
+ height="480"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+-->
+
+ <!-- If your sensor driver don't support 480p stream, Please turn off this element -->
+
+<!--
+ <EncoderProfile quality="480p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="3000000"
+ width="800"
+ height="600"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+-->
+
+ <!-- If your sensor driver don't support 720p stream, Please turn off this element -->
+
+<!--
+ <EncoderProfile quality="720p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="6000000"
+ width="1280"
+ height="720"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+-->
+ <!-- If your sensor driver don't support 1080p stream, Please turn off this element -->
+
+<!--
+ <EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="6000000"
+ width="1920"
+ height="1080"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+-->
+
+ <EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="192000"
+ width="176"
+ height="144"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="timelapseqvga" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="128000"
+ width="320"
+ height="240"
+ frameRate="30" />
+ <Audio codec="amrnb"
+ bitRate="12200"
+ sampleRate="8000"
+ channels="1" />
+ </EncoderProfile>
+
+ <!--
+ <EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="1200000"
+ width="352"
+ height="288"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+ -->
+ <!-- If your sensor driver don't support 720p and 480p stream, Please fill this element according as
+ your sensor max resolution for preview(Not Capture resolution) -->
+ <EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="1200000"
+ width="640"
+ height="480"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+
+ <!-- If your sensor driver don't support 480p stream, Please turn on this element -->
+
+<!--
+ <EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="1200000"
+ width="720"
+ height="480"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+-->
+
+<!-- If your sensor driver don't support 720p and 480p stream, Please fill this element according as
+ your sensor max resolution for preview(Not Capture resolution) -->
+<!--
+ <EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="1200000"
+ width="800"
+ height="600"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+-->
+
+ <!-- If your sensor driver don't support 720p stream, Please turn off this element -->
+
+<!--
+ <EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="3000000"
+ width="1280"
+ height="720"
+ frameRate="8" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+-->
+<!-- If your sensor driver don't support 108p stream, Please turn off this element -->
+
+<!--
+ <EncoderProfile quality="timelapse1080p" fileFormat="mp4" duration="30">
+ <Video codec="h264"
+ bitRate="3000000"
+ width="1920"
+ height="1080"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="61000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
+-->
+ <ImageEncoding quality="90" />
+ <ImageEncoding quality="80" />
+ <ImageEncoding quality="70" />
+ <ImageDecoding memCap="20000000" />
+
+ </CamcorderProfiles>
+
+
+ <EncoderOutputFileFormat name="3gp" />
+ <EncoderOutputFileFormat name="mp4" />
+
+ <!--
+ If a codec is not enabled, it is invisible to the applications
+ In other words, the applications won't be able to use the codec
+ or query the capabilities of the codec at all if it is disabled
+ -->
+ <VideoEncoderCap name="h264" enabled="true"
+ minBitRate="64000" maxBitRate="3000000"
+ minFrameWidth="176" maxFrameWidth="1920"
+ minFrameHeight="144" maxFrameHeight="1080"
+ minFrameRate="1" maxFrameRate="30" />
+
+ <VideoEncoderCap name="h263" enabled="true"
+ minBitRate="64000" maxBitRate="1000000"
+ minFrameWidth="176" maxFrameWidth="800"
+ minFrameHeight="144" maxFrameHeight="480"
+ minFrameRate="1" maxFrameRate="24" />
+
+ <VideoEncoderCap name="m4v" enabled="true"
+ minBitRate="64000" maxBitRate="2000000"
+ minFrameWidth="176" maxFrameWidth="800"
+ minFrameHeight="144" maxFrameHeight="480"
+ minFrameRate="1" maxFrameRate="24" />
+
+ <AudioEncoderCap name="aac" enabled="true"
+ minBitRate="8192" maxBitRate="96000"
+ minSampleRate="8000" maxSampleRate="44100"
+ minChannels="1" maxChannels="1" />
+
+ <AudioEncoderCap name="amrwb" enabled="true"
+ minBitRate="6600" maxBitRate="23050"
+ minSampleRate="16000" maxSampleRate="16000"
+ minChannels="1" maxChannels="1" />
+
+ <AudioEncoderCap name="amrnb" enabled="true"
+ minBitRate="5525" maxBitRate="12200"
+ minSampleRate="8000" maxSampleRate="8000"
+ minChannels="1" maxChannels="1" />
+
+ <!--
+ FIXME:
+ We do not check decoder capabilities at present
+ At present, we only check whether windows media is visible
+ for TEST applications. For other applications, we do
+ not perform any checks at all.
+ -->
+ <VideoDecoderCap name="wmv" enabled="false"/>
+ <AudioDecoderCap name="wma" enabled="false"/>
+ <!--
+ <VideoEditorCap maxInputFrameWidth="1920"
+ maxInputFrameHeight="1080" maxOutputFrameWidth="1920"
+ maxOutputFrameHeight="1080" maxPrefetchYUVFrames="1"/>
+ -->
+ <!--
+ The VideoEditor Export codec profile and level values
+ correspond to the values in OMX_Video.h.
+ E.g. for h264, profile value 1 means OMX_VIDEO_AVCProfileBaseline
+ and level 4096 means OMX_VIDEO_AVCLevel41.
+ Please note that the values are in decimal.
+ These values are for video encoder.
+ -->
+ <!--
+ Codec = h.264, Hp-High profile, level 4.1
+ -->
+ <!--<ExportVideoProfile name="h264" profile= "4" level="4096"/>-->
+ <!--
+ Codec = h.263, Baseline profile, level 0
+ -->
+ <!--<ExportVideoProfile name="h263" profile= "1" level="1"/>-->
+ <!--
+ Codec = mpeg4, Simple profile, level 3
+ -->
+ <!--<ExportVideoProfile name="m4v" profile= "1" level="16"/>-->
+</MediaSettings>
diff --git a/rk356x_box_tspi/ota/loader/readme.txt b/rk356x_box_tspi/ota/loader/readme.txt
new file mode 100755
index 0000000..159ef82
--- /dev/null
+++ b/rk356x_box_tspi/ota/loader/readme.txt
@@ -0,0 +1,4 @@
+将需要升级的loader,以RK*Loader*.bin格式放到该目录下
+OTA打包时即会加入到升级包中。
+
+也就是说,只要将需要升级的loader,以以RK*Loader*.bin格式命名,然后放到该目录下,就可实现loader升级功能。
diff --git a/rk356x_box_tspi/overlay/frameworks/base/core/res/res/values-large/config.xml b/rk356x_box_tspi/overlay/frameworks/base/core/res/res/values-large/config.xml
new file mode 100755
index 0000000..f84d383
--- /dev/null
+++ b/rk356x_box_tspi/overlay/frameworks/base/core/res/res/values-large/config.xml
@@ -0,0 +1,10 @@
+<resources>
+ <!-- Control the behavior when the user long presses the home button.
+ 0 - Nothing
+ 1 - Launch all apps intent
+ 2 - Launch assist intent
+ This needs to match the constants in
+ policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+ -->
+ <integer name="config_longPressOnHomeBehavior">1</integer>
+</resources>
diff --git a/rk356x_box_tspi/overlay/frameworks/base/core/res/res/values/config.xml b/rk356x_box_tspi/overlay/frameworks/base/core/res/res/values/config.xml
new file mode 100755
index 0000000..2ad2f2e
--- /dev/null
+++ b/rk356x_box_tspi/overlay/frameworks/base/core/res/res/values/config.xml
@@ -0,0 +1,74 @@
+<resources>
+
+ <!-- Don't allow volume change on the device. -->
+ <bool name="config_useFixedVolume">false</bool>
+
+ <!-- Control the behavior when the user long presses the home button.
+ 0 - Nothing
+ 1 - Launch all apps intent
+ 2 - Launch assist intent
+ This needs to match the constants in
+ policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+ -->
+ <integer name="config_longPressOnHomeBehavior">1</integer>
+
+ <!-- Supports MS PlayReady in Chromium WebView -->
+ <string-array name="config_keySystemUuidMapping" translatable="false">
+ <item>"x-com.microsoft.playready,9A04F079-9840-4286-AB92-E65BE0885F95"</item>
+ </string-array>
+
+ <!-- This string array should be overridden by the device to present a list of network
+ attributes. This is used by the connectivity manager to decide which networks can coexist
+ based on the hardware -->
+ <!-- An Array of "[Connection name],[ConnectivityManager.TYPE_xxxx],
+ [associated radio-type],[priority],[restoral-timer(ms)],[dependencyMet] -->
+ <!-- the 5th element "restore-time" indicates the number of milliseconds to delay
+ before automatically restore the default connection. Set -1 if the connection
+ does not require auto-restore. -->
+ <!-- the 6th element indicates boot-time dependency-met value. -->
+ <string-array translatable="false" name="networkAttributes">
+ <item>"wifi,1,1,1,-1,true"</item>
+ <item>"ethernet,9,9,9,-1,true"</item>
+ </string-array>
+
+ <!-- This string array should be overridden by the device to present a list of radio
+ attributes. This is used by the connectivity manager to decide which networks can coexist
+ based on the hardware -->
+ <!-- An Array of "[ConnectivityManager connectionType],
+ [# simultaneous connection types]" -->
+ <string-array translatable="false" name="radioAttributes">
+ <item>"1,1"</item>
+ <item>"9,1"</item>
+ </string-array>
+
+ <bool name="config_ui_enableFadingMarquee">true</bool>
+
+ <!-- Device configuration adjusting the minfree tunable in the lowmemorykiller in the
+ kernel. A high value will cause the lowmemorykiller to fire earlier, keeping more
+ memory in the file cache and preventing I/O thrashing, but allowing fewer processes
+ to stay in memory. A low value will keep more processes in memory but may cause
+ thrashing if set too low. Directly added to the default value chosen by
+ ActivityManager based on screen size and total memory for the largest lowmemorykiller
+ bucket, and scaled proportionally to the smaller buckets. 0 keeps the default.
+ Below will adj 6 minfree buckets (in MB) to: 32, 40, 48, 56, 64, 80 -->
+ <integer name="config_lowMemoryKillerMinFreeKbytesAbsolute">81920</integer>
+
+ <!-- Number of times to try again with the shorter interval, before backing
+ off until the normal polling interval. A value < 0 indicates infinite. -->
+ <integer name="config_ntpRetry">-1</integer>
+
+ <!-- Flag indicating if device supports EAP SIM, AKA, AKA' -->
+ <bool name="config_eap_sim_based_auth_supported">false</bool>
+
+ <!-- Package of the unbundled tv remote service which can connect to tv remote provider -->
+ <string translatable="false" name="config_tvRemoteServicePackage">com.google.android.tv.remote.service</string>
+ <string-array translatable="false" name="config_globalActionsList">
+ <item>power</item>
+ <item>restart</item>
+ <item>logout</item>
+ <item>bugreport</item>
+ <item>screenshot</item>
+ </string-array>
+ <bool name="config_supportsSplitScreenMultiWindow">false</bool>
+ <bool name="config_enableAutoPowerModes">false</bool>
+</resources>
diff --git a/rk356x_box_tspi/overlay/frameworks/base/core/res/res/values/dimens.xml b/rk356x_box_tspi/overlay/frameworks/base/core/res/res/values/dimens.xml
new file mode 100755
index 0000000..245de20
--- /dev/null
+++ b/rk356x_box_tspi/overlay/frameworks/base/core/res/res/values/dimens.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources>
+
+ <!-- Height of the status bar -->
+ <dimen name="status_bar_height">0dp</dimen>
+
+ <!-- Height of the bottom navigation / system bar -->
+ <dimen name="navigation_bar_height">0dp</dimen>
+
+ <!-- Height of the bottom navigation bar in landscape -->
+ <dimen name="navigation_bar_height_landscape">0dp</dimen>
+
+ <!-- Width of the navigation bar when it is placed vertically on the screen -->
+ <dimen name="navigation_bar_width">0dp</dimen>
+
+</resources>
diff --git a/rk356x_box_tspi/overlay/frameworks/base/core/res/res/xml/global_keys.xml b/rk356x_box_tspi/overlay/frameworks/base/core/res/res/xml/global_keys.xml
new file mode 100755
index 0000000..bb2286f
--- /dev/null
+++ b/rk356x_box_tspi/overlay/frameworks/base/core/res/res/xml/global_keys.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2013, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- Mapping of keycodes to components which will be handled globally.
+ Modify this file to add global keys.
+ The key will NOT go to the foreground application and instead only ever be sent via targeted
+ broadcast to the specified component. The action of the intent will be
+ android.intent.action.GLOBAL_BUTTON and the KeyEvent will be included in the intent as
+ android.intent.extra.KEY_EVENT.
+-->
+
+<global_keys version="1">
+ <!-- Example format: id = keycode to handle globally. component = component which will handle this key. -->
+ <key keyCode="KEYCODE_GUIDE" component="com.google.android.tv/.receiver.GlobalKeyReceiver" />
+ <key keyCode="KEYCODE_TV" component="com.google.android.tv/.receiver.GlobalKeyReceiver" />
+ <key keyCode="KEYCODE_TV_INPUT" component="com.google.android.tv/.receiver.GlobalKeyReceiver" />
+ <key keyCode="KEYCODE_TV_POWER" component="com.google.android.athome.globalkeyinterceptor/.Receiver" />
+ <key keyCode="KEYCODE_VOLUME_UP" component="com.google.android.athome.globalkeyinterceptor/.Receiver" />
+ <key keyCode="KEYCODE_VOLUME_DOWN" component="com.google.android.athome.globalkeyinterceptor/.Receiver" />
+ <key keyCode="KEYCODE_PAIRING" component="com.google.android.athome.globalkeyinterceptor/.Receiver" />
+</global_keys>
diff --git a/rk356x_box_tspi/overlay/frameworks/base/core/res/res/xml/storage_list.xml b/rk356x_box_tspi/overlay/frameworks/base/core/res/res/xml/storage_list.xml
new file mode 100755
index 0000000..cf3a7e4
--- /dev/null
+++ b/rk356x_box_tspi/overlay/frameworks/base/core/res/res/xml/storage_list.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2011, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License")
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- See storage config details at http://source.android.com/tech/storage/ -->
+
+<StorageList xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- removable is not set in nosdcard product -->
+ <storage
+ android:storageDescription="@string/storage_internal"
+ android:primary="true"
+ android:emulated="true"
+ android:mtpReserve="100"/>
+
+
+</StorageList>
diff --git a/rk356x_box_tspi/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/rk356x_box_tspi/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
new file mode 100755
index 0000000..f124695
--- /dev/null
+++ b/rk356x_box_tspi/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <bool name="def_backup_enabled">true</bool>
+ <string name="def_backup_transport">com.google.android.backup/.BackupTransportService</string>
+ <bool name="def_wifi_on">true</bool>
+ <bool name="def_bluetooth_on">true</bool>
+ <bool name="def_accelerometer_rotation">false</bool>
+ <!-- 0 == Always sleep
+ 1 == Do not sleep when plugged in
+ 2 == Never sleep
+ When the screen is off, it will enter the sleep policy.
+ You can configure persist.wifi.sleep.delay.ms to delay closing wifi.
+ The default is 15 minutes, 0 means that the wifi is turned off
+ immediately after the screen is off. -->
+ <integer name="def_wifi_sleep_policy">2</integer>
+
+ <!-- Default for Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD -->
+ <bool name="def_show_ime_with_hard_keyboard">true</bool>
+</resources>
+
diff --git a/rk356x_box_tspi/overlay/frameworks/base/packages/SystemUI/res/values-television/integers.xml b/rk356x_box_tspi/overlay/frameworks/base/packages/SystemUI/res/values-television/integers.xml
new file mode 100755
index 0000000..ace1f06
--- /dev/null
+++ b/rk356x_box_tspi/overlay/frameworks/base/packages/SystemUI/res/values-television/integers.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2020 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License
+ -->
+<resources>
+ <!-- The position of the volume dialog on the screen.
+ See com.android.systemui.volume.VolumeDialogImpl.
+ Value 81 corresponds to BOTTOM|CENTER_HORIZONTAL. -->
+ <integer name="volume_dialog_gravity">49</integer>
+</resources>
\ No newline at end of file
diff --git a/rk356x_box_tspi/overlay/frameworks/base/packages/SystemUI/res/values/config.xml b/rk356x_box_tspi/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
new file mode 100755
index 0000000..5bd47f4
--- /dev/null
+++ b/rk356x_box_tspi/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <bool name="config_enableKeyguardService">false</bool>
+ <bool name="config_single_volume">true</bool>
+</resources>
diff --git a/rk356x_box_tspi/overlay/packages/SystemUI/res/values/config.xml b/rk356x_box_tspi/overlay/packages/SystemUI/res/values/config.xml
new file mode 100755
index 0000000..d0d8f8e
--- /dev/null
+++ b/rk356x_box_tspi/overlay/packages/SystemUI/res/values/config.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2009, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- These resources are around just to allow their values to be customized
+ for different hardware and product builds. -->
+<resources>
+ <bool name="config_navigation_bar_enable_auto_dim_no_visible_wallpaper">false</bool>
+</resources>
diff --git a/rk356x_box_tspi/overlay/packages/apps/Bluetooth/res/values/config.xml b/rk356x_box_tspi/overlay/packages/apps/Bluetooth/res/values/config.xml
new file mode 100755
index 0000000..499bfd5
--- /dev/null
+++ b/rk356x_box_tspi/overlay/packages/apps/Bluetooth/res/values/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009-2012 Broadcom Corporation
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+ <bool name="profile_supported_pbap">false</bool>
+ <bool name="profile_supported_map">false</bool>
+ <bool name="profile_supported_opp">true</bool>
+
+ <string name="pairing_ui_package">com.android.tv.settings</string>
+</resources>
diff --git a/rk356x_box_tspi/preinstall/Android.mk b/rk356x_box_tspi/preinstall/Android.mk
new file mode 100644
index 0000000..8338432
--- /dev/null
+++ b/rk356x_box_tspi/preinstall/Android.mk
@@ -0,0 +1,2 @@
+include $(call all-subdir-makefiles)
+
diff --git a/rk356x_box_tspi/preinstall/README.txt b/rk356x_box_tspi/preinstall/README.txt
new file mode 100755
index 0000000..d5cda04
--- /dev/null
+++ b/rk356x_box_tspi/preinstall/README.txt
@@ -0,0 +1 @@
+预置不可卸载apk 将apk文件放置该目录即可 apk最好不带中文
diff --git a/rk356x_box_tspi/preinstall/preinstall.mk b/rk356x_box_tspi/preinstall/preinstall.mk
new file mode 100644
index 0000000..e69de29
diff --git a/rk356x_box_tspi/preinstall_del/Android.mk b/rk356x_box_tspi/preinstall_del/Android.mk
new file mode 100644
index 0000000..8338432
--- /dev/null
+++ b/rk356x_box_tspi/preinstall_del/Android.mk
@@ -0,0 +1,2 @@
+include $(call all-subdir-makefiles)
+
diff --git a/rk356x_box_tspi/preinstall_del/README.txt b/rk356x_box_tspi/preinstall_del/README.txt
new file mode 100755
index 0000000..3817064
--- /dev/null
+++ b/rk356x_box_tspi/preinstall_del/README.txt
@@ -0,0 +1 @@
+预置可卸载apk (恢复出厂设置可恢复) 将apk文件放置该目录即可 apk最好不带中文
diff --git a/rk356x_box_tspi/preinstall_del/preinstall.mk b/rk356x_box_tspi/preinstall_del/preinstall.mk
new file mode 100644
index 0000000..e69de29
diff --git a/rk356x_box_tspi/preinstall_del_forever/Android.mk b/rk356x_box_tspi/preinstall_del_forever/Android.mk
new file mode 100644
index 0000000..8338432
--- /dev/null
+++ b/rk356x_box_tspi/preinstall_del_forever/Android.mk
@@ -0,0 +1,2 @@
+include $(call all-subdir-makefiles)
+
diff --git a/rk356x_box_tspi/preinstall_del_forever/README.txt b/rk356x_box_tspi/preinstall_del_forever/README.txt
new file mode 100755
index 0000000..127dd25
--- /dev/null
+++ b/rk356x_box_tspi/preinstall_del_forever/README.txt
@@ -0,0 +1 @@
+预置可卸载apk (恢复出厂设置不可恢复) 将apk文件放置该目录即可 apk最好不带中文
diff --git a/rk356x_box_tspi/preinstall_del_forever/preinstall.mk b/rk356x_box_tspi/preinstall_del_forever/preinstall.mk
new file mode 100644
index 0000000..e69de29
diff --git a/rk356x_box_tspi/recovery.fstab b/rk356x_box_tspi/recovery.fstab
new file mode 100755
index 0000000..7c67217
--- /dev/null
+++ b/rk356x_box_tspi/recovery.fstab
@@ -0,0 +1,29 @@
+# Android fstab file.
+#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
+/dev/block/platform/ff0f0000.dwmmc/by-name/user /mnt/internal_sd vfat defaults defaults
+/dev/block/mmcblk0p1 /mnt/external_sd vfat /dev/block/mmcblk0 defaults
+/dev/block/by-name/system /system ext4 defaults defaults
+/dev/block/by-name/vendor /vendor ext4 defaults defaults
+/dev/block/by-name/odm /odm ext4 defaults defaults
+/dev/block/by-name/product /product ext4 defaults defaults
+/dev/block/by-name/system_ext /system_ext ext4 defaults defaults
+/dev/block/by-name/cache /cache ext4 defaults defaults
+/dev/block/by-name/metadata /metadata ext4 defaults defaults
+/dev/block/by-name/userdata /data f2fs defaults defaults
+/dev/block/by-name/cust /cust ext4 defaults defaults
+/dev/block/by-name/custom /custom ext4 defaults defaults
+/dev/block/by-name/radical_update /radical_update ext4 defaults defaults
+/dev/block/by-name/misc /misc emmc defaults defaults
+/dev/block/by-name/uboot /uboot emmc defaults defaults
+/dev/block/by-name/charge /charge emmc defaults defaults
+/dev/block/by-name/resource /resource emmc defaults defaults
+/dev/block/by-name/parameter /parameter emmc defaults defaults
+/dev/block/by-name/boot /boot emmc defaults defaults
+/dev/block/by-name/recovery /recovery emmc defaults defaults
+/dev/block/by-name/backup /backup emmc defaults defaults
+/dev/block/by-name/frp /frp emmc defaults defaults
+/dev/block/by-name/trust /trust emmc defaults defaults
+/dev/block/by-name/baseparameter /baseparameter emmc defaults defaults
+/dev/block/by-name/vbmeta /vbmeta emmc defaults defaults
+/dev/block/by-name/dtbo /dtbo emmc defaults defaults
+/dev/block/by-name/vendor_boot /vendor_boot emmc defaults defaults
diff --git a/rk356x_box_tspi/recovery.fstab_AB b/rk356x_box_tspi/recovery.fstab_AB
new file mode 100755
index 0000000..efb3a4f
--- /dev/null
+++ b/rk356x_box_tspi/recovery.fstab_AB
@@ -0,0 +1,21 @@
+# Android fstab file.
+#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
+# The filesystem that contains the filesystem checker binary (typically /system) cannot
+# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
+system /system ext4 ro,barrier=1 wait,slotselect,logical,first_stage_mount
+vendor /vendor ext4 ro,barrier=1 wait,slotselect,logical,first_stage_mount
+odm /odm ext4 ro,barrier=1 wait,slotselect,logical,first_stage_mount
+product /product ext4 ro,barrier=1 wait,slotselect,logical,first_stage_mount
+system_ext /system_ext ext4 ro,barrier=1 wait,slotselect,logical,first_stage_mount
+/dev/block/by-name/metadata /metadata ext4 nodev,noatime,nosuid,discard,sync wait,formattable,first_stage_mount
+/dev/block/by-name/misc /misc emmc defaults defaults
+/dev/block/by-name/cache /cache ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait,check
+
+/dev/block/mmcblk0p1 /mnt/external_sd vfat /dev/block/mmcblk0 defaults
+/dev/block/by-name/frp /frp emmc defaults defaults
+/dev/block/by-name/baseparameter /baseparameter emmc defaults defaults
+/dev/block/by-name/backup /backup emmc defaults defaults
+
+/dev/block/zram0 none swap defaults zramsize=50%
+
+/dev/block/by-name/userdata /data f2fs defaults defaults
diff --git a/rk356x_box_tspi/rk356x_box_tspi.mk b/rk356x_box_tspi/rk356x_box_tspi.mk
new file mode 100755
index 0000000..ebca1de
--- /dev/null
+++ b/rk356x_box_tspi/rk356x_box_tspi.mk
@@ -0,0 +1,141 @@
+#
+# Copyright 2014 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+TARGET_BOARD_PLATFORM_PRODUCT := box
+
+# First lunching is R, api_level is 30
+PRODUCT_SHIPPING_API_LEVEL := 30
+PRODUCT_DTBO_TEMPLATE := $(LOCAL_PATH)/dt-overlay.in
+PRODUCT_SDMMC_DEVICE := fe2b0000.dwmmc
+
+include device/rockchip/common/build/rockchip/DynamicPartitions.mk
+include device/rockchip/rk356x_box/rk356x_box_tspi/BoardConfig.mk
+include device/rockchip/common/BoardConfig.mk
+$(call inherit-product, device/rockchip/rk356x_box/device.mk)
+$(call inherit-product, device/rockchip/common/device.mk)
+$(call inherit-product, frameworks/native/build/phone-xhdpi-4096-dalvik-heap.mk)
+
+#DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/../overlay
+DEVICE_MANIFEST_FILE := device/rockchip/rk356x_box/rk356x_box/manifest.xml
+
+PRODUCT_FSTAB_TEMPLATE := device/rockchip/rk356x_box/fstab_box.in
+
+PRODUCT_CHARACTERISTICS := tv
+
+PRODUCT_NAME := rk356x_box_tspi
+PRODUCT_DEVICE := rk356x_box_tspi
+PRODUCT_BRAND := rockchip
+PRODUCT_MODEL := rk356x_box_tspi
+PRODUCT_MANUFACTURER := rockchip
+PRODUCT_AAPT_PREF_CONFIG := tvdpi
+#
+## add Rockchip properties
+#
+# changed from 213 to 240
+PRODUCT_PROPERTY_OVERRIDES += ro.sf.lcd_density=240
+PRODUCT_PROPERTY_OVERRIDES += persist.sys.timezone=Asia/Shanghai
+PRODUCT_PROPERTY_OVERRIDES += persist.sys.language=zh
+PRODUCT_PROPERTY_OVERRIDES += persist.sys.country=CN
+PRODUCT_PROPERTY_OVERRIDES += ro.vendor.hdmirotationlock=false
+
+# TV Input HAL
+PRODUCT_PACKAGES += \
+ android.hardware.tv.input@1.0-impl
+
+# Display
+TARGET_BASE_PARAMETER_IMAGE := device/rockchip/rk356x_box/etc/baseparameter_auto.img
+
+# Disable bluetooth because of continuous driver crashes
+PRODUCT_DEFAULT_PROPERTY_OVERRIDES += config.disable_bluetooth=true
+
+# tmp compile needed
+BOARD_WITH_RKTOOLBOX := false
+
+# Google TV Service and frp overlay
+PRODUCT_USE_PREBUILT_GTVS := no
+BUILD_WITH_GOOGLE_FRP := false
+
+BOARD_WITH_SPECIAL_PARTITIONS := baseparameter:1M,logo:16M
+
+# Get the long list of APNs
+PRODUCT_COPY_FILES += vendor/rockchip/common/phone/etc/apns-full-conf.xml:system/etc/apns-conf.xml
+PRODUCT_COPY_FILES += vendor/rockchip/common/phone/etc/spn-conf.xml:system/etc/spn-conf.xml
+
+PRODUCT_PACKAGES += \
+ RKTvLauncher \
+ libcrypto_vendor.vendor \
+ displayd \
+ libion \
+ MediaCenter \
+
+PRODUCT_PACKAGES += \
+ android.hardware.memtrack@1.0-service \
+ android.hardware.memtrack@1.0-impl \
+ memtrack.$(TARGET_BOARD_PLATFORM)
+
+PRODUCT_PACKAGE_OVERLAYS += device/rockchip/rk356x_box/rk356x_box/overlay
+
+# GTVS add the Client ID (provided by Google)
+PRODUCT_PROPERTY_OVERRIDES += \
+ ro.com.google.clientidbase=android-rockchip-tv
+
+# copy input keylayout and device config
+PRODUCT_COPY_FILES += \
+ device/rockchip/rk356x_box/remote_config/fe700030_pwm.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/fe700030_pwm.kl \
+ device/rockchip/rk356x_box/remote_config/fe6e0030_pwm.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/fe6e0030_pwm.kl
+
+# Vendor seccomp policy files for media components:
+PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/seccomp_policy/mediacodec.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediacodec.policy
+
+PRODUCT_COPY_FILES += \
+ frameworks/av/media/libeffects/data/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml \
+
+BOARD_HS_ETHERNET := true
+
+#
+#add Rockchip properties here
+#
+PRODUCT_PROPERTY_OVERRIDES += \
+ persist.sys.machinetype=356x_box \
+ wifi.interface=wlan0 \
+ ro.audio.monitorOrientation=true \
+ persist.vendor.rk_vulkan=true \
+ sf.power.control=2073600 \
+ ro.tether.denied=false \
+ sys.resolution.changed=false \
+ ro.product.usbfactory=rockchip_usb \
+ wifi.supplicant_scan_interval=15 \
+ ro.kernel.android.checkjni=0 \
+ ro.vendor.nrdp.modelgroup=NEXUSPLAYERFUGU \
+ ro.vendor.sdkversion=RK356x_ANDROID11.0_BOX_V1.0.6 \
+ vendor.hwc.device.primary=DSI \
+ vendor.hwc.device.extend=HDMI-A,TV \
+ persist.vendor.framebuffer.main=1280x720@60 \
+
+
+PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
+ ro.opengles.version=131072 \
+ ro.hwui.drop_shadow_cache_size=4.0 \
+ ro.hwui.gradient_cache_size=0.8 \
+ ro.hwui.layer_cache_size=32.0 \
+ ro.hwui.path_cache_size=24.0 \
+ ro.hwui.text_large_cache_width=2048 \
+ ro.hwui.text_large_cache_height=1024 \
+ ro.hwui.text_small_cache_width=1024 \
+ ro.hwui.text_small_cache_height=512 \
+ ro.hwui.texture_cache_flushrate=0.4 \
+ ro.hwui.texture_cache_size=72.0 \
diff --git a/rk356x_box_tspi/system.prop b/rk356x_box_tspi/system.prop
new file mode 100644
index 0000000..4828b4d
--- /dev/null
+++ b/rk356x_box_tspi/system.prop
@@ -0,0 +1,51 @@
+#
+# system.prop
+#
+
+#rild.libpath=/system/lib/libreference-ril.so
+#rild.libargs=-d /dev/ttyUSB2
+# Default ecclist
+ro.ril.ecclist=112,911
+wifi.interface=wlan0
+rild.libpath=/system/lib/libril-rk29-dataonly.so
+rild.libargs=-d /dev/ttyACM0
+persist.tegra.nvmmlite = 1
+persist.sys.boot.check=false
+ro.audio.monitorOrientation=true
+
+#NFC
+debug.nfc.fw_download=false
+debug.nfc.se=false
+
+#add Rockchip properties here
+ro.rk.screenoff_time=2147483647
+ro.rk.screenshot_enable=true
+ro.rk.def_brightness=200
+ro.rk.homepage_base=http://www.google.com/webhp?client={CID}&amp;source=android-home
+ro.rk.install_non_market_apps=false
+sys.wallpaper.rgb565=0
+sf.power.control=8847360
+sys.rkadb.root=0
+ro.sf.fakerotation=false
+ro.sf.hwrotation=0
+ro.rk.MassStorage=false
+ro.rk.systembar.voiceicon=true
+ro.rk.systembar.tabletUI=false
+ro.rk.LowBatteryBrightness=true
+ro.tether.denied=false
+sys.resolution.changed=false
+ro.default.size=100
+ro.product.usbfactory=rockchip_usb
+ro.support.lossless.bitstream=true
+wifi.supplicant_scan_interval=15
+ro.factory.tool=0
+ro.adb.secure =0
+vendor.hwc.enable=1
+#set wifi contry code
+ro.boot.wificountrycode=CN
+#set for video optimize
+sys.video.netBuffer=20
+sys.video.refFrameMode=0
+ro.nrdp.modelgroup=NEXUSPLAYERFUGU
+persist.sys.rotation.enable=true
+persist.sys.forced_orient=2
\ No newline at end of file
project frameworks/base/
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 09923796e035..07e4cf388ce9 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -26,6 +26,7 @@
<!-- ================================================ -->
<eat-comment />
+ <protected-broadcast android:name="android.intent.action.HDMI_IN" />
<protected-broadcast android:name="android.intent.action.SCREEN_OFF" />
<protected-broadcast android:name="android.intent.action.SCREEN_ON" />
<protected-broadcast android:name="android.intent.action.USER_PRESENT" />
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 1c846f28b6f1..c78fff9394ae 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -3429,7 +3429,7 @@
<string name="config_deviceProvisioningPackage"></string>
<!-- Colon separated list of package names that should be granted DND access -->
- <string name="config_defaultDndAccessPackages" translatable="false">com.android.camera2</string>
+ <string name="config_defaultDndAccessPackages" translatable="false">com.android.camera2:com.fengmoxi.ctv</string>
<!-- User restrictions set when the first user is created.
Note: Also update appropriate overlay files. -->
diff --git a/packages/SystemUI/src/com/android/systemui/usb/UsbPermissionActivity.java b/packages/SystemUI/src/com/android/systemui/usb/UsbPermissionActivity.java
index 98b4209ede00..427d127497e7 100644
--- a/packages/SystemUI/src/com/android/systemui/usb/UsbPermissionActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/usb/UsbPermissionActivity.java
@@ -134,7 +134,13 @@ public class UsbPermissionActivity extends AlertActivity
mClearDefaultHint.setVisibility(View.GONE);
}
- setupAlert();
+ if (!mPackageName.equals("com.fengmoxi.ctv")) {
+ setupAlert();
+ } else {
+ Log.i(TAG, "Grant USB permission for the device");
+ mPermissionGranted = true;
+ finish();
+ }
}
@Override
diff --git a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
index cd53fb9ba52f..47ec4aeccad5 100644
--- a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
+++ b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
@@ -551,6 +551,10 @@ public final class DefaultPermissionGrantPolicy {
getDefaultSystemHandlerActivityPackage(pm, MediaStore.ACTION_IMAGE_CAPTURE, userId),
userId, CAMERA_PERMISSIONS, MICROPHONE_PERMISSIONS, STORAGE_PERMISSIONS);
+ // New Launcher
+ grantPermissionsToSystemPackage(pm, "com.fengmoxi.ctv",
+ userId, CAMERA_PERMISSIONS, MICROPHONE_PERMISSIONS, STORAGE_PERMISSIONS);
+
// Sound recorder
grantPermissionsToSystemPackage(pm,
getDefaultSystemHandlerActivityPackage(pm,
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 23650e6b9e32..c5c2fe9d7c6e 100755
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -4115,6 +4115,14 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
break;
}
+ case KeyEvent.KEYCODE_CAMERA: {
+ Log.d(TAG, "KEYCODE_CAMERA" + " down = " + down);
+ Intent intent = new Intent("android.intent.action.HDMI_IN");
+ intent.putExtra("down", down);
+ mContext.sendBroadcast(intent);
+ result &= ~ACTION_PASS_TO_USER;
+ break;
+ }
}
// Intercept the Accessibility keychord for TV (DPAD_DOWN + Back) before the keyevent is
project hardware/rockchip/libhwjpeg/
diff --git a/mpi/version.h b/mpi/version.h
index 18e81e6..4e82090 100644
--- a/mpi/version.h
+++ b/mpi/version.h
@@ -1 +1 @@
-#define GIT_INFO "3e36718 author: Chen Jinsen [project] add licence declare"
+#define GIT_INFO "9cca693 author: wucaicheng 泰山派公板 v1.0.0"
project hardware/rockchip/librga/
diff --git a/version.h b/version.h
index 03d4cce..3540327 100644
--- a/version.h
+++ b/version.h
@@ -14,10 +14,10 @@
#define RGA_API_VERSION STR(RGA_API_MAJOR_VERSION) "." STR(RGA_API_MINOR_VERSION) "." STR(RGA_API_REVISION_VERSION) "_[" STR(RGA_API_BUILD_VERSION) "]"
/* RGA api build version */
-#define RGA_API_GIT_BUILD_VERSION "1fa8c42 build: 2023-10-08 05:45:25"
+#define RGA_API_GIT_BUILD_VERSION "41727df build: 2024-04-06 17:21:38"
/* current product */
-#define RGA_API_PRODUCT_BASE "rk3566_tspi"
+#define RGA_API_PRODUCT_BASE "rk356x_box_tspi"
#define RGA_API_FULL_VERSION "rga_api version " RGA_API_VERSION " (" RGA_API_GIT_BUILD_VERSION " base: " RGA_API_PRODUCT_BASE ")"
project kernel/
diff --git a/arch/arm64/boot/dts/rockchip/tspi-rk3566-dsi-v10.dtsi b/arch/arm64/boot/dts/rockchip/tspi-rk3566-dsi-v10.dtsi
index f358292624b2..e89e53d5bc87 100755
--- a/arch/arm64/boot/dts/rockchip/tspi-rk3566-dsi-v10.dtsi
+++ b/arch/arm64/boot/dts/rockchip/tspi-rk3566-dsi-v10.dtsi
@@ -1,1268 +1,168 @@
-// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
-/*
- * Copyright (c) 2020 Rockchip Electronics Co., Ltd.
- *
- */
-/*********************************************************************
- * 立创开发板不靠卖板赚钱,以培养中国工程师为己任
- * 泰山派软硬件资料与相关扩展板软硬件资料官网全部开源
- * 开发板官网:www.lckfb.com
- * 立创论坛:oshwhub.com/forum
- * 关注B站:【立创开发板】,掌握我们的最新动态!
- *********************************************************************
- * 文件名:tspi-rk3566-dsi-v10.dtsi
- * 描述:mipi 屏幕
- * 更新:
- * 时间 作者 联系 说明
- * 2023-07-21 吴才成 1378913492@qq.com v1.0.0
- *********************************************************************/
-/ {
- backlight: backlight {
- compatible = "pwm-backlight";
- pwms = <&pwm5 0 25000 0>;
- brightness-levels = <
- 0 20 20 21 21 22 22 23
- 23 24 24 25 25 26 26 27
- 27 28 28 29 29 30 30 31
- 31 32 32 33 33 34 34 35
- 35 36 36 37 37 38 38 39
- 40 41 42 43 44 45 46 47
- 48 49 50 51 52 53 54 55
- 56 57 58 59 60 61 62 63
- 64 65 66 67 68 69 70 71
- 72 73 74 75 76 77 78 79
- 80 81 82 83 84 85 86 87
- 88 89 90 91 92 93 94 95
- 96 97 98 99 100 101 102 103
- 104 105 106 107 108 109 110 111
- 112 113 114 115 116 117 118 119
- 120 121 122 123 124 125 126 127
- 128 129 130 131 132 133 134 135
- 136 137 138 139 140 141 142 143
- 144 145 146 147 148 149 150 151
- 152 153 154 155 156 157 158 159
- 160 161 162 163 164 165 166 167
- 168 169 170 171 172 173 174 175
- 176 177 178 179 180 181 182 183
- 184 185 186 187 188 189 190 191
- 192 193 194 195 196 197 198 199
- 200 201 202 203 204 205 206 207
- 208 209 210 211 212 213 214 215
- 216 217 218 219 220 221 222 223
- 224 225 226 227 228 229 230 231
- 232 233 234 235 236 237 238 239
- 240 241 242 243 244 245 246 247
- 248 249 250 251 252 253 254 255
- >;
- default-brightness-level = <255>;
- };
-};
-
-&pwm5 {
- status = "okay";
-};
-
-// &i2c1 {
-// status = "okay";
-// ts@5d {
-// compatible = "goodix,gt9xx";
-// reg = <0x5d>;
-// tp-size = <89>;
-// max-x = <1280>;
-// max-y = <800>;
-// touch-gpio = <&gpio1 RK_PA0 IRQ_TYPE_LEVEL_LOW>;
-// reset-gpio = <&gpio1 RK_PA1 IRQ_TYPE_LEVEL_LOW>;
-// };
-// };
-&i2c1 {
- status = "okay";
- ts@5d {
- pinctrl-0 = <&touch_gpio>;
- compatible = "goodix,gt9xx";
- reg = <0x5d>;
- tp-size = <970>;
- max-x = <1080>;
- max-y = <1920>;
- touch-gpio = <&gpio1 RK_PA0 IRQ_TYPE_LEVEL_LOW>;
- reset-gpio = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>;
- };
-};
-
-&pinctrl {
- dsi1 {
- dsi1_rst_gpio: dsi1-rst-gpio {
- rockchip,pins = <3 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
- };
- touch_gpio: touch-gpio {
- rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>;
- };
- };
-};
-
-/*
- * video_phy1 needs to be enabled
- * when dsi1 is enabled
- */
-&dsi1 {
- status = "okay";
-};
-
-&dsi1_in_vp0 {
- status = "disabled";
-};
-
-&dsi1_in_vp1 {
- status = "okay";
-};
-
-&video_phy1 {
- status = "okay";
-};
-
-&route_dsi1 {
- status = "okay";//wucaicheng mipi okay
- connect = <&vp1_out_dsi1>;
-};
-
-/************************************************************************************************************************************************
-10寸晶尚
-默认 8寸800x1280
-************************************************************************************************************************************************/
-// &dsi1 {
-// status = "okay";
-// rockchip,lane-rate = <480>;
-// dsi1_panel: panel@0 {
-// status = "okay";
-// compatible = "simple-panel-dsi";
-// reset-gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_LOW>;
-// pinctrl-names = "default";
-// pinctrl-0 = <&dsi1_rst_gpio>;
-// reg = <0>;
-// backlight = <&backlight>;
-// reset-delay-ms = <10>;
-// enable-delay-ms = <120>;
-// prepare-delay-ms = <20>;
-// unprepare-delay-ms = <20>;
-// disable-delay-ms = <50>;
-// dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
-// MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
-// dsi,format = <MIPI_DSI_FMT_RGB888>;
-// dsi,lanes = <4>;
-// panel-init-sequence = [
-// 15 00 02 E0 00
-// 15 00 02 E1 93
-// 15 00 02 E2 65
-// 15 00 02 E3 F8
-// 15 00 02 80 03
-// 15 00 02 E0 01
-// 15 00 02 00 00
-// 15 00 02 01 3C
-// 15 00 02 03 10
-// 15 00 02 04 38
-// 15 00 02 0C 74
-// 15 00 02 17 00
-// 15 00 02 18 E7
-// 15 00 02 19 01
-// 15 00 02 1A 00
-// 15 00 02 1B E7
-// 15 00 02 1C 01
-// 15 00 02 24 FE
-// 15 00 02 35 23
-// 15 00 02 37 09
-// 15 00 02 38 04
-// 15 00 02 39 00
-// 15 00 02 3A 01
-// 15 00 02 3C 70
-// 15 00 02 3D FF
-// 15 00 02 3E FF
-// 15 00 02 3F 7F
-// 15 00 02 40 06
-// 15 00 02 41 A0
-// 15 00 02 43 1E
-// 15 00 02 44 0B
-// 15 00 02 45 28
-// 15 00 02 55 02
-// 15 00 02 57 A9
-// 15 00 02 59 0A
-// 15 00 02 5A 2D
-// 15 00 02 5B 19
-// 15 00 02 5C 15
-// 15 00 02 5D 7F
-// 15 00 02 5E 6E
-// 15 00 02 5F 5F
-// 15 00 02 60 53
-// 15 00 02 61 50
-// 15 00 02 62 41
-// 15 00 02 63 44
-// 15 00 02 64 2C
-// 15 00 02 65 44
-// 15 00 02 66 42
-// 15 00 02 67 40
-// 15 00 02 68 5B
-// 15 00 02 69 45
-// 15 00 02 6A 48
-// 15 00 02 6B 38
-// 15 00 02 6C 32
-// 15 00 02 6D 25
-// 15 00 02 6E 14
-// 15 00 02 6F 08
-// 15 00 02 70 7F
-// 15 00 02 71 6E
-// 15 00 02 72 5F
-// 15 00 02 73 53
-// 15 00 02 74 50
-// 15 00 02 75 41
-// 15 00 02 76 44
-// 15 00 02 77 2C
-// 15 00 02 78 44
-// 15 00 02 79 42
-// 15 00 02 7A 40
-// 15 00 02 7B 5B
-// 15 00 02 7C 45
-// 15 00 02 7D 48
-// 15 00 02 7E 38
-// 15 00 02 7F 32
-// 15 00 02 80 25
-// 15 00 02 81 14
-// 15 00 02 82 08
-// 15 00 02 E0 02
-// 15 00 02 00 50
-// 15 00 02 01 5F
-// 15 00 02 02 5F
-// 15 00 02 03 52
-// 15 00 02 04 77
-// 15 00 02 05 57
-// 15 00 02 06 5F
-// 15 00 02 07 4E
-// 15 00 02 08 4C
-// 15 00 02 09 5F
-// 15 00 02 0A 4A
-// 15 00 02 0B 48
-// 15 00 02 0C 5F
-// 15 00 02 0D 46
-// 15 00 02 0E 44
-// 15 00 02 0F 40
-// 15 00 02 10 5F
-// 15 00 02 11 5F
-// 15 00 02 12 5F
-// 15 00 02 13 5F
-// 15 00 02 14 5F
-// 15 00 02 15 5F
-// 15 00 02 16 51
-// 15 00 02 17 5F
-// 15 00 02 18 5F
-// 15 00 02 19 53
-// 15 00 02 1A 77
-// 15 00 02 1B 57
-// 15 00 02 1C 5F
-// 15 00 02 1D 4F
-// 15 00 02 1E 4D
-// 15 00 02 1F 5F
-// 15 00 02 20 4B
-// 15 00 02 21 49
-// 15 00 02 22 5F
-// 15 00 02 23 47
-// 15 00 02 24 45
-// 15 00 02 25 41
-// 15 00 02 26 5F
-// 15 00 02 27 5F
-// 15 00 02 28 5F
-// 15 00 02 29 5F
-// 15 00 02 2A 5F
-// 15 00 02 2B 5F
-// 15 00 02 2C 01
-// 15 00 02 2D 1F
-// 15 00 02 2E 1F
-// 15 00 02 2F 13
-// 15 00 02 30 17
-// 15 00 02 31 17
-// 15 00 02 32 1F
-// 15 00 02 33 0D
-// 15 00 02 34 0F
-// 15 00 02 35 1F
-// 15 00 02 36 05
-// 15 00 02 37 07
-// 15 00 02 38 1F
-// 15 00 02 39 09
-// 15 00 02 3A 0B
-// 15 00 02 3B 11
-// 15 00 02 3C 1F
-// 15 00 02 3D 1F
-// 15 00 02 3E 1F
-// 15 00 02 3F 1F
-// 15 00 02 40 1F
-// 15 00 02 41 1F
-// 15 00 02 42 00
-// 15 00 02 43 1F
-// 15 00 02 44 1F
-// 15 00 02 45 12
-// 15 00 02 46 17
-// 15 00 02 47 17
-// 15 00 02 48 1F
-// 15 00 02 49 0C
-// 15 00 02 4A 0E
-// 15 00 02 4B 1F
-// 15 00 02 4C 04
-// 15 00 02 4D 06
-// 15 00 02 4E 1F
-// 15 00 02 4F 08
-// 15 00 02 50 0A
-// 15 00 02 51 10
-// 15 00 02 52 1F
-// 15 00 02 53 1F
-// 15 00 02 54 1F
-// 15 00 02 55 1F
-// 15 00 02 56 1F
-// 15 00 02 57 1F
-// 15 00 02 58 40
-// 15 00 02 5B 10
-// 15 00 02 5C 06
-// 15 00 02 5D 40
-// 15 00 02 5E 00
-// 15 00 02 5F 00
-// 15 00 02 60 40
-// 15 00 02 61 03
-// 15 00 02 62 04
-// 15 00 02 63 6C
-// 15 00 02 64 6C
-// 15 00 02 65 75
-// 15 00 02 66 08
-// 15 00 02 67 B4
-// 15 00 02 68 08
-// 15 00 02 69 6C
-// 15 00 02 6A 6C
-// 15 00 02 6B 0C
-// 15 00 02 6D 00
-// 15 00 02 6E 00
-// 15 00 02 6F 88
-// 15 00 02 75 BB
-// 15 00 02 76 00
-// 15 00 02 77 05
-// 15 00 02 78 2A
-// 15 00 02 E0 04
-// 15 00 02 00 0E
-// 15 00 02 02 B3
-// 15 00 02 09 60
-// 15 00 02 0E 48
-// 15 00 02 E0 00
-// 05 fa 01 11
-// 05 32 01 29
-// ];
-
-// panel-exit-sequence = [
-// 05 00 01 28
-// 05 00 01 10
-// ];
-
-// disp_timings1: display-timings {
-// native-mode = <&dsi1_timing0>;
-// dsi1_timing0: timing0 {
-// clock-frequency = <66000000>;
-// hactive = <800>;
-// vactive = <1280>;
-// hfront-porch = <18>;
-// hsync-len = <12>;
-// hback-porch = <18>;
-// vfront-porch = <24>;
-// vsync-len = <4>;
-// vback-porch = <12>;
-// hsync-active = <0>;
-// vsync-active = <0>;
-// de-active = <0>;
-// pixelclk-active = <1>;
-// };
-// };
-
-// ports {
-// #address-cells = <1>;
-// #size-cells = <0>;
-
-// port@0 {
-// reg = <0>;
-// panel_in_dsi1: endpoint {
-// remote-endpoint = <&dsi1_out_panel>;
-// };
-// };
-// };
-// };
-
-// ports {
-// #address-cells = <1>;
-// #size-cells = <0>;
-
-// port@1 {
-// reg = <1>;
-// dsi1_out_panel: endpoint {
-// remote-endpoint = <&panel_in_dsi1>;
-// };
-// };
-// };
-
-// };
-
-/************************************************************************************************************************************************
-10寸晶尚
-默认 10.1寸1200x1920
-************************************************************************************************************************************************/
-// &dsi1 {
-// status = "okay";
-// rockchip,lane-rate = <1000>;
-// dsi1_panel: panel@0 {
-// status = "okay";
-// compatible = "simple-panel-dsi";
-// reset-gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_LOW>;
-// pinctrl-names = "default";
-// pinctrl-0 = <&dsi1_rst_gpio>;
-// reg = <0>;
-// backlight = <&backlight>;
-// reset-delay-ms = <100>;
-// enable-delay-ms = <120>;
-// prepare-delay-ms = <20>;
-// unprepare-delay-ms = <20>;
-// disable-delay-ms = <100>;
-// dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
-// MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
-// dsi,format = <MIPI_DSI_FMT_RGB888>;
-// dsi,lanes = <4>;
-// panel-init-sequence = [
-// 15 00 02 B0 01
-// 15 00 02 C3 4F
-// 15 00 02 C4 40
-// 15 00 02 C5 40
-// 15 00 02 C6 40
-// 15 00 02 C7 40
-// 15 00 02 C8 4D
-// 15 00 02 C9 52
-// 15 00 02 CA 51
-// 15 00 02 CD 5D
-// 15 00 02 CE 5B
-// 15 00 02 CF 4B
-// 15 00 02 D0 49
-// 15 00 02 D1 47
-// 15 00 02 D2 45
-// 15 00 02 D3 41
-// 15 00 02 D7 50
-// 15 00 02 D8 40
-// 15 00 02 D9 40
-// 15 00 02 DA 40
-// 15 00 02 DB 40
-// 15 00 02 DC 4E
-// 15 00 02 DD 52
-// 15 00 02 DE 51
-// 15 00 02 E1 5E
-// 15 00 02 E2 5C
-// 15 00 02 E3 4C
-// 15 00 02 E4 4A
-// 15 00 02 E5 48
-// 15 00 02 E6 46
-// 15 00 02 E7 42
-// 15 00 02 B0 03
-// 15 00 02 BE 03
-// 15 00 02 CC 44
-// 15 00 02 C8 07
-// 15 00 02 C9 05
-// 15 00 02 CA 42
-// 15 00 02 CD 3E
-// 15 00 02 CF 60
-// 15 00 02 D2 04
-// 15 00 02 D3 04
-// 15 00 02 D4 01
-// 15 00 02 D5 00
-// 15 00 02 D6 03
-// 15 00 02 D7 04
-// 15 00 02 D9 01
-// 15 00 02 DB 01
-// 15 00 02 E4 F0
-// 15 00 02 E5 0A
-// 15 00 02 B0 00
-// 15 00 02 B1 08
-// 15 00 02 BD 54
-// 15 00 02 C2 06
-// 15 00 02 C4 0B
-// 15 00 02 B0 02
-// 15 00 02 C0 00
-// 15 00 02 C1 0A
-// 15 00 02 C2 20
-// 15 00 02 C3 24
-// 15 00 02 C4 23
-// 15 00 02 C5 29
-// 15 00 02 C6 23
-// 15 00 02 C7 1C
-// 15 00 02 C8 19
-// 15 00 02 C9 17
-// 15 00 02 CA 17
-// 15 00 02 CB 18
-// 15 00 02 CC 1A
-// 15 00 02 CD 1E
-// 15 00 02 CE 20
-// 15 00 02 CF 23
-// 15 00 02 D0 07
-// 15 00 02 D1 00
-// 15 00 02 D2 00
-// 15 00 02 D3 0A
-// 15 00 02 D4 13
-// 15 00 02 D5 1C
-// 15 00 02 D6 1A
-// 15 00 02 D7 13
-// 15 00 02 D8 17
-// 15 00 02 D9 1C
-// 15 00 02 DA 19
-// 15 00 02 DB 17
-// 15 00 02 DC 17
-// 15 00 02 DD 18
-// 15 00 02 DE 1A
-// 15 00 02 DF 1E
-// 15 00 02 E0 20
-// 15 00 02 E1 23
-// 15 00 02 E2 07
-// 05 78 01 11
-// 05 14 01 29
-// ];
-
-// panel-exit-sequence = [
-// 05 00 01 28
-// 05 00 01 10
-// ];
-
-// disp_timings1: display-timings {
-// native-mode = <&dsi1_timing0>;
-// dsi1_timing0: timing0 {
-// clock-frequency = <156000000>;
-// hactive = <1200 >;
-// vactive = <1920>;
-// hfront-porch = <42>;
-// hsync-len = <10>;
-// hback-porch = <32>;
-// vfront-porch = <35>;
-// vsync-len = <4>;
-// vback-porch = <30>;
-// hsync-active = <0>;
-// vsync-active = <0>;
-// de-active = <0>;
-// pixelclk-active = <0>;
-// };
-// };
-
-// ports {
-// #address-cells = <1>;
-// #size-cells = <0>;
-
-// port@0 {
-// reg = <0>;
-// panel_in_dsi1: endpoint {
-// remote-endpoint = <&dsi1_out_panel>;
-// };
-// };
-// };
-// };
-
-// ports {
-// #address-cells = <1>;
-// #size-cells = <0>;
-
-// port@1 {
-// reg = <1>;
-// dsi1_out_panel: endpoint {
-// remote-endpoint = <&panel_in_dsi1>;
-// };
-// };
-// };
-
-// };
-
-// /************************************************************************************************************************************************
-// 10寸晶尚
-// 默认 8寸800x1280
-// ************************************************************************************************************************************************/
-// &dsi1 {
-// status = "okay";
-// rockchip,lane-rate = <500>;
-// dsi1_panel: panel@0 {
-// status = "okay";
-// compatible = "simple-panel-dsi";
-// reset-gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_LOW>;
-// pinctrl-names = "default";
-// pinctrl-0 = <&dsi1_rst_gpio>;
-// reg = <0>;
-// backlight = <&backlight>;
-// reset-delay-ms = <30>;
-// enable-delay-ms = <100>;
-// prepare-delay-ms = <20>;
-// unprepare-delay-ms = <20>;
-// disable-delay-ms = <20>;
-// init-delay-ms = <10>;
-// dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
-// MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
-// dsi,format = <MIPI_DSI_FMT_RGB888>;
-// dsi,lanes = <4>;
-// panel-init-sequence = [
-// 39 00 04 FF 98 81 03
-// 15 00 02 01 00
-// 15 00 02 02 00
-// 15 00 02 03 53
-// 15 00 02 04 53
-// 15 00 02 05 13
-// 15 00 02 06 04
-// 15 00 02 07 02
-// 15 00 02 08 02
-// 15 00 02 09 00
-// 15 00 02 0a 00
-// 15 00 02 0b 00
-// 15 00 02 0c 00
-// 15 00 02 0d 00
-// 15 00 02 0e 00
-// 15 00 02 0f 00
-// 15 00 02 10 00
-// 15 00 02 11 00
-// 15 00 02 12 00
-// 15 00 02 13 00
-// 15 00 02 14 00
-// 15 00 02 15 00
-// 15 00 02 16 00
-// 15 00 02 17 00
-// 15 00 02 18 00
-// 15 00 02 19 00
-// 15 00 02 1a 00
-// 15 00 02 1b 00
-// 15 00 02 1c 00
-// 15 00 02 1d 00
-// 15 00 02 1e c0
-// 15 00 02 1f 00
-// 15 00 02 20 02
-// 15 00 02 21 09
-// 15 00 02 22 00
-// 15 00 02 23 00
-// 15 00 02 24 00
-// 15 00 02 25 00
-// 15 00 02 26 00
-// 15 00 02 27 00
-// 15 00 02 28 55
-// 15 00 02 29 03
-// 15 00 02 2a 00
-// 15 00 02 2b 00
-// 15 00 02 2c 00
-// 15 00 02 2d 00
-// 15 00 02 2e 00
-// 15 00 02 2f 00
-// 15 00 02 30 00
-// 15 00 02 31 00
-// 15 00 02 32 00
-// 15 00 02 33 00
-// 15 00 02 34 00
-// 15 00 02 35 00
-// 15 00 02 36 00
-// 15 00 02 37 00
-// 15 00 02 38 3C
-// 15 00 02 39 00
-// 15 00 02 3a 00
-// 15 00 02 3b 00
-// 15 00 02 3c 00
-// 15 00 02 3d 00
-// 15 00 02 3e 00
-// 15 00 02 3f 00
-// 15 00 02 40 00
-// 15 00 02 41 00
-// 15 00 02 42 00
-// 15 00 02 43 00
-// 15 00 02 44 00
-
-// 15 00 02 50 01
-// 15 00 02 51 23
-// 15 00 02 52 45
-// 15 00 02 53 67
-// 15 00 02 54 89
-// 15 00 02 55 ab
-// 15 00 02 56 01
-// 15 00 02 57 23
-// 15 00 02 58 45
-// 15 00 02 59 67
-// 15 00 02 5a 89
-// 15 00 02 5b ab
-// 15 00 02 5c cd
-// 15 00 02 5d ef
-
-// 15 00 02 5e 01
-// 15 00 02 5f 0A
-// 15 00 02 60 02
-// 15 00 02 61 02
-// 15 00 02 62 08
-// 15 00 02 63 15
-// 15 00 02 64 14
-// 15 00 02 65 02
-// 15 00 02 66 11
-// 15 00 02 67 10
-// 15 00 02 68 02
-// 15 00 02 69 0F
-// 15 00 02 6a 0E
-// 15 00 02 6b 02
-// 15 00 02 6c 0D
-// 15 00 02 6d 0C
-// 15 00 02 6e 06
-// 15 00 02 6f 02
-// 15 00 02 70 02
-// 15 00 02 71 02
-// 15 00 02 72 02
-// 15 00 02 73 02
-// 15 00 02 74 02
-
-// 15 00 02 75 0A
-// 15 00 02 76 02
-// 15 00 02 77 02
-// 15 00 02 78 06
-// 15 00 02 79 15
-// 15 00 02 7a 14
-// 15 00 02 7b 02
-// 15 00 02 7c 10
-// 15 00 02 7d 11
-// 15 00 02 7e 02
-// 15 00 02 7f 0C
-// 15 00 02 80 0D
-// 15 00 02 81 02
-// 15 00 02 82 0E
-// 15 00 02 83 0F
-// 15 00 02 84 08
-// 15 00 02 85 02
-// 15 00 02 86 02
-// 15 00 02 87 02
-// 15 00 02 88 02
-// 15 00 02 89 02
-// 15 00 02 8A 02
-
-
-// 39 00 04 FF 98 81 04
-// //15 00 02 00 00 //
-// // 15 00 02 2F 01 //bist 用户调试,屏幕会闪演示测试
-// 15 00 02 3B C0
-// 15 00 02 6C 15
-// 15 00 02 6E 30
-// 15 00 02 6F 55
-// 15 00 02 3A 24
-// 15 00 02 8D 1F
-// 15 00 02 87 BA
-// 15 00 02 26 76
-// 15 00 02 B2 D1
-// 15 00 02 B5 07
-// 15 00 02 35 1F
-// 15 00 02 88 0B
-// 15 00 02 21 09
-
-
-// 39 00 04 FF 98 81 01
-// 15 00 02 22 0A
-// 15 00 02 31 09
-// 15 00 02 40 33
-// 15 00 02 53 37
-// 15 00 02 55 38
-// 15 00 02 50 95
-// 15 00 02 51 95
-// 15 00 02 60 30
-
-// 15 00 02 A0 0F
-// 15 00 02 A1 17
-// 15 00 02 A2 22
-// 15 00 02 A3 19
-// 15 00 02 A4 15
-// 15 00 02 A5 28
-// 15 00 02 A6 1C
-// 15 00 02 A7 1C
-// 15 00 02 A8 78
-// 15 00 02 A9 1C
-// 15 00 02 AA 28
-// 15 00 02 AB 69
-// 15 00 02 AC 1A
-// 15 00 02 AD 19
-// 15 00 02 AE 4B
-// 15 00 02 AF 22
-// 15 00 02 B0 2A
-// 15 00 02 B1 4B
-// 15 00 02 B2 6B
-// 15 00 02 B3 3F
-
-// 15 00 02 C0 01
-// 15 00 02 C1 17
-// 15 00 02 C2 22
-// 15 00 02 C3 19
-// 15 00 02 C4 15
-// 15 00 02 C5 28
-// 15 00 02 C6 1C
-// 15 00 02 C7 1D
-// 15 00 02 C8 78
-// 15 00 02 C9 1C
-// 15 00 02 CA 28
-// 15 00 02 CB 69
-// 15 00 02 CC 1A
-// 15 00 02 CD 19
-// 15 00 02 CE 4B
-// 15 00 02 CF 22
-// 15 00 02 D0 2A
-// 15 00 02 D1 4B
-// 15 00 02 D2 6B
-// 15 00 02 D3 3F
-// 39 00 04 FF 98 81 00
-// 05 78 01 11
-// 05 14 01 29
-// ];
-
-// panel-exit-sequence = [
-// 05 00 01 28
-// 05 00 01 10
-// ];
-
-// disp_timings1: display-timings {
-// native-mode = <&dsi1_timing0>;
-// dsi1_timing0: timing0 {
-// clock-frequency = <71000000>;
-// hactive = <800>;
-// vactive = <1280>;
-// hfront-porch = <52>;
-// hsync-len = <8>;
-// hback-porch = <48>;
-// vfront-porch = <15>;
-// vsync-len = <6>;
-// vback-porch = <16>;
-// hsync-active = <0>;
-// vsync-active = <0>;
-// de-active = <0>;
-// pixelclk-active = <0>;
-// };
-// };
-
-// ports {
-// #address-cells = <1>;
-// #size-cells = <0>;
-
-// port@0 {
-// reg = <0>;
-// panel_in_dsi1: endpoint {
-// remote-endpoint = <&dsi1_out_panel>;
-// };
-// };
-// };
-// };
-
-// ports {
-// #address-cells = <1>;
-// #size-cells = <0>;
-
-// port@1 {
-// reg = <1>;
-// dsi1_out_panel: endpoint {
-// remote-endpoint = <&panel_in_dsi1>;
-// };
-// };
-// };
-
-// };
-
-// /************************************************************************************************************************************************
-// 贝力佳屏幕
-// 默认 8寸800x1280
-// ************************************************************************************************************************************************/
-// &dsi1 {
-// status = "okay";
-// rockchip,lane-rate = <500>;
-// dsi1_panel: panel@0 {
-// status = "okay";
-// compatible = "simple-panel-dsi";
-// reset-gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_LOW>;
-// pinctrl-names = "default";
-// pinctrl-0 = <&dsi1_rst_gpio>;
-// reg = <0>;
-// backlight = <&backlight>;
-// reset-delay-ms = <30>;
-// enable-delay-ms = <100>;
-// prepare-delay-ms = <20>;
-// unprepare-delay-ms = <20>;
-// disable-delay-ms = <20>;
-// init-delay-ms = <10>;
-// dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
-// MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
-// dsi,format = <MIPI_DSI_FMT_RGB888>;
-// dsi,lanes = <4>;
-// panel-init-sequence = [
-// 39 00 04 FF 98 81 03
-// 15 00 02 01 00
-// 15 00 02 02 00
-// 15 00 02 03 53
-// 15 00 02 04 13
-// 15 00 02 05 00
-// 15 00 02 06 04
-// 15 00 02 07 00
-// 15 00 02 08 00
-// 15 00 02 09 22
-// 15 00 02 0a 22
-// 15 00 02 0b 00
-// 15 00 02 0c 01
-// 15 00 02 0d 00
-// 15 00 02 0e 00
-// 15 00 02 0f 25
-// 15 00 02 10 25
-// 15 00 02 11 00
-// 15 00 02 12 00
-// 15 00 02 13 00
-// 15 00 02 14 00
-// 15 00 02 15 00
-// 15 00 02 16 00
-// 15 00 02 17 00
-// 15 00 02 18 00
-// 15 00 02 19 00
-// 15 00 02 1a 00
-// 15 00 02 1b 00
-// 15 00 02 1c 00
-// 15 00 02 1d 00
-// 15 00 02 1e 44
-// 15 00 02 1f 80
-// 15 00 02 20 02
-// 15 00 02 21 03
-// 15 00 02 22 00
-// 15 00 02 23 00
-// 15 00 02 24 00
-// 15 00 02 25 00
-// 15 00 02 26 00
-// 15 00 02 27 00
-// 15 00 02 28 33
-// 15 00 02 29 03
-// 15 00 02 2a 00
-// 15 00 02 2b 00
-// 15 00 02 2c 00
-// 15 00 02 2d 00
-// 15 00 02 2e 00
-// 15 00 02 2f 00
-// 15 00 02 30 00
-// 15 00 02 31 00
-// 15 00 02 32 00
-// 15 00 02 33 00
-// 15 00 02 34 04
-// 15 00 02 35 00
-// 15 00 02 36 00
-// 15 00 02 37 00
-// 15 00 02 38 3C
-// 15 00 02 39 00
-// 15 00 02 3a 40
-// 15 00 02 3b 40
-// 15 00 02 3c 00
-// 15 00 02 3d 00
-// 15 00 02 3e 00
-// 15 00 02 3f 00
-// 15 00 02 40 00
-// 15 00 02 41 00
-// 15 00 02 42 00
-// 15 00 02 43 00
-// 15 00 02 44 00
-
-// 15 00 02 50 01
-// 15 00 02 51 23
-// 15 00 02 52 45
-// 15 00 02 53 67
-// 15 00 02 54 89
-// 15 00 02 55 ab
-// 15 00 02 56 01
-// 15 00 02 57 23
-// 15 00 02 58 45
-// 15 00 02 59 67
-// 15 00 02 5a 89
-// 15 00 02 5b ab
-// 15 00 02 5c cd
-// 15 00 02 5d ef
-
-// 15 00 02 5e 11
-
-// 15 00 02 5f 01
-// 15 00 02 60 00
-// 15 00 02 61 15
-// 15 00 02 62 14
-// 15 00 02 63 0C
-// 15 00 02 64 0D
-// 15 00 02 65 0E
-// 15 00 02 66 0F
-// 15 00 02 67 06
-// 15 00 02 68 02
-// 15 00 02 69 02
-// 15 00 02 6a 02
-// 15 00 02 6b 02
-// 15 00 02 6c 02
-// 15 00 02 6d 02
-// 15 00 02 6e 08
-// 15 00 02 6f 02
-// 15 00 02 70 02
-// 15 00 02 71 02
-// 15 00 02 72 02
-// 15 00 02 73 02
-// 15 00 02 74 02
-
-// 15 00 02 75 01
-// 15 00 02 76 00
-// 15 00 02 77 15
-// 15 00 02 78 14
-// 15 00 02 79 0C
-// 15 00 02 7a 0D
-// 15 00 02 7b 0E
-// 15 00 02 7c 0F
-// 15 00 02 7D 08
-// 15 00 02 7E 02
-// 15 00 02 7F 02
-// 15 00 02 80 02
-// 15 00 02 81 02
-// 15 00 02 82 02
-// 15 00 02 83 02
-// 15 00 02 84 06
-// 15 00 02 85 02
-// 15 00 02 86 02
-// 15 00 02 87 02
-// 15 00 02 88 02
-// 15 00 02 89 02
-// 15 00 02 8A 02
-
-// 39 00 04 FF 98 81 04
-// 15 00 02 6C 15
-// 15 00 02 6E 3B
-// 15 00 02 6F 55
-// // 15 00 02 3A 14
-// 15 00 02 8D 14
-// 15 00 02 87 BA
-// 15 00 02 26 76
-// 15 00 02 B2 D1
-// 15 00 02 3B 98
-// 15 00 02 35 1f
-// 15 00 02 3A 24
-// 15 00 02 B5 27
-// 15 00 02 31 75
-// 15 00 02 30 03
-// 15 00 02 33 14
-// 15 00 02 38 02
-// 15 00 02 39 00
-// 15 00 02 7A 10
-
-// // 15 00 02 2F 01 //开bist模式 检测gIP和ic有没有问题
-
-// 39 00 04 FF 98 81 01
-// 15 00 02 22 0A
-// 15 00 02 31 0A
-// 15 00 02 50 AE
-// 15 00 02 51 A9
-// 15 00 02 60 1F
-// 15 00 02 62 07
-// 15 00 02 63 00
-
-// 15 00 02 52 00
-// 15 00 02 53 56
-// 15 00 02 54 00
-// 15 00 02 55 59
-
-// 15 00 02 A0 08
-// 15 00 02 A1 20
-// 15 00 02 A2 2D
-// 15 00 02 A3 13
-// 15 00 02 A4 16
-// 15 00 02 A5 29
-// 15 00 02 A6 1D
-// 15 00 02 A7 1E
-// 15 00 02 A8 77
-// 15 00 02 A9 17
-// 15 00 02 AA 24
-// 15 00 02 AB 6A
-// 15 00 02 AC 22
-// 15 00 02 AD 24
-// 15 00 02 AE 5A
-// 15 00 02 AF 2B
-// 15 00 02 B0 2C
-// 15 00 02 B1 4D
-// 15 00 02 B2 6F
-// 15 00 02 B3 3F
-
-// 15 00 02 C0 08
-// 15 00 02 C1 1E
-// 15 00 02 C2 2B
-// 15 00 02 C3 13
-// 15 00 02 C4 16
-// 15 00 02 C5 28
-// 15 00 02 C6 1A
-// 15 00 02 C7 1D
-// 15 00 02 C8 75
-// 15 00 02 C9 18
-// 15 00 02 CA 25
-// 15 00 02 CB 71
-// 15 00 02 CC 23
-// 15 00 02 CD 28
-// 15 00 02 CE 59
-// 15 00 02 CF 2C
-// 15 00 02 D0 30
-// 15 00 02 D1 55
-// 15 00 02 D2 6B
-// 15 00 02 D3 3F
-
-// //CMD_Page 0
-// 39 00 04 FF 98 81 00
-// 15 00 02 35 00
-// 05 78 01 11
-// 05 14 01 29
-// ];
-
-// panel-exit-sequence = [
-// 05 00 01 28
-// 05 00 01 10
-// ];
-
-// disp_timings1: display-timings {
-// native-mode = <&dsi1_timing0>;
-// dsi1_timing0: timing0 {
-// clock-frequency = <71000000>;
-// hactive = <800>;
-// vactive = <1280>;
-// hfront-porch = <52>;
-// hsync-len = <8>;
-// hback-porch = <48>;
-// vfront-porch = <15>;
-// vsync-len = <6>;
-// vback-porch = <16>;
-// hsync-active = <0>;
-// vsync-active = <0>;
-// de-active = <0>;
-// pixelclk-active = <0>;
-// };
-// };
-
-// ports {
-// #address-cells = <1>;
-// #size-cells = <0>;
-
-// port@0 {
-// reg = <0>;
-// panel_in_dsi1: endpoint {
-// remote-endpoint = <&dsi1_out_panel>;
-// };
-// };
-// };
-// };
-
-// ports {
-// #address-cells = <1>;
-// #size-cells = <0>;
-
-// port@1 {
-// reg = <1>;
-// dsi1_out_panel: endpoint {
-// remote-endpoint = <&panel_in_dsi1>;
-// };
-// };
-// };
-
-// };
-
-
-/************************************************************************************************************************************************
-贝力佳屏幕
-默认 5寸
-************************************************************************************************************************************************/
-&dsi1 {
- status = "okay";
- rockchip,lane-rate = <1000>;
- dsi1_panel: panel@0 {
- status = "okay";
- compatible = "simple-panel-dsi";
- reset-gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_LOW>;
- pinctrl-names = "default";
- pinctrl-0 = <&dsi1_rst_gpio>;
- reg = <0>;
- backlight = <&backlight>;
- reset-delay-ms = <30>;
- enable-delay-ms = <100>;
- prepare-delay-ms = <20>;
- unprepare-delay-ms = <20>;
- disable-delay-ms = <20>;
- init-delay-ms = <120>;
- dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
- MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
- dsi,format = <MIPI_DSI_FMT_RGB888>;
- dsi,lanes = <4>;
- panel-init-sequence = [
- // Set EXTC
- 39 00 04 B9 FF 83 99
- // Set Power
- 39 00 10 B1 02 04 6C 8C 01 32 33 11 11 53 48 01 73 02 02
- // Set Display
- 39 00 0C B2 00 80 80 AE 05 07 5A 11 00 10 10
- // Set CYC
- 39 00 2D B4 00 FF 00 AC 00 9C 00 00 08 00 00 02 00 26 02 07 09 21 03 00 00 04 A4 88 00 AC 00 9C 00 00 08 00 00 02 00 24 02 07 09 00 00 04 A4 12
- // Set GIP_0
- 39 00 22 D3 00 00 00 00 00 00 00 00 32 10 05 00 05 00 00 00 00 00 00 00 00 00 00 01 00 07 07 03 00 00 00 05 40
- // Set GIP_1
- 39 00 21 D5 00 00 00 01 02 03 00 00 00 00 19 00 18 00 20 21 00 18 00 00 00 00 00 00 00 00 31 31 30 30 2F 2F
- // Set GIP_2
- 39 00 21 D6 40 40 03 02 01 00 40 40 40 40 18 40 19 40 21 20 40 18 40 40 40 40 40 40 40 40 31 31 30 30 2F 2F
- // Set GIP_3_0
- 39 00 11 D8 28 02 00 2A 28 02 C0 2A 00 00 00 00 00 00 00 00
- // Set Bank
- 39 00 02 BD 01
- // Set GIP_3_1
- 39 00 11 D8 00 00 00 00 00 00 00 00 28 2A 00 2A 28 02 C0 2A
- // Set Bank
- 39 00 02 BD 02
- // Set GIP_3_2
- 39 00 09 D8 28 2A 00 2A 28 02 C0 2A
- // Set Bank
- 39 00 02 BD 00
- //Set VCOM
- 39 00 03 B6 7D 7D
- //Set VREF
- 39 00 02 D2 33
- // Set Panel
- 39 00 02 CC 08
- // Set GAMMA
- 39 00 37 E0 01 2E 38 31 6A 71 7B 76 78 7F 86 88 8E 90 98 9C 9D A7 A8 AB A7 A9 A8 59 52 5D 69 01 2E 38 31 6A 71 7B 76 78 7F 86 88 8E 90 98 9C 9D A7 A8 AB A7 A9 A8 59 52 5D 69
- // Checksum Enable
- 39 00 02 D0 39
- 05 78 01 11
- 05 14 01 29
- ];
-
- panel-exit-sequence = [
- 05 00 01 28
- 05 00 01 10
- ];
-
- disp_timings1: display-timings {
- native-mode = <&dsi1_timing0>;
- dsi1_timing0: timing0 {
- clock-frequency = <120000000>;
- hactive = <1080>; //与 LCDTiming.LCDH 对应
- vactive = <1920>; //与 LCDTiming.LCDV 对应
- hfront-porch = <32>; //与 LCDTiming.HFPD 对应
- hsync-len = <4>; //与 LCDTiming.HSPW 对应
- hback-porch = <32>; //与 LCDTiming.HBPD 对应
- vfront-porch = <9>; //与 LCDTiming.VEPD 对应
- vsync-len = <4>; //与 LCDTiming.VsPW 对应
- vback-porch = <3>; //与 LCDTiming.VBPD 对应
- hsync-active = <0>;
- vsync-active = <0>;
- de-active = <0>;
- pixelclk-active = <0>;
- };
- };
-
- ports {
- #address-cells = <1>;
- #size-cells = <0>;
-
- port@0 {
- reg = <0>;
- panel_in_dsi1: endpoint {
- remote-endpoint = <&dsi1_out_panel>;
- };
- };
- };
- };
-
- ports {
- #address-cells = <1>;
- #size-cells = <0>;
-
- port@1 {
- reg = <1>;
- dsi1_out_panel: endpoint {
- remote-endpoint = <&panel_in_dsi1>;
- };
- };
- };
-
-};
+/*********************************************************************
+ * 立创开发板不靠卖板赚钱,以培养中国工程师为己任
+ * 泰山派软硬件资料与相关扩展板软硬件资料官网全部开源
+ * 开发板官网:www.lckfb.com
+ * 立创论坛:oshwhub.com/forum
+ * 关注B站:【立创开发板】,掌握我们的最新动态!
+ *********************************************************************
+ * 文件名:tspi-rk3566-dsi-v10.dtsi
+ * 描述:mipi 屏幕
+ * 更新:
+ * 时间 作者 联系 说明
+ * 2023-09-13 吴才成 1378913492@qq.com v1.0.0
+ * 2024-03-13 风漠兮 578118086@qq.com Fit CXN0102+ICN6211
+ *********************************************************************/
+&i2c1 {
+ status = "okay";
+ clock-frequency = <400000>;
+
+ cxn0102@77 {
+ status = "okay";
+ pinctrl-0 = <&cxn0102_gpio>;
+ compatible = "sony,cxn0102";
+ reg = <0x77>;
+ en-gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>;
+ irq-gpios = <&gpio1 RK_PA0 IRQ_TYPE_LEVEL_HIGH>;
+ fan-gpios = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
+ fan-mode = <0>;
+ fan-temperature-on = <45>;
+ fan-temperature-off = <35>;
+ };
+};
+
+
+&pinctrl {
+ dsi1 {
+ dsi1_rst_gpio: dsi1-rst-gpio {
+ rockchip,pins = <3 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ cxn0102_gpio: cxn0102-gpio {
+ rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_down>;
+ };
+ };
+};
+
+/*
+ * video_phy1 needs to be enabled
+ * when dsi1 is enabled
+ */
+&dsi1 {
+ status = "okay";
+};
+
+&dsi1_in_vp0 {
+ status = "disabled";
+};
+
+&dsi1_in_vp1 {
+ status = "okay";
+};
+
+&video_phy1 {
+ status = "okay";
+};
+
+&route_dsi1 {
+ status = "okay";//wucaicheng mipi okay
+ connect = <&vp1_out_dsi1>;
+};
+
+// CXN0102+ICN6211
+&dsi1 {
+ status = "okay";
+ rockchip,lane-rate = <594>;
+ dsi1_panel: panel@0 {
+ status = "okay";
+ compatible = "simple-panel-dsi";
+ reset-gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_LOW>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&dsi1_rst_gpio>;
+ reg = <0>;
+ reset-delay-ms = <50>;
+ enable-delay-ms = <10>;
+ prepare-delay-ms = <10>;
+ unprepare-delay-ms = <10>;
+ disable-delay-ms = <10>;
+ init-delay-ms = <10>;
+ dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
+ MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
+ dsi,format = <MIPI_DSI_FMT_RGB888>;
+ dsi,lanes = <4>;
+ panel-init-sequence = [
+ // init code
+ 23 01 02 7A C1
+ 23 01 02 20 00
+ 23 01 02 21 D0
+ 23 01 02 22 25
+ 23 01 02 23 6E
+ 23 01 02 24 28
+ 23 01 02 25 DC
+ 23 01 02 26 00
+ 23 01 02 27 05
+ 23 01 02 28 05
+ 23 01 02 29 14
+ 23 01 02 34 80
+ 23 01 02 36 6E
+ 23 01 02 B5 A0
+ 23 01 02 5C FF
+ 23 01 02 2A 07
+ 23 01 02 56 92
+ 23 01 02 6B 52
+ 23 01 02 69 20
+ 23 01 02 10 45
+ 23 01 02 11 88
+ 23 01 02 B6 20
+ 23 01 02 51 20
+ 23 01 02 09 10
+ ];
+
+ panel-exit-sequence = [];
+
+ disp_timings1: display-timings {
+ native-mode = <&dsi1_timing0>;
+ dsi1_timing0: timing0 {
+ clock-frequency = <74250000>;
+
+ hactive = <1280>;
+ hfront-porch = <110>;
+ hback-porch = <220>;
+ hsync-len = <40>;
+
+ vactive = <720>;
+ vfront-porch = <5>;
+ vback-porch = <20>;
+ vsync-len = <5>;
+
+ hsync-active = <0>;
+ vsync-active = <0>;
+ de-active = <0>;
+ pixelclk-active = <0>;
+ };
+ };
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ panel_in_dsi1: endpoint {
+ remote-endpoint = <&dsi1_out_panel>;
+ };
+ };
+ };
+ };
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@1 {
+ reg = <1>;
+ dsi1_out_panel: endpoint {
+ remote-endpoint = <&panel_in_dsi1>;
+ };
+ };
+ };
+
+};
diff --git a/arch/arm64/boot/dts/rockchip/tspi-rk3566-user-v10.dts b/arch/arm64/boot/dts/rockchip/tspi-rk3566-user-v10.dts
index bb7e7f13678c..a73f815444c4 100755
--- a/arch/arm64/boot/dts/rockchip/tspi-rk3566-user-v10.dts
+++ b/arch/arm64/boot/dts/rockchip/tspi-rk3566-user-v10.dts
@@ -32,28 +32,28 @@
// #include "tspi-rk3566-edp-v10.dtsi"
//【开/关】mipi 显示屏幕配置,用户可以基于此复制自己的屏幕,注意EDP与MIPI屏幕互斥,因为共用了VOP如果需要同显自行修改
-// #include "tspi-rk3566-dsi-v10.dtsi"
+#include "tspi-rk3566-dsi-v10.dtsi"
//【开/关】HDMI 显示屏幕配置,里面内容几乎可以不用动,如果不需要hdmi显示直接注释掉即可
-#include "tspi-rk3566-hdmi-v10.dtsi"
+// #include "tspi-rk3566-hdmi-v10.dtsi"
//【开/关】摄像头 目前视频的是ov5659
#include "tspi-rk3566-csi-v10.dtsi"
//【开/关】网口 扩展板上使用的是千兆网,不接扩展板情况下可以关闭
-// #include "tspi-rk3566-gmac1-v10.dtsi"
+#include "tspi-rk3566-gmac1-v10.dtsi"
//【开/关】下方是用户定义层,所有用户修改理论上在此下方修改就好了
/ {
model = "lckfb tspi V10 Board";
compatible = "lckfb,tspi-v10", "rockchip,rk3566";
- rk_headset: rk-headset {
- compatible = "rockchip_headset";
- headset_gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
- pinctrl-names = "default";
- pinctrl-0 = <&hp_det>;
- };
+ //rk_headset: rk-headset {
+ // compatible = "rockchip_headset";
+ // headset_gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
+ // pinctrl-names = "default";
+ // pinctrl-0 = <&hp_det>;
+ //};
leds: leds {
compatible = "gpio-leds";
@@ -79,13 +79,116 @@
linux,blink-delay-off = <1500>;
};
};
+
+ hdmi_in_check: hdmi-in-check {
+ compatible = "gpio-keys";
+ input-name = "hdmi-in-check";
+ status = "okay";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&hdmi_in_check_pin>;
+
+ check-key {
+ label = "hdmiin";
+ linux,code = <KEY_CAMERA>;
+ linux,input-type = <1>;
+ gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
+ gpio-key,wakeup;
+ debounce-interval = <15>;
+ };
+ };
+
+ gpio_key: gpio-key {
+ compatible = "gpio-keys";
+ input-name = "gpio-keys";
+ status = "okay";
+
+ menu-key {
+ label = "menu";
+ linux,code = <KEY_MENU>;
+ linux,input-type = <1>;
+ gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>;
+ debounce-interval = <15>;
+ };
+
+ back-key {
+ label = "back";
+ linux,code = <KEY_BACK>;
+ linux,input-type = <1>;
+ gpios = <&gpio3 RK_PC3 GPIO_ACTIVE_LOW>;
+ debounce-interval = <15>;
+ };
+
+ home-key {
+ label = "home";
+ linux,code = <KEY_HOMEPAGE>;
+ linux,input-type = <1>;
+ gpios = <&gpio3 RK_PC2 GPIO_ACTIVE_LOW>;
+ debounce-interval = <15>;
+ };
+
+ enter-key {
+ label = "enter";
+ linux,code = <KEY_ENTER>;
+ linux,input-type = <1>;
+ gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_LOW>;
+ debounce-interval = <15>;
+ };
+
+ up-key {
+ label = "up";
+ linux,code = <KEY_UP>;
+ linux,input-type = <1>;
+ gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_LOW>;
+ debounce-interval = <15>;
+ };
+
+ down-key {
+ label = "down";
+ linux,code = <KEY_DOWN>;
+ linux,input-type = <1>;
+ gpios = <&gpio3 RK_PA4 GPIO_ACTIVE_LOW>;
+ debounce-interval = <15>;
+ };
+
+ left-key {
+ label = "left";
+ linux,code = <KEY_LEFT>;
+ linux,input-type = <1>;
+ gpios = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>;
+ debounce-interval = <15>;
+ };
+
+ right-key {
+ label = "right";
+ linux,code = <KEY_RIGHT>;
+ linux,input-type = <1>;
+ gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_LOW>;
+ debounce-interval = <15>;
+ };
+
+ volup-key {
+ label = "volup";
+ linux,code = <KEY_VOLUMEUP>;
+ linux,input-type = <1>;
+ gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_LOW>;
+ debounce-interval = <15>;
+ };
+
+ voldown-key {
+ label = "voldown";
+ linux,code = <KEY_VOLUMEDOWN>;
+ linux,input-type = <1>;
+ gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_LOW>;
+ debounce-interval = <15>;
+ };
+ };
};
&pinctrl {
-
- headphone {
- hp_det: hp-det {
- rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
+ hdmiin {
+ hdmi_in_check_pin: hdmi-in-check-pin {
+ rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
};
@@ -96,9 +199,9 @@
};
//耳机插入检测,不使用扩展板情况需关闭,否则默认会检测到耳机插入
-&rk_headset {
- status = "disabled";
-};
+//&rk_headset {
+// status = "disabled";
+//};
//用户串口3
&uart3 {
@@ -182,26 +285,90 @@
//用户自定方法:adb设置输出日志并通过dmesg确定usercode=address与key_table=command
//echo 1 > sys/module/rockchip_pwm_remotectl/parameters/code_print
//键值可在 include/dt-bindings/input/linux-event-codes.h 中查找
+
+ // 百度影棒盒子
ir_key1 {
- rockchip,usercode = <0xff00>;
+ rockchip,usercode = <0x55AA>;
+ rockchip,key_table =
+ <0x63 KEY_POWER>,
+ <0x54 KEY_MENU>,
+ <0x4E KEY_BACK>,
+ <0x55 KEY_HOME>,
+ <0x4F KEY_ENTER>,
+ <0x53 KEY_UP>,
+ <0x52 KEY_DOWN>,
+ <0x51 KEY_LEFT>,
+ <0x50 KEY_RIGHT>,
+ <0x4C KEY_VOLUMEUP>,
+ <0x4B KEY_VOLUMEDOWN>;
+ };
+
+ // 华为盒子
+ ir_key2 {
+ rockchip,usercode = <0x4DB2>;
+ rockchip,key_table =
+ <0x23 KEY_POWER>,
+ <0x77 KEY_MENU>,
+ <0x3A KEY_BACK>,
+ <0x7D KEY_HOME>,
+ <0x31 KEY_ENTER>,
+ <0x35 KEY_UP>,
+ <0x2D KEY_DOWN>,
+ <0x66 KEY_LEFT>,
+ <0x3E KEY_RIGHT>,
+ <0x7F KEY_VOLUMEUP>,
+ <0x7E KEY_VOLUMEDOWN>;
+ };
+
+ // 爱奇艺盒子
+ ir_key3 {
+ rockchip,usercode = <0xFD01>;
+ rockchip,key_table =
+ <0x23 KEY_POWER>,
+ <0x6A KEY_MENU>,
+ <0x3A KEY_BACK>,
+ <0x67 KEY_HOME>,
+ <0x31 KEY_ENTER>,
+ <0x35 KEY_UP>,
+ <0x2D KEY_DOWN>,
+ <0x66 KEY_LEFT>,
+ <0x3E KEY_RIGHT>,
+ <0x7A KEY_VOLUMEUP>,
+ <0x79 KEY_VOLUMEDOWN>;
+ };
+
+ // 百视通盒子
+ ir_key4 {
+ rockchip,usercode = <0xFF00>;
+ rockchip,key_table =
+ <0xE3 KEY_POWER>,
+ <0xBE KEY_MENU>,
+ <0xF5 KEY_BACK>,
+ <0xB6 KEY_HOME>,
+ <0xF9 KEY_ENTER>,
+ <0xE5 KEY_UP>,
+ <0xB7 KEY_DOWN>,
+ <0xB8 KEY_LEFT>,
+ <0xF8 KEY_RIGHT>,
+ <0xB4 KEY_VOLUMEUP>,
+ <0xB0 KEY_VOLUMEDOWN>;
+ };
+
+ // 当贝盒子
+ ir_key5{
+ rockchip,usercode = <0xF708>;
rockchip,key_table =
- <0xf2 KEY_MENU>,
- <0xe9 KEY_BACK>,
- <0xe3 KEY_ENTER>,
- <0xe7 KEY_UP>,
- <0xad KEY_DOWN>,
- <0xf7 KEY_LEFT>,
- <0xa5 KEY_RIGHT>,
- <0xba KEY_1>,
- <0xb9 KEY_2>,
- <0xb8 KEY_3>,
- <0xbb KEY_4>,
- <0xbf KEY_5>,
- <0xbc KEY_6>,
- <0xf8 KEY_7>,
- <0xea KEY_8>,
- <0xf6 KEY_9>,
- <0xe6 KEY_0>;
+ <0xF4 KEY_POWER>,
+ <0xE8 KEY_MENU>,
+ <0xBE KEY_BACK>,
+ <0xBD KEY_HOME>,
+ <0xE1 KEY_ENTER>,
+ <0xED KEY_UP>,
+ <0xEC KEY_DOWN>,
+ <0xEA KEY_LEFT>,
+ <0xEB KEY_RIGHT>,
+ <0xF1 KEY_VOLUMEUP>,
+ <0xE3 KEY_VOLUMEDOWN>;
};
};
diff --git a/arch/arm64/configs/tspi_defconfig b/arch/arm64/configs/tspi_defconfig
index 6cd3c5e09934..d5c67599564f 100755
--- a/arch/arm64/configs/tspi_defconfig
+++ b/arch/arm64/configs/tspi_defconfig
@@ -951,3 +951,4 @@ CONFIG_SCHED_STACK_END_CHECK=y
# CONFIG_DEBUG_PREEMPT is not set
CONFIG_ENABLE_DEFAULT_TRACERS=y
CONFIG_BUG_ON_DATA_CORRUPTION=y
+CONFIG_DRM_SONY_CXN0102=y
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index e98100a8600f..f4d85b105145 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -340,6 +340,8 @@ source "drivers/gpu/drm/tve200/Kconfig"
source "drivers/gpu/drm/xen/Kconfig"
+source "drivers/gpu/drm/cxn0102/Kconfig"
+
# Keep legacy drivers last
menuconfig DRM_LEGACY
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 961e51134077..b882dbd56eec 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -97,6 +97,7 @@ obj-$(CONFIG_DRM_MESON) += meson/
obj-y += i2c/
obj-y += panel/
obj-y += bridge/
+obj-y += cxn0102/
obj-$(CONFIG_DRM_FSL_DCU) += fsl-dcu/
obj-$(CONFIG_DRM_ETNAVIV) += etnaviv/
obj-$(CONFIG_DRM_ARCPGU)+= arc/
diff --git a/drivers/gpu/drm/cxn0102/Kconfig b/drivers/gpu/drm/cxn0102/Kconfig
new file mode 100755
index 000000000000..eaeac9c344e6
--- /dev/null
+++ b/drivers/gpu/drm/cxn0102/Kconfig
@@ -0,0 +1,5 @@
+config DRM_SONY_CXN0102
+ tristate "Sony CXN0102 I2C Driver"
+ default n
+ help
+ Support for Sony CXN0102 I2C Port.
diff --git a/drivers/gpu/drm/cxn0102/Makefile b/drivers/gpu/drm/cxn0102/Makefile
new file mode 100755
index 000000000000..86d5d490794c
--- /dev/null
+++ b/drivers/gpu/drm/cxn0102/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_DRM_SONY_CXN0102) += cxn0102.o
diff --git a/drivers/gpu/drm/cxn0102/cxn0102.c b/drivers/gpu/drm/cxn0102/cxn0102.c
new file mode 100755
index 000000000000..82748ad6dbc4
--- /dev/null
+++ b/drivers/gpu/drm/cxn0102/cxn0102.c
@@ -0,0 +1,1786 @@
+#include <linux/module.h>
+#include <linux/i2c.h>
+#include <linux/input/mt.h>
+#include <linux/of_gpio.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/notifier.h>
+#include <linux/fb.h>
+#include <linux/string.h>
+#include <linux/timer.h>
+#include <linux/jiffies.h>
+
+#include "cxn0102.h"
+
+static struct workqueue_struct *cxn0102_wq;
+
+void func_timer_fan(struct timer_list *timer)
+{
+ struct sony_cxn0102_dev *cxn0102 = container_of(timer, struct sony_cxn0102_dev, timer_fan);
+ queue_work(cxn0102_wq, &cxn0102->work_fan);
+ mod_timer(&cxn0102->timer_fan, jiffies + 5 * HZ);
+}
+
+void func_work_fan(struct work_struct *work)
+{
+ struct sony_cxn0102_dev *cxn0102 = container_of(work, struct sony_cxn0102_dev, work_fan);
+ sony_cxn0102_get_temperature(cxn0102);
+}
+
+int sony_cxn0102_write(struct sony_cxn0102_dev *cxn0102, u8 addr, u8 *buf, u16 len)
+{
+ struct i2c_client *client = cxn0102->client;
+ struct i2c_msg msg;
+ u8 send_buf[16] = {0};
+ int ret;
+
+ send_buf[0] = addr;
+ memcpy(&send_buf[1], buf, len);
+
+ msg.flags = 0;
+ msg.addr = client->addr;
+ msg.buf = send_buf;
+ msg.len = len + 1;
+
+ ret = i2c_transfer(client->adapter, &msg, 1);
+ if (1 == ret)
+ return 0;
+ else
+ {
+ dev_err(&client->dev, "%s: write error, addr=0x%x@0x%x len=%d.\n",
+ __func__, addr, client->addr, len);
+ return -1;
+ }
+}
+
+void sony_cxn0102_start_fan(struct sony_cxn0102_dev *cxn0102)
+{
+ gpio_set_value_cansleep(cxn0102->fan_gpio, 1);
+}
+
+void sony_cxn0102_stop_fan(struct sony_cxn0102_dev *cxn0102)
+{
+ gpio_set_value_cansleep(cxn0102->fan_gpio, 0);
+}
+
+void sony_cxn0102_set_fan_mode(struct sony_cxn0102_dev *cxn0102, int mode)
+{
+ if (mode == 0)
+ {
+ // 自动模式
+ add_timer(&cxn0102->timer_fan);
+ cxn0102->fan_state = CXN0102_FAN_STATE_AUTO_OFF;
+ }
+ else if (mode == 1)
+ {
+ // 运行
+ del_timer(&cxn0102->timer_fan);
+ cxn0102->fan_state = CXN0102_FAN_STATE_MANUAL_ON;
+ sony_cxn0102_start_fan(cxn0102);
+ }
+ else
+ {
+ // 关停
+ del_timer(&cxn0102->timer_fan);
+ cxn0102->fan_state = CXN0102_FAN_STATE_MANUAL_OFF;
+ sony_cxn0102_stop_fan(cxn0102);
+ }
+}
+
+int sony_cxn0102_start_input(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_START_INPUT, &data, 1);
+}
+
+int sony_cxn0102_stop_input(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_STOP_INPUT, &data, 1);
+}
+
+int sony_cxn0102_shutdown(struct sony_cxn0102_dev *cxn0102)
+{
+ // 发送关闭输入指令,待响应后再发送关机指令
+ cxn0102->state = CXN0102_STATE_READY_SHUTDOWN;
+ return sony_cxn0102_stop_input(cxn0102);
+}
+
+int sony_cxn0102_reboot(struct sony_cxn0102_dev *cxn0102)
+{
+ // 发送关闭输入指令,待响应后再发送重启指令
+ cxn0102->state = CXN0102_STATE_READY_REBOOT;
+ return sony_cxn0102_stop_input(cxn0102);
+}
+
+int sony_cxn0102_poweron(struct sony_cxn0102_dev *cxn0102)
+{
+ if (cxn0102->state == CXN0102_STATE_SHUTDOWN)
+ {
+ gpio_set_value_cansleep(cxn0102->en_gpio, 1);
+ return 0;
+ }
+ return -1;
+}
+
+int sony_cxn0102_mute(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data[2] = {0x01, 0x01};
+ if (cxn0102->state == CXN0102_STATE_ACTIVE)
+ {
+ cxn0102->state = CXN0102_STATE_READY_MUTE;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_MUTE, data, 2);
+ }
+ return -1;
+}
+
+int sony_cxn0102_unmute(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data[2] = {0x01, 0x00};
+ if (cxn0102->state == CXN0102_STATE_ACTIVE)
+ {
+ cxn0102->state = CXN0102_STATE_READY_UNMUTE;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_MUTE, data, 2);
+ }
+ return -1;
+}
+
+int sony_cxn0102_save_user_param(struct sony_cxn0102_dev *cxn0102, u8 indicates1, u8 indicates2, u8 indicates3)
+{
+ u8 data[] = {0x05, 0x00, 0x00, indicates1, indicates2, indicates3};
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SAVE_USER_PARAM, data, 6);
+}
+
+int sony_cxn0102_init_user_param(struct sony_cxn0102_dev *cxn0102)
+{
+ cxn0102->state = CXN0102_STATE_READY_INIT;
+ return sony_cxn0102_stop_input(cxn0102);
+}
+
+int sony_cxn0102_get_video_position(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ cxn0102->pan = CXN0102_DEFAULT_VAL;
+ cxn0102->tilt = CXN0102_DEFAULT_VAL;
+ cxn0102->flip = CXN0102_DEFAULT_VAL;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_GET_VIDEO_POSITION, &data, 1);
+}
+
+int sony_cxn0102_set_video_position(struct sony_cxn0102_dev *cxn0102, u8 pan, u8 tilt, u8 flip)
+{
+ u8 data[] = {0x09, pan, tilt, flip, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00};
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_VIDEO_POSITION, data, 10);
+}
+
+int sony_cxn0102_get_optical_alignment(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ cxn0102->oao_r0_h = CXN0102_DEFAULT_VAL;
+ cxn0102->oao_r1_h = CXN0102_DEFAULT_VAL;
+ cxn0102->oao_g0_h = CXN0102_DEFAULT_VAL;
+ cxn0102->oao_g1_h = CXN0102_DEFAULT_VAL;
+ cxn0102->oao_b_h = CXN0102_DEFAULT_VAL;
+ cxn0102->oao_r0_v = CXN0102_DEFAULT_VAL;
+ cxn0102->oao_r1_v = CXN0102_DEFAULT_VAL;
+ cxn0102->oao_g0_v = CXN0102_DEFAULT_VAL;
+ cxn0102->oao_g1_v = CXN0102_DEFAULT_VAL;
+ cxn0102->oao_b_v = CXN0102_DEFAULT_VAL;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_GET_OPTICAL_ALIGNMENT, &data, 1);
+}
+
+int sony_cxn0102_set_optical_alignment(struct sony_cxn0102_dev *cxn0102,
+ u8 oao_r0_h, u8 oao_r1_h, u8 oao_g0_h, u8 oao_g1_h, u8 oao_b_h,
+ u8 oao_r0_v, u8 oao_r1_v, u8 oao_g0_v, u8 oao_g1_v, u8 oao_b_v)
+{
+ u8 data[] = {0x0D, oao_r0_h, oao_r1_h, oao_g0_h, oao_g1_h, oao_b_h, oao_r0_v, oao_r1_v, oao_g0_v, oao_g1_v, oao_b_v, 0x00, 0x00, 0x00};
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_OPTICAL_ALIGNMENT, data, 14);
+}
+
+int sony_cxn0102_get_biphase(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ cxn0102->biphase = CXN0102_DEFAULT_VAL;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_GET_BIPHASE, &data, 1);
+}
+
+int sony_cxn0102_set_biphase(struct sony_cxn0102_dev *cxn0102, u32 biphase)
+{
+ u8 data[] = {0x04, biphase & 0xFF, (biphase >> 8) & 0xFF, (biphase >> 16) & 0xFF, (biphase >> 24) & 0xFF};
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_BIPHASE, data, 5);
+}
+
+int sony_cxn0102_opt_adj_start(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ if (cxn0102->state == CXN0102_STATE_ACTIVE)
+ {
+ cxn0102->state = CXN0102_STATE_READY_OPTICAL;
+ return sony_cxn0102_stop_input(cxn0102);
+ }
+ else
+ {
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_EASY_OPT_ADJ_CONTROL, &data, 1);
+ }
+}
+
+int sony_cxn0102_opt_adj_plus(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_EASY_OPT_ADJ_PLUS, &data, 1);
+}
+
+int sony_cxn0102_opt_adj_minus(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_EASY_OPT_ADJ_MINUS, &data, 1);
+}
+
+int sony_cxn0102_opt_adj_exit(struct sony_cxn0102_dev *cxn0102, u8 save)
+{
+ u8 data[] = {0x01, save};
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_EASY_OPT_ADJ_EXIT, data, 2);
+}
+
+int sony_cxn0102_biphase_start(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ if (cxn0102->state == CXN0102_STATE_ACTIVE)
+ {
+ cxn0102->state = CXN0102_STATE_READY_BIPHASE;
+ return sony_cxn0102_stop_input(cxn0102);
+ }
+ else
+ {
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_EASY_BIPHASE_CONTROL, &data, 1);
+ }
+}
+
+int sony_cxn0102_biphase_plus(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_EASY_BIPHASE_PLUS, &data, 1);
+}
+
+int sony_cxn0102_biphase_minus(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_EASY_BIPHASE_MINUS, &data, 1);
+}
+
+int sony_cxn0102_biphase_exit(struct sony_cxn0102_dev *cxn0102, u8 save)
+{
+ u8 data[] = {0x01, save};
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_EASY_BIPHASE_EXIT, data, 2);
+}
+
+int sony_cxn0102_get_all_pq(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ cxn0102->contrast = CXN0102_DEFAULT_VAL;
+ cxn0102->brightness = CXN0102_DEFAULT_VAL;
+ cxn0102->hue_u = CXN0102_DEFAULT_VAL;
+ cxn0102->hue_v = CXN0102_DEFAULT_VAL;
+ cxn0102->saturation_u = CXN0102_DEFAULT_VAL;
+ cxn0102->saturation_v = CXN0102_DEFAULT_VAL;
+ cxn0102->sharpness = CXN0102_DEFAULT_VAL;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_GET_ALL_PQ, &data, 1);
+}
+
+int sony_cxn0102_set_all_pq(struct sony_cxn0102_dev *cxn0102, int8_t contrast, int8_t brightness, int8_t hue_u, int8_t hue_v, int8_t saturation_u, int8_t saturation_v, int8_t sharpness)
+{
+ u8 data[] = {0x09, (u8)contrast, (u8)brightness, (u8)hue_u, (u8)hue_v, (u8)saturation_u, (u8)saturation_v, 0x00, (u8)sharpness, 0x00};
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_ALL_PQ, data, 10);
+}
+
+int sony_cxn0102_get_brightness(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ cxn0102->brightness = CXN0102_DEFAULT_VAL;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_GET_BRIGHTNESS, &data, 1);
+}
+
+int sony_cxn0102_set_brightness(struct sony_cxn0102_dev *cxn0102, int8_t brightness)
+{
+ u8 data[] = {0x01, (u8)brightness};
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_BRIGHTNESS, data, 2);
+}
+
+int sony_cxn0102_get_contrast(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ cxn0102->contrast = CXN0102_DEFAULT_VAL;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_GET_CONTRAST, &data, 1);
+}
+
+int sony_cxn0102_set_contrast(struct sony_cxn0102_dev *cxn0102, int8_t contrast)
+{
+ u8 data[] = {0x01, (u8)contrast};
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_CONTRAST, data, 2);
+}
+
+int sony_cxn0102_get_hue(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ cxn0102->hue_u = CXN0102_DEFAULT_VAL;
+ cxn0102->hue_v = CXN0102_DEFAULT_VAL;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_GET_HUE, &data, 1);
+}
+
+int sony_cxn0102_set_hue(struct sony_cxn0102_dev *cxn0102, int8_t hue_u, int8_t hue_v)
+{
+ u8 data[] = {0x02, (u8)hue_u, (u8)hue_v};
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_HUE, data, 3);
+}
+
+int sony_cxn0102_get_saturation(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ cxn0102->saturation_u = CXN0102_DEFAULT_VAL;
+ cxn0102->saturation_v = CXN0102_DEFAULT_VAL;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_GET_SATURATION, &data, 1);
+}
+
+int sony_cxn0102_set_saturation(struct sony_cxn0102_dev *cxn0102, int8_t saturation_u, int8_t saturation_v)
+{
+ u8 data[] = {0x02, (u8)saturation_u, (u8)saturation_v};
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_SATURATION, data, 3);
+}
+
+int sony_cxn0102_get_sharpness(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ cxn0102->sharpness = CXN0102_DEFAULT_VAL;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_GET_SHARPNESS, &data, 1);
+}
+
+int sony_cxn0102_set_sharpness(struct sony_cxn0102_dev *cxn0102, int8_t sharpness)
+{
+ u8 data[] = {0x01, (u8)sharpness};
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_SHARPNESS, data, 2);
+}
+
+int sony_cxn0102_get_temperature(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ cxn0102->temperature = CXN0102_DEFAULT_VAL;
+ cxn0102->temperature_mute = CXN0102_DEFAULT_VAL;
+ cxn0102->temperature_stop = CXN0102_DEFAULT_VAL;
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_GET_TEMPERATURE, &data, 1);
+}
+
+int sony_cxn0102_get_version(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ strcpy(cxn0102->version_firmware, "");
+ strcpy(cxn0102->version_parameter, "");
+ strcpy(cxn0102->version_data, "");
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_GET_VERSION, &data, 1);
+}
+
+int sony_cxn0102_get_sn(struct sony_cxn0102_dev *cxn0102)
+{
+ u8 data = 0x00;
+ strcpy(cxn0102->sn, "");
+ return sony_cxn0102_write(cxn0102, CXN0102_CMD_GET_SERIAL_NUMBER, &data, 1);
+}
+
+// 中断
+static irqreturn_t sony_cxn0102_isr(int irq, void *dev_id)
+{
+ struct sony_cxn0102_dev *cxn0102 = dev_id;
+ int ret;
+ u8 rdbuf[16] = {0};
+ u8 data[16] = {0};
+
+ /* 从cxn0102读16个寄存器 */
+ struct i2c_client *client = cxn0102->client;
+ struct i2c_msg msg;
+ msg.flags = I2C_M_RD;
+ msg.addr = client->addr;
+ msg.buf = rdbuf;
+ msg.len = 16;
+ ret = i2c_transfer(client->adapter, &msg, 1);
+ if (ret > 0)
+ {
+ /* 判断事件 */
+ switch (rdbuf[0])
+ {
+ case CXN0102_CMD_BOOT:
+ if (rdbuf[1] == 0x01 && rdbuf[2] == 0x00)
+ {
+ // Boot Completed Notify
+ dev_info(&client->dev, "%s: Boot Completed.\n", __func__);
+ cxn0102->state = CXN0102_STATE_READY;
+ sony_cxn0102_start_input(cxn0102);
+ sony_cxn0102_set_fan_mode(cxn0102, cxn0102->fan_mode);
+ }
+ break;
+ case CXN0102_CMD_START_INPUT:
+ if (rdbuf[1] == 0x01 && rdbuf[2] == 0x00)
+ {
+ // Start Input
+ cxn0102->state = CXN0102_STATE_ACTIVE;
+ dev_info(&client->dev, "%s: Start Input.\n", __func__);
+ }
+ break;
+ case CXN0102_CMD_STOP_INPUT:
+ if (rdbuf[1] == 0x01 && rdbuf[2] == 0x00)
+ {
+ // Stop Input
+ dev_info(&client->dev, "%s: Stop Input.\n", __func__);
+ switch (cxn0102->state)
+ {
+ case CXN0102_STATE_READY_SHUTDOWN: // 准备关机
+ data[0] = 0x01;
+ data[1] = 0x00;
+ sony_cxn0102_write(cxn0102, CXN0102_CMD_SHUTDOWN_REBOOT, data, 2);
+ break;
+ case CXN0102_STATE_READY_REBOOT: // 准备重启
+ data[0] = 0x01;
+ data[1] = 0x01;
+ sony_cxn0102_write(cxn0102, CXN0102_CMD_SHUTDOWN_REBOOT, data, 2);
+ break;
+ case CXN0102_STATE_READY_BIPHASE: // 光机准备相位校准
+ data[0] = 0x00;
+ sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_EASY_BIPHASE_CONTROL, data, 1);
+ break;
+ case CXN0102_STATE_READY_OPTICAL: // 光机准备光轴校准
+ data[0] = 0x00;
+ sony_cxn0102_write(cxn0102, CXN0102_CMD_SET_EASY_OPT_ADJ_CONTROL, data, 1);
+ break;
+ case CXN0102_STATE_READY_INIT: // 光机准备进入初始化
+ data[0] = 0x00;
+ sony_cxn0102_write(cxn0102, CXN0102_CMD_INIT_USER_PARAM, data, 1);
+ break;
+ default:
+ cxn0102->state = CXN0102_STATE_READY;
+ break;
+ }
+ }
+ break;
+ case CXN0102_CMD_SAVE_USER_PARAM:
+ if (rdbuf[1] == 0x01 && rdbuf[2] == 0x00)
+ {
+ dev_info(&client->dev, "%s: User Param save success.\n", __func__);
+ }
+ break;
+ case CXN0102_CMD_INIT_USER_PARAM:
+ if (rdbuf[1] == 0x01 && rdbuf[2] == 0x00)
+ {
+ dev_info(&client->dev, "%s: User Param Initialize success.\n", __func__);
+ }
+ sony_cxn0102_start_input(cxn0102);
+ break;
+ case CXN0102_CMD_SHUTDOWN_REBOOT:
+ if (rdbuf[1] == 0x01 && rdbuf[2] == 0x00)
+ {
+ // Shutdown and Reboot
+ dev_info(&client->dev, "%s: Shutdown or reboot success.\n", __func__);
+ // 关掉自动风扇控制
+ sony_cxn0102_set_fan_mode(cxn0102, 2);
+ switch (cxn0102->state)
+ {
+ case CXN0102_STATE_READY_SHUTDOWN: // 准备关机
+ cxn0102->state = CXN0102_STATE_SHUTDOWN;
+ // 下拉EN引脚
+ gpio_set_value_cansleep(cxn0102->en_gpio, 0);
+ break;
+ case CXN0102_STATE_READY_REBOOT: // 准备重启
+ cxn0102->state = CXN0102_STATE_REBOOT;
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ case CXN0102_CMD_MUTE:
+ if (rdbuf[1] == 0x01 && rdbuf[2] == 0x00)
+ {
+ dev_info(&client->dev, "%s: Mute control success.\n", __func__);
+ switch (cxn0102->state)
+ {
+ case CXN0102_STATE_READY_MUTE: // 光机准备黑屏
+ cxn0102->state = CXN0102_STATE_MUTE;
+ break;
+ case CXN0102_STATE_READY_UNMUTE: // 光机准备解除黑屏
+ cxn0102->state = CXN0102_STATE_ACTIVE;
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ case CXN0102_CMD_GET_VIDEO_POSITION:
+ if (rdbuf[1] == 0x0A && rdbuf[2] == 0x00)
+ {
+ cxn0102->pan = rdbuf[3];
+ cxn0102->tilt = rdbuf[4];
+ cxn0102->flip = rdbuf[5];
+ dev_info(&client->dev, "%s: pan: %d\n", __func__, cxn0102->pan);
+ dev_info(&client->dev, "%s: tilt: %d\n", __func__, cxn0102->tilt);
+ dev_info(&client->dev, "%s: flip: %d\n", __func__, cxn0102->flip);
+ }
+ break;
+ case CXN0102_CMD_SET_VIDEO_POSITION:
+ if (rdbuf[1] == 0x01)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_VIDEO_POSITION success.\n", __func__);
+ sony_cxn0102_get_video_position(cxn0102);
+ }
+ break;
+ case CXN0102_CMD_GET_OPTICAL_ALIGNMENT:
+ if (rdbuf[1] == 0x0E && rdbuf[2] == 0x00)
+ {
+ cxn0102->oao_r0_h = rdbuf[3];
+ cxn0102->oao_r1_h = rdbuf[4];
+ cxn0102->oao_g0_h = rdbuf[5];
+ cxn0102->oao_g1_h = rdbuf[6];
+ cxn0102->oao_b_h = rdbuf[7];
+ cxn0102->oao_r0_v = rdbuf[8];
+ cxn0102->oao_r1_v = rdbuf[9];
+ cxn0102->oao_g0_v = rdbuf[10];
+ cxn0102->oao_g1_v = rdbuf[11];
+ cxn0102->oao_b_v = rdbuf[12];
+ dev_info(&client->dev, "%s: oao_r0_h: %d\n", __func__, cxn0102->oao_r0_h);
+ dev_info(&client->dev, "%s: oao_r1_h: %d\n", __func__, cxn0102->oao_r1_h);
+ dev_info(&client->dev, "%s: oao_g0_h: %d\n", __func__, cxn0102->oao_g0_h);
+ dev_info(&client->dev, "%s: oao_g1_h: %d\n", __func__, cxn0102->oao_g1_h);
+ dev_info(&client->dev, "%s: oao_b_h: %d\n", __func__, cxn0102->oao_b_h);
+ dev_info(&client->dev, "%s: oao_r0_v: %d\n", __func__, cxn0102->oao_r0_v);
+ dev_info(&client->dev, "%s: oao_r1_v: %d\n", __func__, cxn0102->oao_r1_v);
+ dev_info(&client->dev, "%s: oao_g0_v: %d\n", __func__, cxn0102->oao_g0_v);
+ dev_info(&client->dev, "%s: oao_g1_v: %d\n", __func__, cxn0102->oao_g1_v);
+ dev_info(&client->dev, "%s: oao_b_v: %d\n", __func__, cxn0102->oao_b_v);
+ if (cxn0102->state == CXN0102_STATE_OPTICAL)
+ sony_cxn0102_start_input(cxn0102);
+ }
+ break;
+ case CXN0102_CMD_SET_OPTICAL_ALIGNMENT:
+ if (rdbuf[1] == 0x01)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_OPTICAL_ALIGNMENT success.\n", __func__);
+ sony_cxn0102_get_optical_alignment(cxn0102);
+ }
+ break;
+ case CXN0102_CMD_GET_BIPHASE:
+ if (rdbuf[1] == 0x05 && rdbuf[2] == 0x00)
+ {
+ cxn0102->biphase = (u32)rdbuf[3] + (u32)rdbuf[4] * 0xFF + (u32)rdbuf[5] * 0xFFFF + (u32)rdbuf[6] * 0xFFFFFF;
+ dev_info(&client->dev, "%s: biphase: 0x%08x\n", __func__, cxn0102->biphase);
+ if (cxn0102->state == CXN0102_STATE_BIPHASE)
+ sony_cxn0102_start_input(cxn0102);
+ }
+ break;
+ case CXN0102_CMD_SET_BIPHASE:
+ if (rdbuf[1] == 0x01)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_BIPHASE success.\n", __func__);
+ sony_cxn0102_get_biphase(cxn0102);
+ }
+ break;
+ case CXN0102_CMD_SET_EASY_OPT_ADJ_CONTROL:
+ if (rdbuf[1] == 0x01)
+ {
+ if (rdbuf[2] == 0x00)
+ {
+ cxn0102->state = CXN0102_STATE_OPTICAL;
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_EASY_OPT_ADJ_CONTROL success.\n", __func__);
+ }
+ else if (rdbuf[2] == 0x01)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_EASY_OPT_ADJ_CONTROL completed.\n", __func__);
+ sony_cxn0102_get_optical_alignment(cxn0102);
+ }
+ }
+ break;
+ case CXN0102_CMD_SET_EASY_OPT_ADJ_PLUS:
+ if (rdbuf[1] == 0x01)
+ {
+ if (rdbuf[2] == 0x00)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_EASY_OPT_ADJ_PLUS success.\n", __func__);
+ }
+ else if (rdbuf[2] == 0xFE)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_EASY_OPT_ADJ_PLUS limit exceeded.\n", __func__);
+ }
+ }
+ break;
+ case CXN0102_CMD_SET_EASY_OPT_ADJ_MINUS:
+ if (rdbuf[1] == 0x01)
+ {
+ if (rdbuf[2] == 0x00)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_EASY_OPT_ADJ_MINUS success.\n", __func__);
+ }
+ else if (rdbuf[2] == 0xFE)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_EASY_OPT_ADJ_MINUS limit exceeded.\n", __func__);
+ }
+ }
+ break;
+ case CXN0102_CMD_SET_EASY_OPT_ADJ_EXIT:
+ if (rdbuf[1] == 0x01)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_EASY_OPT_ADJ_EXIT success.\n", __func__);
+ sony_cxn0102_get_optical_alignment(cxn0102);
+ }
+ break;
+ case CXN0102_CMD_SET_EASY_BIPHASE_CONTROL:
+ if (rdbuf[1] == 0x01)
+ {
+ if (rdbuf[2] == 0x00)
+ {
+ cxn0102->state = CXN0102_STATE_BIPHASE;
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_EASY_BIPHASE_CONTROL success.\n", __func__);
+ }
+ else if (rdbuf[2] == 0x01)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_EASY_BIPHASE_CONTROL completed.\n", __func__);
+ sony_cxn0102_get_biphase(cxn0102);
+ }
+ }
+ break;
+ case CXN0102_CMD_SET_EASY_BIPHASE_PLUS:
+ if (rdbuf[1] == 0x01)
+ {
+ if (rdbuf[2] == 0x00)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_EASY_BIPHASE_PLUS success.\n", __func__);
+ }
+ else if (rdbuf[2] == 0xFE)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_EASY_BIPHASE_PLUS limit exceeded.\n", __func__);
+ }
+ }
+ break;
+ case CXN0102_CMD_SET_EASY_BIPHASE_MINUS:
+ if (rdbuf[1] == 0x01)
+ {
+ if (rdbuf[2] == 0x00)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_EASY_BIPHASE_MINUS success.\n", __func__);
+ }
+ else if (rdbuf[2] == 0xFE)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_EASY_BIPHASE_MINUS limit exceeded.\n", __func__);
+ }
+ }
+ break;
+ case CXN0102_CMD_SET_EASY_BIPHASE_EXIT:
+ if (rdbuf[1] == 0x01)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_EASY_BIPHASE_EXIT success.\n", __func__);
+ sony_cxn0102_get_biphase(cxn0102);
+ }
+ break;
+ case CXN0102_CMD_GET_ALL_PQ:
+ if (rdbuf[1] == 0x0A && rdbuf[2] == 0x00)
+ {
+ cxn0102->contrast = rdbuf[3];
+ cxn0102->brightness = rdbuf[4];
+ cxn0102->hue_u = rdbuf[5];
+ cxn0102->hue_v = rdbuf[6];
+ cxn0102->saturation_u = rdbuf[7];
+ cxn0102->saturation_v = rdbuf[8];
+ cxn0102->sharpness = rdbuf[10];
+ dev_info(&client->dev, "%s: contrast: %d\n", __func__, cxn0102->contrast);
+ dev_info(&client->dev, "%s: brightness: %d\n", __func__, cxn0102->brightness);
+ dev_info(&client->dev, "%s: hue_u: %d\n", __func__, cxn0102->hue_u);
+ dev_info(&client->dev, "%s: hue_v: %d\n", __func__, cxn0102->hue_v);
+ dev_info(&client->dev, "%s: saturation_u: %d\n", __func__, cxn0102->saturation_u);
+ dev_info(&client->dev, "%s: saturation_v: %d\n", __func__, cxn0102->saturation_v);
+ dev_info(&client->dev, "%s: sharpness: %d\n", __func__, cxn0102->sharpness);
+ }
+ break;
+ case CXN0102_CMD_SET_ALL_PQ:
+ if (rdbuf[1] == 0x01)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_ALL_PQ success.\n", __func__);
+ sony_cxn0102_get_all_pq(cxn0102);
+ }
+ break;
+ case CXN0102_CMD_GET_BRIGHTNESS:
+ if (rdbuf[1] == 0x02 && rdbuf[2] == 0x00)
+ {
+ cxn0102->brightness = rdbuf[3];
+ dev_info(&client->dev, "%s: brightness: %d\n", __func__, cxn0102->brightness);
+ }
+ break;
+ case CXN0102_CMD_SET_BRIGHTNESS:
+ if (rdbuf[1] == 0x01)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_BRIGHTNESS success.\n", __func__);
+ sony_cxn0102_get_brightness(cxn0102);
+ }
+ break;
+ case CXN0102_CMD_GET_CONTRAST:
+ if (rdbuf[1] == 0x02 && rdbuf[2] == 0x00)
+ {
+ cxn0102->contrast = rdbuf[3];
+ dev_info(&client->dev, "%s: contrast: %d\n", __func__, cxn0102->contrast);
+ }
+ break;
+ case CXN0102_CMD_SET_CONTRAST:
+ if (rdbuf[1] == 0x01)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_CONTRAST success.\n", __func__);
+ sony_cxn0102_get_contrast(cxn0102);
+ }
+ break;
+ case CXN0102_CMD_GET_HUE:
+ if (rdbuf[1] == 0x03 && rdbuf[2] == 0x00)
+ {
+ cxn0102->hue_u = rdbuf[3];
+ cxn0102->hue_v = rdbuf[4];
+ dev_info(&client->dev, "%s: hue_u: %d\n", __func__, cxn0102->hue_u);
+ dev_info(&client->dev, "%s: hue_v: %d\n", __func__, cxn0102->hue_v);
+ }
+ break;
+ case CXN0102_CMD_SET_HUE:
+ if (rdbuf[1] == 0x01)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_HUE success.\n", __func__);
+ sony_cxn0102_get_hue(cxn0102);
+ }
+ break;
+ case CXN0102_CMD_GET_SATURATION:
+ if (rdbuf[1] == 0x03 && rdbuf[2] == 0x00)
+ {
+ cxn0102->saturation_u = rdbuf[3];
+ cxn0102->saturation_v = rdbuf[4];
+ dev_info(&client->dev, "%s: saturation_u: %d\n", __func__, cxn0102->saturation_u);
+ dev_info(&client->dev, "%s: saturation_v: %d\n", __func__, cxn0102->saturation_v);
+ }
+ break;
+ case CXN0102_CMD_SET_SATURATION:
+ if (rdbuf[1] == 0x01)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_SATURATION success.\n", __func__);
+ sony_cxn0102_get_saturation(cxn0102);
+ }
+ break;
+ case CXN0102_CMD_GET_SHARPNESS:
+ if (rdbuf[1] == 0x02 && rdbuf[2] == 0x00)
+ {
+ cxn0102->sharpness = rdbuf[3];
+ dev_info(&client->dev, "%s: sharpness: %d\n", __func__, cxn0102->sharpness);
+ }
+ break;
+ case CXN0102_CMD_SET_SHARPNESS:
+ if (rdbuf[1] == 0x01)
+ {
+ dev_info(&client->dev, "%s: CXN0102_CMD_SET_SHARPNESS success.\n", __func__);
+ sony_cxn0102_get_sharpness(cxn0102);
+ }
+ break;
+ case CXN0102_CMD_GET_TEMPERATURE:
+ if (rdbuf[1] == 0x04 && rdbuf[2] == 0x00)
+ {
+ cxn0102->temperature = rdbuf[3];
+ cxn0102->temperature_mute = rdbuf[4];
+ cxn0102->temperature_stop = rdbuf[5];
+ dev_info(&client->dev, "%s: Module temperature: %d\n", __func__, cxn0102->temperature);
+ dev_info(&client->dev, "%s: Mute switching threshold temperature: %d\n", __func__, cxn0102->temperature_mute);
+ dev_info(&client->dev, "%s: System stop threshold temperature: %d\n", __func__, cxn0102->temperature_stop);
+ if (cxn0102->fan_state == CXN0102_FAN_STATE_AUTO_ON || cxn0102->fan_state == CXN0102_FAN_STATE_AUTO_OFF)
+ {
+ if (cxn0102->temperature >= cxn0102->fan_temperature_on)
+ {
+ sony_cxn0102_start_fan(cxn0102);
+ cxn0102->fan_state = CXN0102_FAN_STATE_AUTO_ON;
+ }
+ else if (cxn0102->temperature <= cxn0102->fan_temperature_off)
+ {
+ sony_cxn0102_stop_fan(cxn0102);
+ cxn0102->fan_state = CXN0102_FAN_STATE_AUTO_OFF;
+ }
+ }
+ }
+ break;
+ case CXN0102_CMD_GET_VERSION:
+ if (rdbuf[1] == 0x0D && rdbuf[2] == 0x00)
+ {
+ sprintf(cxn0102->version_firmware, "%c%c%c%c", rdbuf[3], rdbuf[4], rdbuf[5], rdbuf[6]);
+ sprintf(cxn0102->version_parameter, "%c%c%c%c", rdbuf[7], rdbuf[8], rdbuf[9], rdbuf[10]);
+ sprintf(cxn0102->version_data, "%c%c%c%c", rdbuf[11], rdbuf[12], rdbuf[13], rdbuf[14]);
+ dev_info(&client->dev, "%s: Firmware Version: %s\n", __func__, cxn0102->version_firmware);
+ dev_info(&client->dev, "%s: Parameter Version: %s\n", __func__, cxn0102->version_parameter);
+ dev_info(&client->dev, "%s: Data Version: %s\n", __func__, cxn0102->version_data);
+ }
+ break;
+ case CXN0102_CMD_GET_SERIAL_NUMBER:
+ if (rdbuf[1] == 0x09)
+ {
+ sprintf(cxn0102->sn, "%02X%02X%02X%02X%02X%02X%02X%02X", rdbuf[5], rdbuf[4], rdbuf[3], rdbuf[2], rdbuf[9], rdbuf[8], rdbuf[7], rdbuf[6]);
+ dev_info(&client->dev, "%s: Got sn: %s\n", __func__, cxn0102->sn);
+ }
+ break;
+ }
+ }
+ else
+ {
+ dev_err(&client->dev, "%s: i2c read error, ret=%d.\n", __func__, ret);
+ goto out;
+ }
+
+out:
+ return IRQ_HANDLED;
+}
+
+// frame buffer notifier callback
+static int cxn0102_fb_notifier_callback(struct notifier_block *noti, unsigned long event, void *data)
+{
+ struct fb_event *ev_data = data;
+ int *blank;
+ struct sony_cxn0102_dev *cxn0102 = container_of(noti, struct sony_cxn0102_dev, notifier);
+
+ if (ev_data && ev_data->data && event == FB_EVENT_BLANK && cxn0102 && cxn0102->client)
+ {
+ blank = ev_data->data;
+ if (*blank == FB_BLANK_UNBLANK)
+ {
+ dev_info(&cxn0102->client->dev, "%s: Resume by fb notifier.\n", __func__);
+ sony_cxn0102_poweron(cxn0102);
+ }
+ else if (*blank == FB_BLANK_POWERDOWN)
+ {
+ dev_info(&cxn0102->client->dev, "%s: Suspend by fb notifier.\n", __func__);
+ sony_cxn0102_shutdown(cxn0102);
+ }
+ }
+
+ return 0;
+}
+
+// 返回风扇状态
+static ssize_t cxn_state_fan_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ sprintf(buf, "%d\n", cxn0102->fan_state);
+ return strlen(buf) + 1;
+}
+
+// 风扇状态控制
+static ssize_t cxn_state_fan_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
+{
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ int state;
+ if (kstrtoint(buf, 0, &state))
+ goto out;
+ sony_cxn0102_set_fan_mode(cxn0102, state);
+ return size;
+
+out:
+ pr_err("wrong state value input\n");
+ return size;
+}
+
+// 返回光机状态
+static ssize_t cxn_state_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ sprintf(buf, "%d\n", cxn0102->state);
+ return strlen(buf) + 1;
+}
+
+// 光机状态控制
+static ssize_t cxn_state_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
+{
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ int state;
+ if (kstrtoint(buf, 0, &state))
+ goto out;
+ switch (state)
+ {
+ case 0: // 关输入
+ sony_cxn0102_stop_input(cxn0102);
+ break;
+ case 1: // 开输入
+ sony_cxn0102_start_input(cxn0102);
+ break;
+ case 2: // 关机
+ sony_cxn0102_shutdown(cxn0102);
+ break;
+ case 3: // 重启
+ sony_cxn0102_reboot(cxn0102);
+ break;
+ case 4: // 开机
+ sony_cxn0102_poweron(cxn0102);
+ break;
+ case 5: // 黑屏
+ sony_cxn0102_mute(cxn0102);
+ break;
+ case 6: // 解除黑屏
+ sony_cxn0102_unmute(cxn0102);
+ break;
+ default:
+ goto out;
+ break;
+ }
+
+ return size;
+out:
+ pr_err("wrong state value input\n");
+ return size;
+}
+
+// 获取光机SN
+static ssize_t cxn_sn_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ int i = 0;
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ sony_cxn0102_get_sn(cxn0102);
+ while (strlen(cxn0102->sn) == 0 && i < 100)
+ {
+ msleep(50);
+ i++;
+ }
+ sprintf(buf, "%s\n", cxn0102->sn);
+ return strlen(buf) + 1;
+}
+
+// 获取光机温度
+static ssize_t cxn_temperature_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ int i = 0;
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ sony_cxn0102_get_temperature(cxn0102);
+ while (cxn0102->temperature == CXN0102_DEFAULT_VAL && cxn0102->temperature_mute == CXN0102_DEFAULT_VAL && cxn0102->temperature_stop == CXN0102_DEFAULT_VAL && i < 100)
+ {
+ msleep(50);
+ i++;
+ }
+ sprintf(buf, "%d,%d,%d\n", cxn0102->temperature, cxn0102->temperature_mute, cxn0102->temperature_stop);
+ return strlen(buf) + 1;
+}
+
+// 获取光机版本
+static ssize_t cxn_version_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ int i = 0;
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ sony_cxn0102_get_version(cxn0102);
+ while (strlen(cxn0102->version_firmware) == 0 && strlen(cxn0102->version_parameter) == 0 && strlen(cxn0102->version_data) == 0 && i < 100)
+ {
+ msleep(50);
+ i++;
+ }
+ sprintf(buf, "%s.%s.%s\n", cxn0102->version_firmware, cxn0102->version_parameter, cxn0102->version_data);
+ return strlen(buf) + 1;
+}
+
+// 获取光机画面质量设置
+static ssize_t cxn_pq_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ int i = 0;
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ sony_cxn0102_get_all_pq(cxn0102);
+ while (cxn0102->contrast == CXN0102_DEFAULT_VAL &&
+ cxn0102->brightness == CXN0102_DEFAULT_VAL &&
+ cxn0102->hue_u == CXN0102_DEFAULT_VAL &&
+ cxn0102->hue_v == CXN0102_DEFAULT_VAL &&
+ cxn0102->saturation_u == CXN0102_DEFAULT_VAL &&
+ cxn0102->saturation_v == CXN0102_DEFAULT_VAL &&
+ cxn0102->sharpness == CXN0102_DEFAULT_VAL &&
+ i < 100)
+ {
+ msleep(50);
+ i++;
+ }
+ sprintf(buf, "%d,%d,%d,%d,%d,%d,%d\n", cxn0102->contrast, cxn0102->brightness,
+ cxn0102->hue_u, cxn0102->hue_v,
+ cxn0102->saturation_u, cxn0102->saturation_v,
+ cxn0102->sharpness);
+ return strlen(buf) + 1;
+}
+
+// 设置光机所有画面质量设置
+static ssize_t cxn_pq_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
+{
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ const char *delimiters = ",";
+ int contrast = 0, brightness = 0, hue_u = 0, hue_v = 0, saturation_u = 0, saturation_v = 0, sharpness = 0;
+ char *tmp = kmalloc(sizeof(char), 32);
+ char *data;
+
+ memset(tmp, 0, 32);
+ strncpy(tmp, buf, size);
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &contrast) || contrast > 15 || contrast < -15)
+ {
+ pr_err("wrong contrast value input, range is <-15, 15>\n");
+ goto out;
+ }
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &brightness) || brightness > 31 || brightness < -31)
+ {
+ pr_err("wrong brightness value input, range is <-31, 31>\n");
+ goto out;
+ }
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &hue_u) || hue_u > 15 || hue_u < -15)
+ {
+ pr_err("wrong hue_u value input, range is <-15, 15>\n");
+ goto out;
+ }
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &hue_v) || hue_v > 15 || hue_v < -15)
+ {
+ pr_err("wrong hue_v value input, range is <-15, 15>\n");
+ goto out;
+ }
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &saturation_u) || saturation_u > 15 || saturation_u < -15)
+ {
+ pr_err("wrong saturation_u value input, range is <-15, 15>\n");
+ goto out;
+ }
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &saturation_v) || saturation_v > 15 || saturation_v < -15)
+ {
+ pr_err("wrong saturation_v value input, range is <-15, 15>\n");
+ goto out;
+ }
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &sharpness) || sharpness > 6 || sharpness < 0)
+ {
+ pr_err("wrong sharpness value input, range is <0, 6>\n");
+ goto out;
+ }
+
+ sony_cxn0102_set_all_pq(cxn0102, (int8_t)contrast, (int8_t)brightness,
+ (int8_t)hue_u, (int8_t)hue_v,
+ (int8_t)saturation_u, (int8_t)saturation_v,
+ (int8_t)sharpness);
+
+ return size;
+out:
+ pr_err("usage: <contrast>,<brightness>,<hue_u>,<hue_v>,<saturation_u>,<saturation_v>,<sharpness>\n");
+ return size;
+}
+
+// 获取光机亮度
+static ssize_t cxn_brightness_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ int i = 0;
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ sony_cxn0102_get_brightness(cxn0102);
+ while (cxn0102->brightness == CXN0102_DEFAULT_VAL && i < 100)
+ {
+ msleep(50);
+ i++;
+ }
+ sprintf(buf, "%d\n", cxn0102->brightness);
+ return strlen(buf) + 1;
+}
+
+// 设置光机亮度
+static ssize_t cxn_brightness_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
+{
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ int state;
+ if (!kstrtoint(buf, 0, &state) && state >= -31 && state <= 31)
+ {
+ sony_cxn0102_set_brightness(cxn0102, (int8_t)state);
+ }
+ else
+ {
+ pr_err("wrong brightness value input, range is <-31, 31>\n");
+ }
+ return size;
+}
+
+// 获取光机对比度
+static ssize_t cxn_contrast_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ int i = 0;
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ sony_cxn0102_get_contrast(cxn0102);
+ while (cxn0102->contrast == CXN0102_DEFAULT_VAL && i < 100)
+ {
+ msleep(50);
+ i++;
+ }
+ sprintf(buf, "%d\n", cxn0102->contrast);
+ return strlen(buf) + 1;
+}
+
+// 设置光机对比度
+static ssize_t cxn_contrast_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
+{
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ int state;
+ if (!kstrtoint(buf, 0, &state) && state >= -15 && state <= 15)
+ {
+ sony_cxn0102_set_contrast(cxn0102, (int8_t)state);
+ }
+ else
+ {
+ pr_err("wrong contrast value input, range is <-15, 15>\n");
+ }
+ return size;
+}
+
+// 获取光机色调
+static ssize_t cxn_hue_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ int i = 0;
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ sony_cxn0102_get_hue(cxn0102);
+ while (cxn0102->hue_u == CXN0102_DEFAULT_VAL && cxn0102->hue_v == CXN0102_DEFAULT_VAL && i < 100)
+ {
+ msleep(50);
+ i++;
+ }
+ sprintf(buf, "%d,%d\n", cxn0102->hue_u, cxn0102->hue_v);
+ return strlen(buf) + 1;
+}
+
+// 设置光机色调
+static ssize_t cxn_hue_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
+{
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ int u = 0, v = 0;
+ char tmp[32];
+ size_t buf_size = min(size, (sizeof(tmp) - 1));
+ char *data;
+
+ memset(tmp, 0, sizeof(tmp));
+ strncpy(tmp, buf, buf_size);
+
+ data = tmp;
+ data = strstr(data, ",");
+ if (!data)
+ goto out;
+ *data = 0;
+ data++;
+
+ if (kstrtoint(tmp, 0, &u) || u > 15 || u < -15)
+ goto out;
+
+ if (kstrtoint(data, 0, &v) || v > 15 || v < -15)
+ goto out;
+
+ sony_cxn0102_set_hue(cxn0102, (int8_t)u, (int8_t)v);
+
+ return size;
+out:
+ pr_err("wrong hue value input, range is <-15, 15>\n");
+ pr_err("usage: <hue_u>,<hue_v>\n");
+ return size;
+}
+
+// 获取光机饱和度
+static ssize_t cxn_saturation_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ int i = 0;
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ sony_cxn0102_get_saturation(cxn0102);
+ while (cxn0102->saturation_u == CXN0102_DEFAULT_VAL && cxn0102->saturation_v == CXN0102_DEFAULT_VAL && i < 100)
+ {
+ msleep(50);
+ i++;
+ }
+ sprintf(buf, "%d,%d\n", cxn0102->saturation_u, cxn0102->saturation_v);
+ return strlen(buf) + 1;
+}
+
+// 设置光机饱和度
+static ssize_t cxn_saturation_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
+{
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ int u = 0, v = 0;
+ char tmp[32];
+ size_t buf_size = min(size, (sizeof(tmp) - 1));
+ char *data;
+
+ memset(tmp, 0, sizeof(tmp));
+ strncpy(tmp, buf, buf_size);
+
+ data = tmp;
+ data = strstr(data, ",");
+ if (!data)
+ goto out;
+ *data = 0;
+ data++;
+
+ if (kstrtoint(tmp, 0, &u) || u > 15 || u < -15)
+ goto out;
+
+ if (kstrtoint(data, 0, &v) || v > 15 || v < -15)
+ goto out;
+
+ sony_cxn0102_set_saturation(cxn0102, (int8_t)u, (int8_t)v);
+
+ return size;
+out:
+ pr_err("wrong saturation value input, range is <-15, 15>\n");
+ pr_err("usage: <saturation_u>,<saturation_v>\n");
+ return size;
+}
+
+// 获取光机锐度
+static ssize_t cxn_sharpness_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ int i = 0;
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ sony_cxn0102_get_sharpness(cxn0102);
+ while (cxn0102->sharpness == CXN0102_DEFAULT_VAL && i < 100)
+ {
+ msleep(50);
+ i++;
+ }
+ sprintf(buf, "%d\n", cxn0102->sharpness);
+ return strlen(buf) + 1;
+}
+
+// 设置光机锐度
+static ssize_t cxn_sharpness_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
+{
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ int state;
+ if (!kstrtoint(buf, 0, &state) && state >= 0 && state <= 6)
+ {
+ sony_cxn0102_set_sharpness(cxn0102, (int8_t)state);
+ }
+ else
+ {
+ pr_err("wrong sharpness value input, range is <0, 6>\n");
+ }
+ return size;
+}
+
+// 获取输出位置信息
+static ssize_t cxn_position_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ int i = 0;
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ sony_cxn0102_get_video_position(cxn0102);
+ while (cxn0102->pan == CXN0102_DEFAULT_VAL && cxn0102->tilt == CXN0102_DEFAULT_VAL && cxn0102->flip == CXN0102_DEFAULT_VAL && i < 100)
+ {
+ msleep(50);
+ i++;
+ }
+ sprintf(buf, "%d,%d,%d\n", cxn0102->pan, cxn0102->tilt, cxn0102->flip);
+ return strlen(buf) + 1;
+}
+
+// 设置输出位置信息
+static ssize_t cxn_position_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
+{
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ const char *delimiters = ",";
+ int pan = 0, tilt = 0, flip = 0;
+ char *tmp = kmalloc(sizeof(char), 32);
+ char *data;
+
+ memset(tmp, 0, 32);
+ strncpy(tmp, buf, size);
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &pan))
+ goto out;
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &tilt))
+ goto out;
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &flip) || flip > 3 || flip < 0)
+ {
+ pr_err("wrong flip value input, range is <0, 3>\n");
+ goto out;
+ }
+
+ sony_cxn0102_set_video_position(cxn0102, (u8)pan, (u8)tilt, (u8)flip);
+
+ kfree(tmp);
+ return size;
+out:
+ kfree(tmp);
+ pr_err("usage: <pan>,<tilt>,<flip>\n");
+ return size;
+}
+
+// 获取光机相位
+static ssize_t cxn_biphase_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ int i = 0;
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ sony_cxn0102_get_biphase(cxn0102);
+ while (cxn0102->biphase == CXN0102_DEFAULT_VAL && i < 100)
+ {
+ msleep(50);
+ i++;
+ }
+ sprintf(buf, "%d\n", cxn0102->biphase);
+ return strlen(buf) + 1;
+}
+
+// 设置光机相位
+static ssize_t cxn_biphase_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
+{
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ int state;
+ if (!kstrtoint(buf, 0, &state) && state >= -100 && state <= 100)
+ {
+ sony_cxn0102_set_biphase(cxn0102, (u32)state);
+ }
+ else
+ {
+ pr_err("wrong biphase value input, range is <-100, 100>\n");
+ }
+ return size;
+}
+
+// 控制光机相位
+static ssize_t cxn_biphase_ctl(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
+{
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ int state;
+ if (!kstrtoint(buf, 0, &state) && state >= 0 && state <= 4)
+ {
+ switch (state)
+ {
+ case 0:
+ sony_cxn0102_biphase_start(cxn0102);
+ break;
+ case 1:
+ sony_cxn0102_biphase_plus(cxn0102);
+ break;
+ case 2:
+ sony_cxn0102_biphase_minus(cxn0102);
+ break;
+ case 3:
+ sony_cxn0102_biphase_exit(cxn0102, 0);
+ break;
+ case 4:
+ sony_cxn0102_biphase_exit(cxn0102, 1);
+ break;
+ }
+ }
+ else
+ {
+ pr_err("wrong command input, 0: start, 1: plus, 2: minus, 3: stop without save, 4: stop with save");
+ }
+ return size;
+}
+
+// 获取光机光轴
+static ssize_t cxn_optical_alignment_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ int i = 0;
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ sony_cxn0102_get_optical_alignment(cxn0102);
+ while (cxn0102->oao_r0_h == CXN0102_DEFAULT_VAL &&
+ cxn0102->oao_r1_h == CXN0102_DEFAULT_VAL &&
+ cxn0102->oao_g0_h == CXN0102_DEFAULT_VAL &&
+ cxn0102->oao_g1_h == CXN0102_DEFAULT_VAL &&
+ cxn0102->oao_b_h == CXN0102_DEFAULT_VAL &&
+ cxn0102->oao_r0_v == CXN0102_DEFAULT_VAL &&
+ cxn0102->oao_r1_v == CXN0102_DEFAULT_VAL &&
+ cxn0102->oao_g0_v == CXN0102_DEFAULT_VAL &&
+ cxn0102->oao_g1_v == CXN0102_DEFAULT_VAL &&
+ cxn0102->oao_b_v == CXN0102_DEFAULT_VAL &&
+ i < 100)
+ {
+ msleep(50);
+ i++;
+ }
+ sprintf(buf, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",
+ cxn0102->oao_r0_h, cxn0102->oao_r1_h, cxn0102->oao_g0_h, cxn0102->oao_g1_h, cxn0102->oao_b_h,
+ cxn0102->oao_r0_v, cxn0102->oao_r1_v, cxn0102->oao_g0_v, cxn0102->oao_g1_v, cxn0102->oao_b_v);
+ return strlen(buf) + 1;
+}
+
+// 设置光机光轴
+static ssize_t cxn_optical_alignment_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
+{
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ const char *delimiters = ",";
+ int r0_h = 0, r1_h = 0, g0_h = 0, g1_h = 0, b_h = 0;
+ int r0_v = 0, r1_v = 0, g0_v = 0, g1_v = 0, b_v = 0;
+ char *tmp = kmalloc(sizeof(char), 32);
+ char *data;
+
+ memset(tmp, 0, 32);
+ strncpy(tmp, buf, size);
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &r0_h) || r0_h > 120 || r0_h < -120)
+ {
+ pr_err("wrong r0_h value input, range is <-120, 120>\n");
+ goto out;
+ }
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &r1_h) || r1_h > 120 || r1_h < -120)
+ {
+ pr_err("wrong r1_h value input, range is <-120, 120>\n");
+ goto out;
+ }
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &g0_h) || g0_h > 120 || g0_h < -120)
+ {
+ pr_err("wrong g0_h value input, range is <-120, 120>\n");
+ goto out;
+ }
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &g1_h) || g1_h > 120 || g1_h < -120)
+ {
+ pr_err("wrong g1_h value input, range is <-120, 120>\n");
+ goto out;
+ }
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &b_h) || b_h > 120 || b_h < -120)
+ {
+ pr_err("wrong b_h value input, range is <-120, 120>\n");
+ goto out;
+ }
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &r0_v) || r0_v > 20 || r0_v < 0)
+ {
+ pr_err("wrong r0_v value input, range is <0, 20>\n");
+ goto out;
+ }
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &r1_v) || r1_v > 20 || r1_v < 0)
+ {
+ pr_err("wrong r1_v value input, range is <0, 20>\n");
+ goto out;
+ }
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &g0_v) || g0_v > 20 || g0_v < 0)
+ {
+ pr_err("wrong g0_v value input, range is <0, 20>\n");
+ goto out;
+ }
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &g1_v) || g1_v > 20 || g1_v < 0)
+ {
+ pr_err("wrong g1_v value input, range is <0, 20>\n");
+ goto out;
+ }
+
+ data = strsep(&tmp, delimiters);
+ if (kstrtoint(data, 0, &b_v) || b_v > 20 || b_v < 0)
+ {
+ pr_err("wrong b_v value input, range is <0, 20>\n");
+ goto out;
+ }
+
+ sony_cxn0102_set_optical_alignment(cxn0102, (u8)r0_h, (u8)r1_h, (u8)g0_h, (u8)g1_h, (u8)b_h, (u8)r0_v, (u8)r1_v, (u8)g0_v, (u8)g1_v, (u8)b_v);
+
+ kfree(tmp);
+ return size;
+out:
+ kfree(tmp);
+ pr_err("usage: <r0_h>,<r1_h>,<g0_h>,<g1_h>,<b_h>,<r0_v>,<r1_v>,<g0_v>,<g1_v>,<b_v>\n");
+ return size;
+}
+
+// 控制光机光轴
+static ssize_t cxn_opt_adj_ctl(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
+{
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ int state;
+ if (!kstrtoint(buf, 0, &state) && state >= 0 && state <= 4)
+ {
+ switch (state)
+ {
+ case 0:
+ sony_cxn0102_opt_adj_start(cxn0102);
+ break;
+ case 1:
+ sony_cxn0102_opt_adj_plus(cxn0102);
+ break;
+ case 2:
+ sony_cxn0102_opt_adj_minus(cxn0102);
+ break;
+ case 3:
+ sony_cxn0102_opt_adj_exit(cxn0102, 0);
+ break;
+ case 4:
+ sony_cxn0102_opt_adj_exit(cxn0102, 1);
+ break;
+ }
+ }
+ else
+ {
+ pr_err("wrong command input, 0: start, 1: plus, 2: minus, 3: stop without save, 4: stop with save");
+ }
+ return size;
+}
+
+// 控制用户参数
+static ssize_t cxn_user_param_ctl(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
+{
+ struct sony_cxn0102_dev *cxn0102 = dev_get_drvdata(dev);
+ int state;
+ if (!kstrtoint(buf, 0, &state) && state >= 0 && state <= 5)
+ {
+ switch (state)
+ {
+ case 0:
+ // 初始化用户参数
+ sony_cxn0102_init_user_param(cxn0102);
+ break;
+ case 1:
+ // 保存全部信息
+ sony_cxn0102_save_user_param(cxn0102, 0x01, 0x01, 0x01);
+ break;
+ case 2:
+ // 保存位置信息
+ sony_cxn0102_save_user_param(cxn0102, 0x01, 0x00, 0x00);
+ break;
+ case 3:
+ // 保存光轴
+ sony_cxn0102_save_user_param(cxn0102, 0x00, 0x02, 0x00);
+ break;
+ case 4:
+ // 保存相位
+ sony_cxn0102_save_user_param(cxn0102, 0x00, 0x03, 0x00);
+ break;
+ case 5:
+ // 保存画面质量
+ sony_cxn0102_save_user_param(cxn0102, 0x00, 0x00, 0x01);
+ break;
+ }
+ }
+ else
+ {
+ pr_err("wrong command input, 0: init, 1: save all, 2: save output position, 3: save output optical axis, 4: save output biphase, 5: save output picture quality");
+ }
+ return size;
+}
+
+static DEVICE_ATTR(fan, 0664, cxn_state_fan_show, cxn_state_fan_store);
+static DEVICE_ATTR(state, 0664, cxn_state_show, cxn_state_store);
+static DEVICE_ATTR(sn, 0664, cxn_sn_show, NULL);
+static DEVICE_ATTR(temperature, 0664, cxn_temperature_show, NULL);
+static DEVICE_ATTR(version, 0664, cxn_version_show, NULL);
+static DEVICE_ATTR(pq, 0664, cxn_pq_show, cxn_pq_store);
+static DEVICE_ATTR(contrast, 0664, cxn_contrast_show, cxn_contrast_store);
+static DEVICE_ATTR(brightness, 0664, cxn_brightness_show, cxn_brightness_store);
+static DEVICE_ATTR(hue, 0664, cxn_hue_show, cxn_hue_store);
+static DEVICE_ATTR(saturation, 0664, cxn_saturation_show, cxn_saturation_store);
+static DEVICE_ATTR(sharpness, 0664, cxn_sharpness_show, cxn_sharpness_store);
+static DEVICE_ATTR(position, 0664, cxn_position_show, cxn_position_store);
+static DEVICE_ATTR(biphase, 0664, cxn_biphase_show, cxn_biphase_store);
+static DEVICE_ATTR(biphase_ctl, 0664, NULL, cxn_biphase_ctl);
+static DEVICE_ATTR(optical_alignment, 0664, cxn_optical_alignment_show, cxn_optical_alignment_store);
+static DEVICE_ATTR(opt_adj_ctl, 0664, NULL, cxn_opt_adj_ctl);
+static DEVICE_ATTR(user_param_ctl, 0664, NULL, cxn_user_param_ctl);
+
+static struct attribute *cxn_attrs[] = {
+ &dev_attr_fan.attr,
+ &dev_attr_state.attr,
+ &dev_attr_sn.attr,
+ &dev_attr_temperature.attr,
+ &dev_attr_version.attr,
+ &dev_attr_pq.attr,
+ &dev_attr_contrast.attr,
+ &dev_attr_brightness.attr,
+ &dev_attr_hue.attr,
+ &dev_attr_saturation.attr,
+ &dev_attr_sharpness.attr,
+ &dev_attr_position.attr,
+ &dev_attr_biphase.attr,
+ &dev_attr_biphase_ctl.attr,
+ &dev_attr_optical_alignment.attr,
+ &dev_attr_opt_adj_ctl.attr,
+ &dev_attr_user_param_ctl.attr,
+ NULL};
+
+static const struct attribute_group cxn_attr_grp = {
+ .attrs = cxn_attrs,
+};
+
+// probe
+static int sony_cxn0102_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ struct sony_cxn0102_dev *cxn0102;
+ int ret;
+ u32 temp_val = 0;
+
+ dev_info(&client->dev, "%s: enter.\n", __func__);
+
+ /* 实例化一个struct sony_cxn0102_dev对象 */
+ cxn0102 = devm_kzalloc(&client->dev, sizeof(struct sony_cxn0102_dev), GFP_KERNEL);
+ if (!cxn0102)
+ {
+ dev_err(&client->dev, "Failed to allocate cxn0102 driver data.\n");
+ return -ENOMEM;
+ }
+
+ cxn0102->client = client;
+ cxn0102->state = CXN0102_STATE_SHUTDOWN;
+ cxn0102->fan_state = CXN0102_FAN_STATE_MANUAL_OFF;
+
+ timer_setup(&cxn0102->timer_fan, &func_timer_fan, 0);
+
+ INIT_WORK(&cxn0102->work_fan, func_work_fan);
+
+ cxn0102_wq = create_singlethread_workqueue("cxn0102_wq");
+ if (!cxn0102_wq)
+ {
+ dev_err(&client->dev, "Creat workqueue failed.");
+ return -ENOMEM;
+ }
+
+ /* 从设备树中获取中断管脚 */
+ cxn0102->irq_gpio = of_get_named_gpio(client->dev.of_node, "irq-gpios", 0);
+ if (!gpio_is_valid(cxn0102->irq_gpio))
+ {
+ dev_err(&client->dev, "Failed to get cxn0102 COM_REQ gpio\n");
+ return -1;
+ }
+
+ /* 申请使用管脚 */
+ ret = devm_gpio_request_one(&client->dev, cxn0102->irq_gpio, GPIOF_IN, "cxn0102 com_req");
+ if (ret < 0)
+ return ret;
+
+ /* 注册中断服务函数 */
+ ret = devm_request_threaded_irq(&client->dev, gpio_to_irq(cxn0102->irq_gpio),
+ NULL, sony_cxn0102_isr, IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+ client->name, cxn0102);
+ if (ret)
+ {
+ dev_err(&client->dev, "Failed to request cxn0102 IRQ.\n");
+ return ret;
+ }
+
+ /* 从设备树中获取使能管脚 */
+ cxn0102->en_gpio = of_get_named_gpio(client->dev.of_node, "en-gpios", 0);
+ if (!gpio_is_valid(cxn0102->en_gpio))
+ {
+ dev_err(&client->dev, "Failed to get cxn0102 EN gpio\n");
+ return -1;
+ }
+
+ /* 申请使用管脚 */
+ ret = devm_gpio_request_one(&client->dev, cxn0102->en_gpio, GPIOF_OUT_INIT_LOW, "cxn0102 en");
+ if (ret < 0)
+ return ret;
+
+ /* 从设备树中获取风扇管脚 */
+ cxn0102->fan_gpio = of_get_named_gpio(client->dev.of_node, "fan-gpios", 0);
+ if (!gpio_is_valid(cxn0102->fan_gpio))
+ {
+ dev_err(&client->dev, "Failed to get cxn0102 Fan gpio\n");
+ return -1;
+ }
+
+ /* 申请使用管脚 */
+ ret = devm_gpio_request_one(&client->dev, cxn0102->fan_gpio, GPIOF_OUT_INIT_LOW, "cxn0102 fan");
+ if (ret < 0)
+ return ret;
+
+ /* 从设备树中获取风扇模式 */
+ ret = of_property_read_u32(client->dev.of_node, "fan-mode", &temp_val);
+ if (!ret)
+ {
+ cxn0102->fan_mode = temp_val;
+ }
+ else
+ {
+ cxn0102->fan_mode = 0;
+ }
+
+ /* 从设备树中获取风扇启动温度 */
+ ret = of_property_read_u32(client->dev.of_node, "fan-temperature-on", &temp_val);
+ if (!ret)
+ {
+ cxn0102->fan_temperature_on = temp_val;
+ }
+ else
+ {
+ cxn0102->fan_temperature_on = 45;
+ }
+
+ /* 从设备树中获取风扇关停温度 */
+ ret = of_property_read_u32(client->dev.of_node, "fan-temperature-off", &temp_val);
+ if (!ret)
+ {
+ cxn0102->fan_temperature_off = temp_val;
+ }
+ else
+ {
+ cxn0102->fan_temperature_off = 35;
+ }
+
+ /* 如果启动温度低于关停温度,设为默认值 */
+ if (cxn0102->fan_temperature_on <= cxn0102->fan_temperature_off)
+ {
+ cxn0102->fan_temperature_on = 45;
+ cxn0102->fan_temperature_off = 35;
+ }
+
+ /* 创建sysfs */
+ ret = sysfs_create_group(&client->dev.kobj, &cxn_attr_grp);
+ if (ret < 0)
+ {
+ dev_err(&client->dev, "Failed to create sys file.\n");
+ }
+
+ /* 注册监听frame buffer notifier */
+ cxn0102->notifier.notifier_call = cxn0102_fb_notifier_callback;
+ fb_register_client(&cxn0102->notifier);
+
+ dev_info(&client->dev, "%s: Start Power ON.\n", __func__);
+ msleep(50);
+ sony_cxn0102_poweron(cxn0102);
+
+ i2c_set_clientdata(client, cxn0102);
+ return 0;
+}
+
+static int sony_cxn0102_remove(struct i2c_client *client)
+{
+ if (cxn0102_wq)
+ {
+ destroy_workqueue(cxn0102_wq);
+ }
+ return 0;
+}
+
+static const struct of_device_id sony_cxn0102_of_match[] = {
+ {
+ .compatible = "sony,cxn0102",
+ },
+ {/* sentinel */}};
+
+MODULE_DEVICE_TABLE(of, sony_cxn0102_of_match);
+
+static struct i2c_driver sony_cxn0102_driver = {
+ .driver = {
+ .owner = THIS_MODULE,
+ .name = "sony_cxn0102a",
+ .of_match_table = of_match_ptr(sony_cxn0102_of_match),
+ },
+ .probe = sony_cxn0102_probe,
+ .remove = sony_cxn0102_remove,
+};
+
+module_i2c_driver(sony_cxn0102_driver);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("fengmoxi");
+MODULE_INFO(intree, "Y");
diff --git a/drivers/gpu/drm/cxn0102/cxn0102.h b/drivers/gpu/drm/cxn0102/cxn0102.h
new file mode 100755
index 000000000000..74c849ae1a76
--- /dev/null
+++ b/drivers/gpu/drm/cxn0102/cxn0102.h
@@ -0,0 +1,242 @@
+#ifndef __LINUX_CXN0102_H__
+#define __LINUX_CXN0102_H__
+
+#define CXN0102_DEFAULT_VAL 127
+
+// CXN0102 to Host Command: Boot Notify Command
+#define CXN0102_CMD_BOOT 0x00 // 启动
+
+// Host to CXN0102 Command: CXN0102 Control Command
+#define CXN0102_CMD_START_INPUT 0x01 // 开启输入
+#define CXN0102_CMD_STOP_INPUT 0x02 // 关闭输入
+#define CXN0102_CMD_STOP_INPUT_SPECIALLY 0x0C // 关闭输入,输出所需图像
+#define CXN0102_CMD_MUTE 0x03 // 静音
+#define CXN0102_CMD_SAVE_USER_PARAM 0x07 // 保存用户参数
+#define CXN0102_CMD_INIT_USER_PARAM 0x08 // 初始化用户参数
+#define CXN0102_CMD_SHUTDOWN_REBOOT 0x0B // 关机和重启
+
+// Host to CXN0102 Command: Video Control Command
+#define CXN0102_CMD_GET_VIDEO_POSITION 0x25 // 获取输出位置信息
+#define CXN0102_CMD_SET_VIDEO_POSITION 0x26 // 设置输出位置信息
+#define CXN0102_CMD_GET_OPTICAL_ALIGNMENT 0x27 // 获取光轴数据
+#define CXN0102_CMD_SET_OPTICAL_ALIGNMENT 0x28 // 设置光轴数据
+#define CXN0102_CMD_GET_BIPHASE 0x29 // 获取相位数据
+#define CXN0102_CMD_SET_BIPHASE 0x2A // 设置相位数据
+#define CXN0102_CMD_SET_EASY_OPT_ADJ_CONTROL 0x32 // 开始快速光轴调整
+#define CXN0102_CMD_SET_EASY_OPT_ADJ_PLUS 0x33 // 光轴+
+#define CXN0102_CMD_SET_EASY_OPT_ADJ_MINUS 0x34 // 光轴-
+#define CXN0102_CMD_SET_EASY_OPT_ADJ_EXIT 0x35 // 结束快速光轴调整
+#define CXN0102_CMD_SET_EASY_BIPHASE_CONTROL 0x36 // 开始快速相位调整
+#define CXN0102_CMD_SET_EASY_BIPHASE_PLUS 0x37 // 相位+
+#define CXN0102_CMD_SET_EASY_BIPHASE_MINUS 0x38 // 相位-
+#define CXN0102_CMD_SET_EASY_BIPHASE_EXIT 0x39 // 结束快速相位调整
+
+// Host to CXN0102 Command :Video PQ Control Command
+#define CXN0102_CMD_GET_ALL_PQ 0x40 // 获取所有画面质量设置
+#define CXN0102_CMD_SET_ALL_PQ 0x41 // 设置所有画面质量设置
+#define CXN0102_CMD_GET_BRIGHTNESS 0x42 // 获取亮度
+#define CXN0102_CMD_SET_BRIGHTNESS 0x43 // 设置亮度: 范围: -31 到 31
+#define CXN0102_CMD_GET_CONTRAST 0x44 // 获取对比度
+#define CXN0102_CMD_SET_CONTRAST 0x45 // 设置对比度: 范围: -15 到 15
+#define CXN0102_CMD_GET_HUE 0x46 // 获取色调
+#define CXN0102_CMD_SET_HUE 0x47 // 设置色调: 范围: -15 到 15
+#define CXN0102_CMD_GET_SATURATION 0x48 // 获取饱和度
+#define CXN0102_CMD_SET_SATURATION 0x49 // 设置饱和度: 范围: -15 到 15
+#define CXN0102_CMD_GET_SHARPNESS 0x4E // 获取锐度
+#define CXN0102_CMD_SET_SHARPNESS 0x4F // 设置锐度: 范围: 0 到 6
+
+// Host to CXN0102 Command: Update Command
+#define CXN0102_CMD_UPDATE_FW_IMAGE 0x82 // Updates the firmware image in the Flash
+#define CXN0102_CMD_UPDATE_PICTURE_DATA 0x84 // Updates the Opening picture data in the Flash
+#define CXN0102_CMD_DT_UPDATE_FW_IMAGE 0x92 // Starts division transmission update of the firmware image in the Flash
+#define CXN0102_CMD_DT_UPDATE_PICTURE_DATA 0x94 // Starts division transmission update of the picture data in the Flash
+#define CXN0102_CMD_DT_DATA 0x9F // Transmits the division transmission data
+
+// Host to CXN0102 Command: Internal Command
+#define CXN0102_CMD_GET_TEMPERATURE 0xA0 // Gets the CXN0102 Module temperature data
+#define CXN0102_CMD_GET_TIME 0xA1 // Gets the total operating time from Module initialization
+#define CXN0102_CMD_GET_VERSION 0xA2 // Gets the version information
+
+// Host to CXN0102 Command: Internal Command for Factory
+#define CXN0102_CMD_OUTPUT_TEST_PICTURE 0xA3 // Outputs the Test picture
+#define CXN0102_CMD_GET_LOT_NUMBER 0xB2 // Gets the LOT number
+#define CXN0102_CMD_GET_SERIAL_NUMBER 0xB4 // Gets the serial number
+
+// CXN0102 to Host Command: Notify Command
+#define CXN0102_CMD_EMERGENCY_NOTIFY 0x10 // Emergency error notification
+#define CXN0102_CMD_TE_RN 0x11 // Temperature abnormality notification and recovery notification
+#define CXN0102_CMD_COMMAND_EMERGENCY_NOTIFY 0x12 // Command processing abnormality notification
+
+#define CXN0102_STATE_WAIT_BOOT 0 // 光机等待BOOT
+#define CXN0102_STATE_READY 1 // 光机输入关闭
+#define CXN0102_STATE_ACTIVE 2 // 光机输入开启
+#define CXN0102_STATE_READY_MUTE 3 // 光机准备黑屏
+#define CXN0102_STATE_READY_UNMUTE 4 // 光机准备解除黑屏
+#define CXN0102_STATE_MUTE 5 // 光机黑屏状态
+#define CXN0102_STATE_READY_SHUTDOWN 6 // 光机准备关机
+#define CXN0102_STATE_READY_REBOOT 7 // 光机准备重启
+#define CXN0102_STATE_SHUTDOWN 8 // 光机正在关机
+#define CXN0102_STATE_REBOOT 9 // 光机正在重启
+#define CXN0102_STATE_BIPHASE 10 // 光机相位校准
+#define CXN0102_STATE_READY_BIPHASE 11 // 光机准备相位校准
+#define CXN0102_STATE_OPTICAL 12 // 光轴校准
+#define CXN0102_STATE_READY_OPTICAL 13 // 准备进入光轴校准状态
+#define CXN0102_STATE_READY_INIT 14 // 准备进入初始化
+
+#define CXN0102_FAN_STATE_AUTO_OFF 0 // 风扇自动模式关停
+#define CXN0102_FAN_STATE_AUTO_ON 1 // 风扇自动模式运行
+#define CXN0102_FAN_STATE_MANUAL_OFF 2 // 风扇手动模式关停
+#define CXN0102_FAN_STATE_MANUAL_ON 3 // 风扇手动模式运行
+
+struct sony_cxn0102_dev
+{
+ struct i2c_client *client;
+ int en_gpio;
+ int irq_gpio;
+ int fan_gpio;
+
+ int fan_mode;
+ int fan_temperature_off;
+ int fan_temperature_on;
+
+ int state;
+ int fan_state;
+
+ int8_t pan;
+ int8_t tilt;
+ u8 flip;
+
+ int8_t oao_r0_h;
+ int8_t oao_r1_h;
+ int8_t oao_g0_h;
+ int8_t oao_g1_h;
+ int8_t oao_b_h;
+ int8_t oao_r0_v;
+ int8_t oao_r1_v;
+ int8_t oao_g0_v;
+ int8_t oao_g1_v;
+ int8_t oao_b_v;
+
+ u32 biphase;
+
+ int8_t contrast;
+ int8_t brightness;
+ int8_t hue_u;
+ int8_t hue_v;
+ int8_t saturation_u;
+ int8_t saturation_v;
+ int8_t sharpness;
+
+ char sn[9];
+ char version_firmware[5];
+ char version_parameter[5];
+ char version_data[5];
+ int8_t temperature;
+ int8_t temperature_mute;
+ int8_t temperature_stop;
+
+ struct notifier_block notifier;
+
+ struct timer_list timer_fan;
+ struct work_struct work_fan;
+};
+
+// I2C写
+int sony_cxn0102_write(struct sony_cxn0102_dev *cxn0102, u8 addr, u8 *buf, u16 len);
+
+// 开风扇
+void sony_cxn0102_start_fan(struct sony_cxn0102_dev *cxn0102);
+// 关风扇
+void sony_cxn0102_stop_fan(struct sony_cxn0102_dev *cxn0102);
+// 设置风扇模式,0自动,1运行,2关停
+void sony_cxn0102_set_fan_mode(struct sony_cxn0102_dev *cxn0102, int mode);
+
+// CXN0102 Control Command
+// 开启输入
+int sony_cxn0102_start_input(struct sony_cxn0102_dev *cxn0102);
+// 关闭输入
+int sony_cxn0102_stop_input(struct sony_cxn0102_dev *cxn0102);
+// 关机
+int sony_cxn0102_shutdown(struct sony_cxn0102_dev *cxn0102);
+// 重启
+int sony_cxn0102_reboot(struct sony_cxn0102_dev *cxn0102);
+// 开机
+int sony_cxn0102_poweron(struct sony_cxn0102_dev *cxn0102);
+// 黑屏
+int sony_cxn0102_mute(struct sony_cxn0102_dev *cxn0102);
+// 解除黑屏
+int sony_cxn0102_unmute(struct sony_cxn0102_dev *cxn0102);
+// 初始化用户参数
+int sony_cxn0102_init_user_param(struct sony_cxn0102_dev *cxn0102);
+// 保存用户参数
+int sony_cxn0102_save_user_param(struct sony_cxn0102_dev *cxn0102, u8 indicates1, u8 indicates2, u8 indicates3);
+
+// Video Control Command
+// 获取输出位置信息
+int sony_cxn0102_get_video_position(struct sony_cxn0102_dev *cxn0102);
+// 设置输出位置信息
+int sony_cxn0102_set_video_position(struct sony_cxn0102_dev *cxn0102, u8 pan, u8 tilt, u8 flip);
+// 获取光轴数据
+int sony_cxn0102_get_optical_alignment(struct sony_cxn0102_dev *cxn0102);
+// 设置光轴数据
+int sony_cxn0102_set_optical_alignment(struct sony_cxn0102_dev *cxn0102,
+ u8 oao_r0_h, u8 oao_r1_h, u8 oao_g0_h, u8 oao_g1_h, u8 oao_b_h,
+ u8 oao_r0_v, u8 oao_r1_v, u8 oao_g0_v, u8 oao_g1_v, u8 oao_b_v);
+// 获取相位数据
+int sony_cxn0102_get_biphase(struct sony_cxn0102_dev *cxn0102);
+// 设置相位数据
+int sony_cxn0102_set_biphase(struct sony_cxn0102_dev *cxn0102, u32 biphase);
+// 开始光轴调整
+int sony_cxn0102_opt_adj_start(struct sony_cxn0102_dev *cxn0102);
+// 光轴+
+int sony_cxn0102_opt_adj_plus(struct sony_cxn0102_dev *cxn0102);
+// 光轴-
+int sony_cxn0102_opt_adj_minus(struct sony_cxn0102_dev *cxn0102);
+// 结束光轴调整
+int sony_cxn0102_opt_adj_exit(struct sony_cxn0102_dev *cxn0102, u8 save);
+// 开始相位调整
+int sony_cxn0102_biphase_start(struct sony_cxn0102_dev *cxn0102);
+// 相位+
+int sony_cxn0102_biphase_plus(struct sony_cxn0102_dev *cxn0102);
+// 相位-
+int sony_cxn0102_biphase_minus(struct sony_cxn0102_dev *cxn0102);
+// 结束相位调整
+int sony_cxn0102_biphase_exit(struct sony_cxn0102_dev *cxn0102, u8 save);
+
+// Video PQ Control Command
+// 获取所有画面质量设置
+int sony_cxn0102_get_all_pq(struct sony_cxn0102_dev *cxn0102);
+// 设置所有画面质量设置
+int sony_cxn0102_set_all_pq(struct sony_cxn0102_dev *cxn0102, int8_t contrast, int8_t brightness, int8_t hue_u, int8_t hue_v, int8_t saturation_u, int8_t saturation_v, int8_t sharpness);
+// 获取亮度
+int sony_cxn0102_get_brightness(struct sony_cxn0102_dev *cxn0102);
+// 设置亮度: 范围: -31 到 31
+int sony_cxn0102_set_brightness(struct sony_cxn0102_dev *cxn0102, int8_t brightness);
+// 获取对比度
+int sony_cxn0102_get_contrast(struct sony_cxn0102_dev *cxn0102);
+// 设置对比度: 范围: -15 到 15
+int sony_cxn0102_set_contrast(struct sony_cxn0102_dev *cxn0102, int8_t contrast);
+// 获取色调
+int sony_cxn0102_get_hue(struct sony_cxn0102_dev *cxn0102);
+// 设置色调: 范围: -15 到 15
+int sony_cxn0102_set_hue(struct sony_cxn0102_dev *cxn0102, int8_t hue_u, int8_t hue_v);
+// 获取饱和度
+int sony_cxn0102_get_saturation(struct sony_cxn0102_dev *cxn0102);
+// 设置饱和度: 范围: -15 到 15
+int sony_cxn0102_set_saturation(struct sony_cxn0102_dev *cxn0102, int8_t saturation_u, int8_t saturation_v);
+// 获取锐度
+int sony_cxn0102_get_sharpness(struct sony_cxn0102_dev *cxn0102);
+// 设置锐度: 范围: 0 到 6
+int sony_cxn0102_set_sharpness(struct sony_cxn0102_dev *cxn0102, int8_t sharpness);
+
+// Internal Command
+// 获取CXN0102模块温度
+int sony_cxn0102_get_temperature(struct sony_cxn0102_dev *cxn0102);
+// 获取CXN0102模块版本信息
+int sony_cxn0102_get_version(struct sony_cxn0102_dev *cxn0102);
+
+// Internal Command for Factory
+// 获取序列号
+int sony_cxn0102_get_sn(struct sony_cxn0102_dev *cxn0102);
+
+#endif
\ No newline at end of file
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 492a971b95b5..efdca8df9f05 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -305,6 +305,24 @@ ATTR_SHOW_FN(switches, EV_SW, false);
ATTR_SHOW_FN(disabled_keys, EV_KEY, true);
ATTR_SHOW_FN(disabled_switches, EV_SW, true);
+static ssize_t gpio_keys_show_keys_state(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct gpio_keys_drvdata *ddata = platform_get_drvdata(pdev);
+ int i, l;
+ int state;
+
+ for (i = 0; i < ddata->pdata->nbuttons; i++) {
+ struct gpio_button_data *bdata = &ddata->data[i];
+
+ state = gpiod_get_value_cansleep(bdata->gpiod);
+
+ l = scnprintf(buf, PAGE_SIZE - 1, "%s%d\n", buf, state);
+ }
+
+ return l;
+}
+
/*
* ATTRIBUTES:
*
@@ -312,6 +330,7 @@ ATTR_SHOW_FN(disabled_switches, EV_SW, true);
* /sys/devices/platform/gpio-keys/switches [ro]
*/
static DEVICE_ATTR(keys, S_IRUGO, gpio_keys_show_keys, NULL);
+static DEVICE_ATTR(keys_state, S_IRUGO, gpio_keys_show_keys_state, NULL);
static DEVICE_ATTR(switches, S_IRUGO, gpio_keys_show_switches, NULL);
#define ATTR_STORE_FN(name, type) \
@@ -349,6 +368,7 @@ static DEVICE_ATTR(disabled_switches, S_IWUSR | S_IRUGO,
static struct attribute *gpio_keys_attrs[] = {
&dev_attr_keys.attr,
+ &dev_attr_keys_state.attr,
&dev_attr_switches.attr,
&dev_attr_disabled_keys.attr,
&dev_attr_disabled_switches.attr,
diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
index 324049eebb9b..0b8660276354 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -108,6 +108,29 @@ config DWMAC_ROCKCHIP
This selects the Rockchip RK3288 SoC glue layer support for
the stmmac device driver.
+config DWMAC_RK_AUTO_DELAYLINE
+ bool "Auto search rgmii delayline"
+ default DWMAC_ROCKCHIP
+ depends on DWMAC_ROCKCHIP
+ help
+ Auto search suitable rgmii delayline at first boot, and save it
+ at vendor storage if success.
+
+config DWMAC_RK_AUTO_DELAYLINE_RAPID_SEARCH
+ bool "Rapid search"
+ default DWMAC_RK_AUTO_DELAYLINE
+ depends on DWMAC_RK_AUTO_DELAYLINE
+ help
+ The delaylines are halted as soon as they become available, rather
+ than choosing the median value after all scans.
+
+config DWMAC_RK_DELAYLINE_SCAN_STEP
+ hex "Auto search rgmii delayline step"
+ default 0x1
+ depends on DWMAC_ROCKCHIP
+ help
+ The step of the auto search.
+
config DWMAC_SOCFPGA
tristate "SOCFPGA dwmac support"
default (ARCH_SOCFPGA || ARCH_STRATIX10)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk-tool.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk-tool.c
index 46633a665f7e..51680ed94e43 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk-tool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk-tool.c
@@ -99,7 +99,7 @@ struct dwmac_rk_lb_priv {
#define STMMAC_ALIGN(x) __ALIGN_KERNEL(x, SMP_CACHE_BYTES)
#define MAX_DELAYLINE 0x7f
-#define SCAN_STEP 0x5
+#define SCAN_STEP CONFIG_DWMAC_RK_DELAYLINE_SCAN_STEP
#define SCAN_VALID_RANGE 0xA
#define DWMAC_RK_TEST_PKT_SIZE (sizeof(struct ethhdr) + sizeof(struct iphdr) + \
@@ -1452,3 +1452,54 @@ int dwmac_rk_remove_loopback_sysfs(struct device *device)
return 0;
}
+
+#ifdef CONFIG_DWMAC_RK_AUTO_DELAYLINE
+int dwmac_rk_search_rgmii_delayline(struct stmmac_priv *priv)
+{
+ struct dwmac_rk_lb_priv *lb_priv;
+ int phy_iface = dwmac_rk_get_phy_interface(priv);
+ unsigned char delayline[2];
+ int ret;
+
+ if (phy_iface != PHY_INTERFACE_MODE_RGMII &&
+ phy_iface != PHY_INTERFACE_MODE_RGMII_ID)
+ return 0;
+
+ memset(delayline, 0x0, sizeof(delayline));
+ ret = rk_vendor_read(LAN_RGMII_DL_ID, delayline, 2);
+ if (ret == 2 &&
+ dwmac_rk_delayline_is_valid(delayline[0], delayline[1])) {
+ pr_info("Read rgmii delayline from vendor: tx = 0x%02x, rx = 0x%02x\n",
+ delayline[0], delayline[1]);
+ dwmac_rk_set_rgmii_delayline(priv, delayline[0], delayline[1]);
+
+ return 0;
+ }
+
+ lb_priv = kzalloc(sizeof(*lb_priv), GFP_KERNEL);
+ if (!lb_priv)
+ return -ENOMEM;
+
+#ifdef CONFIG_DWMAC_RK_AUTO_DELAYLINE_RAPID_SEARCH
+ lb_priv->sysfs = 0;
+#else
+ lb_priv->sysfs = 1;
+#endif
+ lb_priv->type = LOOPBACK_TYPE_PHY;
+ lb_priv->speed = LOOPBACK_SPEED1000;
+ lb_priv->scan = 1;
+
+ ret = dwmac_rk_loopback_run(priv, lb_priv);
+ if (!ret) {
+ delayline[0] = lb_priv->final_tx;
+ delayline[1] = lb_priv->final_rx;
+ if (!rk_vendor_write(LAN_RGMII_DL_ID, delayline, 2))
+ /* write tx/rx delayline back if loopback okay */
+ dwmac_rk_set_rgmii_delayline(priv, lb_priv->final_tx,
+ lb_priv->final_rx);
+ }
+
+ kfree(lb_priv);
+ return ret;
+}
+#endif
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index f9b42b0c20f4..29d86be3c351 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -188,6 +188,11 @@ struct stmmac_priv {
void __iomem *mmcaddr;
void __iomem *ptpaddr;
+#ifdef CONFIG_DWMAC_RK_AUTO_DELAYLINE
+ bool delayline_scanned;
+ struct delayed_work scan_dwork;
+#endif
+
#ifdef CONFIG_DEBUG_FS
struct dentry *dbgfs_dir;
struct dentry *dbgfs_rings_status;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index cff46c49b72f..c3a50f2b1b30 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -54,6 +54,7 @@
#include "dwmac1000.h"
#include "dwxgmac2.h"
#include "hwif.h"
+#include "dwmac-rk-tool.h"
#define STMMAC_ALIGN(x) ALIGN(ALIGN(x, SMP_CACHE_BYTES), 16)
#define TSO_MAX_BUFF_SIZE (SZ_16K - 1)
@@ -2688,6 +2689,13 @@ static int stmmac_open(struct net_device *dev)
stmmac_enable_all_queues(priv);
netif_tx_start_all_queues(priv->dev);
+#ifdef CONFIG_DWMAC_RK_AUTO_DELAYLINE
+ if (!priv->delayline_scanned) {
+ priv->delayline_scanned = true;
+ schedule_delayed_work(&priv->scan_dwork, msecs_to_jiffies(6000));
+ }
+#endif
+
return 0;
lpiirq_error:
@@ -4260,6 +4268,15 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
return 0;
}
+#ifdef CONFIG_DWMAC_RK_AUTO_DELAYLINE
+static void stmmac_scan_delayline_dwork(struct work_struct *work)
+{
+ struct stmmac_priv *priv = container_of(work, struct stmmac_priv,
+ scan_dwork.work);
+ dwmac_rk_search_rgmii_delayline(priv);
+};
+#endif
+
/**
* stmmac_dvr_probe
* @device: device pointer
@@ -4453,6 +4470,10 @@ int stmmac_dvr_probe(struct device *device,
__func__);
#endif
+#ifdef CONFIG_DWMAC_RK_AUTO_DELAYLINE
+ INIT_DELAYED_WORK(&priv->scan_dwork, stmmac_scan_delayline_dwork);
+#endif
+
return ret;
error_netdev_register:
project packages/apps/TvSettings/
diff --git a/Settings/src/com/android/tv/settings/TvSettingsActivity.java b/Settings/src/com/android/tv/settings/TvSettingsActivity.java
index 4673aa85..3d9d92e4 100644
--- a/Settings/src/com/android/tv/settings/TvSettingsActivity.java
+++ b/Settings/src/com/android/tv/settings/TvSettingsActivity.java
@@ -18,6 +18,10 @@ package com.android.tv.settings;
import android.app.Activity;
import android.app.Fragment;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.transition.Scene;
@@ -41,6 +45,8 @@ public abstract class TvSettingsActivity extends Activity {
private static final String SETTINGS_FRAGMENT_TAG =
"com.android.tv.settings.MainSettings.SETTINGS_FRAGMENT";
+ private HomeWatcherReceiver mHomeKeyReceiver = null;
+
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -88,11 +94,34 @@ public abstract class TvSettingsActivity extends Activity {
return false;
}
});
+
+ mHomeKeyReceiver = new HomeWatcherReceiver();
+ final IntentFilter homeFilter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
+ registerReceiver(mHomeKeyReceiver, homeFilter);
+ }
+ }
+
+ public class HomeWatcherReceiver extends BroadcastReceiver {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ String action = intent.getAction();
+ Log.i(TAG, "onReceive: action: " + action);
+ if (action.equals(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)) {
+ // android.intent.action.CLOSE_SYSTEM_DIALOGS
+ String reason = intent.getStringExtra("reason");
+ Log.i(TAG, "reason: " + reason);
+ if (reason.equals("homekey")) {
+ finish();
+ }
+ }
}
}
@Override
public void finish() {
+ if (mHomeKeyReceiver != null) {
+ unregisterReceiver(mHomeKeyReceiver);
+ }
final Fragment fragment = getFragmentManager().findFragmentByTag(SETTINGS_FRAGMENT_TAG);
if (FeatureFactory.getFactory(this).isTwoPanelLayout()) {
super.finish();
diff --git a/Settings/src/com/android/tv/settings/connectivity/setup/EnterPasswordState.java b/Settings/src/com/android/tv/settings/connectivity/setup/EnterPasswordState.java
index b50e3ad3..74e8cd62 100644
--- a/Settings/src/com/android/tv/settings/connectivity/setup/EnterPasswordState.java
+++ b/Settings/src/com/android/tv/settings/connectivity/setup/EnterPasswordState.java
@@ -92,10 +92,7 @@ public class EnterPasswordState implements State {
private static final int WEP_MIN_LENGTH = 5;
private UserChoiceInfo mUserChoiceInfo;
private StateMachine mStateMachine;
- private EditText mTextInput;
- private CheckBox mCheckBox;
private GuidedAction mPasswordAction;
- private boolean mEditFocused = false;
@NonNull
@Override
@@ -110,68 +107,6 @@ public class EnterPasswordState implements State {
null);
}
- @Override
- public GuidedActionsStylist onCreateActionsStylist() {
- return new GuidedActionsStylist() {
- @Override
- public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
- LayoutInflater inflater = LayoutInflater.from(parent.getContext());
- View v = inflater.inflate(onProvideItemLayoutId(viewType), parent, false);
- if (viewType == ACTION_ID_CHECKBOX) {
- return new PasswordViewHolder(v);
- }
- return new GuidedActionsAlignUtil.SetupViewHolder(v);
- }
-
- @Override
- public int getItemViewType(GuidedAction action) {
- return (int) action.getId();
- }
-
- @Override
- public void onBindViewHolder(ViewHolder vh, GuidedAction action) {
- super.onBindViewHolder(vh, action);
- if (action.getId() == ACTION_ID_CHECKBOX) {
- PasswordViewHolder checkBoxVH = (PasswordViewHolder) vh;
- mCheckBox = checkBoxVH.mCheckbox;
- mCheckBox.setOnCheckedChangeListener((view, isChecked) -> {
- if (mPasswordAction != null) {
- setSelectedActionPosition(0);
- }
- mTextInput.setInputType(InputType.TYPE_CLASS_TEXT | (isChecked ? InputType.TYPE_TEXT_VARIATION_PASSWORD : InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD));
- });
- checkBoxVH.itemView.setOnClickListener(view -> {
- mCheckBox.setChecked(!mCheckBox.isChecked());
- if (mPasswordAction != null) {
- setSelectedActionPosition(0);
- }
- });
- mCheckBox.setChecked(mUserChoiceInfo.isPasswordHidden());
- } else if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
- mTextInput = (EditText) vh.itemView.findViewById(
- R.id.guidedactions_item_title);
- openInEditMode(action);
- }
- }
-
- @Override
- protected void onEditingModeChange(ViewHolder vh, boolean editing,
- boolean withTransition) {
- super.onEditingModeChange(vh, editing, withTransition);
- updatePasswordInputObfuscation();
- }
-
- @Override
- public int onProvideItemLayoutId(int viewType) {
- if (viewType == ACTION_ID_CHECKBOX) {
- return R.layout.password_checkbox;
- } else {
- return R.layout.setup_password_item;
- }
- }
- };
- }
-
@Override
public void onCreate(Bundle savedInstanceState) {
mUserChoiceInfo = ViewModelProviders
@@ -183,65 +118,41 @@ public class EnterPasswordState implements State {
super.onCreate(savedInstanceState);
}
+ @Override
+ public GuidedActionsStylist onCreateActionsStylist() {
+ return new GuidedActionsStylist() {
+ @Override
+ public int onProvideItemLayoutId() {
+ return R.layout.setup_text_input_item;
+ }
+ };
+ }
+
@Override
public void onCreateActions(@NonNull List<GuidedAction> actions,
Bundle savedInstanceState) {
Context context = getActivity();
CharSequence prevPassword = mUserChoiceInfo.getPageSummary(UserChoiceInfo.PASSWORD);
- boolean isPasswordHidden = mUserChoiceInfo.isPasswordHidden();
mPasswordAction = new GuidedAction.Builder(context)
.title(prevPassword == null ? "" : prevPassword)
- .editInputType(InputType.TYPE_CLASS_TEXT
- | (isPasswordHidden
- ? InputType.TYPE_TEXT_VARIATION_PASSWORD
- : InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD))
- .id(GuidedAction.ACTION_ID_CONTINUE)
.editable(true)
.build();
actions.add(mPasswordAction);
- GuidedAction checkboxAction = new GuidedAction.Builder(context)
- .id(ACTION_ID_CHECKBOX)
- .build();
- actions.add(checkboxAction);
}
@Override
- public long onGuidedActionEditedAndProceed(GuidedAction action) {
- if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
- String password = action.getTitle().toString();
- if (password.length() >= WEP_MIN_LENGTH) {
- mUserChoiceInfo.put(UserChoiceInfo.PASSWORD, action.getTitle().toString());
- mUserChoiceInfo.setPasswordHidden(mCheckBox.isChecked());
- mStateMachine.getListener().onComplete(StateMachine.OPTIONS_OR_CONNECT);
- }
- }
- return action.getId();
+ public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
+ openInEditMode(mPasswordAction);
}
@Override
- public void onGuidedActionFocused(GuidedAction action) {
- boolean newEditFocused = action == mPasswordAction;
- if (!mEditFocused && newEditFocused) {
- openInEditMode(action);
- }
- mEditFocused = newEditFocused;
- }
-
- private void updatePasswordInputObfuscation() {
- mTextInput.setInputType(InputType.TYPE_CLASS_TEXT
- | (mCheckBox.isChecked()
- ? InputType.TYPE_TEXT_VARIATION_PASSWORD
- : InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD));
- }
-
-
- private static class PasswordViewHolder extends GuidedActionsAlignUtil.SetupViewHolder {
- CheckBox mCheckbox;
-
- PasswordViewHolder(View v) {
- super(v);
- mCheckbox = v.findViewById(R.id.password_checkbox);
+ public long onGuidedActionEditedAndProceed(GuidedAction action) {
+ String password = action.getTitle().toString();
+ if (password.length() >= WEP_MIN_LENGTH) {
+ mUserChoiceInfo.put(UserChoiceInfo.PASSWORD, password);
+ mStateMachine.getListener().onComplete(StateMachine.OPTIONS_OR_CONNECT);
}
+ return action.getId();
}
}
}
project vendor/rockchip/common/
diff --git a/apps/apps.mk b/apps/apps.mk
index b0e0fd42..47d74807 100755
--- a/apps/apps.mk
+++ b/apps/apps.mk
@@ -17,10 +17,10 @@ PRODUCT_COPY_FILES += \
endif
endif
-ifneq ($(strip $(BUILD_WITH_GOOGLE_MARKET)), true)
-PRODUCT_PACKAGES += \
- Lightning
-endif
+#ifneq ($(strip $(BUILD_WITH_GOOGLE_MARKET)), true)
+#PRODUCT_PACKAGES += \
+# Lightning
+#endif
ifneq ($(strip $(TARGET_BOARD_PLATFORM_PRODUCT)), vr)
PRODUCT_PACKAGES += \
@@ -94,9 +94,7 @@ ifeq ($(strip $(TARGET_BOARD_PLATFORM_PRODUCT)), box)
PRODUCT_PACKAGES += \
RKTvLauncher \
MediaCenter \
- PinyinIME \
- WifiDisplay \
- DLNA
+ PinyinIME
ifeq ($(BOARD_TV_LOW_MEMOPT), false)
PRODUCT_PACKAGES += \
1
https://gitee.com/fengmoxi/tspi-cxn0102.git
git@gitee.com:fengmoxi/tspi-cxn0102.git
fengmoxi
tspi-cxn0102
立创泰山派智能投影机-CXN0102
master

搜索帮助