zc3xx.c 254 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021
  1. /*
  2. * Z-Star/Vimicro zc301/zc302p/vc30x driver
  3. *
  4. * Copyright (C) 2009-2012 Jean-Francois Moine <http://moinejf.free.fr>
  5. * Copyright (C) 2004 2005 2006 Michel Xhaard mxhaard@magic.fr
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  22. #include <linux/input.h>
  23. #include "gspca.h"
  24. #include "jpeg.h"
  25. MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>, "
  26. "Serge A. Suchkov <Serge.A.S@tochka.ru>");
  27. MODULE_DESCRIPTION("GSPCA ZC03xx/VC3xx USB Camera Driver");
  28. MODULE_LICENSE("GPL");
  29. static int force_sensor = -1;
  30. #define REG08_DEF 3 /* default JPEG compression (75%) */
  31. #include "zc3xx-reg.h"
  32. /* specific webcam descriptor */
  33. struct sd {
  34. struct gspca_dev gspca_dev; /* !! must be the first item */
  35. struct { /* gamma/brightness/contrast control cluster */
  36. struct v4l2_ctrl *gamma;
  37. struct v4l2_ctrl *brightness;
  38. struct v4l2_ctrl *contrast;
  39. };
  40. struct { /* autogain/exposure control cluster */
  41. struct v4l2_ctrl *autogain;
  42. struct v4l2_ctrl *exposure;
  43. };
  44. struct v4l2_ctrl *plfreq;
  45. struct v4l2_ctrl *sharpness;
  46. struct v4l2_ctrl *jpegqual;
  47. struct work_struct work;
  48. struct workqueue_struct *work_thread;
  49. u8 reg08; /* webcam compression quality */
  50. u8 bridge;
  51. u8 sensor; /* Type of image sensor chip */
  52. u16 chip_revision;
  53. u8 jpeg_hdr[JPEG_HDR_SZ];
  54. };
  55. enum bridges {
  56. BRIDGE_ZC301,
  57. BRIDGE_ZC303,
  58. };
  59. enum sensors {
  60. SENSOR_ADCM2700,
  61. SENSOR_CS2102,
  62. SENSOR_CS2102K,
  63. SENSOR_GC0303,
  64. SENSOR_GC0305,
  65. SENSOR_HDCS2020,
  66. SENSOR_HV7131B,
  67. SENSOR_HV7131R,
  68. SENSOR_ICM105A,
  69. SENSOR_MC501CB,
  70. SENSOR_MT9V111_1, /* (mi360soc) zc301 */
  71. SENSOR_MT9V111_3, /* (mi360soc) zc303 */
  72. SENSOR_OV7620, /* OV7648 - same values */
  73. SENSOR_OV7630C,
  74. SENSOR_PAS106,
  75. SENSOR_PAS202B,
  76. SENSOR_PB0330,
  77. SENSOR_PO2030,
  78. SENSOR_TAS5130C,
  79. SENSOR_MAX
  80. };
  81. static const struct v4l2_pix_format vga_mode[] = {
  82. {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
  83. .bytesperline = 320,
  84. .sizeimage = 320 * 240 * 3 / 8 + 590,
  85. .colorspace = V4L2_COLORSPACE_JPEG,
  86. .priv = 1},
  87. {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
  88. .bytesperline = 640,
  89. .sizeimage = 640 * 480 * 3 / 8 + 590,
  90. .colorspace = V4L2_COLORSPACE_JPEG,
  91. .priv = 0},
  92. };
  93. static const struct v4l2_pix_format broken_vga_mode[] = {
  94. {320, 232, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
  95. .bytesperline = 320,
  96. .sizeimage = 320 * 232 * 4 / 8 + 590,
  97. .colorspace = V4L2_COLORSPACE_JPEG,
  98. .priv = 1},
  99. {640, 472, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
  100. .bytesperline = 640,
  101. .sizeimage = 640 * 472 * 3 / 8 + 590,
  102. .colorspace = V4L2_COLORSPACE_JPEG,
  103. .priv = 0},
  104. };
  105. static const struct v4l2_pix_format sif_mode[] = {
  106. {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
  107. .bytesperline = 176,
  108. .sizeimage = 176 * 144 * 3 / 8 + 590,
  109. .colorspace = V4L2_COLORSPACE_JPEG,
  110. .priv = 1},
  111. {352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
  112. .bytesperline = 352,
  113. .sizeimage = 352 * 288 * 3 / 8 + 590,
  114. .colorspace = V4L2_COLORSPACE_JPEG,
  115. .priv = 0},
  116. };
  117. /*
  118. * Bridge reg08 bits 1-2 -> JPEG quality conversion table. Note the highest
  119. * quality setting is not usable as USB 1 does not have enough bandwidth.
  120. */
  121. static u8 jpeg_qual[] = {50, 75, 87, /* 94 */};
  122. /* usb exchanges */
  123. struct usb_action {
  124. u8 req;
  125. u8 val;
  126. u16 idx;
  127. };
  128. static const struct usb_action adcm2700_Initial[] = {
  129. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
  130. {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT}, /* 00,02,04,cc */
  131. {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
  132. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
  133. {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */
  134. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
  135. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
  136. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
  137. {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
  138. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
  139. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
  140. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
  141. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
  142. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
  143. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
  144. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
  145. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
  146. {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
  147. {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
  148. {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */
  149. {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
  150. {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */
  151. {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
  152. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
  153. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
  154. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
  155. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
  156. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
  157. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
  158. {0xa0, 0x58, ZC3XX_R116_RGAIN}, /* 01,16,58,cc */
  159. {0xa0, 0x5a, ZC3XX_R118_BGAIN}, /* 01,18,5a,cc */
  160. {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
  161. {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */
  162. {0xbb, 0x00, 0x0408}, /* 04,00,08,bb */
  163. {0xdd, 0x00, 0x0200}, /* 00,02,00,dd */
  164. {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */
  165. {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
  166. {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */
  167. {0xbb, 0xe0, 0x0c2e}, /* 0c,e0,2e,bb */
  168. {0xbb, 0x01, 0x2000}, /* 20,01,00,bb */
  169. {0xbb, 0x96, 0x2400}, /* 24,96,00,bb */
  170. {0xbb, 0x06, 0x1006}, /* 10,06,06,bb */
  171. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  172. {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
  173. {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
  174. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
  175. {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
  176. {0xbb, 0x5f, 0x2090}, /* 20,5f,90,bb */
  177. {0xbb, 0x01, 0x8000}, /* 80,01,00,bb */
  178. {0xbb, 0x09, 0x8400}, /* 84,09,00,bb */
  179. {0xbb, 0x86, 0x0002}, /* 00,86,02,bb */
  180. {0xbb, 0xe6, 0x0401}, /* 04,e6,01,bb */
  181. {0xbb, 0x86, 0x0802}, /* 08,86,02,bb */
  182. {0xbb, 0xe6, 0x0c01}, /* 0c,e6,01,bb */
  183. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  184. {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
  185. {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */
  186. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
  187. {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
  188. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  189. {0xaa, 0xfe, 0x0020}, /* 00,fe,20,aa */
  190. /*mswin+*/
  191. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
  192. {0xaa, 0xfe, 0x0002},
  193. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
  194. {0xaa, 0xb4, 0xcd37},
  195. {0xaa, 0xa4, 0x0004},
  196. {0xaa, 0xa8, 0x0007},
  197. {0xaa, 0xac, 0x0004},
  198. /*mswin-*/
  199. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
  200. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  201. {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
  202. {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */
  203. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
  204. {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
  205. {0xbb, 0x04, 0x0400}, /* 04,04,00,bb */
  206. {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
  207. {0xbb, 0x01, 0x0400}, /* 04,01,00,bb */
  208. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  209. {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
  210. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
  211. {0xbb, 0x41, 0x2803}, /* 28,41,03,bb */
  212. {0xbb, 0x40, 0x2c03}, /* 2c,40,03,bb */
  213. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  214. {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
  215. {}
  216. };
  217. static const struct usb_action adcm2700_InitialScale[] = {
  218. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
  219. {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
  220. {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
  221. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
  222. {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */
  223. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
  224. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
  225. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
  226. {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
  227. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
  228. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
  229. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
  230. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
  231. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
  232. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
  233. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
  234. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
  235. {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d8,cc */
  236. {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
  237. {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */
  238. {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
  239. {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */
  240. {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
  241. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
  242. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
  243. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
  244. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
  245. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
  246. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
  247. {0xa0, 0x58, ZC3XX_R116_RGAIN}, /* 01,16,58,cc */
  248. {0xa0, 0x5a, ZC3XX_R118_BGAIN}, /* 01,18,5a,cc */
  249. {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
  250. {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */
  251. {0xbb, 0x00, 0x0408}, /* 04,00,08,bb */
  252. {0xdd, 0x00, 0x0200}, /* 00,02,00,dd */
  253. {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */
  254. {0xdd, 0x00, 0x0050}, /* 00,00,50,dd */
  255. {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */
  256. {0xbb, 0xe0, 0x0c2e}, /* 0c,e0,2e,bb */
  257. {0xbb, 0x01, 0x2000}, /* 20,01,00,bb */
  258. {0xbb, 0x96, 0x2400}, /* 24,96,00,bb */
  259. {0xbb, 0x06, 0x1006}, /* 10,06,06,bb */
  260. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  261. {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
  262. {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
  263. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
  264. {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
  265. {0xbb, 0x5f, 0x2090}, /* 20,5f,90,bb */
  266. {0xbb, 0x01, 0x8000}, /* 80,01,00,bb */
  267. {0xbb, 0x09, 0x8400}, /* 84,09,00,bb */
  268. {0xbb, 0x86, 0x0002}, /* 00,88,02,bb */
  269. {0xbb, 0xe6, 0x0401}, /* 04,e6,01,bb */
  270. {0xbb, 0x86, 0x0802}, /* 08,88,02,bb */
  271. {0xbb, 0xe6, 0x0c01}, /* 0c,e6,01,bb */
  272. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  273. {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
  274. {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */
  275. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
  276. {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
  277. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  278. {0xaa, 0xfe, 0x0020}, /* 00,fe,20,aa */
  279. /*******/
  280. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
  281. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  282. {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
  283. {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */
  284. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
  285. {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */
  286. {0xbb, 0x04, 0x0400}, /* 04,04,00,bb */
  287. {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
  288. {0xbb, 0x01, 0x0400}, /* 04,01,00,bb */
  289. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  290. {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
  291. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
  292. {0xbb, 0x41, 0x2803}, /* 28,41,03,bb */
  293. {0xbb, 0x40, 0x2c03}, /* 2c,40,03,bb */
  294. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  295. {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
  296. {}
  297. };
  298. static const struct usb_action adcm2700_50HZ[] = {
  299. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  300. {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
  301. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
  302. {0xbb, 0x05, 0x8400}, /* 84,05,00,bb */
  303. {0xbb, 0xd0, 0xb007}, /* b0,d0,07,bb */
  304. {0xbb, 0xa0, 0xb80f}, /* b8,a0,0f,bb */
  305. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  306. {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
  307. {0xaa, 0x26, 0x00d0}, /* 00,26,d0,aa */
  308. {0xaa, 0x28, 0x0002}, /* 00,28,02,aa */
  309. {}
  310. };
  311. static const struct usb_action adcm2700_60HZ[] = {
  312. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  313. {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
  314. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
  315. {0xbb, 0x07, 0x8400}, /* 84,07,00,bb */
  316. {0xbb, 0x82, 0xb006}, /* b0,82,06,bb */
  317. {0xbb, 0x04, 0xb80d}, /* b8,04,0d,bb */
  318. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  319. {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
  320. {0xaa, 0x26, 0x0057}, /* 00,26,57,aa */
  321. {0xaa, 0x28, 0x0002}, /* 00,28,02,aa */
  322. {}
  323. };
  324. static const struct usb_action adcm2700_NoFliker[] = {
  325. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  326. {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */
  327. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */
  328. {0xbb, 0x07, 0x8400}, /* 84,07,00,bb */
  329. {0xbb, 0x05, 0xb000}, /* b0,05,00,bb */
  330. {0xbb, 0xa0, 0xb801}, /* b8,a0,01,bb */
  331. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  332. {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */
  333. {}
  334. };
  335. static const struct usb_action cs2102_InitialScale[] = { /* 320x240 */
  336. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  337. {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
  338. {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
  339. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  340. {0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
  341. {0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
  342. {0xa0, 0x30, ZC3XX_R083_RGAINADDR},
  343. {0xa0, 0x31, ZC3XX_R084_GGAINADDR},
  344. {0xa0, 0x32, ZC3XX_R085_BGAINADDR},
  345. {0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
  346. {0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
  347. {0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
  348. {0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
  349. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
  350. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
  351. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  352. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  353. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  354. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  355. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  356. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  357. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  358. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  359. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  360. {0xaa, 0x02, 0x0008},
  361. {0xaa, 0x03, 0x0000},
  362. {0xaa, 0x11, 0x0000},
  363. {0xaa, 0x12, 0x0089},
  364. {0xaa, 0x13, 0x0000},
  365. {0xaa, 0x14, 0x00e9},
  366. {0xaa, 0x20, 0x0000},
  367. {0xaa, 0x22, 0x0000},
  368. {0xaa, 0x0b, 0x0004},
  369. {0xaa, 0x30, 0x0030},
  370. {0xaa, 0x31, 0x0030},
  371. {0xaa, 0x32, 0x0030},
  372. {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
  373. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  374. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  375. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  376. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  377. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  378. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  379. {0xa0, 0x10, 0x01ae},
  380. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  381. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  382. {0xa0, 0x68, ZC3XX_R18D_YTARGET},
  383. {0xa0, 0x00, 0x01ad},
  384. {}
  385. };
  386. static const struct usb_action cs2102_Initial[] = { /* 640x480 */
  387. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  388. {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
  389. {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
  390. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  391. {0xa0, 0x20, ZC3XX_R080_HBLANKHIGH},
  392. {0xa0, 0x21, ZC3XX_R081_HBLANKLOW},
  393. {0xa0, 0x30, ZC3XX_R083_RGAINADDR},
  394. {0xa0, 0x31, ZC3XX_R084_GGAINADDR},
  395. {0xa0, 0x32, ZC3XX_R085_BGAINADDR},
  396. {0xa0, 0x23, ZC3XX_R086_EXPTIMEHIGH},
  397. {0xa0, 0x24, ZC3XX_R087_EXPTIMEMID},
  398. {0xa0, 0x25, ZC3XX_R088_EXPTIMELOW},
  399. {0xa0, 0xb3, ZC3XX_R08B_I2CDEVICEADDR},
  400. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
  401. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
  402. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  403. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  404. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  405. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  406. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  407. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  408. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  409. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  410. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  411. {0xaa, 0x02, 0x0008},
  412. {0xaa, 0x03, 0x0000},
  413. {0xaa, 0x11, 0x0001},
  414. {0xaa, 0x12, 0x0087},
  415. {0xaa, 0x13, 0x0001},
  416. {0xaa, 0x14, 0x00e7},
  417. {0xaa, 0x20, 0x0000},
  418. {0xaa, 0x22, 0x0000},
  419. {0xaa, 0x0b, 0x0004},
  420. {0xaa, 0x30, 0x0030},
  421. {0xaa, 0x31, 0x0030},
  422. {0xaa, 0x32, 0x0030},
  423. {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
  424. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  425. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  426. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  427. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  428. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  429. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  430. {0xa0, 0x15, 0x01ae},
  431. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  432. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  433. {0xa0, 0x68, ZC3XX_R18D_YTARGET},
  434. {0xa0, 0x00, 0x01ad},
  435. {}
  436. };
  437. static const struct usb_action cs2102_50HZScale[] = {
  438. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  439. {0xaa, 0x23, 0x0001},
  440. {0xaa, 0x24, 0x005f},
  441. {0xaa, 0x25, 0x0090},
  442. {0xaa, 0x21, 0x00dd},
  443. {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
  444. {0xa0, 0xbf, ZC3XX_R191_EXPOSURELIMITMID},
  445. {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW},
  446. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  447. {0xa0, 0x3a, ZC3XX_R196_ANTIFLICKERMID},
  448. {0xa0, 0x98, ZC3XX_R197_ANTIFLICKERLOW},
  449. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
  450. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  451. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
  452. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
  453. {0xa0, 0xdd, ZC3XX_R01D_HSYNC_0},
  454. {0xa0, 0xe4, ZC3XX_R01E_HSYNC_1},
  455. {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
  456. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  457. {}
  458. };
  459. static const struct usb_action cs2102_50HZ[] = {
  460. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  461. {0xaa, 0x23, 0x0000},
  462. {0xaa, 0x24, 0x00af},
  463. {0xaa, 0x25, 0x00c8},
  464. {0xaa, 0x21, 0x0068},
  465. {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
  466. {0xa0, 0x5f, ZC3XX_R191_EXPOSURELIMITMID},
  467. {0xa0, 0x90, ZC3XX_R192_EXPOSURELIMITLOW},
  468. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  469. {0xa0, 0x1d, ZC3XX_R196_ANTIFLICKERMID},
  470. {0xa0, 0x4c, ZC3XX_R197_ANTIFLICKERLOW},
  471. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
  472. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  473. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
  474. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
  475. {0xa0, 0x68, ZC3XX_R01D_HSYNC_0},
  476. {0xa0, 0xe3, ZC3XX_R01E_HSYNC_1},
  477. {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
  478. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  479. {}
  480. };
  481. static const struct usb_action cs2102_60HZScale[] = {
  482. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  483. {0xaa, 0x23, 0x0001},
  484. {0xaa, 0x24, 0x0055},
  485. {0xaa, 0x25, 0x00cc},
  486. {0xaa, 0x21, 0x003f},
  487. {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
  488. {0xa0, 0xab, ZC3XX_R191_EXPOSURELIMITMID},
  489. {0xa0, 0x98, ZC3XX_R192_EXPOSURELIMITLOW},
  490. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  491. {0xa0, 0x30, ZC3XX_R196_ANTIFLICKERMID},
  492. {0xa0, 0xd4, ZC3XX_R197_ANTIFLICKERLOW},
  493. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
  494. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  495. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
  496. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
  497. {0xa0, 0x39, ZC3XX_R01D_HSYNC_0},
  498. {0xa0, 0x70, ZC3XX_R01E_HSYNC_1},
  499. {0xa0, 0xb0, ZC3XX_R01F_HSYNC_2},
  500. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  501. {}
  502. };
  503. static const struct usb_action cs2102_60HZ[] = {
  504. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  505. {0xaa, 0x23, 0x0000},
  506. {0xaa, 0x24, 0x00aa},
  507. {0xaa, 0x25, 0x00e6},
  508. {0xaa, 0x21, 0x003f},
  509. {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
  510. {0xa0, 0x55, ZC3XX_R191_EXPOSURELIMITMID},
  511. {0xa0, 0xcc, ZC3XX_R192_EXPOSURELIMITLOW},
  512. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  513. {0xa0, 0x18, ZC3XX_R196_ANTIFLICKERMID},
  514. {0xa0, 0x6a, ZC3XX_R197_ANTIFLICKERLOW},
  515. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
  516. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  517. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
  518. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
  519. {0xa0, 0x3f, ZC3XX_R01D_HSYNC_0},
  520. {0xa0, 0xa5, ZC3XX_R01E_HSYNC_1},
  521. {0xa0, 0xf0, ZC3XX_R01F_HSYNC_2},
  522. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  523. {}
  524. };
  525. static const struct usb_action cs2102_NoFlikerScale[] = {
  526. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  527. {0xaa, 0x23, 0x0001},
  528. {0xaa, 0x24, 0x005f},
  529. {0xaa, 0x25, 0x0000},
  530. {0xaa, 0x21, 0x0001},
  531. {0xa0, 0x02, ZC3XX_R190_EXPOSURELIMITHIGH},
  532. {0xa0, 0xbf, ZC3XX_R191_EXPOSURELIMITMID},
  533. {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
  534. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  535. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  536. {0xa0, 0x80, ZC3XX_R197_ANTIFLICKERLOW},
  537. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
  538. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  539. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
  540. {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
  541. {0xa0, 0x01, ZC3XX_R01D_HSYNC_0},
  542. {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
  543. {0xa0, 0xa0, ZC3XX_R01F_HSYNC_2},
  544. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  545. {}
  546. };
  547. static const struct usb_action cs2102_NoFliker[] = {
  548. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  549. {0xaa, 0x23, 0x0000},
  550. {0xaa, 0x24, 0x00af},
  551. {0xaa, 0x25, 0x0080},
  552. {0xaa, 0x21, 0x0001},
  553. {0xa0, 0x01, ZC3XX_R190_EXPOSURELIMITHIGH},
  554. {0xa0, 0x5f, ZC3XX_R191_EXPOSURELIMITMID},
  555. {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},
  556. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  557. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  558. {0xa0, 0x80, ZC3XX_R197_ANTIFLICKERLOW},
  559. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
  560. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  561. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
  562. {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
  563. {0xa0, 0x01, ZC3XX_R01D_HSYNC_0},
  564. {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
  565. {0xa0, 0xa0, ZC3XX_R01F_HSYNC_2},
  566. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  567. {}
  568. };
  569. /* CS2102_KOCOM */
  570. static const struct usb_action cs2102K_InitialScale[] = {
  571. {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
  572. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  573. {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
  574. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  575. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  576. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  577. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  578. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  579. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
  580. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  581. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  582. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  583. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  584. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  585. {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
  586. {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
  587. {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
  588. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  589. {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
  590. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  591. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  592. {0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
  593. {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
  594. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  595. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  596. {0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
  597. {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
  598. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  599. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  600. {0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
  601. {0xa0, 0x7c, ZC3XX_R093_I2CSETVALUE},
  602. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  603. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  604. {0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
  605. {0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
  606. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  607. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  608. {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
  609. {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
  610. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  611. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  612. {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
  613. {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
  614. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  615. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  616. {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
  617. {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
  618. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  619. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  620. {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
  621. {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
  622. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  623. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  624. {0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
  625. {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
  626. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  627. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  628. {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
  629. {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
  630. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  631. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  632. {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
  633. {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
  634. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  635. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  636. {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
  637. {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
  638. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  639. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  640. {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
  641. {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
  642. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  643. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  644. {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
  645. {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
  646. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  647. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  648. {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
  649. {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
  650. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  651. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  652. {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
  653. {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
  654. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  655. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  656. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  657. {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
  658. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  659. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  660. {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
  661. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  662. {0xa0, 0x78, ZC3XX_R18D_YTARGET},
  663. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  664. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  665. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  666. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  667. {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
  668. {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
  669. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  670. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  671. {0xa0, 0x00, 0x01ad},
  672. {0xa0, 0x01, 0x01b1},
  673. {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
  674. {0xa0, 0x60, ZC3XX_R116_RGAIN},
  675. {0xa0, 0x40, ZC3XX_R117_GGAIN},
  676. {0xa0, 0x4c, ZC3XX_R118_BGAIN},
  677. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
  678. {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
  679. {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
  680. {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
  681. {0xa0, 0x38, ZC3XX_R121_GAMMA01},
  682. {0xa0, 0x59, ZC3XX_R122_GAMMA02},
  683. {0xa0, 0x79, ZC3XX_R123_GAMMA03},
  684. {0xa0, 0x92, ZC3XX_R124_GAMMA04},
  685. {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
  686. {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
  687. {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
  688. {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
  689. {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
  690. {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
  691. {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
  692. {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
  693. {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
  694. {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
  695. {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
  696. {0xa0, 0x26, ZC3XX_R130_GAMMA10},
  697. {0xa0, 0x22, ZC3XX_R131_GAMMA11},
  698. {0xa0, 0x20, ZC3XX_R132_GAMMA12},
  699. {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
  700. {0xa0, 0x16, ZC3XX_R134_GAMMA14},
  701. {0xa0, 0x13, ZC3XX_R135_GAMMA15},
  702. {0xa0, 0x10, ZC3XX_R136_GAMMA16},
  703. {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
  704. {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
  705. {0xa0, 0x09, ZC3XX_R139_GAMMA19},
  706. {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
  707. {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
  708. {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
  709. {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
  710. {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
  711. {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
  712. {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
  713. {0xa0, 0xf4, ZC3XX_R10B_RGB01},
  714. {0xa0, 0xf4, ZC3XX_R10C_RGB02},
  715. {0xa0, 0xf4, ZC3XX_R10D_RGB10},
  716. {0xa0, 0x58, ZC3XX_R10E_RGB11},
  717. {0xa0, 0xf4, ZC3XX_R10F_RGB12},
  718. {0xa0, 0xf4, ZC3XX_R110_RGB20},
  719. {0xa0, 0xf4, ZC3XX_R111_RGB21},
  720. {0xa0, 0x58, ZC3XX_R112_RGB22},
  721. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  722. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  723. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  724. {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
  725. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  726. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  727. {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
  728. {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
  729. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  730. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  731. {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
  732. {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
  733. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  734. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  735. {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
  736. {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
  737. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  738. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  739. {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
  740. {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
  741. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  742. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  743. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  744. {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
  745. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  746. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  747. {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
  748. {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
  749. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  750. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  751. {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
  752. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  753. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  754. {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
  755. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
  756. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  757. {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
  758. {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
  759. {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
  760. {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
  761. {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
  762. {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
  763. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  764. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  765. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  766. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  767. {0xa0, 0x60, ZC3XX_R116_RGAIN},
  768. {0xa0, 0x40, ZC3XX_R117_GGAIN},
  769. {0xa0, 0x4c, ZC3XX_R118_BGAIN},
  770. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  771. {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
  772. {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
  773. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  774. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  775. {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
  776. {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
  777. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  778. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  779. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  780. {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
  781. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  782. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  783. {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
  784. {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
  785. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  786. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  787. {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
  788. {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
  789. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  790. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  791. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  792. {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
  793. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  794. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  795. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  796. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  797. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  798. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  799. {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
  800. {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
  801. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  802. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  803. {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
  804. {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
  805. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  806. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  807. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  808. {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
  809. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  810. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  811. {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
  812. {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
  813. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  814. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  815. {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
  816. {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
  817. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  818. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  819. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  820. {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
  821. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  822. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  823. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  824. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  825. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  826. {}
  827. };
  828. static const struct usb_action cs2102K_Initial[] = {
  829. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  830. {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
  831. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  832. {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
  833. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  834. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  835. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  836. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  837. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  838. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
  839. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  840. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  841. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  842. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  843. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  844. {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
  845. {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
  846. /*fixme: next sequence = i2c exchanges*/
  847. {0xa0, 0x55, ZC3XX_R08B_I2CDEVICEADDR},
  848. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  849. {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
  850. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  851. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  852. {0xa0, 0x0a, ZC3XX_R092_I2CADDRESSSELECT},
  853. {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
  854. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  855. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  856. {0xa0, 0x0b, ZC3XX_R092_I2CADDRESSSELECT},
  857. {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
  858. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  859. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  860. {0xa0, 0x0c, ZC3XX_R092_I2CADDRESSSELECT},
  861. {0xa0, 0x7b, ZC3XX_R093_I2CSETVALUE},
  862. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  863. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  864. {0xa0, 0x0d, ZC3XX_R092_I2CADDRESSSELECT},
  865. {0xa0, 0xa3, ZC3XX_R093_I2CSETVALUE},
  866. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  867. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  868. {0xa0, 0x03, ZC3XX_R092_I2CADDRESSSELECT},
  869. {0xa0, 0xfb, ZC3XX_R093_I2CSETVALUE},
  870. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  871. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  872. {0xa0, 0x05, ZC3XX_R092_I2CADDRESSSELECT},
  873. {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
  874. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  875. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  876. {0xa0, 0x06, ZC3XX_R092_I2CADDRESSSELECT},
  877. {0xa0, 0x03, ZC3XX_R093_I2CSETVALUE},
  878. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  879. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  880. {0xa0, 0x09, ZC3XX_R092_I2CADDRESSSELECT},
  881. {0xa0, 0x08, ZC3XX_R093_I2CSETVALUE},
  882. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  883. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  884. {0xa0, 0x0e, ZC3XX_R092_I2CADDRESSSELECT},
  885. {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
  886. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  887. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  888. {0xa0, 0x0f, ZC3XX_R092_I2CADDRESSSELECT},
  889. {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
  890. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  891. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  892. {0xa0, 0x10, ZC3XX_R092_I2CADDRESSSELECT},
  893. {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
  894. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  895. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  896. {0xa0, 0x11, ZC3XX_R092_I2CADDRESSSELECT},
  897. {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
  898. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  899. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  900. {0xa0, 0x12, ZC3XX_R092_I2CADDRESSSELECT},
  901. {0xa0, 0x18, ZC3XX_R093_I2CSETVALUE},
  902. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  903. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  904. {0xa0, 0x15, ZC3XX_R092_I2CADDRESSSELECT},
  905. {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
  906. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  907. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  908. {0xa0, 0x16, ZC3XX_R092_I2CADDRESSSELECT},
  909. {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
  910. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  911. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  912. {0xa0, 0x17, ZC3XX_R092_I2CADDRESSSELECT},
  913. {0xa0, 0x0c, ZC3XX_R093_I2CSETVALUE},
  914. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  915. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  916. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  917. {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
  918. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  919. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  920. {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
  921. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  922. {0xa0, 0x78, ZC3XX_R18D_YTARGET},
  923. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  924. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  925. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  926. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  927. {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID},
  928. {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW},
  929. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  930. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  931. {0xa0, 0x00, 0x01ad},
  932. {0xa0, 0x01, 0x01b1},
  933. {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
  934. {0xa0, 0x60, ZC3XX_R116_RGAIN},
  935. {0xa0, 0x40, ZC3XX_R117_GGAIN},
  936. {0xa0, 0x4c, ZC3XX_R118_BGAIN},
  937. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
  938. {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
  939. {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
  940. {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
  941. {0xa0, 0x38, ZC3XX_R121_GAMMA01},
  942. {0xa0, 0x59, ZC3XX_R122_GAMMA02},
  943. {0xa0, 0x79, ZC3XX_R123_GAMMA03},
  944. {0xa0, 0x92, ZC3XX_R124_GAMMA04},
  945. {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
  946. {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
  947. {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
  948. {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
  949. {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
  950. {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
  951. {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
  952. {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
  953. {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
  954. {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
  955. {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
  956. {0xa0, 0x26, ZC3XX_R130_GAMMA10},
  957. {0xa0, 0x22, ZC3XX_R131_GAMMA11},
  958. {0xa0, 0x20, ZC3XX_R132_GAMMA12},
  959. {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
  960. {0xa0, 0x16, ZC3XX_R134_GAMMA14},
  961. {0xa0, 0x13, ZC3XX_R135_GAMMA15},
  962. {0xa0, 0x10, ZC3XX_R136_GAMMA16},
  963. {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
  964. {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
  965. {0xa0, 0x09, ZC3XX_R139_GAMMA19},
  966. {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
  967. {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
  968. {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
  969. {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
  970. {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
  971. {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
  972. {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
  973. {0xa0, 0xf4, ZC3XX_R10B_RGB01},
  974. {0xa0, 0xf4, ZC3XX_R10C_RGB02},
  975. {0xa0, 0xf4, ZC3XX_R10D_RGB10},
  976. {0xa0, 0x58, ZC3XX_R10E_RGB11},
  977. {0xa0, 0xf4, ZC3XX_R10F_RGB12},
  978. {0xa0, 0xf4, ZC3XX_R110_RGB20},
  979. {0xa0, 0xf4, ZC3XX_R111_RGB21},
  980. {0xa0, 0x58, ZC3XX_R112_RGB22},
  981. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  982. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  983. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  984. {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
  985. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  986. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  987. {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
  988. {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
  989. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  990. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  991. {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
  992. {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
  993. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  994. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  995. {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
  996. {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
  997. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  998. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  999. {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
  1000. {0xa0, 0x22, ZC3XX_R093_I2CSETVALUE},
  1001. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1002. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1003. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  1004. {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
  1005. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1006. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1007. {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH},
  1008. {0xa0, 0x22, ZC3XX_R0A4_EXPOSURETIMELOW},
  1009. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  1010. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  1011. {0xa0, 0xee, ZC3XX_R192_EXPOSURELIMITLOW},
  1012. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  1013. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  1014. {0xa0, 0x3a, ZC3XX_R197_ANTIFLICKERLOW},
  1015. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
  1016. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  1017. {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
  1018. {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
  1019. {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
  1020. {0xa0, 0x0f, ZC3XX_R01E_HSYNC_1},
  1021. {0xa0, 0x19, ZC3XX_R01F_HSYNC_2},
  1022. {0xa0, 0x1f, ZC3XX_R020_HSYNC_3},
  1023. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  1024. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  1025. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  1026. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  1027. {0xa0, 0x60, ZC3XX_R116_RGAIN},
  1028. {0xa0, 0x40, ZC3XX_R117_GGAIN},
  1029. {0xa0, 0x4c, ZC3XX_R118_BGAIN},
  1030. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  1031. {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
  1032. {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
  1033. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1034. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1035. {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
  1036. {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
  1037. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1038. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1039. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  1040. {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
  1041. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1042. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1043. {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
  1044. {0xa0, 0x5c, ZC3XX_R093_I2CSETVALUE},
  1045. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1046. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1047. {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
  1048. {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
  1049. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1050. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1051. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  1052. {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
  1053. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1054. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1055. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  1056. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  1057. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  1058. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  1059. {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
  1060. {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
  1061. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1062. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1063. {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
  1064. {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
  1065. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1066. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1067. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  1068. {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
  1069. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1070. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1071. {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
  1072. {0xa0, 0x96, ZC3XX_R093_I2CSETVALUE},
  1073. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1074. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1075. {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
  1076. {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
  1077. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1078. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1079. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  1080. {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
  1081. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1082. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1083. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  1084. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  1085. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  1086. /*fixme:what does the next sequence?*/
  1087. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  1088. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  1089. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  1090. {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
  1091. {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
  1092. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1093. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1094. {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
  1095. {0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
  1096. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1097. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1098. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  1099. {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
  1100. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1101. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1102. {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
  1103. {0xa0, 0xd0, ZC3XX_R093_I2CSETVALUE},
  1104. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1105. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1106. {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
  1107. {0xa0, 0x01, ZC3XX_R093_I2CSETVALUE},
  1108. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1109. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1110. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  1111. {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
  1112. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1113. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1114. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  1115. {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING},
  1116. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  1117. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  1118. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  1119. {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
  1120. {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
  1121. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1122. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1123. {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
  1124. {0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
  1125. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1126. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1127. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  1128. {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
  1129. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1130. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1131. {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
  1132. {0xa0, 0x0a, ZC3XX_R093_I2CSETVALUE},
  1133. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1134. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1135. {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
  1136. {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
  1137. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1138. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1139. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  1140. {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
  1141. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1142. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1143. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  1144. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  1145. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  1146. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  1147. {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
  1148. {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
  1149. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1150. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1151. {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
  1152. {0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
  1153. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1154. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1155. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  1156. {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
  1157. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1158. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1159. {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
  1160. {0xa0, 0x44, ZC3XX_R093_I2CSETVALUE},
  1161. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1162. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1163. {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
  1164. {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
  1165. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1166. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1167. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  1168. {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
  1169. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1170. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1171. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  1172. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  1173. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  1174. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  1175. {0xa0, 0x20, ZC3XX_R092_I2CADDRESSSELECT},
  1176. {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
  1177. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1178. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1179. {0xa0, 0x21, ZC3XX_R092_I2CADDRESSSELECT},
  1180. {0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
  1181. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1182. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1183. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  1184. {0xa0, 0x00, ZC3XX_R093_I2CSETVALUE},
  1185. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1186. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1187. {0xa0, 0x13, ZC3XX_R092_I2CADDRESSSELECT},
  1188. {0xa0, 0x7e, ZC3XX_R093_I2CSETVALUE},
  1189. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1190. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1191. {0xa0, 0x14, ZC3XX_R092_I2CADDRESSSELECT},
  1192. {0xa0, 0x02, ZC3XX_R093_I2CSETVALUE},
  1193. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1194. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1195. {0xa0, 0x18, ZC3XX_R092_I2CADDRESSSELECT},
  1196. {0xa0, 0x04, ZC3XX_R093_I2CSETVALUE},
  1197. {0xa0, 0x00, ZC3XX_R094_I2CWRITEACK},
  1198. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  1199. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  1200. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  1201. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  1202. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  1203. {}
  1204. };
  1205. static const struct usb_action gc0305_Initial[] = { /* 640x480 */
  1206. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
  1207. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
  1208. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  1209. {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT}, /* 00,02,04,cc */
  1210. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
  1211. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
  1212. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
  1213. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
  1214. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
  1215. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
  1216. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
  1217. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
  1218. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
  1219. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
  1220. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
  1221. {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc */
  1222. {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
  1223. {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc */
  1224. {0xaa, 0x13, 0x0002}, /* 00,13,02,aa */
  1225. {0xaa, 0x15, 0x0003}, /* 00,15,03,aa */
  1226. {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
  1227. {0xaa, 0x02, 0x0000}, /* 00,02,00,aa */
  1228. {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
  1229. {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa */
  1230. {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
  1231. {0xaa, 0x1f, 0x0008}, /* 00,1f,08,aa */
  1232. {0xaa, 0x21, 0x0012}, /* 00,21,12,aa */
  1233. {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc */
  1234. {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc */
  1235. {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc */
  1236. {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
  1237. {0xaa, 0x0a, 0x0000}, /* 00,0a,00,aa */
  1238. {0xaa, 0x0b, 0x00b0}, /* 00,0b,b0,aa */
  1239. {0xaa, 0x0c, 0x0000}, /* 00,0c,00,aa */
  1240. {0xaa, 0x0d, 0x00b0}, /* 00,0d,b0,aa */
  1241. {0xaa, 0x0e, 0x0000}, /* 00,0e,00,aa */
  1242. {0xaa, 0x0f, 0x00b0}, /* 00,0f,b0,aa */
  1243. {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
  1244. {0xaa, 0x11, 0x00b0}, /* 00,11,b0,aa */
  1245. {0xaa, 0x16, 0x0001}, /* 00,16,01,aa */
  1246. {0xaa, 0x17, 0x00e6}, /* 00,17,e6,aa */
  1247. {0xaa, 0x18, 0x0002}, /* 00,18,02,aa */
  1248. {0xaa, 0x19, 0x0086}, /* 00,19,86,aa */
  1249. {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
  1250. {0xaa, 0x1b, 0x0020}, /* 00,1b,20,aa */
  1251. {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc */
  1252. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
  1253. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
  1254. {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc */
  1255. {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc */
  1256. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
  1257. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
  1258. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
  1259. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
  1260. {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
  1261. {0xa0, 0x85, ZC3XX_R18D_YTARGET}, /* 01,8d,85,cc */
  1262. {0xa0, 0x00, 0x011e}, /* 01,1e,00,cc */
  1263. {0xa0, 0x52, ZC3XX_R116_RGAIN}, /* 01,16,52,cc */
  1264. {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* 01,17,40,cc */
  1265. {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
  1266. {0xa0, 0x03, ZC3XX_R113_RGB03}, /* 01,13,03,cc */
  1267. {}
  1268. };
  1269. static const struct usb_action gc0305_InitialScale[] = { /* 320x240 */
  1270. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
  1271. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
  1272. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  1273. {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
  1274. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
  1275. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
  1276. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
  1277. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
  1278. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
  1279. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
  1280. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
  1281. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
  1282. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
  1283. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
  1284. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
  1285. {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc */
  1286. {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
  1287. {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc */
  1288. {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
  1289. {0xaa, 0x15, 0x0001}, /* 00,15,01,aa */
  1290. {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
  1291. {0xaa, 0x02, 0x0000}, /* 00,02,00,aa */
  1292. {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
  1293. {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa */
  1294. {0xaa, 0x1d, 0x0080}, /* 00,1d,80,aa */
  1295. {0xaa, 0x1f, 0x0008}, /* 00,1f,08,aa */
  1296. {0xaa, 0x21, 0x0012}, /* 00,21,12,aa */
  1297. {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc */
  1298. {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc */
  1299. {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc */
  1300. {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
  1301. {0xaa, 0x0a, 0x0000}, /* 00,0a,00,aa */
  1302. {0xaa, 0x0b, 0x00b0}, /* 00,0b,b0,aa */
  1303. {0xaa, 0x0c, 0x0000}, /* 00,0c,00,aa */
  1304. {0xaa, 0x0d, 0x00b0}, /* 00,0d,b0,aa */
  1305. {0xaa, 0x0e, 0x0000}, /* 00,0e,00,aa */
  1306. {0xaa, 0x0f, 0x00b0}, /* 00,0f,b0,aa */
  1307. {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
  1308. {0xaa, 0x11, 0x00b0}, /* 00,11,b0,aa */
  1309. {0xaa, 0x16, 0x0001}, /* 00,16,01,aa */
  1310. {0xaa, 0x17, 0x00e8}, /* 00,17,e8,aa */
  1311. {0xaa, 0x18, 0x0002}, /* 00,18,02,aa */
  1312. {0xaa, 0x19, 0x0088}, /* 00,19,88,aa */
  1313. {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
  1314. {0xaa, 0x1b, 0x0020}, /* 00,1b,20,aa */
  1315. {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc */
  1316. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
  1317. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
  1318. {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc */
  1319. {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc */
  1320. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
  1321. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
  1322. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
  1323. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
  1324. {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
  1325. {0xa0, 0x00, 0x011e}, /* 01,1e,00,cc */
  1326. {0xa0, 0x52, ZC3XX_R116_RGAIN}, /* 01,16,52,cc */
  1327. {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* 01,17,40,cc */
  1328. {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
  1329. {0xa0, 0x03, ZC3XX_R113_RGB03}, /* 01,13,03,cc */
  1330. {}
  1331. };
  1332. static const struct usb_action gc0305_50HZ[] = {
  1333. {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
  1334. {0xaa, 0x83, 0x0002}, /* 00,83,02,aa */
  1335. {0xaa, 0x84, 0x0038}, /* 00,84,38,aa */ /* win: 00,84,ec */
  1336. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  1337. {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0b,cc */
  1338. {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
  1339. /* win: 01,92,10 */
  1340. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  1341. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  1342. {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,8e,cc */
  1343. /* win: 01,97,ec */
  1344. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc */
  1345. {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc */
  1346. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
  1347. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
  1348. {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc */
  1349. {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
  1350. {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
  1351. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  1352. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,60,cc */
  1353. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
  1354. /* {0xa0, 0x85, ZC3XX_R18D_YTARGET}, * 01,8d,85,cc *
  1355. * if 640x480 */
  1356. {}
  1357. };
  1358. static const struct usb_action gc0305_60HZ[] = {
  1359. {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
  1360. {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
  1361. {0xaa, 0x84, 0x00ec}, /* 00,84,ec,aa */
  1362. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  1363. {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0b,cc */
  1364. {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc */
  1365. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  1366. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  1367. {0xa0, 0xec, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,ec,cc */
  1368. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc */
  1369. {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc */
  1370. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
  1371. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
  1372. {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc */
  1373. {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
  1374. {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
  1375. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  1376. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,60,cc */
  1377. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
  1378. {0xa0, 0x80, ZC3XX_R18D_YTARGET}, /* 01,8d,80,cc */
  1379. {}
  1380. };
  1381. static const struct usb_action gc0305_NoFliker[] = {
  1382. {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc */
  1383. {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
  1384. {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
  1385. {0xaa, 0x84, 0x0020}, /* 00,84,20,aa */
  1386. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  1387. {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,00,cc */
  1388. {0xa0, 0x48, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,48,cc */
  1389. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  1390. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  1391. {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
  1392. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc */
  1393. {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc */
  1394. {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc */
  1395. {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc */
  1396. {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc */
  1397. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  1398. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,60,cc */
  1399. {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,03,cc */
  1400. {0xa0, 0x80, ZC3XX_R18D_YTARGET}, /* 01,8d,80,cc */
  1401. {}
  1402. };
  1403. static const struct usb_action hdcs2020_InitialScale[] = {
  1404. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  1405. {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
  1406. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* qtable 0x05 */
  1407. {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
  1408. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  1409. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  1410. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  1411. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  1412. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  1413. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
  1414. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  1415. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  1416. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  1417. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  1418. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  1419. {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
  1420. {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
  1421. {0xaa, 0x1c, 0x0000},
  1422. {0xaa, 0x0a, 0x0001},
  1423. {0xaa, 0x0b, 0x0006},
  1424. {0xaa, 0x0c, 0x007b},
  1425. {0xaa, 0x0d, 0x00a7},
  1426. {0xaa, 0x03, 0x00fb},
  1427. {0xaa, 0x05, 0x0000},
  1428. {0xaa, 0x06, 0x0003},
  1429. {0xaa, 0x09, 0x0008},
  1430. {0xaa, 0x0f, 0x0018}, /* set sensor gain */
  1431. {0xaa, 0x10, 0x0018},
  1432. {0xaa, 0x11, 0x0018},
  1433. {0xaa, 0x12, 0x0018},
  1434. {0xaa, 0x15, 0x004e},
  1435. {0xaa, 0x1c, 0x0004},
  1436. {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
  1437. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  1438. {0xa0, 0x70, ZC3XX_R18D_YTARGET},
  1439. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  1440. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  1441. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  1442. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  1443. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  1444. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  1445. {0xa1, 0x01, 0x0002},
  1446. {0xa1, 0x01, 0x0008},
  1447. {0xa1, 0x01, 0x0180},
  1448. {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
  1449. {0xa0, 0x40, ZC3XX_R116_RGAIN},
  1450. {0xa0, 0x40, ZC3XX_R117_GGAIN},
  1451. {0xa0, 0x40, ZC3XX_R118_BGAIN},
  1452. {0xa1, 0x01, 0x0008},
  1453. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
  1454. {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
  1455. {0xa1, 0x01, 0x01c8},
  1456. {0xa1, 0x01, 0x01c9},
  1457. {0xa1, 0x01, 0x01ca},
  1458. {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
  1459. {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
  1460. {0xa0, 0x38, ZC3XX_R121_GAMMA01},
  1461. {0xa0, 0x59, ZC3XX_R122_GAMMA02},
  1462. {0xa0, 0x79, ZC3XX_R123_GAMMA03},
  1463. {0xa0, 0x92, ZC3XX_R124_GAMMA04},
  1464. {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
  1465. {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
  1466. {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
  1467. {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
  1468. {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
  1469. {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
  1470. {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
  1471. {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
  1472. {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
  1473. {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
  1474. {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
  1475. {0xa0, 0x26, ZC3XX_R130_GAMMA10},
  1476. {0xa0, 0x22, ZC3XX_R131_GAMMA11},
  1477. {0xa0, 0x20, ZC3XX_R132_GAMMA12},
  1478. {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
  1479. {0xa0, 0x16, ZC3XX_R134_GAMMA14},
  1480. {0xa0, 0x13, ZC3XX_R135_GAMMA15},
  1481. {0xa0, 0x10, ZC3XX_R136_GAMMA16},
  1482. {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
  1483. {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
  1484. {0xa0, 0x09, ZC3XX_R139_GAMMA19},
  1485. {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
  1486. {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
  1487. {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
  1488. {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
  1489. {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
  1490. {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
  1491. {0xa0, 0x66, ZC3XX_R10A_RGB00}, /* matrix */
  1492. {0xa0, 0xed, ZC3XX_R10B_RGB01},
  1493. {0xa0, 0xed, ZC3XX_R10C_RGB02},
  1494. {0xa0, 0xed, ZC3XX_R10D_RGB10},
  1495. {0xa0, 0x66, ZC3XX_R10E_RGB11},
  1496. {0xa0, 0xed, ZC3XX_R10F_RGB12},
  1497. {0xa0, 0xed, ZC3XX_R110_RGB20},
  1498. {0xa0, 0xed, ZC3XX_R111_RGB21},
  1499. {0xa0, 0x66, ZC3XX_R112_RGB22},
  1500. {0xa1, 0x01, 0x0180},
  1501. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  1502. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  1503. {0xaa, 0x13, 0x0031},
  1504. {0xaa, 0x14, 0x0001},
  1505. {0xaa, 0x0e, 0x0004},
  1506. {0xaa, 0x19, 0x00cd},
  1507. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  1508. {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
  1509. {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
  1510. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  1511. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  1512. {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
  1513. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
  1514. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  1515. {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 0x14 */
  1516. {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
  1517. {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
  1518. {0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
  1519. {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
  1520. {0xa0, 0x41, ZC3XX_R020_HSYNC_3},
  1521. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  1522. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  1523. {0xa1, 0x01, 0x0180},
  1524. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  1525. {0xa0, 0x40, ZC3XX_R116_RGAIN},
  1526. {0xa0, 0x40, ZC3XX_R117_GGAIN},
  1527. {0xa0, 0x40, ZC3XX_R118_BGAIN},
  1528. {}
  1529. };
  1530. static const struct usb_action hdcs2020_Initial[] = {
  1531. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  1532. {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
  1533. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  1534. {0xa0, 0x08, ZC3XX_R010_CMOSSENSORSELECT},
  1535. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  1536. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  1537. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  1538. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  1539. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  1540. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
  1541. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  1542. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  1543. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  1544. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  1545. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  1546. {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
  1547. {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
  1548. {0xaa, 0x1c, 0x0000},
  1549. {0xaa, 0x0a, 0x0001},
  1550. {0xaa, 0x0b, 0x0006},
  1551. {0xaa, 0x0c, 0x007a},
  1552. {0xaa, 0x0d, 0x00a7},
  1553. {0xaa, 0x03, 0x00fb},
  1554. {0xaa, 0x05, 0x0000},
  1555. {0xaa, 0x06, 0x0003},
  1556. {0xaa, 0x09, 0x0008},
  1557. {0xaa, 0x0f, 0x0018}, /* original setting */
  1558. {0xaa, 0x10, 0x0018},
  1559. {0xaa, 0x11, 0x0018},
  1560. {0xaa, 0x12, 0x0018},
  1561. {0xaa, 0x15, 0x004e},
  1562. {0xaa, 0x1c, 0x0004},
  1563. {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
  1564. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  1565. {0xa0, 0x70, ZC3XX_R18D_YTARGET},
  1566. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  1567. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  1568. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  1569. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  1570. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  1571. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  1572. {0xa1, 0x01, 0x0002},
  1573. {0xa1, 0x01, 0x0008},
  1574. {0xa1, 0x01, 0x0180},
  1575. {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
  1576. {0xa0, 0x40, ZC3XX_R116_RGAIN},
  1577. {0xa0, 0x40, ZC3XX_R117_GGAIN},
  1578. {0xa0, 0x40, ZC3XX_R118_BGAIN},
  1579. {0xa1, 0x01, 0x0008},
  1580. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
  1581. {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
  1582. {0xa1, 0x01, 0x01c8},
  1583. {0xa1, 0x01, 0x01c9},
  1584. {0xa1, 0x01, 0x01ca},
  1585. {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
  1586. {0xa0, 0x13, ZC3XX_R120_GAMMA00}, /* gamma 4 */
  1587. {0xa0, 0x38, ZC3XX_R121_GAMMA01},
  1588. {0xa0, 0x59, ZC3XX_R122_GAMMA02},
  1589. {0xa0, 0x79, ZC3XX_R123_GAMMA03},
  1590. {0xa0, 0x92, ZC3XX_R124_GAMMA04},
  1591. {0xa0, 0xa7, ZC3XX_R125_GAMMA05},
  1592. {0xa0, 0xb9, ZC3XX_R126_GAMMA06},
  1593. {0xa0, 0xc8, ZC3XX_R127_GAMMA07},
  1594. {0xa0, 0xd4, ZC3XX_R128_GAMMA08},
  1595. {0xa0, 0xdf, ZC3XX_R129_GAMMA09},
  1596. {0xa0, 0xe7, ZC3XX_R12A_GAMMA0A},
  1597. {0xa0, 0xee, ZC3XX_R12B_GAMMA0B},
  1598. {0xa0, 0xf4, ZC3XX_R12C_GAMMA0C},
  1599. {0xa0, 0xf9, ZC3XX_R12D_GAMMA0D},
  1600. {0xa0, 0xfc, ZC3XX_R12E_GAMMA0E},
  1601. {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
  1602. {0xa0, 0x26, ZC3XX_R130_GAMMA10},
  1603. {0xa0, 0x22, ZC3XX_R131_GAMMA11},
  1604. {0xa0, 0x20, ZC3XX_R132_GAMMA12},
  1605. {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
  1606. {0xa0, 0x16, ZC3XX_R134_GAMMA14},
  1607. {0xa0, 0x13, ZC3XX_R135_GAMMA15},
  1608. {0xa0, 0x10, ZC3XX_R136_GAMMA16},
  1609. {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
  1610. {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
  1611. {0xa0, 0x09, ZC3XX_R139_GAMMA19},
  1612. {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
  1613. {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
  1614. {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
  1615. {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
  1616. {0xa0, 0x03, ZC3XX_R13E_GAMMA1E},
  1617. {0xa0, 0x02, ZC3XX_R13F_GAMMA1F},
  1618. {0xa0, 0x66, ZC3XX_R10A_RGB00}, /* matrix */
  1619. {0xa0, 0xed, ZC3XX_R10B_RGB01},
  1620. {0xa0, 0xed, ZC3XX_R10C_RGB02},
  1621. {0xa0, 0xed, ZC3XX_R10D_RGB10},
  1622. {0xa0, 0x66, ZC3XX_R10E_RGB11},
  1623. {0xa0, 0xed, ZC3XX_R10F_RGB12},
  1624. {0xa0, 0xed, ZC3XX_R110_RGB20},
  1625. {0xa0, 0xed, ZC3XX_R111_RGB21},
  1626. {0xa0, 0x66, ZC3XX_R112_RGB22},
  1627. {0xa1, 0x01, 0x0180},
  1628. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  1629. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  1630. /**** set exposure ***/
  1631. {0xaa, 0x13, 0x0031},
  1632. {0xaa, 0x14, 0x0001},
  1633. {0xaa, 0x0e, 0x0004},
  1634. {0xaa, 0x19, 0x00cd},
  1635. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  1636. {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
  1637. {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW},
  1638. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  1639. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  1640. {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
  1641. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
  1642. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  1643. {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF},
  1644. {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP},
  1645. {0xa0, 0x04, ZC3XX_R01D_HSYNC_0},
  1646. {0xa0, 0x18, ZC3XX_R01E_HSYNC_1},
  1647. {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2},
  1648. {0xa0, 0x41, ZC3XX_R020_HSYNC_3},
  1649. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  1650. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  1651. {0xa1, 0x01, 0x0180},
  1652. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  1653. {0xa0, 0x40, ZC3XX_R116_RGAIN},
  1654. {0xa0, 0x40, ZC3XX_R117_GGAIN},
  1655. {0xa0, 0x40, ZC3XX_R118_BGAIN},
  1656. {}
  1657. };
  1658. static const struct usb_action hdcs2020_50HZ[] = {
  1659. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  1660. {0xaa, 0x13, 0x0018}, /* 00,13,18,aa */
  1661. {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
  1662. {0xaa, 0x0e, 0x0005}, /* 00,0e,05,aa */
  1663. {0xaa, 0x19, 0x001f}, /* 00,19,1f,aa */
  1664. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  1665. {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
  1666. {0xa0, 0x76, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,76,cc */
  1667. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  1668. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  1669. {0xa0, 0x46, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,46,cc */
  1670. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
  1671. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
  1672. {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
  1673. {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
  1674. {0xa0, 0x05, ZC3XX_R01D_HSYNC_0}, /* 00,1d,05,cc */
  1675. {0xa0, 0x1a, ZC3XX_R01E_HSYNC_1}, /* 00,1e,1a,cc */
  1676. {0xa0, 0x2f, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2f,cc */
  1677. {}
  1678. };
  1679. static const struct usb_action hdcs2020_60HZ[] = {
  1680. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  1681. {0xaa, 0x13, 0x0031}, /* 00,13,31,aa */
  1682. {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
  1683. {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */
  1684. {0xaa, 0x19, 0x00cd}, /* 00,19,cd,aa */
  1685. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  1686. {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
  1687. {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,62,cc */
  1688. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  1689. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  1690. {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3d,cc */
  1691. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
  1692. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
  1693. {0xa0, 0x0c, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,0c,cc */
  1694. {0xa0, 0x28, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,28,cc */
  1695. {0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
  1696. {0xa0, 0x18, ZC3XX_R01E_HSYNC_1}, /* 00,1e,18,cc */
  1697. {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2c,cc */
  1698. {}
  1699. };
  1700. static const struct usb_action hdcs2020_NoFliker[] = {
  1701. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  1702. {0xaa, 0x13, 0x0010}, /* 00,13,10,aa */
  1703. {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
  1704. {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */
  1705. {0xaa, 0x19, 0x0000}, /* 00,19,00,aa */
  1706. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  1707. {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
  1708. {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
  1709. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  1710. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  1711. {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
  1712. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
  1713. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
  1714. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
  1715. {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
  1716. {0xa0, 0x04, ZC3XX_R01D_HSYNC_0}, /* 00,1d,04,cc */
  1717. {0xa0, 0x17, ZC3XX_R01E_HSYNC_1}, /* 00,1e,17,cc */
  1718. {0xa0, 0x2a, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2a,cc */
  1719. {}
  1720. };
  1721. static const struct usb_action hv7131b_InitialScale[] = { /* 320x240 */
  1722. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  1723. {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
  1724. {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
  1725. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  1726. {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
  1727. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
  1728. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
  1729. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  1730. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  1731. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  1732. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  1733. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  1734. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  1735. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  1736. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  1737. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  1738. {0xaa, 0x30, 0x002d},
  1739. {0xaa, 0x01, 0x0005},
  1740. {0xaa, 0x11, 0x0000},
  1741. {0xaa, 0x13, 0x0001}, /* {0xaa, 0x13, 0x0000}, */
  1742. {0xaa, 0x14, 0x0001},
  1743. {0xaa, 0x15, 0x00e8},
  1744. {0xaa, 0x16, 0x0002},
  1745. {0xaa, 0x17, 0x0086}, /* 00,17,88,aa */
  1746. {0xaa, 0x31, 0x0038},
  1747. {0xaa, 0x32, 0x0038},
  1748. {0xaa, 0x33, 0x0038},
  1749. {0xaa, 0x5b, 0x0001},
  1750. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  1751. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  1752. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  1753. {0xa0, 0x68, ZC3XX_R18D_YTARGET},
  1754. {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
  1755. {0xa0, 0x00, 0x01ad},
  1756. {0xa0, 0xc0, 0x019b},
  1757. {0xa0, 0xa0, 0x019c},
  1758. {0xa0, 0x02, ZC3XX_R188_MINGAIN},
  1759. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  1760. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  1761. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  1762. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  1763. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  1764. {0xaa, 0x02, 0x0090}, /* 00,02,80,aa */
  1765. {}
  1766. };
  1767. static const struct usb_action hv7131b_Initial[] = { /* 640x480*/
  1768. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  1769. {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
  1770. {0xa0, 0x00, ZC3XX_R010_CMOSSENSORSELECT},
  1771. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  1772. {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
  1773. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
  1774. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
  1775. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  1776. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  1777. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  1778. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  1779. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  1780. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  1781. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  1782. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  1783. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  1784. {0xaa, 0x30, 0x002d},
  1785. {0xaa, 0x01, 0x0005},
  1786. {0xaa, 0x11, 0x0001},
  1787. {0xaa, 0x13, 0x0000}, /* {0xaa, 0x13, 0x0001}; */
  1788. {0xaa, 0x14, 0x0001},
  1789. {0xaa, 0x15, 0x00e6},
  1790. {0xaa, 0x16, 0x0002},
  1791. {0xaa, 0x17, 0x0086},
  1792. {0xaa, 0x31, 0x0038},
  1793. {0xaa, 0x32, 0x0038},
  1794. {0xaa, 0x33, 0x0038},
  1795. {0xaa, 0x5b, 0x0001},
  1796. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  1797. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  1798. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  1799. {0xa0, 0x70, ZC3XX_R18D_YTARGET},
  1800. {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
  1801. {0xa0, 0x00, 0x01ad},
  1802. {0xa0, 0xc0, 0x019b},
  1803. {0xa0, 0xa0, 0x019c},
  1804. {0xa0, 0x02, ZC3XX_R188_MINGAIN},
  1805. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  1806. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  1807. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  1808. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  1809. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  1810. {0xaa, 0x02, 0x0090}, /* {0xaa, 0x02, 0x0080}, */
  1811. {}
  1812. };
  1813. static const struct usb_action hv7131b_50HZ[] = { /* 640x480*/
  1814. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  1815. {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
  1816. {0xaa, 0x26, 0x0053}, /* 00,26,53,aa */
  1817. {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
  1818. {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
  1819. {0xaa, 0x21, 0x0050}, /* 00,21,50,aa */
  1820. {0xaa, 0x22, 0x001b}, /* 00,22,1b,aa */
  1821. {0xaa, 0x23, 0x00fc}, /* 00,23,fc,aa */
  1822. {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
  1823. {0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,9b,cc */
  1824. {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
  1825. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  1826. {0xa0, 0xea, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,ea,cc */
  1827. {0xa0, 0x60, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,60,cc */
  1828. {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
  1829. {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
  1830. {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
  1831. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
  1832. {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
  1833. {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
  1834. {0xa0, 0x1b, ZC3XX_R01F_HSYNC_2}, /* 00,1f,1b,cc */
  1835. {0xa0, 0xfc, ZC3XX_R020_HSYNC_3}, /* 00,20,fc,cc */
  1836. {}
  1837. };
  1838. static const struct usb_action hv7131b_50HZScale[] = { /* 320x240 */
  1839. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  1840. {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
  1841. {0xaa, 0x26, 0x0053}, /* 00,26,53,aa */
  1842. {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
  1843. {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
  1844. {0xaa, 0x21, 0x0050}, /* 00,21,50,aa */
  1845. {0xaa, 0x22, 0x0012}, /* 00,22,12,aa */
  1846. {0xaa, 0x23, 0x0080}, /* 00,23,80,aa */
  1847. {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
  1848. {0xa0, 0x9b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,9b,cc */
  1849. {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
  1850. {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,01,cc */
  1851. {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,d4,cc */
  1852. {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,c0,cc */
  1853. {0xa0, 0x07, ZC3XX_R18C_AEFREEZE}, /* 01,8c,07,cc */
  1854. {0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,0f,cc */
  1855. {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
  1856. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
  1857. {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
  1858. {0xa0, 0x50, ZC3XX_R01E_HSYNC_1}, /* 00,1e,50,cc */
  1859. {0xa0, 0x12, ZC3XX_R01F_HSYNC_2}, /* 00,1f,12,cc */
  1860. {0xa0, 0x80, ZC3XX_R020_HSYNC_3}, /* 00,20,80,cc */
  1861. {}
  1862. };
  1863. static const struct usb_action hv7131b_60HZ[] = { /* 640x480*/
  1864. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  1865. {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
  1866. {0xaa, 0x26, 0x00a1}, /* 00,26,a1,aa */
  1867. {0xaa, 0x27, 0x0020}, /* 00,27,20,aa */
  1868. {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
  1869. {0xaa, 0x21, 0x0040}, /* 00,21,40,aa */
  1870. {0xaa, 0x22, 0x0013}, /* 00,22,13,aa */
  1871. {0xaa, 0x23, 0x004c}, /* 00,23,4c,aa */
  1872. {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
  1873. {0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,4d,cc */
  1874. {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,60,cc */
  1875. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  1876. {0xa0, 0xc3, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,c3,cc */
  1877. {0xa0, 0x50, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,50,cc */
  1878. {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
  1879. {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
  1880. {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
  1881. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
  1882. {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
  1883. {0xa0, 0x40, ZC3XX_R01E_HSYNC_1}, /* 00,1e,40,cc */
  1884. {0xa0, 0x13, ZC3XX_R01F_HSYNC_2}, /* 00,1f,13,cc */
  1885. {0xa0, 0x4c, ZC3XX_R020_HSYNC_3}, /* 00,20,4c,cc */
  1886. {}
  1887. };
  1888. static const struct usb_action hv7131b_60HZScale[] = { /* 320x240 */
  1889. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  1890. {0xaa, 0x25, 0x0007}, /* 00,25,07,aa */
  1891. {0xaa, 0x26, 0x00a1}, /* 00,26,a1,aa */
  1892. {0xaa, 0x27, 0x0020}, /* 00,27,20,aa */
  1893. {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
  1894. {0xaa, 0x21, 0x00a0}, /* 00,21,a0,aa */
  1895. {0xaa, 0x22, 0x0016}, /* 00,22,16,aa */
  1896. {0xaa, 0x23, 0x0040}, /* 00,23,40,aa */
  1897. {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
  1898. {0xa0, 0x4d, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,4d,cc */
  1899. {0xa0, 0x60, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,60,cc */
  1900. {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,01,cc */
  1901. {0xa0, 0x86, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,86,cc */
  1902. {0xa0, 0xa0, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,a0,cc */
  1903. {0xa0, 0x07, ZC3XX_R18C_AEFREEZE}, /* 01,8c,07,cc */
  1904. {0xa0, 0x0f, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,0f,cc */
  1905. {0xa0, 0x18, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,18,cc */
  1906. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
  1907. {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
  1908. {0xa0, 0xa0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,a0,cc */
  1909. {0xa0, 0x16, ZC3XX_R01F_HSYNC_2}, /* 00,1f,16,cc */
  1910. {0xa0, 0x40, ZC3XX_R020_HSYNC_3}, /* 00,20,40,cc */
  1911. {}
  1912. };
  1913. static const struct usb_action hv7131b_NoFliker[] = { /* 640x480*/
  1914. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  1915. {0xaa, 0x25, 0x0003}, /* 00,25,03,aa */
  1916. {0xaa, 0x26, 0x0000}, /* 00,26,00,aa */
  1917. {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
  1918. {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
  1919. {0xaa, 0x21, 0x0010}, /* 00,21,10,aa */
  1920. {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
  1921. {0xaa, 0x23, 0x0003}, /* 00,23,03,aa */
  1922. {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
  1923. {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,f8,cc */
  1924. {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,00,cc */
  1925. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  1926. {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,02,cc */
  1927. {0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,00,cc */
  1928. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
  1929. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
  1930. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
  1931. {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
  1932. {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
  1933. {0xa0, 0x10, ZC3XX_R01E_HSYNC_1}, /* 00,1e,10,cc */
  1934. {0xa0, 0x00, ZC3XX_R01F_HSYNC_2}, /* 00,1f,00,cc */
  1935. {0xa0, 0x03, ZC3XX_R020_HSYNC_3}, /* 00,20,03,cc */
  1936. {}
  1937. };
  1938. static const struct usb_action hv7131b_NoFlikerScale[] = { /* 320x240 */
  1939. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  1940. {0xaa, 0x25, 0x0003}, /* 00,25,03,aa */
  1941. {0xaa, 0x26, 0x0000}, /* 00,26,00,aa */
  1942. {0xaa, 0x27, 0x0000}, /* 00,27,00,aa */
  1943. {0xaa, 0x20, 0x0000}, /* 00,20,00,aa */
  1944. {0xaa, 0x21, 0x00a0}, /* 00,21,a0,aa */
  1945. {0xaa, 0x22, 0x0016}, /* 00,22,16,aa */
  1946. {0xaa, 0x23, 0x0040}, /* 00,23,40,aa */
  1947. {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,2f,cc */
  1948. {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,f8,cc */
  1949. {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,00,cc */
  1950. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  1951. {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,02,cc */
  1952. {0xa0, 0x00, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,00,cc */
  1953. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
  1954. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
  1955. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
  1956. {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
  1957. {0xa0, 0x00, ZC3XX_R01D_HSYNC_0}, /* 00,1d,00,cc */
  1958. {0xa0, 0xa0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,a0,cc */
  1959. {0xa0, 0x16, ZC3XX_R01F_HSYNC_2}, /* 00,1f,16,cc */
  1960. {0xa0, 0x40, ZC3XX_R020_HSYNC_3}, /* 00,20,40,cc */
  1961. {}
  1962. };
  1963. /* from lPEPI264v.inf (hv7131b!) */
  1964. static const struct usb_action hv7131r_InitialScale[] = {
  1965. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  1966. {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
  1967. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
  1968. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  1969. {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
  1970. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  1971. {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
  1972. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  1973. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  1974. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  1975. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  1976. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  1977. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  1978. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  1979. {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
  1980. {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
  1981. {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
  1982. {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
  1983. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  1984. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  1985. {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
  1986. {0xdd, 0x00, 0x0200},
  1987. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  1988. {0xaa, 0x01, 0x000c},
  1989. {0xaa, 0x11, 0x0000},
  1990. {0xaa, 0x13, 0x0000},
  1991. {0xaa, 0x14, 0x0001},
  1992. {0xaa, 0x15, 0x00e8},
  1993. {0xaa, 0x16, 0x0002},
  1994. {0xaa, 0x17, 0x0088},
  1995. {0xaa, 0x30, 0x000b},
  1996. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  1997. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  1998. {0xa0, 0x78, ZC3XX_R18D_YTARGET},
  1999. {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
  2000. {0xa0, 0x00, 0x01ad},
  2001. {0xa0, 0xc0, 0x019b},
  2002. {0xa0, 0xa0, 0x019c},
  2003. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  2004. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  2005. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  2006. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  2007. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  2008. {}
  2009. };
  2010. static const struct usb_action hv7131r_Initial[] = {
  2011. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  2012. {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
  2013. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT},
  2014. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  2015. {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
  2016. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  2017. {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
  2018. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  2019. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  2020. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  2021. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  2022. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  2023. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  2024. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  2025. {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
  2026. {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
  2027. {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
  2028. {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
  2029. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  2030. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  2031. {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
  2032. {0xdd, 0x00, 0x0200},
  2033. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  2034. {0xaa, 0x01, 0x000c},
  2035. {0xaa, 0x11, 0x0000},
  2036. {0xaa, 0x13, 0x0000},
  2037. {0xaa, 0x14, 0x0001},
  2038. {0xaa, 0x15, 0x00e6},
  2039. {0xaa, 0x16, 0x0002},
  2040. {0xaa, 0x17, 0x0086},
  2041. {0xaa, 0x30, 0x000b},
  2042. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  2043. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  2044. {0xa0, 0x78, ZC3XX_R18D_YTARGET},
  2045. {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
  2046. {0xa0, 0x00, 0x01ad},
  2047. {0xa0, 0xc0, 0x019b},
  2048. {0xa0, 0xa0, 0x019c},
  2049. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  2050. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  2051. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  2052. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  2053. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  2054. {}
  2055. };
  2056. static const struct usb_action hv7131r_50HZ[] = {
  2057. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  2058. {0xa0, 0x06, ZC3XX_R190_EXPOSURELIMITHIGH},
  2059. {0xa0, 0x68, ZC3XX_R191_EXPOSURELIMITMID},
  2060. {0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW},
  2061. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  2062. {0xa0, 0xea, ZC3XX_R196_ANTIFLICKERMID},
  2063. {0xa0, 0x60, ZC3XX_R197_ANTIFLICKERLOW},
  2064. {0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
  2065. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  2066. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
  2067. {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
  2068. {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
  2069. {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
  2070. {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
  2071. {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
  2072. {}
  2073. };
  2074. static const struct usb_action hv7131r_50HZScale[] = {
  2075. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  2076. {0xa0, 0x0c, ZC3XX_R190_EXPOSURELIMITHIGH},
  2077. {0xa0, 0xd1, ZC3XX_R191_EXPOSURELIMITMID},
  2078. {0xa0, 0x40, ZC3XX_R192_EXPOSURELIMITLOW},
  2079. {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
  2080. {0xa0, 0xd4, ZC3XX_R196_ANTIFLICKERMID},
  2081. {0xa0, 0xc0, ZC3XX_R197_ANTIFLICKERLOW},
  2082. {0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
  2083. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  2084. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
  2085. {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
  2086. {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
  2087. {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
  2088. {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
  2089. {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
  2090. {}
  2091. };
  2092. static const struct usb_action hv7131r_60HZ[] = {
  2093. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  2094. {0xa0, 0x06, ZC3XX_R190_EXPOSURELIMITHIGH},
  2095. {0xa0, 0x1a, ZC3XX_R191_EXPOSURELIMITMID},
  2096. {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW},
  2097. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  2098. {0xa0, 0xc3, ZC3XX_R196_ANTIFLICKERMID},
  2099. {0xa0, 0x50, ZC3XX_R197_ANTIFLICKERLOW},
  2100. {0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
  2101. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  2102. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
  2103. {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
  2104. {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
  2105. {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
  2106. {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
  2107. {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
  2108. {}
  2109. };
  2110. static const struct usb_action hv7131r_60HZScale[] = {
  2111. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  2112. {0xa0, 0x0c, ZC3XX_R190_EXPOSURELIMITHIGH},
  2113. {0xa0, 0x35, ZC3XX_R191_EXPOSURELIMITMID},
  2114. {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
  2115. {0xa0, 0x01, ZC3XX_R195_ANTIFLICKERHIGH},
  2116. {0xa0, 0x86, ZC3XX_R196_ANTIFLICKERMID},
  2117. {0xa0, 0xa0, ZC3XX_R197_ANTIFLICKERLOW},
  2118. {0xa0, 0x18, ZC3XX_R18C_AEFREEZE},
  2119. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  2120. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
  2121. {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
  2122. {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
  2123. {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
  2124. {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
  2125. {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
  2126. {}
  2127. };
  2128. static const struct usb_action hv7131r_NoFliker[] = {
  2129. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  2130. {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},
  2131. {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},
  2132. {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
  2133. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  2134. {0xa0, 0x02, ZC3XX_R196_ANTIFLICKERMID},
  2135. {0xa0, 0x58, ZC3XX_R197_ANTIFLICKERLOW},
  2136. {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
  2137. {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
  2138. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
  2139. {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
  2140. {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
  2141. {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
  2142. {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
  2143. {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
  2144. {}
  2145. };
  2146. static const struct usb_action hv7131r_NoFlikerScale[] = {
  2147. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  2148. {0xa0, 0x2f, ZC3XX_R190_EXPOSURELIMITHIGH},
  2149. {0xa0, 0xf8, ZC3XX_R191_EXPOSURELIMITMID},
  2150. {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
  2151. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  2152. {0xa0, 0x04, ZC3XX_R196_ANTIFLICKERMID},
  2153. {0xa0, 0xb0, ZC3XX_R197_ANTIFLICKERLOW},
  2154. {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
  2155. {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
  2156. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
  2157. {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
  2158. {0xa0, 0x00, ZC3XX_R01D_HSYNC_0},
  2159. {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1},
  2160. {0xa0, 0x00, ZC3XX_R01F_HSYNC_2},
  2161. {0xa0, 0x08, ZC3XX_R020_HSYNC_3},
  2162. {}
  2163. };
  2164. static const struct usb_action icm105a_InitialScale[] = {
  2165. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  2166. {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
  2167. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  2168. {0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
  2169. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  2170. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  2171. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  2172. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  2173. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  2174. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
  2175. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  2176. {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
  2177. {0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
  2178. {0xa0, 0x01, ZC3XX_R098_WINYSTARTLOW},
  2179. {0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
  2180. {0xa0, 0x01, ZC3XX_R09A_WINXSTARTLOW},
  2181. {0xa0, 0x01, ZC3XX_R11A_FIRSTYLOW},
  2182. {0xa0, 0x01, ZC3XX_R11C_FIRSTXLOW},
  2183. {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
  2184. {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
  2185. {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
  2186. {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
  2187. {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
  2188. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  2189. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  2190. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  2191. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  2192. {0xaa, 0x01, 0x0010},
  2193. {0xaa, 0x03, 0x0000},
  2194. {0xaa, 0x04, 0x0001},
  2195. {0xaa, 0x05, 0x0020},
  2196. {0xaa, 0x06, 0x0001},
  2197. {0xaa, 0x08, 0x0000},
  2198. {0xaa, 0x03, 0x0001},
  2199. {0xaa, 0x04, 0x0011},
  2200. {0xaa, 0x05, 0x00a0},
  2201. {0xaa, 0x06, 0x0001},
  2202. {0xaa, 0x08, 0x0000},
  2203. {0xaa, 0x03, 0x0002},
  2204. {0xaa, 0x04, 0x0013},
  2205. {0xaa, 0x05, 0x0020},
  2206. {0xaa, 0x06, 0x0001},
  2207. {0xaa, 0x08, 0x0000},
  2208. {0xaa, 0x03, 0x0003},
  2209. {0xaa, 0x04, 0x0015},
  2210. {0xaa, 0x05, 0x0020},
  2211. {0xaa, 0x06, 0x0005},
  2212. {0xaa, 0x08, 0x0000},
  2213. {0xaa, 0x03, 0x0004},
  2214. {0xaa, 0x04, 0x0017},
  2215. {0xaa, 0x05, 0x0020},
  2216. {0xaa, 0x06, 0x000d},
  2217. {0xaa, 0x08, 0x0000},
  2218. {0xaa, 0x03, 0x0005},
  2219. {0xaa, 0x04, 0x0019},
  2220. {0xaa, 0x05, 0x0020},
  2221. {0xaa, 0x06, 0x0005},
  2222. {0xaa, 0x08, 0x0000},
  2223. {0xaa, 0x03, 0x0006},
  2224. {0xaa, 0x04, 0x0017},
  2225. {0xaa, 0x05, 0x0026},
  2226. {0xaa, 0x06, 0x0005},
  2227. {0xaa, 0x08, 0x0000},
  2228. {0xaa, 0x03, 0x0007},
  2229. {0xaa, 0x04, 0x0019},
  2230. {0xaa, 0x05, 0x0022},
  2231. {0xaa, 0x06, 0x0005},
  2232. {0xaa, 0x08, 0x0000},
  2233. {0xaa, 0x03, 0x0008},
  2234. {0xaa, 0x04, 0x0021},
  2235. {0xaa, 0x05, 0x00aa},
  2236. {0xaa, 0x06, 0x0005},
  2237. {0xaa, 0x08, 0x0000},
  2238. {0xaa, 0x03, 0x0009},
  2239. {0xaa, 0x04, 0x0023},
  2240. {0xaa, 0x05, 0x00aa},
  2241. {0xaa, 0x06, 0x000d},
  2242. {0xaa, 0x08, 0x0000},
  2243. {0xaa, 0x03, 0x000a},
  2244. {0xaa, 0x04, 0x0025},
  2245. {0xaa, 0x05, 0x00aa},
  2246. {0xaa, 0x06, 0x0005},
  2247. {0xaa, 0x08, 0x0000},
  2248. {0xaa, 0x03, 0x000b},
  2249. {0xaa, 0x04, 0x00ec},
  2250. {0xaa, 0x05, 0x002e},
  2251. {0xaa, 0x06, 0x0005},
  2252. {0xaa, 0x08, 0x0000},
  2253. {0xaa, 0x03, 0x000c},
  2254. {0xaa, 0x04, 0x00fa},
  2255. {0xaa, 0x05, 0x002a},
  2256. {0xaa, 0x06, 0x0005},
  2257. {0xaa, 0x08, 0x0000},
  2258. {0xaa, 0x07, 0x000d},
  2259. {0xaa, 0x01, 0x0005},
  2260. {0xaa, 0x94, 0x0002},
  2261. {0xaa, 0x90, 0x0000},
  2262. {0xaa, 0x91, 0x001f},
  2263. {0xaa, 0x10, 0x0064},
  2264. {0xaa, 0x9b, 0x00f0},
  2265. {0xaa, 0x9c, 0x0002},
  2266. {0xaa, 0x14, 0x001a},
  2267. {0xaa, 0x20, 0x0080},
  2268. {0xaa, 0x22, 0x0080},
  2269. {0xaa, 0x24, 0x0080},
  2270. {0xaa, 0x26, 0x0080},
  2271. {0xaa, 0x00, 0x0084},
  2272. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  2273. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  2274. {0xaa, 0xa8, 0x00c0},
  2275. {0xa1, 0x01, 0x0002},
  2276. {0xa1, 0x01, 0x0008},
  2277. {0xa1, 0x01, 0x0180},
  2278. {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
  2279. {0xa0, 0x40, ZC3XX_R116_RGAIN},
  2280. {0xa0, 0x40, ZC3XX_R117_GGAIN},
  2281. {0xa0, 0x40, ZC3XX_R118_BGAIN},
  2282. {0xa1, 0x01, 0x0008},
  2283. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
  2284. {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
  2285. {0xa1, 0x01, 0x01c8},
  2286. {0xa1, 0x01, 0x01c9},
  2287. {0xa1, 0x01, 0x01ca},
  2288. {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
  2289. {0xa0, 0x52, ZC3XX_R10A_RGB00}, /* matrix */
  2290. {0xa0, 0xf7, ZC3XX_R10B_RGB01},
  2291. {0xa0, 0xf7, ZC3XX_R10C_RGB02},
  2292. {0xa0, 0xf7, ZC3XX_R10D_RGB10},
  2293. {0xa0, 0x52, ZC3XX_R10E_RGB11},
  2294. {0xa0, 0xf7, ZC3XX_R10F_RGB12},
  2295. {0xa0, 0xf7, ZC3XX_R110_RGB20},
  2296. {0xa0, 0xf7, ZC3XX_R111_RGB21},
  2297. {0xa0, 0x52, ZC3XX_R112_RGB22},
  2298. {0xa1, 0x01, 0x0180},
  2299. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  2300. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  2301. {0xaa, 0x0d, 0x0003},
  2302. {0xaa, 0x0c, 0x008c},
  2303. {0xaa, 0x0e, 0x0095},
  2304. {0xaa, 0x0f, 0x0002},
  2305. {0xaa, 0x1c, 0x0094},
  2306. {0xaa, 0x1d, 0x0002},
  2307. {0xaa, 0x20, 0x0080},
  2308. {0xaa, 0x22, 0x0080},
  2309. {0xaa, 0x24, 0x0080},
  2310. {0xaa, 0x26, 0x0080},
  2311. {0xaa, 0x00, 0x0084},
  2312. {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
  2313. {0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW},
  2314. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  2315. {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
  2316. {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW},
  2317. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  2318. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  2319. {0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW},
  2320. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
  2321. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  2322. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
  2323. {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
  2324. {0xa0, 0xe3, ZC3XX_R01D_HSYNC_0},
  2325. {0xa0, 0xec, ZC3XX_R01E_HSYNC_1},
  2326. {0xa0, 0xf5, ZC3XX_R01F_HSYNC_2},
  2327. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  2328. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  2329. {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN},
  2330. {0xa0, 0xc0, ZC3XX_R11D_GLOBALGAIN},
  2331. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  2332. {0xa1, 0x01, 0x0180},
  2333. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  2334. {0xa0, 0x40, ZC3XX_R116_RGAIN},
  2335. {0xa0, 0x40, ZC3XX_R117_GGAIN},
  2336. {0xa0, 0x40, ZC3XX_R118_BGAIN},
  2337. {}
  2338. };
  2339. static const struct usb_action icm105a_Initial[] = {
  2340. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  2341. {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
  2342. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  2343. {0xa0, 0x0c, ZC3XX_R010_CMOSSENSORSELECT},
  2344. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  2345. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  2346. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  2347. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  2348. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  2349. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
  2350. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  2351. {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
  2352. {0xa0, 0x00, ZC3XX_R097_WINYSTARTHIGH},
  2353. {0xa0, 0x02, ZC3XX_R098_WINYSTARTLOW},
  2354. {0xa0, 0x00, ZC3XX_R099_WINXSTARTHIGH},
  2355. {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW},
  2356. {0xa0, 0x02, ZC3XX_R11A_FIRSTYLOW},
  2357. {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW},
  2358. {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
  2359. {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
  2360. {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
  2361. {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
  2362. {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
  2363. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  2364. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  2365. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  2366. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  2367. {0xaa, 0x01, 0x0010},
  2368. {0xaa, 0x03, 0x0000},
  2369. {0xaa, 0x04, 0x0001},
  2370. {0xaa, 0x05, 0x0020},
  2371. {0xaa, 0x06, 0x0001},
  2372. {0xaa, 0x08, 0x0000},
  2373. {0xaa, 0x03, 0x0001},
  2374. {0xaa, 0x04, 0x0011},
  2375. {0xaa, 0x05, 0x00a0},
  2376. {0xaa, 0x06, 0x0001},
  2377. {0xaa, 0x08, 0x0000},
  2378. {0xaa, 0x03, 0x0002},
  2379. {0xaa, 0x04, 0x0013},
  2380. {0xaa, 0x05, 0x0020},
  2381. {0xaa, 0x06, 0x0001},
  2382. {0xaa, 0x08, 0x0000},
  2383. {0xaa, 0x03, 0x0003},
  2384. {0xaa, 0x04, 0x0015},
  2385. {0xaa, 0x05, 0x0020},
  2386. {0xaa, 0x06, 0x0005},
  2387. {0xaa, 0x08, 0x0000},
  2388. {0xaa, 0x03, 0x0004},
  2389. {0xaa, 0x04, 0x0017},
  2390. {0xaa, 0x05, 0x0020},
  2391. {0xaa, 0x06, 0x000d},
  2392. {0xaa, 0x08, 0x0000},
  2393. {0xaa, 0x03, 0x0005},
  2394. {0xa0, 0x04, ZC3XX_R092_I2CADDRESSSELECT},
  2395. {0xa0, 0x19, ZC3XX_R093_I2CSETVALUE},
  2396. {0xa0, 0x01, ZC3XX_R090_I2CCOMMAND},
  2397. {0xa1, 0x01, 0x0091},
  2398. {0xaa, 0x05, 0x0020},
  2399. {0xaa, 0x06, 0x0005},
  2400. {0xaa, 0x08, 0x0000},
  2401. {0xaa, 0x03, 0x0006},
  2402. {0xaa, 0x04, 0x0017},
  2403. {0xaa, 0x05, 0x0026},
  2404. {0xaa, 0x06, 0x0005},
  2405. {0xaa, 0x08, 0x0000},
  2406. {0xaa, 0x03, 0x0007},
  2407. {0xaa, 0x04, 0x0019},
  2408. {0xaa, 0x05, 0x0022},
  2409. {0xaa, 0x06, 0x0005},
  2410. {0xaa, 0x08, 0x0000},
  2411. {0xaa, 0x03, 0x0008},
  2412. {0xaa, 0x04, 0x0021},
  2413. {0xaa, 0x05, 0x00aa},
  2414. {0xaa, 0x06, 0x0005},
  2415. {0xaa, 0x08, 0x0000},
  2416. {0xaa, 0x03, 0x0009},
  2417. {0xaa, 0x04, 0x0023},
  2418. {0xaa, 0x05, 0x00aa},
  2419. {0xaa, 0x06, 0x000d},
  2420. {0xaa, 0x08, 0x0000},
  2421. {0xaa, 0x03, 0x000a},
  2422. {0xaa, 0x04, 0x0025},
  2423. {0xaa, 0x05, 0x00aa},
  2424. {0xaa, 0x06, 0x0005},
  2425. {0xaa, 0x08, 0x0000},
  2426. {0xaa, 0x03, 0x000b},
  2427. {0xaa, 0x04, 0x00ec},
  2428. {0xaa, 0x05, 0x002e},
  2429. {0xaa, 0x06, 0x0005},
  2430. {0xaa, 0x08, 0x0000},
  2431. {0xaa, 0x03, 0x000c},
  2432. {0xaa, 0x04, 0x00fa},
  2433. {0xaa, 0x05, 0x002a},
  2434. {0xaa, 0x06, 0x0005},
  2435. {0xaa, 0x08, 0x0000},
  2436. {0xaa, 0x07, 0x000d},
  2437. {0xaa, 0x01, 0x0005},
  2438. {0xaa, 0x94, 0x0002},
  2439. {0xaa, 0x90, 0x0000},
  2440. {0xaa, 0x91, 0x0010},
  2441. {0xaa, 0x10, 0x0064},
  2442. {0xaa, 0x9b, 0x00f0},
  2443. {0xaa, 0x9c, 0x0002},
  2444. {0xaa, 0x14, 0x001a},
  2445. {0xaa, 0x20, 0x0080},
  2446. {0xaa, 0x22, 0x0080},
  2447. {0xaa, 0x24, 0x0080},
  2448. {0xaa, 0x26, 0x0080},
  2449. {0xaa, 0x00, 0x0084},
  2450. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  2451. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  2452. {0xaa, 0xa8, 0x0080},
  2453. {0xa0, 0x78, ZC3XX_R18D_YTARGET},
  2454. {0xa1, 0x01, 0x0002},
  2455. {0xa1, 0x01, 0x0008},
  2456. {0xa1, 0x01, 0x0180},
  2457. {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
  2458. {0xa0, 0x40, ZC3XX_R116_RGAIN},
  2459. {0xa0, 0x40, ZC3XX_R117_GGAIN},
  2460. {0xa0, 0x40, ZC3XX_R118_BGAIN},
  2461. {0xa1, 0x01, 0x0008},
  2462. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
  2463. {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
  2464. {0xa1, 0x01, 0x01c8},
  2465. {0xa1, 0x01, 0x01c9},
  2466. {0xa1, 0x01, 0x01ca},
  2467. {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
  2468. {0xa0, 0x52, ZC3XX_R10A_RGB00}, /* matrix */
  2469. {0xa0, 0xf7, ZC3XX_R10B_RGB01},
  2470. {0xa0, 0xf7, ZC3XX_R10C_RGB02},
  2471. {0xa0, 0xf7, ZC3XX_R10D_RGB10},
  2472. {0xa0, 0x52, ZC3XX_R10E_RGB11},
  2473. {0xa0, 0xf7, ZC3XX_R10F_RGB12},
  2474. {0xa0, 0xf7, ZC3XX_R110_RGB20},
  2475. {0xa0, 0xf7, ZC3XX_R111_RGB21},
  2476. {0xa0, 0x52, ZC3XX_R112_RGB22},
  2477. {0xa1, 0x01, 0x0180},
  2478. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  2479. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  2480. {0xaa, 0x0d, 0x0003},
  2481. {0xaa, 0x0c, 0x0020},
  2482. {0xaa, 0x0e, 0x000e},
  2483. {0xaa, 0x0f, 0x0002},
  2484. {0xaa, 0x1c, 0x000d},
  2485. {0xaa, 0x1d, 0x0002},
  2486. {0xaa, 0x20, 0x0080},
  2487. {0xaa, 0x22, 0x0080},
  2488. {0xaa, 0x24, 0x0080},
  2489. {0xaa, 0x26, 0x0080},
  2490. {0xaa, 0x00, 0x0084},
  2491. {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH},
  2492. {0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW},
  2493. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  2494. {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
  2495. {0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW},
  2496. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  2497. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  2498. {0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW},
  2499. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
  2500. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  2501. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
  2502. {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP},
  2503. {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0},
  2504. {0xa0, 0xd8, ZC3XX_R01E_HSYNC_1},
  2505. {0xa0, 0xea, ZC3XX_R01F_HSYNC_2},
  2506. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  2507. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN},
  2508. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  2509. {0xa1, 0x01, 0x0180},
  2510. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  2511. {0xa0, 0x40, ZC3XX_R116_RGAIN},
  2512. {0xa0, 0x40, ZC3XX_R117_GGAIN},
  2513. {0xa0, 0x40, ZC3XX_R118_BGAIN},
  2514. {}
  2515. };
  2516. static const struct usb_action icm105a_50HZScale[] = {
  2517. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  2518. {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
  2519. {0xaa, 0x0c, 0x0020}, /* 00,0c,20,aa */
  2520. {0xaa, 0x0e, 0x000e}, /* 00,0e,0e,aa */
  2521. {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
  2522. {0xaa, 0x1c, 0x000d}, /* 00,1c,0d,aa */
  2523. {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
  2524. {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
  2525. {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
  2526. {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
  2527. {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
  2528. {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
  2529. {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
  2530. {0xa0, 0x0d, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,0d,cc */
  2531. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  2532. {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
  2533. {0xa0, 0x1a, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,1a,cc */
  2534. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  2535. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  2536. {0xa0, 0x4b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,4b,cc */
  2537. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
  2538. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
  2539. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
  2540. {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
  2541. {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
  2542. {0xa0, 0xd8, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d8,cc */
  2543. {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
  2544. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  2545. {}
  2546. };
  2547. static const struct usb_action icm105a_50HZ[] = {
  2548. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  2549. {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
  2550. {0xaa, 0x0c, 0x008c}, /* 00,0c,8c,aa */
  2551. {0xaa, 0x0e, 0x0095}, /* 00,0e,95,aa */
  2552. {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
  2553. {0xaa, 0x1c, 0x0094}, /* 00,1c,94,aa */
  2554. {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
  2555. {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
  2556. {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
  2557. {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
  2558. {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
  2559. {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
  2560. {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
  2561. {0xa0, 0x94, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,94,cc */
  2562. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  2563. {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
  2564. {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
  2565. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  2566. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  2567. {0xa0, 0x84, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,84,cc */
  2568. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
  2569. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
  2570. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
  2571. {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
  2572. {0xa0, 0xe3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,e3,cc */
  2573. {0xa0, 0xec, ZC3XX_R01E_HSYNC_1}, /* 00,1e,ec,cc */
  2574. {0xa0, 0xf5, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f5,cc */
  2575. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  2576. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
  2577. {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
  2578. {}
  2579. };
  2580. static const struct usb_action icm105a_60HZScale[] = {
  2581. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  2582. {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
  2583. {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
  2584. {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
  2585. {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
  2586. {0xaa, 0x1c, 0x0008}, /* 00,1c,08,aa */
  2587. {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
  2588. {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
  2589. {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
  2590. {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
  2591. {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
  2592. {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
  2593. {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
  2594. {0xa0, 0x08, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,08,cc */
  2595. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  2596. {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
  2597. {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,10,cc */
  2598. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  2599. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  2600. {0xa0, 0x41, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,41,cc */
  2601. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
  2602. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
  2603. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
  2604. {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
  2605. {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
  2606. {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
  2607. {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
  2608. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  2609. {}
  2610. };
  2611. static const struct usb_action icm105a_60HZ[] = {
  2612. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  2613. {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
  2614. {0xaa, 0x0c, 0x0008}, /* 00,0c,08,aa */
  2615. {0xaa, 0x0e, 0x0086}, /* 00,0e,86,aa */
  2616. {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
  2617. {0xaa, 0x1c, 0x0085}, /* 00,1c,85,aa */
  2618. {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
  2619. {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
  2620. {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
  2621. {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
  2622. {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
  2623. {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
  2624. {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
  2625. {0xa0, 0x85, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,85,cc */
  2626. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  2627. {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
  2628. {0xa0, 0x08, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,08,cc */
  2629. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  2630. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  2631. {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,81,cc */
  2632. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
  2633. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
  2634. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
  2635. {0xa0, 0x12, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,12,cc */
  2636. {0xa0, 0xc2, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c2,cc */
  2637. {0xa0, 0xd6, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d6,cc */
  2638. {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
  2639. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  2640. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
  2641. {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
  2642. {}
  2643. };
  2644. static const struct usb_action icm105a_NoFlikerScale[] = {
  2645. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  2646. {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
  2647. {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
  2648. {0xaa, 0x0e, 0x000d}, /* 00,0e,0d,aa */
  2649. {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
  2650. {0xaa, 0x1c, 0x0000}, /* 00,1c,00,aa */
  2651. {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
  2652. {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
  2653. {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
  2654. {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
  2655. {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
  2656. {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
  2657. {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
  2658. {0xa0, 0x00, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,00,cc */
  2659. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  2660. {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
  2661. {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
  2662. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  2663. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  2664. {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
  2665. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
  2666. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
  2667. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
  2668. {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
  2669. {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
  2670. {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
  2671. {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
  2672. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  2673. {}
  2674. };
  2675. static const struct usb_action icm105a_NoFliker[] = {
  2676. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  2677. {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */
  2678. {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */
  2679. {0xaa, 0x0e, 0x0081}, /* 00,0e,81,aa */
  2680. {0xaa, 0x0f, 0x0002}, /* 00,0f,02,aa */
  2681. {0xaa, 0x1c, 0x0080}, /* 00,1c,80,aa */
  2682. {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
  2683. {0xaa, 0x20, 0x0080}, /* 00,20,80,aa */
  2684. {0xaa, 0x22, 0x0080}, /* 00,22,80,aa */
  2685. {0xaa, 0x24, 0x0080}, /* 00,24,80,aa */
  2686. {0xaa, 0x26, 0x0080}, /* 00,26,80,aa */
  2687. {0xaa, 0x00, 0x0084}, /* 00,00,84,aa */
  2688. {0xa0, 0x02, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,02,cc */
  2689. {0xa0, 0x80, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,80,cc */
  2690. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  2691. {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
  2692. {0xa0, 0x20, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,20,cc */
  2693. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  2694. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  2695. {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
  2696. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
  2697. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
  2698. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
  2699. {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
  2700. {0xa0, 0xc1, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c1,cc */
  2701. {0xa0, 0xd4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d4,cc */
  2702. {0xa0, 0xe8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e8,cc */
  2703. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  2704. {0xa0, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN}, /* 01,a7,00,cc */
  2705. {0xa0, 0xc0, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,c0,cc */
  2706. {}
  2707. };
  2708. static const struct usb_action mc501cb_Initial[] = {
  2709. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
  2710. {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc */
  2711. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  2712. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
  2713. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
  2714. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
  2715. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
  2716. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
  2717. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
  2718. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
  2719. {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
  2720. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
  2721. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
  2722. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
  2723. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
  2724. {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
  2725. {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
  2726. {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
  2727. {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
  2728. {0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
  2729. {0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
  2730. {0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
  2731. {0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
  2732. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
  2733. {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
  2734. {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
  2735. {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
  2736. {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
  2737. {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
  2738. {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
  2739. {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
  2740. {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
  2741. {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
  2742. {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
  2743. {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
  2744. {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
  2745. {0xaa, 0x18, 0x00de}, /* 00,18,de,aa */
  2746. {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
  2747. {0xaa, 0x1a, 0x0086}, /* 00,1a,86,aa */
  2748. {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
  2749. {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
  2750. {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
  2751. {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
  2752. {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
  2753. {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
  2754. {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
  2755. {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
  2756. {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
  2757. {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
  2758. {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
  2759. {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
  2760. {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
  2761. {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
  2762. {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
  2763. {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
  2764. {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
  2765. {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
  2766. {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
  2767. {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
  2768. {0xaa, 0xa0, 0x001a}, /* 00,a0,1a,aa */
  2769. {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
  2770. {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
  2771. {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
  2772. {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
  2773. {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
  2774. {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
  2775. {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
  2776. {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
  2777. {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
  2778. {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
  2779. {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
  2780. {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
  2781. {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
  2782. {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
  2783. {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
  2784. {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
  2785. {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
  2786. {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
  2787. {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
  2788. {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
  2789. {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
  2790. {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
  2791. {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
  2792. {0xaa, 0x1c, 0x0050}, /* 00,1C,50,aa */
  2793. {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
  2794. {0xaa, 0x3b, 0x001d}, /* 00,3b,1D,aa */
  2795. {0xaa, 0x3c, 0x004c}, /* 00,3c,4C,aa */
  2796. {0xaa, 0x3d, 0x0018}, /* 00,3d,18,aa */
  2797. {0xaa, 0x3e, 0x006a}, /* 00,3e,6A,aa */
  2798. {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
  2799. {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
  2800. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  2801. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
  2802. {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
  2803. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
  2804. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
  2805. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
  2806. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
  2807. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
  2808. {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
  2809. {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
  2810. {0xaa, 0x51, 0x0027}, /* 00,51,27,aa */
  2811. {0xaa, 0x52, 0x0020}, /* 00,52,20,aa */
  2812. {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
  2813. {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
  2814. {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
  2815. {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
  2816. {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
  2817. {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
  2818. {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
  2819. {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
  2820. {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
  2821. {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
  2822. {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
  2823. {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
  2824. {}
  2825. };
  2826. static const struct usb_action mc501cb_InitialScale[] = { /* 320x240 */
  2827. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
  2828. {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
  2829. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  2830. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
  2831. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
  2832. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
  2833. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
  2834. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
  2835. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
  2836. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
  2837. {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
  2838. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
  2839. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
  2840. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
  2841. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
  2842. {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
  2843. {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d8,cc */
  2844. {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
  2845. {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
  2846. {0xa0, 0x33, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,33,cc */
  2847. {0xa0, 0x34, ZC3XX_R087_EXPTIMEMID}, /* 00,87,34,cc */
  2848. {0xa0, 0x35, ZC3XX_R088_EXPTIMELOW}, /* 00,88,35,cc */
  2849. {0xa0, 0xb0, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,b0,cc */
  2850. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
  2851. {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
  2852. {0xaa, 0x01, 0x0003}, /* 00,01,03,aa */
  2853. {0xaa, 0x01, 0x0001}, /* 00,01,01,aa */
  2854. {0xaa, 0x03, 0x0000}, /* 00,03,00,aa */
  2855. {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
  2856. {0xaa, 0x11, 0x0080}, /* 00,11,80,aa */
  2857. {0xaa, 0x12, 0x0000}, /* 00,12,00,aa */
  2858. {0xaa, 0x13, 0x0000}, /* 00,13,00,aa */
  2859. {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
  2860. {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
  2861. {0xaa, 0x16, 0x0000}, /* 00,16,00,aa */
  2862. {0xaa, 0x17, 0x0001}, /* 00,17,01,aa */
  2863. {0xaa, 0x18, 0x00d8}, /* 00,18,d8,aa */
  2864. {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
  2865. {0xaa, 0x1a, 0x0088}, /* 00,1a,88,aa */
  2866. {0xaa, 0x20, 0x00a8}, /* 00,20,a8,aa */
  2867. {0xaa, 0x22, 0x0000}, /* 00,22,00,aa */
  2868. {0xaa, 0x23, 0x0000}, /* 00,23,00,aa */
  2869. {0xaa, 0x24, 0x0000}, /* 00,24,00,aa */
  2870. {0xaa, 0x40, 0x0033}, /* 00,40,33,aa */
  2871. {0xaa, 0x41, 0x0077}, /* 00,41,77,aa */
  2872. {0xaa, 0x42, 0x0053}, /* 00,42,53,aa */
  2873. {0xaa, 0x43, 0x00b0}, /* 00,43,b0,aa */
  2874. {0xaa, 0x4b, 0x0001}, /* 00,4b,01,aa */
  2875. {0xaa, 0x72, 0x0020}, /* 00,72,20,aa */
  2876. {0xaa, 0x73, 0x0000}, /* 00,73,00,aa */
  2877. {0xaa, 0x80, 0x0000}, /* 00,80,00,aa */
  2878. {0xaa, 0x85, 0x0050}, /* 00,85,50,aa */
  2879. {0xaa, 0x91, 0x0070}, /* 00,91,70,aa */
  2880. {0xaa, 0x92, 0x0072}, /* 00,92,72,aa */
  2881. {0xaa, 0x03, 0x0001}, /* 00,03,01,aa */
  2882. {0xaa, 0x10, 0x00a0}, /* 00,10,a0,aa */
  2883. {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
  2884. {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
  2885. {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
  2886. {0xaa, 0xa0, 0x001a}, /* 00,a0,1a,aa */
  2887. {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
  2888. {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
  2889. {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
  2890. {0xaa, 0xa4, 0x0010}, /* 00,a4,10,aa */
  2891. {0xaa, 0xa5, 0x0020}, /* 00,a5,20,aa */
  2892. {0xaa, 0xb1, 0x0044}, /* 00,b1,44,aa */
  2893. {0xaa, 0xd0, 0x0001}, /* 00,d0,01,aa */
  2894. {0xaa, 0xd1, 0x0085}, /* 00,d1,85,aa */
  2895. {0xaa, 0xd2, 0x0080}, /* 00,d2,80,aa */
  2896. {0xaa, 0xd3, 0x0080}, /* 00,d3,80,aa */
  2897. {0xaa, 0xd4, 0x0080}, /* 00,d4,80,aa */
  2898. {0xaa, 0xd5, 0x0080}, /* 00,d5,80,aa */
  2899. {0xaa, 0xc0, 0x00c3}, /* 00,c0,c3,aa */
  2900. {0xaa, 0xc2, 0x0044}, /* 00,c2,44,aa */
  2901. {0xaa, 0xc4, 0x0040}, /* 00,c4,40,aa */
  2902. {0xaa, 0xc5, 0x0020}, /* 00,c5,20,aa */
  2903. {0xaa, 0xc6, 0x0008}, /* 00,c6,08,aa */
  2904. {0xaa, 0x03, 0x0004}, /* 00,03,04,aa */
  2905. {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
  2906. {0xaa, 0x40, 0x0030}, /* 00,40,30,aa */
  2907. {0xaa, 0x41, 0x0020}, /* 00,41,20,aa */
  2908. {0xaa, 0x42, 0x002d}, /* 00,42,2d,aa */
  2909. {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
  2910. {0xaa, 0x1c, 0x0050}, /* 00,1c,50,aa */
  2911. {0xaa, 0x11, 0x0081}, /* 00,11,81,aa */
  2912. {0xaa, 0x3b, 0x003a}, /* 00,3b,3A,aa */
  2913. {0xaa, 0x3c, 0x0098}, /* 00,3c,98,aa */
  2914. {0xaa, 0x3d, 0x0030}, /* 00,3d,30,aa */
  2915. {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
  2916. {0xaa, 0x01, 0x0000}, /* 00,01,00,aa */
  2917. {0xaa, 0x52, 0x00ff}, /* 00,52,FF,aa */
  2918. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  2919. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
  2920. {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
  2921. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
  2922. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
  2923. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
  2924. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
  2925. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
  2926. {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
  2927. {0xaa, 0x03, 0x0002}, /* 00,03,02,aa */
  2928. {0xaa, 0x51, 0x004e}, /* 00,51,4E,aa */
  2929. {0xaa, 0x52, 0x0041}, /* 00,52,41,aa */
  2930. {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
  2931. {0xaa, 0x50, 0x0010}, /* 00,50,10,aa */
  2932. {0xaa, 0x51, 0x0010}, /* 00,51,10,aa */
  2933. {0xaa, 0x54, 0x0010}, /* 00,54,10,aa */
  2934. {0xaa, 0x55, 0x0010}, /* 00,55,10,aa */
  2935. {0xa0, 0xf0, 0x0199}, /* 01,99,F0,cc */
  2936. {0xa0, 0x80, 0x019a}, /* 01,9A,80,cc */
  2937. {}
  2938. };
  2939. static const struct usb_action mc501cb_50HZ[] = {
  2940. {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
  2941. {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
  2942. {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */
  2943. {0xaa, 0x37, 0x004c}, /* 00,37,4C,aa */
  2944. {0xaa, 0x3b, 0x001d}, /* 00,3B,1D,aa */
  2945. {0xaa, 0x3c, 0x004c}, /* 00,3C,4C,aa */
  2946. {0xaa, 0x3d, 0x001d}, /* 00,3D,1D,aa */
  2947. {0xaa, 0x3e, 0x004c}, /* 00,3E,4C,aa */
  2948. {}
  2949. };
  2950. static const struct usb_action mc501cb_50HZScale[] = {
  2951. {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
  2952. {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
  2953. {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */
  2954. {0xaa, 0x37, 0x0098}, /* 00,37,98,aa */
  2955. {0xaa, 0x3b, 0x003a}, /* 00,3B,3A,aa */
  2956. {0xaa, 0x3c, 0x0098}, /* 00,3C,98,aa */
  2957. {0xaa, 0x3d, 0x003a}, /* 00,3D,3A,aa */
  2958. {0xaa, 0x3e, 0x0098}, /* 00,3E,98,aa */
  2959. {}
  2960. };
  2961. static const struct usb_action mc501cb_60HZ[] = {
  2962. {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
  2963. {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
  2964. {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
  2965. {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
  2966. {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
  2967. {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
  2968. {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
  2969. {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
  2970. {}
  2971. };
  2972. static const struct usb_action mc501cb_60HZScale[] = {
  2973. {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
  2974. {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
  2975. {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
  2976. {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
  2977. {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
  2978. {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
  2979. {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
  2980. {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
  2981. {}
  2982. };
  2983. static const struct usb_action mc501cb_NoFliker[] = {
  2984. {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
  2985. {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
  2986. {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */
  2987. {0xaa, 0x37, 0x006a}, /* 00,37,6A,aa */
  2988. {0xaa, 0x3d, 0x0018}, /* 00,3D,18,aa */
  2989. {0xaa, 0x3e, 0x006a}, /* 00,3E,6A,aa */
  2990. {0xaa, 0x3b, 0x0018}, /* 00,3B,18,aa */
  2991. {0xaa, 0x3c, 0x006a}, /* 00,3C,6A,aa */
  2992. {}
  2993. };
  2994. static const struct usb_action mc501cb_NoFlikerScale[] = {
  2995. {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */
  2996. {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */
  2997. {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */
  2998. {0xaa, 0x37, 0x00d4}, /* 00,37,D4,aa */
  2999. {0xaa, 0x3d, 0x0030}, /* 00,3D,30,aa */
  3000. {0xaa, 0x3e, 0x00d4}, /* 00,3E,D4,aa */
  3001. {0xaa, 0x3b, 0x0030}, /* 00,3B,30,aa */
  3002. {0xaa, 0x3c, 0x00d4}, /* 00,3C,D4,aa */
  3003. {}
  3004. };
  3005. /* from zs211.inf */
  3006. static const struct usb_action ov7620_Initial[] = { /* 640x480 */
  3007. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
  3008. {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, /* 00,02,40,cc */
  3009. {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,00,cc */
  3010. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
  3011. {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
  3012. {0xa0, 0x02, ZC3XX_R083_RGAINADDR}, /* 00,83,02,cc */
  3013. {0xa0, 0x01, ZC3XX_R085_BGAINADDR}, /* 00,85,01,cc */
  3014. {0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,80,cc */
  3015. {0xa0, 0x81, ZC3XX_R087_EXPTIMEMID}, /* 00,87,81,cc */
  3016. {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW}, /* 00,88,10,cc */
  3017. {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
  3018. {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
  3019. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
  3020. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
  3021. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
  3022. {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */
  3023. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
  3024. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
  3025. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
  3026. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
  3027. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
  3028. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
  3029. {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */
  3030. {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
  3031. {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
  3032. {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
  3033. {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
  3034. {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
  3035. {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
  3036. {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
  3037. {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
  3038. {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
  3039. {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
  3040. {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
  3041. {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
  3042. {0xaa, 0x1a, 0x00f1}, /* 00,1a,f1,aa */
  3043. {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
  3044. {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
  3045. {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
  3046. {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
  3047. {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
  3048. {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
  3049. {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
  3050. {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
  3051. {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
  3052. {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
  3053. {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
  3054. {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
  3055. {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
  3056. {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
  3057. {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
  3058. {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
  3059. {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
  3060. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
  3061. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
  3062. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
  3063. {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
  3064. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
  3065. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
  3066. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
  3067. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
  3068. {0xa0, 0x68, ZC3XX_R116_RGAIN}, /* 01,16,68,cc */
  3069. {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
  3070. {0xa0, 0x40, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,40,cc */
  3071. {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
  3072. {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,50,cc */
  3073. {}
  3074. };
  3075. static const struct usb_action ov7620_InitialScale[] = { /* 320x240 */
  3076. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
  3077. {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT}, /* 00,02,50,cc */
  3078. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,00,cc */
  3079. /* mx change? */
  3080. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
  3081. {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,06,cc */
  3082. {0xa0, 0x02, ZC3XX_R083_RGAINADDR}, /* 00,83,02,cc */
  3083. {0xa0, 0x01, ZC3XX_R085_BGAINADDR}, /* 00,85,01,cc */
  3084. {0xa0, 0x80, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,80,cc */
  3085. {0xa0, 0x81, ZC3XX_R087_EXPTIMEMID}, /* 00,87,81,cc */
  3086. {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW}, /* 00,88,10,cc */
  3087. {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,a1,cc */
  3088. {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
  3089. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
  3090. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
  3091. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
  3092. {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */
  3093. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
  3094. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
  3095. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
  3096. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
  3097. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
  3098. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
  3099. {0xa0, 0xd6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d6,cc */
  3100. /* OV7648 00,9c,d8,cc */
  3101. {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
  3102. {0xaa, 0x12, 0x0088}, /* 00,12,88,aa */
  3103. {0xaa, 0x12, 0x0048}, /* 00,12,48,aa */
  3104. {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
  3105. {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
  3106. {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
  3107. {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
  3108. {0xaa, 0x14, 0x0000}, /* 00,14,00,aa */
  3109. {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
  3110. {0xaa, 0x24, 0x0088}, /* 00,24,88,aa */
  3111. {0xaa, 0x25, 0x0078}, /* 00,25,78,aa */
  3112. {0xaa, 0x17, 0x0018}, /* 00,17,18,aa */
  3113. {0xaa, 0x18, 0x00ba}, /* 00,18,ba,aa */
  3114. {0xaa, 0x19, 0x0002}, /* 00,19,02,aa */
  3115. {0xaa, 0x1a, 0x00f2}, /* 00,1a,f2,aa */
  3116. {0xaa, 0x20, 0x0040}, /* 00,20,40,aa */
  3117. {0xaa, 0x27, 0x00f6}, /* 00,27,f6,aa */
  3118. {0xaa, 0x28, 0x00a0}, /* 00,28,a0,aa */
  3119. {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
  3120. {0xaa, 0x2a, 0x0083}, /* 00,2a,83,aa */
  3121. {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
  3122. {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
  3123. {0xaa, 0x74, 0x0020}, /* 00,74,20,aa */
  3124. {0xaa, 0x61, 0x0068}, /* 00,61,68,aa */
  3125. {0xaa, 0x64, 0x0088}, /* 00,64,88,aa */
  3126. {0xaa, 0x00, 0x0000}, /* 00,00,00,aa */
  3127. {0xaa, 0x06, 0x0080}, /* 00,06,80,aa */
  3128. {0xaa, 0x01, 0x0090}, /* 00,01,90,aa */
  3129. {0xaa, 0x02, 0x0030}, /* 00,02,30,aa */
  3130. {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,77,cc */
  3131. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
  3132. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
  3133. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
  3134. {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
  3135. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
  3136. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
  3137. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
  3138. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
  3139. {0xa0, 0x68, ZC3XX_R116_RGAIN}, /* 01,16,68,cc */
  3140. {0xa0, 0x52, ZC3XX_R118_BGAIN}, /* 01,18,52,cc */
  3141. {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,50,cc */
  3142. {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
  3143. {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,50,cc */
  3144. {}
  3145. };
  3146. static const struct usb_action ov7620_50HZ[] = {
  3147. {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
  3148. {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
  3149. {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */
  3150. {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
  3151. {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
  3152. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  3153. {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
  3154. {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
  3155. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  3156. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  3157. {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
  3158. {0xaa, 0x10, 0x0082}, /* 00,10,82,aa */
  3159. {0xaa, 0x76, 0x0003}, /* 00,76,03,aa */
  3160. /* {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, * 00,02,40,cc
  3161. * if mode0 (640x480) */
  3162. {}
  3163. };
  3164. static const struct usb_action ov7620_60HZ[] = {
  3165. {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
  3166. /* (bug in zs211.inf) */
  3167. {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
  3168. {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */
  3169. {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */
  3170. {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */
  3171. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  3172. {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
  3173. {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
  3174. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  3175. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  3176. {0xa0, 0x83, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,83,cc */
  3177. {0xaa, 0x10, 0x0020}, /* 00,10,20,aa */
  3178. {0xaa, 0x76, 0x0003}, /* 00,76,03,aa */
  3179. /* {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, * 00,02,40,cc
  3180. * if mode0 (640x480) */
  3181. /* ?? in gspca v1, it was
  3182. {0xa0, 0x00, 0x0039}, * 00,00,00,dd *
  3183. {0xa1, 0x01, 0x0037}, */
  3184. {}
  3185. };
  3186. static const struct usb_action ov7620_NoFliker[] = {
  3187. {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */
  3188. /* (bug in zs211.inf) */
  3189. {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */
  3190. {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */
  3191. {0xaa, 0x75, 0x008e}, /* 00,75,8e,aa */
  3192. {0xaa, 0x2d, 0x0001}, /* 00,2d,01,aa */
  3193. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  3194. {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */
  3195. {0xa0, 0x18, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,18,cc */
  3196. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  3197. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  3198. {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,01,cc */
  3199. /* {0xa0, 0x44, ZC3XX_R002_CLOCKSELECT}, * 00,02,44,cc
  3200. * if mode1 (320x240) */
  3201. /* ?? was
  3202. {0xa0, 0x00, 0x0039}, * 00,00,00,dd *
  3203. {0xa1, 0x01, 0x0037}, */
  3204. {}
  3205. };
  3206. static const struct usb_action ov7630c_InitialScale[] = {
  3207. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  3208. {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
  3209. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  3210. {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
  3211. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  3212. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  3213. {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
  3214. {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
  3215. {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
  3216. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  3217. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  3218. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  3219. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  3220. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  3221. {0xaa, 0x12, 0x0080},
  3222. {0xa0, 0x02, ZC3XX_R083_RGAINADDR},
  3223. {0xa0, 0x01, ZC3XX_R085_BGAINADDR},
  3224. {0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
  3225. {0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
  3226. {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
  3227. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  3228. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  3229. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  3230. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  3231. {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW},
  3232. {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
  3233. {0xaa, 0x12, 0x0069},
  3234. {0xaa, 0x04, 0x0020},
  3235. {0xaa, 0x06, 0x0050},
  3236. {0xaa, 0x13, 0x0083},
  3237. {0xaa, 0x14, 0x0000},
  3238. {0xaa, 0x15, 0x0024},
  3239. {0xaa, 0x17, 0x0018},
  3240. {0xaa, 0x18, 0x00ba},
  3241. {0xaa, 0x19, 0x0002},
  3242. {0xaa, 0x1a, 0x00f6},
  3243. {0xaa, 0x1b, 0x0002},
  3244. {0xaa, 0x20, 0x00c2},
  3245. {0xaa, 0x24, 0x0060},
  3246. {0xaa, 0x25, 0x0040},
  3247. {0xaa, 0x26, 0x0030},
  3248. {0xaa, 0x27, 0x00ea},
  3249. {0xaa, 0x28, 0x00a0},
  3250. {0xaa, 0x21, 0x0000},
  3251. {0xaa, 0x2a, 0x0081},
  3252. {0xaa, 0x2b, 0x0096},
  3253. {0xaa, 0x2d, 0x0094},
  3254. {0xaa, 0x2f, 0x003d},
  3255. {0xaa, 0x30, 0x0024},
  3256. {0xaa, 0x60, 0x0000},
  3257. {0xaa, 0x61, 0x0040},
  3258. {0xaa, 0x68, 0x007c},
  3259. {0xaa, 0x6f, 0x0015},
  3260. {0xaa, 0x75, 0x0088},
  3261. {0xaa, 0x77, 0x00b5},
  3262. {0xaa, 0x01, 0x0060},
  3263. {0xaa, 0x02, 0x0060},
  3264. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  3265. {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
  3266. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  3267. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  3268. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  3269. {0xa0, 0x00, 0x01ad},
  3270. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  3271. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  3272. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  3273. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  3274. {0xa0, 0x60, ZC3XX_R116_RGAIN},
  3275. {0xa0, 0x46, ZC3XX_R118_BGAIN},
  3276. {0xa0, 0x04, ZC3XX_R113_RGB03},
  3277. /* 0x10, */
  3278. {0xa1, 0x01, 0x0002},
  3279. {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
  3280. {0xa0, 0xf8, ZC3XX_R10B_RGB01},
  3281. {0xa0, 0xf8, ZC3XX_R10C_RGB02},
  3282. {0xa0, 0xf8, ZC3XX_R10D_RGB10},
  3283. {0xa0, 0x50, ZC3XX_R10E_RGB11},
  3284. {0xa0, 0xf8, ZC3XX_R10F_RGB12},
  3285. {0xa0, 0xf8, ZC3XX_R110_RGB20},
  3286. {0xa0, 0xf8, ZC3XX_R111_RGB21},
  3287. {0xa0, 0x50, ZC3XX_R112_RGB22},
  3288. {0xa1, 0x01, 0x0008},
  3289. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
  3290. {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
  3291. {0xa1, 0x01, 0x01c8},
  3292. {0xa1, 0x01, 0x01c9},
  3293. {0xa1, 0x01, 0x01ca},
  3294. {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
  3295. {0xa0, 0x01, ZC3XX_R120_GAMMA00}, /* gamma 2 ?*/
  3296. {0xa0, 0x0c, ZC3XX_R121_GAMMA01},
  3297. {0xa0, 0x1f, ZC3XX_R122_GAMMA02},
  3298. {0xa0, 0x3a, ZC3XX_R123_GAMMA03},
  3299. {0xa0, 0x53, ZC3XX_R124_GAMMA04},
  3300. {0xa0, 0x6d, ZC3XX_R125_GAMMA05},
  3301. {0xa0, 0x85, ZC3XX_R126_GAMMA06},
  3302. {0xa0, 0x9c, ZC3XX_R127_GAMMA07},
  3303. {0xa0, 0xb0, ZC3XX_R128_GAMMA08},
  3304. {0xa0, 0xc2, ZC3XX_R129_GAMMA09},
  3305. {0xa0, 0xd1, ZC3XX_R12A_GAMMA0A},
  3306. {0xa0, 0xde, ZC3XX_R12B_GAMMA0B},
  3307. {0xa0, 0xe9, ZC3XX_R12C_GAMMA0C},
  3308. {0xa0, 0xf2, ZC3XX_R12D_GAMMA0D},
  3309. {0xa0, 0xf9, ZC3XX_R12E_GAMMA0E},
  3310. {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
  3311. {0xa0, 0x05, ZC3XX_R130_GAMMA10},
  3312. {0xa0, 0x0f, ZC3XX_R131_GAMMA11},
  3313. {0xa0, 0x16, ZC3XX_R132_GAMMA12},
  3314. {0xa0, 0x1a, ZC3XX_R133_GAMMA13},
  3315. {0xa0, 0x19, ZC3XX_R134_GAMMA14},
  3316. {0xa0, 0x19, ZC3XX_R135_GAMMA15},
  3317. {0xa0, 0x17, ZC3XX_R136_GAMMA16},
  3318. {0xa0, 0x15, ZC3XX_R137_GAMMA17},
  3319. {0xa0, 0x12, ZC3XX_R138_GAMMA18},
  3320. {0xa0, 0x10, ZC3XX_R139_GAMMA19},
  3321. {0xa0, 0x0e, ZC3XX_R13A_GAMMA1A},
  3322. {0xa0, 0x0b, ZC3XX_R13B_GAMMA1B},
  3323. {0xa0, 0x09, ZC3XX_R13C_GAMMA1C},
  3324. {0xa0, 0x08, ZC3XX_R13D_GAMMA1D},
  3325. {0xa0, 0x06, ZC3XX_R13E_GAMMA1E},
  3326. {0xa0, 0x03, ZC3XX_R13F_GAMMA1F},
  3327. {0xa0, 0x50, ZC3XX_R10A_RGB00}, /* matrix */
  3328. {0xa0, 0xf8, ZC3XX_R10B_RGB01},
  3329. {0xa0, 0xf8, ZC3XX_R10C_RGB02},
  3330. {0xa0, 0xf8, ZC3XX_R10D_RGB10},
  3331. {0xa0, 0x50, ZC3XX_R10E_RGB11},
  3332. {0xa0, 0xf8, ZC3XX_R10F_RGB12},
  3333. {0xa0, 0xf8, ZC3XX_R110_RGB20},
  3334. {0xa0, 0xf8, ZC3XX_R111_RGB21},
  3335. {0xa0, 0x50, ZC3XX_R112_RGB22},
  3336. {0xa1, 0x01, 0x0180},
  3337. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  3338. {0xaa, 0x10, 0x001b},
  3339. {0xaa, 0x76, 0x0002},
  3340. {0xaa, 0x2a, 0x0081},
  3341. {0xaa, 0x2b, 0x0000},
  3342. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  3343. {0xa0, 0x01, ZC3XX_R191_EXPOSURELIMITMID},
  3344. {0xa0, 0xb8, ZC3XX_R192_EXPOSURELIMITLOW},
  3345. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  3346. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  3347. {0xa0, 0x37, ZC3XX_R197_ANTIFLICKERLOW},
  3348. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
  3349. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  3350. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
  3351. {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
  3352. {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
  3353. {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
  3354. {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
  3355. {0xaa, 0x13, 0x0083}, /* 40 */
  3356. {0xa1, 0x01, 0x0180},
  3357. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  3358. {}
  3359. };
  3360. static const struct usb_action ov7630c_Initial[] = {
  3361. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  3362. {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
  3363. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  3364. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  3365. {0xa0, 0x06, ZC3XX_R010_CMOSSENSORSELECT},
  3366. {0xa0, 0xa1, ZC3XX_R08B_I2CDEVICEADDR},
  3367. {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
  3368. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  3369. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  3370. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  3371. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  3372. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  3373. {0xaa, 0x12, 0x0080},
  3374. {0xa0, 0x02, ZC3XX_R083_RGAINADDR},
  3375. {0xa0, 0x01, ZC3XX_R085_BGAINADDR},
  3376. {0xa0, 0x90, ZC3XX_R086_EXPTIMEHIGH},
  3377. {0xa0, 0x91, ZC3XX_R087_EXPTIMEMID},
  3378. {0xa0, 0x10, ZC3XX_R088_EXPTIMELOW},
  3379. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  3380. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  3381. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  3382. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  3383. {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
  3384. {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
  3385. {0xaa, 0x12, 0x0069}, /* i2c */
  3386. {0xaa, 0x04, 0x0020},
  3387. {0xaa, 0x06, 0x0050},
  3388. {0xaa, 0x13, 0x00c3},
  3389. {0xaa, 0x14, 0x0000},
  3390. {0xaa, 0x15, 0x0024},
  3391. {0xaa, 0x19, 0x0003},
  3392. {0xaa, 0x1a, 0x00f6},
  3393. {0xaa, 0x1b, 0x0002},
  3394. {0xaa, 0x20, 0x00c2},
  3395. {0xaa, 0x24, 0x0060},
  3396. {0xaa, 0x25, 0x0040},
  3397. {0xaa, 0x26, 0x0030},
  3398. {0xaa, 0x27, 0x00ea},
  3399. {0xaa, 0x28, 0x00a0},
  3400. {0xaa, 0x21, 0x0000},
  3401. {0xaa, 0x2a, 0x0081},
  3402. {0xaa, 0x2b, 0x0096},
  3403. {0xaa, 0x2d, 0x0084},
  3404. {0xaa, 0x2f, 0x003d},
  3405. {0xaa, 0x30, 0x0024},
  3406. {0xaa, 0x60, 0x0000},
  3407. {0xaa, 0x61, 0x0040},
  3408. {0xaa, 0x68, 0x007c},
  3409. {0xaa, 0x6f, 0x0015},
  3410. {0xaa, 0x75, 0x0088},
  3411. {0xaa, 0x77, 0x00b5},
  3412. {0xaa, 0x01, 0x0060},
  3413. {0xaa, 0x02, 0x0060},
  3414. {0xaa, 0x17, 0x0018},
  3415. {0xaa, 0x18, 0x00ba},
  3416. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  3417. {0xa0, 0x77, ZC3XX_R101_SENSORCORRECTION},
  3418. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  3419. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  3420. {0xa0, 0x04, ZC3XX_R1A7_CALCGLOBALMEAN},
  3421. {0xa0, 0x00, 0x01ad},
  3422. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  3423. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  3424. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  3425. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  3426. {0xa0, 0x60, ZC3XX_R116_RGAIN},
  3427. {0xa0, 0x46, ZC3XX_R118_BGAIN},
  3428. {0xa0, 0x04, ZC3XX_R113_RGB03},
  3429. {0xa1, 0x01, 0x0002},
  3430. {0xa0, 0x4e, ZC3XX_R10A_RGB00}, /* matrix */
  3431. {0xa0, 0xfe, ZC3XX_R10B_RGB01},
  3432. {0xa0, 0xf4, ZC3XX_R10C_RGB02},
  3433. {0xa0, 0xf7, ZC3XX_R10D_RGB10},
  3434. {0xa0, 0x4d, ZC3XX_R10E_RGB11},
  3435. {0xa0, 0xfc, ZC3XX_R10F_RGB12},
  3436. {0xa0, 0x00, ZC3XX_R110_RGB20},
  3437. {0xa0, 0xf6, ZC3XX_R111_RGB21},
  3438. {0xa0, 0x4a, ZC3XX_R112_RGB22},
  3439. {0xa1, 0x01, 0x0008},
  3440. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */
  3441. {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */
  3442. {0xa1, 0x01, 0x01c8},
  3443. {0xa1, 0x01, 0x01c9},
  3444. {0xa1, 0x01, 0x01ca},
  3445. {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */
  3446. {0xa0, 0x16, ZC3XX_R120_GAMMA00}, /* gamma ~4 */
  3447. {0xa0, 0x3a, ZC3XX_R121_GAMMA01},
  3448. {0xa0, 0x5b, ZC3XX_R122_GAMMA02},
  3449. {0xa0, 0x7c, ZC3XX_R123_GAMMA03},
  3450. {0xa0, 0x94, ZC3XX_R124_GAMMA04},
  3451. {0xa0, 0xa9, ZC3XX_R125_GAMMA05},
  3452. {0xa0, 0xbb, ZC3XX_R126_GAMMA06},
  3453. {0xa0, 0xca, ZC3XX_R127_GAMMA07},
  3454. {0xa0, 0xd7, ZC3XX_R128_GAMMA08},
  3455. {0xa0, 0xe1, ZC3XX_R129_GAMMA09},
  3456. {0xa0, 0xea, ZC3XX_R12A_GAMMA0A},
  3457. {0xa0, 0xf1, ZC3XX_R12B_GAMMA0B},
  3458. {0xa0, 0xf7, ZC3XX_R12C_GAMMA0C},
  3459. {0xa0, 0xfc, ZC3XX_R12D_GAMMA0D},
  3460. {0xa0, 0xff, ZC3XX_R12E_GAMMA0E},
  3461. {0xa0, 0xff, ZC3XX_R12F_GAMMA0F},
  3462. {0xa0, 0x20, ZC3XX_R130_GAMMA10},
  3463. {0xa0, 0x22, ZC3XX_R131_GAMMA11},
  3464. {0xa0, 0x20, ZC3XX_R132_GAMMA12},
  3465. {0xa0, 0x1c, ZC3XX_R133_GAMMA13},
  3466. {0xa0, 0x16, ZC3XX_R134_GAMMA14},
  3467. {0xa0, 0x13, ZC3XX_R135_GAMMA15},
  3468. {0xa0, 0x10, ZC3XX_R136_GAMMA16},
  3469. {0xa0, 0x0d, ZC3XX_R137_GAMMA17},
  3470. {0xa0, 0x0b, ZC3XX_R138_GAMMA18},
  3471. {0xa0, 0x09, ZC3XX_R139_GAMMA19},
  3472. {0xa0, 0x07, ZC3XX_R13A_GAMMA1A},
  3473. {0xa0, 0x06, ZC3XX_R13B_GAMMA1B},
  3474. {0xa0, 0x05, ZC3XX_R13C_GAMMA1C},
  3475. {0xa0, 0x04, ZC3XX_R13D_GAMMA1D},
  3476. {0xa0, 0x00, ZC3XX_R13E_GAMMA1E},
  3477. {0xa0, 0x01, ZC3XX_R13F_GAMMA1F},
  3478. {0xa0, 0x4e, ZC3XX_R10A_RGB00}, /* matrix */
  3479. {0xa0, 0xfe, ZC3XX_R10B_RGB01},
  3480. {0xa0, 0xf4, ZC3XX_R10C_RGB02},
  3481. {0xa0, 0xf7, ZC3XX_R10D_RGB10},
  3482. {0xa0, 0x4d, ZC3XX_R10E_RGB11},
  3483. {0xa0, 0xfc, ZC3XX_R10F_RGB12},
  3484. {0xa0, 0x00, ZC3XX_R110_RGB20},
  3485. {0xa0, 0xf6, ZC3XX_R111_RGB21},
  3486. {0xa0, 0x4a, ZC3XX_R112_RGB22},
  3487. {0xa1, 0x01, 0x0180},
  3488. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  3489. {0xaa, 0x10, 0x000d},
  3490. {0xaa, 0x76, 0x0002},
  3491. {0xaa, 0x2a, 0x0081},
  3492. {0xaa, 0x2b, 0x0000},
  3493. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  3494. {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},
  3495. {0xa0, 0xd8, ZC3XX_R192_EXPOSURELIMITLOW},
  3496. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  3497. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  3498. {0xa0, 0x1b, ZC3XX_R197_ANTIFLICKERLOW},
  3499. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
  3500. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  3501. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF},
  3502. {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
  3503. {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
  3504. {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE},
  3505. {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
  3506. {0xaa, 0x13, 0x00c3},
  3507. {0xa1, 0x01, 0x0180},
  3508. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  3509. {}
  3510. };
  3511. static const struct usb_action pas106b_Initial_com[] = {
  3512. /* Sream and Sensor specific */
  3513. {0xa1, 0x01, 0x0010}, /* CMOSSensorSelect */
  3514. /* System */
  3515. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* SystemControl */
  3516. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* SystemControl */
  3517. /* Picture size */
  3518. {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* ClockSelect */
  3519. {0xa0, 0x03, 0x003a},
  3520. {0xa0, 0x0c, 0x003b},
  3521. {0xa0, 0x04, 0x0038},
  3522. {}
  3523. };
  3524. static const struct usb_action pas106b_InitialScale[] = { /* 176x144 */
  3525. /* JPEG control */
  3526. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  3527. /* Sream and Sensor specific */
  3528. {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
  3529. /* Picture size */
  3530. {0xa0, 0x00, ZC3XX_R003_FRAMEWIDTHHIGH},
  3531. {0xa0, 0xb0, ZC3XX_R004_FRAMEWIDTHLOW},
  3532. {0xa0, 0x00, ZC3XX_R005_FRAMEHEIGHTHIGH},
  3533. {0xa0, 0x90, ZC3XX_R006_FRAMEHEIGHTLOW},
  3534. /* System */
  3535. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  3536. /* Sream and Sensor specific */
  3537. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
  3538. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  3539. /* Sensor Interface */
  3540. {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
  3541. /* Window inside sensor array */
  3542. {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
  3543. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  3544. {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
  3545. {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
  3546. {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
  3547. /* Init the sensor */
  3548. {0xaa, 0x02, 0x0004},
  3549. {0xaa, 0x08, 0x0000},
  3550. {0xaa, 0x09, 0x0005},
  3551. {0xaa, 0x0a, 0x0002},
  3552. {0xaa, 0x0b, 0x0002},
  3553. {0xaa, 0x0c, 0x0005},
  3554. {0xaa, 0x0d, 0x0000},
  3555. {0xaa, 0x0e, 0x0002},
  3556. {0xaa, 0x14, 0x0081},
  3557. /* Other registers */
  3558. {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
  3559. /* Frame retreiving */
  3560. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  3561. /* Gains */
  3562. {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
  3563. /* Unknown */
  3564. {0xa0, 0x00, 0x01ad},
  3565. /* Sharpness */
  3566. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  3567. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  3568. /* Other registers */
  3569. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  3570. /* Auto exposure and white balance */
  3571. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  3572. /*Dead pixels */
  3573. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  3574. /* EEPROM */
  3575. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  3576. /* JPEG control */
  3577. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  3578. {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
  3579. {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
  3580. /* Other registers */
  3581. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  3582. /* Auto exposure and white balance */
  3583. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  3584. /*Dead pixels */
  3585. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  3586. /* EEPROM */
  3587. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  3588. /* JPEG control */
  3589. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  3590. {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
  3591. {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
  3592. {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
  3593. {0xa0, 0xf4, ZC3XX_R10B_RGB01},
  3594. {0xa0, 0xf4, ZC3XX_R10C_RGB02},
  3595. {0xa0, 0xf4, ZC3XX_R10D_RGB10},
  3596. {0xa0, 0x58, ZC3XX_R10E_RGB11},
  3597. {0xa0, 0xf4, ZC3XX_R10F_RGB12},
  3598. {0xa0, 0xf4, ZC3XX_R110_RGB20},
  3599. {0xa0, 0xf4, ZC3XX_R111_RGB21},
  3600. {0xa0, 0x58, ZC3XX_R112_RGB22},
  3601. /* Auto correction */
  3602. {0xa0, 0x03, ZC3XX_R181_WINXSTART},
  3603. {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
  3604. {0xa0, 0x16, ZC3XX_R183_WINXCENTER},
  3605. {0xa0, 0x03, ZC3XX_R184_WINYSTART},
  3606. {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
  3607. {0xa0, 0x14, ZC3XX_R186_WINYCENTER},
  3608. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  3609. /* Auto exposure and white balance */
  3610. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  3611. {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
  3612. {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
  3613. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  3614. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  3615. {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
  3616. {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
  3617. {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
  3618. /* sensor on */
  3619. {0xaa, 0x07, 0x00b1},
  3620. {0xaa, 0x05, 0x0003},
  3621. {0xaa, 0x04, 0x0001},
  3622. {0xaa, 0x03, 0x003b},
  3623. /* Gains */
  3624. {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
  3625. {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
  3626. {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},
  3627. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  3628. /* Auto correction */
  3629. {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
  3630. {0xa1, 0x01, 0x0180}, /* AutoCorrectEnable */
  3631. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  3632. /* Gains */
  3633. {0xa0, 0x40, ZC3XX_R116_RGAIN},
  3634. {0xa0, 0x40, ZC3XX_R117_GGAIN},
  3635. {0xa0, 0x40, ZC3XX_R118_BGAIN},
  3636. {}
  3637. };
  3638. static const struct usb_action pas106b_Initial[] = { /* 352x288 */
  3639. /* JPEG control */
  3640. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  3641. /* Sream and Sensor specific */
  3642. {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
  3643. /* Picture size */
  3644. {0xa0, 0x01, ZC3XX_R003_FRAMEWIDTHHIGH},
  3645. {0xa0, 0x60, ZC3XX_R004_FRAMEWIDTHLOW},
  3646. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  3647. {0xa0, 0x20, ZC3XX_R006_FRAMEHEIGHTLOW},
  3648. /* System */
  3649. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  3650. /* Sream and Sensor specific */
  3651. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
  3652. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  3653. /* Sensor Interface */
  3654. {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
  3655. /* Window inside sensor array */
  3656. {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
  3657. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  3658. {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
  3659. {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
  3660. {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
  3661. /* Init the sensor */
  3662. {0xaa, 0x02, 0x0004},
  3663. {0xaa, 0x08, 0x0000},
  3664. {0xaa, 0x09, 0x0005},
  3665. {0xaa, 0x0a, 0x0002},
  3666. {0xaa, 0x0b, 0x0002},
  3667. {0xaa, 0x0c, 0x0005},
  3668. {0xaa, 0x0d, 0x0000},
  3669. {0xaa, 0x0e, 0x0002},
  3670. {0xaa, 0x14, 0x0081},
  3671. /* Other registers */
  3672. {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
  3673. /* Frame retreiving */
  3674. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  3675. /* Gains */
  3676. {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
  3677. /* Unknown */
  3678. {0xa0, 0x00, 0x01ad},
  3679. /* Sharpness */
  3680. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  3681. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  3682. /* Other registers */
  3683. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  3684. /* Auto exposure and white balance */
  3685. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  3686. {0xa0, 0x80, ZC3XX_R18D_YTARGET},
  3687. /*Dead pixels */
  3688. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  3689. /* EEPROM */
  3690. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  3691. /* JPEG control */
  3692. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  3693. {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
  3694. {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
  3695. /* Other registers */
  3696. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  3697. /* Auto exposure and white balance */
  3698. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  3699. /*Dead pixels */
  3700. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  3701. /* EEPROM */
  3702. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  3703. /* JPEG control */
  3704. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  3705. {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
  3706. {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
  3707. {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
  3708. {0xa0, 0xf4, ZC3XX_R10B_RGB01},
  3709. {0xa0, 0xf4, ZC3XX_R10C_RGB02},
  3710. {0xa0, 0xf4, ZC3XX_R10D_RGB10},
  3711. {0xa0, 0x58, ZC3XX_R10E_RGB11},
  3712. {0xa0, 0xf4, ZC3XX_R10F_RGB12},
  3713. {0xa0, 0xf4, ZC3XX_R110_RGB20},
  3714. {0xa0, 0xf4, ZC3XX_R111_RGB21},
  3715. {0xa0, 0x58, ZC3XX_R112_RGB22},
  3716. /* Auto correction */
  3717. {0xa0, 0x03, ZC3XX_R181_WINXSTART},
  3718. {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
  3719. {0xa0, 0x16, ZC3XX_R183_WINXCENTER},
  3720. {0xa0, 0x03, ZC3XX_R184_WINYSTART},
  3721. {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
  3722. {0xa0, 0x14, ZC3XX_R186_WINYCENTER},
  3723. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  3724. /* Auto exposure and white balance */
  3725. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  3726. {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
  3727. {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
  3728. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  3729. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  3730. {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
  3731. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
  3732. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  3733. /* sensor on */
  3734. {0xaa, 0x07, 0x00b1},
  3735. {0xaa, 0x05, 0x0003},
  3736. {0xaa, 0x04, 0x0001},
  3737. {0xaa, 0x03, 0x003b},
  3738. /* Gains */
  3739. {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
  3740. {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
  3741. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  3742. /* Auto correction */
  3743. {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
  3744. {0xa1, 0x01, 0x0180}, /* AutoCorrectEnable */
  3745. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  3746. /* Gains */
  3747. {0xa0, 0x40, ZC3XX_R116_RGAIN},
  3748. {0xa0, 0x40, ZC3XX_R117_GGAIN},
  3749. {0xa0, 0x40, ZC3XX_R118_BGAIN},
  3750. {0xa0, 0x00, 0x0007}, /* AutoCorrectEnable */
  3751. {0xa0, 0xff, ZC3XX_R018_FRAMELOST}, /* Frame adjust */
  3752. {}
  3753. };
  3754. static const struct usb_action pas106b_50HZ[] = {
  3755. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  3756. {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
  3757. {0xa0, 0x54, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,54,cc */
  3758. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  3759. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  3760. {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,87,cc */
  3761. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
  3762. {0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,30,cc */
  3763. {0xaa, 0x03, 0x0021}, /* 00,03,21,aa */
  3764. {0xaa, 0x04, 0x000c}, /* 00,04,0c,aa */
  3765. {0xaa, 0x05, 0x0002}, /* 00,05,02,aa */
  3766. {0xaa, 0x07, 0x001c}, /* 00,07,1c,aa */
  3767. {0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
  3768. {}
  3769. };
  3770. static const struct usb_action pas106b_60HZ[] = {
  3771. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  3772. {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
  3773. {0xa0, 0x2e, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,2e,cc */
  3774. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  3775. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  3776. {0xa0, 0x71, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,71,cc */
  3777. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
  3778. {0xa0, 0x30, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,30,cc */
  3779. {0xaa, 0x03, 0x001c}, /* 00,03,1c,aa */
  3780. {0xaa, 0x04, 0x0004}, /* 00,04,04,aa */
  3781. {0xaa, 0x05, 0x0001}, /* 00,05,01,aa */
  3782. {0xaa, 0x07, 0x00c4}, /* 00,07,c4,aa */
  3783. {0xa0, 0x04, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,04,cc */
  3784. {}
  3785. };
  3786. static const struct usb_action pas106b_NoFliker[] = {
  3787. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  3788. {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,06,cc */
  3789. {0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc */
  3790. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  3791. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  3792. {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc */
  3793. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
  3794. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
  3795. {0xaa, 0x03, 0x0013}, /* 00,03,13,aa */
  3796. {0xaa, 0x04, 0x0000}, /* 00,04,00,aa */
  3797. {0xaa, 0x05, 0x0001}, /* 00,05,01,aa */
  3798. {0xaa, 0x07, 0x0030}, /* 00,07,30,aa */
  3799. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
  3800. {}
  3801. };
  3802. /* from lvWIMv.inf 046d:08a2/:08aa 2007/06/03 */
  3803. static const struct usb_action pas202b_Initial[] = { /* 640x480 */
  3804. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
  3805. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  3806. {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0e,cc */
  3807. {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, /* 00,02,00,cc */
  3808. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
  3809. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
  3810. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
  3811. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
  3812. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
  3813. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
  3814. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
  3815. {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
  3816. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
  3817. {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,03,cc */
  3818. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
  3819. {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,03,cc */
  3820. {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
  3821. {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc */
  3822. {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
  3823. {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
  3824. {0xaa, 0x02, 0x0002}, /* 00,02,04,aa --> 02 */
  3825. {0xaa, 0x07, 0x0006}, /* 00,07,06,aa */
  3826. {0xaa, 0x08, 0x0002}, /* 00,08,02,aa */
  3827. {0xaa, 0x09, 0x0006}, /* 00,09,06,aa */
  3828. {0xaa, 0x0a, 0x0001}, /* 00,0a,01,aa */
  3829. {0xaa, 0x0b, 0x0001}, /* 00,0b,01,aa */
  3830. {0xaa, 0x0c, 0x0006},
  3831. {0xaa, 0x0d, 0x0000}, /* 00,0d,00,aa */
  3832. {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
  3833. {0xaa, 0x12, 0x0005}, /* 00,12,05,aa */
  3834. {0xaa, 0x13, 0x0063}, /* 00,13,63,aa */
  3835. {0xaa, 0x15, 0x0070}, /* 00,15,70,aa */
  3836. {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc */
  3837. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
  3838. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
  3839. {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
  3840. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
  3841. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
  3842. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
  3843. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
  3844. {0xa0, 0x70, ZC3XX_R18D_YTARGET}, /* 01,8d,70,cc */
  3845. {}
  3846. };
  3847. static const struct usb_action pas202b_InitialScale[] = { /* 320x240 */
  3848. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
  3849. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  3850. {0xa0, 0x0e, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0e,cc */
  3851. {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
  3852. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
  3853. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
  3854. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
  3855. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  3856. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
  3857. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
  3858. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
  3859. {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* 00,8d,08,cc */
  3860. {0xa0, 0x08, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,08,cc */
  3861. {0xa0, 0x02, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,02,cc */
  3862. {0xa0, 0x08, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,08,cc */
  3863. {0xa0, 0x02, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,02,cc */
  3864. {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, /* 00,9b,01,cc */
  3865. {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
  3866. {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH}, /* 00,9d,02,cc */
  3867. {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
  3868. {0xaa, 0x02, 0x0002}, /* 00,02,02,aa */
  3869. {0xaa, 0x07, 0x0006}, /* 00,07,06,aa */
  3870. {0xaa, 0x08, 0x0002}, /* 00,08,02,aa */
  3871. {0xaa, 0x09, 0x0006}, /* 00,09,06,aa */
  3872. {0xaa, 0x0a, 0x0001}, /* 00,0a,01,aa */
  3873. {0xaa, 0x0b, 0x0001}, /* 00,0b,01,aa */
  3874. {0xaa, 0x0c, 0x0006},
  3875. {0xaa, 0x0d, 0x0000}, /* 00,0d,00,aa */
  3876. {0xaa, 0x10, 0x0000}, /* 00,10,00,aa */
  3877. {0xaa, 0x12, 0x0005}, /* 00,12,05,aa */
  3878. {0xaa, 0x13, 0x0063}, /* 00,13,63,aa */
  3879. {0xaa, 0x15, 0x0070}, /* 00,15,70,aa */
  3880. {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */
  3881. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
  3882. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
  3883. {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
  3884. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
  3885. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
  3886. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
  3887. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
  3888. {0xa0, 0x70, ZC3XX_R18D_YTARGET}, /* 01,8d,70,cc */
  3889. {0xa0, 0xff, ZC3XX_R097_WINYSTARTHIGH},
  3890. {0xa0, 0xfe, ZC3XX_R098_WINYSTARTLOW},
  3891. {}
  3892. };
  3893. static const struct usb_action pas202b_50HZ[] = {
  3894. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  3895. {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
  3896. {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
  3897. {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
  3898. {0xaa, 0x21, 0x001b},
  3899. {0xaa, 0x03, 0x0044}, /* 00,03,44,aa */
  3900. {0xaa, 0x04, 0x0008},
  3901. {0xaa, 0x05, 0x001b},
  3902. {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
  3903. {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
  3904. {0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
  3905. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
  3906. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  3907. {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
  3908. {0xa0, 0x1b, ZC3XX_R192_EXPOSURELIMITLOW},
  3909. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  3910. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  3911. {0xa0, 0x4d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,4d,cc */
  3912. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  3913. {0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
  3914. {0xa0, 0x44, ZC3XX_R01D_HSYNC_0}, /* 00,1d,44,cc */
  3915. {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1}, /* 00,1e,6f,cc */
  3916. {0xa0, 0xad, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ad,cc */
  3917. {0xa0, 0xeb, ZC3XX_R020_HSYNC_3}, /* 00,20,eb,cc */
  3918. {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
  3919. {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
  3920. {}
  3921. };
  3922. static const struct usb_action pas202b_50HZScale[] = {
  3923. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  3924. {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
  3925. {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
  3926. {0xaa, 0x20, 0x0004},
  3927. {0xaa, 0x21, 0x003d},
  3928. {0xaa, 0x03, 0x0041}, /* 00,03,41,aa */
  3929. {0xaa, 0x04, 0x0010},
  3930. {0xaa, 0x05, 0x003d},
  3931. {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
  3932. {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
  3933. {0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
  3934. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
  3935. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  3936. {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
  3937. {0xa0, 0x3d, ZC3XX_R192_EXPOSURELIMITLOW},
  3938. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  3939. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  3940. {0xa0, 0x9b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,9b,cc */
  3941. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  3942. {0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
  3943. {0xa0, 0x41, ZC3XX_R01D_HSYNC_0}, /* 00,1d,41,cc */
  3944. {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1}, /* 00,1e,6f,cc */
  3945. {0xa0, 0xad, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ad,cc */
  3946. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  3947. {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
  3948. {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
  3949. {}
  3950. };
  3951. static const struct usb_action pas202b_60HZ[] = {
  3952. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  3953. {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
  3954. {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
  3955. {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
  3956. {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
  3957. {0xaa, 0x03, 0x0045}, /* 00,03,45,aa */
  3958. {0xaa, 0x04, 0x0008}, /* 00,04,08,aa */
  3959. {0xaa, 0x05, 0x0000}, /* 00,05,00,aa */
  3960. {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
  3961. {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
  3962. {0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
  3963. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
  3964. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  3965. {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
  3966. {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
  3967. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  3968. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  3969. {0xa0, 0x40, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,40,cc */
  3970. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  3971. {0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
  3972. {0xa0, 0x45, ZC3XX_R01D_HSYNC_0}, /* 00,1d,45,cc */
  3973. {0xa0, 0x8e, ZC3XX_R01E_HSYNC_1}, /* 00,1e,8e,cc */
  3974. {0xa0, 0xc1, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c1,cc */
  3975. {0xa0, 0xf5, ZC3XX_R020_HSYNC_3}, /* 00,20,f5,cc */
  3976. {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
  3977. {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
  3978. {}
  3979. };
  3980. static const struct usb_action pas202b_60HZScale[] = {
  3981. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  3982. {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
  3983. {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
  3984. {0xaa, 0x20, 0x0004},
  3985. {0xaa, 0x21, 0x0008},
  3986. {0xaa, 0x03, 0x0042}, /* 00,03,42,aa */
  3987. {0xaa, 0x04, 0x0010},
  3988. {0xaa, 0x05, 0x0008},
  3989. {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
  3990. {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
  3991. {0xa0, 0x1c, ZC3XX_R1A9_DIGITALLIMITDIFF},
  3992. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc */
  3993. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  3994. {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
  3995. {0xa0, 0x08, ZC3XX_R192_EXPOSURELIMITLOW},
  3996. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  3997. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  3998. {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,81,cc */
  3999. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  4000. {0xa0, 0x1b, ZC3XX_R18F_AEUNFREEZE},
  4001. {0xa0, 0x42, ZC3XX_R01D_HSYNC_0}, /* 00,1d,42,cc */
  4002. {0xa0, 0x6f, ZC3XX_R01E_HSYNC_1}, /* 00,1e,6f,cc */
  4003. {0xa0, 0xaf, ZC3XX_R01F_HSYNC_2}, /* 00,1f,af,cc */
  4004. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  4005. {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
  4006. {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
  4007. {}
  4008. };
  4009. static const struct usb_action pas202b_NoFliker[] = {
  4010. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  4011. {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
  4012. {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
  4013. {0xaa, 0x20, 0x0002}, /* 00,20,02,aa */
  4014. {0xaa, 0x21, 0x0006},
  4015. {0xaa, 0x03, 0x0040}, /* 00,03,40,aa */
  4016. {0xaa, 0x04, 0x0008}, /* 00,04,08,aa */
  4017. {0xaa, 0x05, 0x0006},
  4018. {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
  4019. {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
  4020. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  4021. {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID},
  4022. {0xa0, 0x06, ZC3XX_R192_EXPOSURELIMITLOW},
  4023. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  4024. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  4025. {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW},
  4026. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
  4027. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
  4028. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
  4029. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
  4030. {0xa0, 0x40, ZC3XX_R01D_HSYNC_0}, /* 00,1d,40,cc */
  4031. {0xa0, 0x60, ZC3XX_R01E_HSYNC_1}, /* 00,1e,60,cc */
  4032. {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
  4033. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  4034. {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
  4035. {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
  4036. {}
  4037. };
  4038. static const struct usb_action pas202b_NoFlikerScale[] = {
  4039. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  4040. {0xa0, 0x20, ZC3XX_R087_EXPTIMEMID}, /* 00,87,20,cc */
  4041. {0xa0, 0x21, ZC3XX_R088_EXPTIMELOW}, /* 00,88,21,cc */
  4042. {0xaa, 0x20, 0x0004},
  4043. {0xaa, 0x21, 0x000c},
  4044. {0xaa, 0x03, 0x0040}, /* 00,03,40,aa */
  4045. {0xaa, 0x04, 0x0010},
  4046. {0xaa, 0x05, 0x000c},
  4047. {0xaa, 0x0e, 0x0001}, /* 00,0e,01,aa */
  4048. {0xaa, 0x0f, 0x0000}, /* 00,0f,00,aa */
  4049. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  4050. {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
  4051. {0xa0, 0x0c, ZC3XX_R192_EXPOSURELIMITLOW},
  4052. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  4053. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  4054. {0xa0, 0x02, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,02,cc */
  4055. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* 01,8c,10,cc */
  4056. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,20,cc */
  4057. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
  4058. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
  4059. {0xa0, 0x40, ZC3XX_R01D_HSYNC_0}, /* 00,1d,40,cc */
  4060. {0xa0, 0x60, ZC3XX_R01E_HSYNC_1}, /* 00,1e,60,cc */
  4061. {0xa0, 0x90, ZC3XX_R01F_HSYNC_2}, /* 00,1f,90,cc */
  4062. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  4063. {0xa0, 0x0f, ZC3XX_R087_EXPTIMEMID}, /* 00,87,0f,cc */
  4064. {0xa0, 0x0e, ZC3XX_R088_EXPTIMELOW}, /* 00,88,0e,cc */
  4065. {}
  4066. };
  4067. /* mt9v111 (mi0360soc) and pb0330 from vm30x.inf 0ac8:301b 07/02/13 */
  4068. static const struct usb_action mt9v111_1_Initial[] = { /* 640x480 */
  4069. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  4070. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  4071. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
  4072. {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
  4073. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  4074. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  4075. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  4076. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  4077. {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
  4078. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  4079. {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
  4080. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  4081. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  4082. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  4083. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  4084. {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
  4085. {0xdd, 0x00, 0x0200},
  4086. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  4087. {0xaa, 0x01, 0x0001},
  4088. {0xaa, 0x06, 0x0000},
  4089. {0xaa, 0x08, 0x0483},
  4090. {0xaa, 0x01, 0x0004},
  4091. {0xaa, 0x08, 0x0006},
  4092. {0xaa, 0x02, 0x0011},
  4093. {0xaa, 0x03, 0x01e5}, /*jfm: was 01e7*/
  4094. {0xaa, 0x04, 0x0285}, /*jfm: was 0287*/
  4095. {0xaa, 0x07, 0x3002},
  4096. {0xaa, 0x20, 0x5100},
  4097. {0xaa, 0x35, 0x507f},
  4098. {0xaa, 0x30, 0x0005},
  4099. {0xaa, 0x31, 0x0000},
  4100. {0xaa, 0x58, 0x0078},
  4101. {0xaa, 0x62, 0x0411},
  4102. {0xaa, 0x2b, 0x007f},
  4103. {0xaa, 0x2c, 0x007f}, /*jfm: was 0030*/
  4104. {0xaa, 0x2d, 0x007f}, /*jfm: was 0030*/
  4105. {0xaa, 0x2e, 0x007f}, /*jfm: was 0030*/
  4106. {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
  4107. {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
  4108. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  4109. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  4110. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  4111. {0xa0, 0x09, 0x01ad}, /*jfm: was 00*/
  4112. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  4113. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  4114. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  4115. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  4116. {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
  4117. {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
  4118. {0xa0, 0x61, ZC3XX_R116_RGAIN},
  4119. {0xa0, 0x65, ZC3XX_R118_BGAIN},
  4120. {}
  4121. };
  4122. static const struct usb_action mt9v111_1_InitialScale[] = { /* 320x240 */
  4123. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  4124. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  4125. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
  4126. {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
  4127. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  4128. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  4129. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  4130. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  4131. {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
  4132. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  4133. {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
  4134. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  4135. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  4136. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  4137. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  4138. {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
  4139. {0xdd, 0x00, 0x0200},
  4140. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  4141. {0xaa, 0x01, 0x0001},
  4142. {0xaa, 0x06, 0x0000},
  4143. {0xaa, 0x08, 0x0483},
  4144. {0xaa, 0x01, 0x0004},
  4145. {0xaa, 0x08, 0x0006},
  4146. {0xaa, 0x02, 0x0011},
  4147. {0xaa, 0x03, 0x01e7},
  4148. {0xaa, 0x04, 0x0287},
  4149. {0xaa, 0x07, 0x3002},
  4150. {0xaa, 0x20, 0x5100},
  4151. {0xaa, 0x35, 0x007f}, /*jfm: was 0050*/
  4152. {0xaa, 0x30, 0x0005},
  4153. {0xaa, 0x31, 0x0000},
  4154. {0xaa, 0x58, 0x0078},
  4155. {0xaa, 0x62, 0x0411},
  4156. {0xaa, 0x2b, 0x007f}, /*jfm: was 28*/
  4157. {0xaa, 0x2c, 0x007f}, /*jfm: was 30*/
  4158. {0xaa, 0x2d, 0x007f}, /*jfm: was 30*/
  4159. {0xaa, 0x2e, 0x007f}, /*jfm: was 28*/
  4160. {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
  4161. {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION},
  4162. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  4163. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  4164. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  4165. {0xa0, 0x09, 0x01ad}, /*jfm: was 00*/
  4166. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  4167. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  4168. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  4169. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  4170. {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
  4171. {0xa0, 0x6c, ZC3XX_R18D_YTARGET},
  4172. {0xa0, 0x61, ZC3XX_R116_RGAIN},
  4173. {0xa0, 0x65, ZC3XX_R118_BGAIN},
  4174. {}
  4175. };
  4176. static const struct usb_action mt9v111_1_AE50HZ[] = {
  4177. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  4178. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4179. {0xbb, 0x00, 0x0562},
  4180. {0xbb, 0x01, 0x09aa},
  4181. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4182. {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
  4183. {0xa0, 0x9b, ZC3XX_R192_EXPOSURELIMITLOW},
  4184. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4185. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4186. {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
  4187. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  4188. {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
  4189. {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4190. {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
  4191. {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},
  4192. {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
  4193. {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
  4194. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  4195. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  4196. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  4197. {}
  4198. };
  4199. static const struct usb_action mt9v111_1_AE50HZScale[] = {
  4200. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  4201. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4202. {0xbb, 0x00, 0x0509},
  4203. {0xbb, 0x01, 0x0934},
  4204. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4205. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  4206. {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
  4207. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4208. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4209. {0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
  4210. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  4211. {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
  4212. {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4213. {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
  4214. {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
  4215. {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
  4216. {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
  4217. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  4218. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  4219. {}
  4220. };
  4221. static const struct usb_action mt9v111_1_AE60HZ[] = {
  4222. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  4223. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4224. {0xaa, 0x05, 0x003d},
  4225. {0xaa, 0x09, 0x016e},
  4226. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4227. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  4228. {0xa0, 0xdd, ZC3XX_R192_EXPOSURELIMITLOW},
  4229. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4230. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4231. {0xa0, 0x3d, ZC3XX_R197_ANTIFLICKERLOW},
  4232. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  4233. {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
  4234. {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4235. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
  4236. {0xa0, 0x62, ZC3XX_R01D_HSYNC_0},
  4237. {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
  4238. {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
  4239. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  4240. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  4241. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  4242. {}
  4243. };
  4244. static const struct usb_action mt9v111_1_AE60HZScale[] = {
  4245. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  4246. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4247. {0xbb, 0x00, 0x0509},
  4248. {0xbb, 0x01, 0x0983},
  4249. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4250. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  4251. {0xa0, 0x8f, ZC3XX_R192_EXPOSURELIMITLOW},
  4252. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4253. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4254. {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},
  4255. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  4256. {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
  4257. {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4258. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
  4259. {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
  4260. {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
  4261. {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
  4262. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  4263. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  4264. {}
  4265. };
  4266. static const struct usb_action mt9v111_1_AENoFliker[] = {
  4267. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  4268. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4269. {0xbb, 0x00, 0x0509},
  4270. {0xbb, 0x01, 0x0960},
  4271. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4272. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  4273. {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
  4274. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4275. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4276. {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
  4277. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  4278. {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
  4279. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4280. {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
  4281. {0xa0, 0x09, ZC3XX_R01D_HSYNC_0},
  4282. {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
  4283. {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
  4284. {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
  4285. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  4286. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  4287. {}
  4288. };
  4289. static const struct usb_action mt9v111_1_AENoFlikerScale[] = {
  4290. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  4291. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4292. {0xbb, 0x00, 0x0534},
  4293. {0xbb, 0x02, 0x0960},
  4294. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4295. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  4296. {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
  4297. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4298. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4299. {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
  4300. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  4301. {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
  4302. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4303. {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
  4304. {0xa0, 0x34, ZC3XX_R01D_HSYNC_0},
  4305. {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
  4306. {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
  4307. {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
  4308. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  4309. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  4310. {}
  4311. };
  4312. /* from usbvm303.inf 0ac8:303b 07/03/25 (3 - tas5130c) */
  4313. static const struct usb_action mt9v111_3_Initial[] = {
  4314. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  4315. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  4316. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
  4317. {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
  4318. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  4319. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  4320. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  4321. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  4322. {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
  4323. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  4324. {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
  4325. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  4326. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  4327. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  4328. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  4329. {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
  4330. {0xdd, 0x00, 0x0200},
  4331. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  4332. {0xaa, 0x01, 0x0001}, /* select IFP/SOC registers */
  4333. {0xaa, 0x06, 0x0000}, /* operating mode control */
  4334. {0xaa, 0x08, 0x0483}, /* output format control */
  4335. /* H red first, V red or blue first,
  4336. * raw Bayer, auto flicker */
  4337. {0xaa, 0x01, 0x0004}, /* select sensor core registers */
  4338. {0xaa, 0x08, 0x0006}, /* row start */
  4339. {0xaa, 0x02, 0x0011}, /* column start */
  4340. {0xaa, 0x03, 0x01e5}, /* window height - 1 */
  4341. {0xaa, 0x04, 0x0285}, /* window width - 1 */
  4342. {0xaa, 0x07, 0x3002}, /* output control */
  4343. {0xaa, 0x20, 0x1100}, /* read mode: bits 8 & 12 (?) */
  4344. {0xaa, 0x35, 0x007f}, /* global gain */
  4345. {0xaa, 0x30, 0x0005},
  4346. {0xaa, 0x31, 0x0000},
  4347. {0xaa, 0x58, 0x0078},
  4348. {0xaa, 0x62, 0x0411},
  4349. {0xaa, 0x2b, 0x007f}, /* green1 gain */
  4350. {0xaa, 0x2c, 0x007f}, /* blue gain */
  4351. {0xaa, 0x2d, 0x007f}, /* red gain */
  4352. {0xaa, 0x2e, 0x007f}, /* green2 gain */
  4353. {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
  4354. {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
  4355. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  4356. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  4357. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  4358. {0xa0, 0x00, 0x01ad},
  4359. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  4360. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  4361. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  4362. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  4363. {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
  4364. {0xa0, 0x80, ZC3XX_R18D_YTARGET},
  4365. {0xa0, 0x61, ZC3XX_R116_RGAIN},
  4366. {0xa0, 0x65, ZC3XX_R118_BGAIN},
  4367. {}
  4368. };
  4369. static const struct usb_action mt9v111_3_InitialScale[] = {
  4370. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  4371. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  4372. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
  4373. {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
  4374. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  4375. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  4376. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  4377. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  4378. {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
  4379. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  4380. {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
  4381. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  4382. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  4383. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  4384. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  4385. {0xa0, 0xdc, ZC3XX_R08B_I2CDEVICEADDR},
  4386. {0xdd, 0x00, 0x0200},
  4387. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  4388. {0xaa, 0x01, 0x0001},
  4389. {0xaa, 0x06, 0x0000},
  4390. {0xaa, 0x08, 0x0483},
  4391. {0xaa, 0x01, 0x0004},
  4392. {0xaa, 0x08, 0x0006},
  4393. {0xaa, 0x02, 0x0011},
  4394. {0xaa, 0x03, 0x01e7},
  4395. {0xaa, 0x04, 0x0287},
  4396. {0xaa, 0x07, 0x3002},
  4397. {0xaa, 0x20, 0x1100},
  4398. {0xaa, 0x35, 0x007f},
  4399. {0xaa, 0x30, 0x0005},
  4400. {0xaa, 0x31, 0x0000},
  4401. {0xaa, 0x58, 0x0078},
  4402. {0xaa, 0x62, 0x0411},
  4403. {0xaa, 0x2b, 0x007f},
  4404. {0xaa, 0x2c, 0x007f},
  4405. {0xaa, 0x2d, 0x007f},
  4406. {0xaa, 0x2e, 0x007f},
  4407. {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
  4408. {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
  4409. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  4410. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  4411. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  4412. {0xa0, 0x00, 0x01ad},
  4413. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  4414. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  4415. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  4416. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  4417. {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
  4418. {0xa0, 0x80, ZC3XX_R18D_YTARGET},
  4419. {0xa0, 0x61, ZC3XX_R116_RGAIN},
  4420. {0xa0, 0x65, ZC3XX_R118_BGAIN},
  4421. {}
  4422. };
  4423. static const struct usb_action mt9v111_3_AE50HZ[] = {
  4424. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  4425. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4426. {0xaa, 0x05, 0x0009}, /* horizontal blanking */
  4427. {0xaa, 0x09, 0x01ce}, /* shutter width */
  4428. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4429. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  4430. {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
  4431. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4432. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4433. {0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
  4434. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  4435. {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
  4436. {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4437. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
  4438. {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
  4439. {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
  4440. {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
  4441. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  4442. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  4443. {}
  4444. };
  4445. static const struct usb_action mt9v111_3_AE50HZScale[] = {
  4446. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  4447. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4448. {0xaa, 0x05, 0x0009},
  4449. {0xaa, 0x09, 0x01ce},
  4450. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4451. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  4452. {0xa0, 0xd2, ZC3XX_R192_EXPOSURELIMITLOW},
  4453. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4454. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4455. {0xa0, 0x9a, ZC3XX_R197_ANTIFLICKERLOW},
  4456. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  4457. {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
  4458. {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4459. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
  4460. {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
  4461. {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
  4462. {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
  4463. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  4464. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  4465. {}
  4466. };
  4467. static const struct usb_action mt9v111_3_AE60HZ[] = {
  4468. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  4469. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4470. {0xaa, 0x05, 0x0009},
  4471. {0xaa, 0x09, 0x0083},
  4472. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4473. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  4474. {0xa0, 0x8f, ZC3XX_R192_EXPOSURELIMITLOW},
  4475. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4476. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4477. {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},
  4478. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  4479. {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
  4480. {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4481. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
  4482. {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
  4483. {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
  4484. {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
  4485. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  4486. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  4487. {}
  4488. };
  4489. static const struct usb_action mt9v111_3_AE60HZScale[] = {
  4490. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  4491. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4492. {0xaa, 0x05, 0x0009},
  4493. {0xaa, 0x09, 0x0083},
  4494. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4495. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  4496. {0xa0, 0x8f, ZC3XX_R192_EXPOSURELIMITLOW},
  4497. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4498. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4499. {0xa0, 0x81, ZC3XX_R197_ANTIFLICKERLOW},
  4500. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  4501. {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
  4502. {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4503. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
  4504. {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
  4505. {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1},
  4506. {0xa0, 0xf9, ZC3XX_R01F_HSYNC_2},
  4507. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  4508. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  4509. {}
  4510. };
  4511. static const struct usb_action mt9v111_3_AENoFliker[] = {
  4512. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  4513. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4514. {0xaa, 0x05, 0x0034},
  4515. {0xaa, 0x09, 0x0260},
  4516. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4517. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  4518. {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
  4519. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4520. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4521. {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
  4522. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  4523. {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
  4524. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4525. {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
  4526. {0xa0, 0x34, ZC3XX_R01D_HSYNC_0},
  4527. {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
  4528. {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
  4529. {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
  4530. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  4531. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  4532. {}
  4533. };
  4534. static const struct usb_action mt9v111_3_AENoFlikerScale[] = {
  4535. {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
  4536. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4537. {0xaa, 0x05, 0x0034},
  4538. {0xaa, 0x09, 0x0260},
  4539. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4540. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  4541. {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
  4542. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4543. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4544. {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
  4545. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  4546. {0xa0, 0x1c, ZC3XX_R18F_AEUNFREEZE},
  4547. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4548. {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
  4549. {0xa0, 0x34, ZC3XX_R01D_HSYNC_0},
  4550. {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
  4551. {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
  4552. {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
  4553. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  4554. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
  4555. {}
  4556. };
  4557. static const struct usb_action pb0330_Initial[] = { /* 640x480 */
  4558. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  4559. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
  4560. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
  4561. {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
  4562. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  4563. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  4564. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  4565. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  4566. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  4567. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  4568. {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
  4569. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  4570. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  4571. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  4572. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  4573. {0xdd, 0x00, 0x0200},
  4574. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  4575. {0xaa, 0x01, 0x0006},
  4576. {0xaa, 0x02, 0x0011},
  4577. {0xaa, 0x03, 0x01e5}, /*jfm: was 1e7*/
  4578. {0xaa, 0x04, 0x0285}, /*jfm: was 0287*/
  4579. {0xaa, 0x06, 0x0003},
  4580. {0xaa, 0x07, 0x3002},
  4581. {0xaa, 0x20, 0x1100},
  4582. {0xaa, 0x2f, 0xf7b0},
  4583. {0xaa, 0x30, 0x0005},
  4584. {0xaa, 0x31, 0x0000},
  4585. {0xaa, 0x34, 0x0100},
  4586. {0xaa, 0x35, 0x0060},
  4587. {0xaa, 0x3d, 0x068f},
  4588. {0xaa, 0x40, 0x01e0},
  4589. {0xaa, 0x58, 0x0078},
  4590. {0xaa, 0x62, 0x0411},
  4591. {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
  4592. {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
  4593. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  4594. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  4595. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  4596. {0xa0, 0x09, 0x01ad}, /*jfm: was 00 */
  4597. {0xa0, 0x15, 0x01ae},
  4598. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  4599. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  4600. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  4601. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  4602. {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
  4603. {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /*jfm: was 6c*/
  4604. {}
  4605. };
  4606. static const struct usb_action pb0330_InitialScale[] = { /* 320x240 */
  4607. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  4608. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00 */
  4609. {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT},
  4610. {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
  4611. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  4612. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  4613. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  4614. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  4615. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  4616. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  4617. {0xa0, 0x07, ZC3XX_R012_VIDEOCONTROLFUNC},
  4618. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
  4619. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
  4620. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
  4621. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW},
  4622. {0xdd, 0x00, 0x0200},
  4623. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  4624. {0xaa, 0x01, 0x0006},
  4625. {0xaa, 0x02, 0x0011},
  4626. {0xaa, 0x03, 0x01e7},
  4627. {0xaa, 0x04, 0x0287},
  4628. {0xaa, 0x06, 0x0003},
  4629. {0xaa, 0x07, 0x3002},
  4630. {0xaa, 0x20, 0x1100},
  4631. {0xaa, 0x2f, 0xf7b0},
  4632. {0xaa, 0x30, 0x0005},
  4633. {0xaa, 0x31, 0x0000},
  4634. {0xaa, 0x34, 0x0100},
  4635. {0xaa, 0x35, 0x0060},
  4636. {0xaa, 0x3d, 0x068f},
  4637. {0xaa, 0x40, 0x01e0},
  4638. {0xaa, 0x58, 0x0078},
  4639. {0xaa, 0x62, 0x0411},
  4640. {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID},
  4641. {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
  4642. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  4643. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  4644. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  4645. {0xa0, 0x09, 0x01ad},
  4646. {0xa0, 0x15, 0x01ae},
  4647. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  4648. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  4649. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  4650. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  4651. {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN},
  4652. {0xa0, 0x78, ZC3XX_R18D_YTARGET}, /*jfm: was 6c*/
  4653. {}
  4654. };
  4655. static const struct usb_action pb0330_50HZ[] = {
  4656. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4657. {0xbb, 0x00, 0x055c},
  4658. {0xbb, 0x01, 0x09aa},
  4659. {0xbb, 0x00, 0x1001},
  4660. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  4661. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4662. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  4663. {0xa0, 0xc4, ZC3XX_R192_EXPOSURELIMITLOW},
  4664. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4665. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4666. {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW},
  4667. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  4668. {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
  4669. {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4670. {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
  4671. {0xa0, 0x5c, ZC3XX_R01D_HSYNC_0},
  4672. {0xa0, 0x90, ZC3XX_R01E_HSYNC_1},
  4673. {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2},
  4674. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  4675. {}
  4676. };
  4677. static const struct usb_action pb0330_50HZScale[] = {
  4678. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4679. {0xbb, 0x00, 0x0566},
  4680. {0xbb, 0x02, 0x09b2},
  4681. {0xbb, 0x00, 0x1002},
  4682. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  4683. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4684. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  4685. {0xa0, 0x8c, ZC3XX_R192_EXPOSURELIMITLOW},
  4686. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4687. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4688. {0xa0, 0x8a, ZC3XX_R197_ANTIFLICKERLOW},
  4689. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  4690. {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
  4691. {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4692. {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
  4693. {0xa0, 0xd7, ZC3XX_R01D_HSYNC_0},
  4694. {0xa0, 0xf0, ZC3XX_R01E_HSYNC_1},
  4695. {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2},
  4696. {0xa0, 0xff, ZC3XX_R020_HSYNC_3},
  4697. {}
  4698. };
  4699. static const struct usb_action pb0330_60HZ[] = {
  4700. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4701. {0xbb, 0x00, 0x0535},
  4702. {0xbb, 0x01, 0x0974},
  4703. {0xbb, 0x00, 0x1001},
  4704. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  4705. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4706. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  4707. {0xa0, 0xfe, ZC3XX_R192_EXPOSURELIMITLOW},
  4708. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4709. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4710. {0xa0, 0x3e, ZC3XX_R197_ANTIFLICKERLOW},
  4711. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  4712. {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
  4713. {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4714. {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
  4715. {0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
  4716. {0xa0, 0x50, ZC3XX_R01E_HSYNC_1},
  4717. {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
  4718. {0xa0, 0xd0, ZC3XX_R020_HSYNC_3},
  4719. {}
  4720. };
  4721. static const struct usb_action pb0330_60HZScale[] = {
  4722. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4723. {0xbb, 0x00, 0x0535},
  4724. {0xbb, 0x02, 0x096c},
  4725. {0xbb, 0x00, 0x1002},
  4726. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  4727. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4728. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  4729. {0xa0, 0xc0, ZC3XX_R192_EXPOSURELIMITLOW},
  4730. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4731. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4732. {0xa0, 0x7c, ZC3XX_R197_ANTIFLICKERLOW},
  4733. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE},
  4734. {0xa0, 0x1a, ZC3XX_R18F_AEUNFREEZE},
  4735. {0xa0, 0x14, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4736. {0xa0, 0x66, ZC3XX_R1AA_DIGITALGAINSTEP},
  4737. {0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
  4738. {0xa0, 0x50, ZC3XX_R01E_HSYNC_1},
  4739. {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
  4740. {0xa0, 0xd0, ZC3XX_R020_HSYNC_3},
  4741. {}
  4742. };
  4743. static const struct usb_action pb0330_NoFliker[] = {
  4744. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4745. {0xbb, 0x00, 0x0509},
  4746. {0xbb, 0x02, 0x0940},
  4747. {0xbb, 0x00, 0x1002},
  4748. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  4749. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4750. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  4751. {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
  4752. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4753. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4754. {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW},
  4755. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
  4756. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  4757. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4758. {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
  4759. {0xa0, 0x09, ZC3XX_R01D_HSYNC_0},
  4760. {0xa0, 0x40, ZC3XX_R01E_HSYNC_1},
  4761. {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
  4762. {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
  4763. {}
  4764. };
  4765. static const struct usb_action pb0330_NoFlikerScale[] = {
  4766. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
  4767. {0xbb, 0x00, 0x0535},
  4768. {0xbb, 0x01, 0x0980},
  4769. {0xbb, 0x00, 0x1001},
  4770. {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
  4771. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
  4772. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  4773. {0xa0, 0xf0, ZC3XX_R192_EXPOSURELIMITLOW},
  4774. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  4775. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  4776. {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW},
  4777. {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
  4778. {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
  4779. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF},
  4780. {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP},
  4781. {0xa0, 0x35, ZC3XX_R01D_HSYNC_0},
  4782. {0xa0, 0x60, ZC3XX_R01E_HSYNC_1},
  4783. {0xa0, 0x90, ZC3XX_R01F_HSYNC_2},
  4784. {0xa0, 0xe0, ZC3XX_R020_HSYNC_3},
  4785. {}
  4786. };
  4787. /* from oem9.inf */
  4788. static const struct usb_action po2030_Initial[] = { /* 640x480 */
  4789. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
  4790. {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT}, /* 00,02,04,cc */
  4791. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  4792. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
  4793. {0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
  4794. {0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
  4795. {0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
  4796. {0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
  4797. {0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
  4798. {0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
  4799. {0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
  4800. {0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
  4801. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
  4802. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
  4803. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
  4804. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
  4805. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
  4806. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
  4807. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
  4808. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
  4809. {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
  4810. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
  4811. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
  4812. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
  4813. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
  4814. {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc */
  4815. {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */
  4816. {0xaa, 0x09, 0x00ce}, /* 00,09,ce,aa */
  4817. {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
  4818. {0xaa, 0x0d, 0x0054}, /* 00,0d,54,aa */
  4819. {0xaa, 0x0f, 0x00eb}, /* 00,0f,eb,aa */
  4820. {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
  4821. {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
  4822. {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
  4823. {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
  4824. {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
  4825. {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
  4826. {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
  4827. {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
  4828. {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
  4829. {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
  4830. {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
  4831. {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
  4832. {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
  4833. {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
  4834. {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
  4835. {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
  4836. {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
  4837. {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
  4838. {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
  4839. {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
  4840. {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
  4841. {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
  4842. {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
  4843. {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
  4844. {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
  4845. {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
  4846. {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
  4847. {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
  4848. {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
  4849. {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
  4850. {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
  4851. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
  4852. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
  4853. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
  4854. {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
  4855. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
  4856. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
  4857. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
  4858. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
  4859. {0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
  4860. {0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
  4861. {}
  4862. };
  4863. /* from oem9.inf */
  4864. static const struct usb_action po2030_InitialScale[] = { /* 320x240 */
  4865. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */
  4866. {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */
  4867. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */
  4868. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */
  4869. {0xa0, 0x04, ZC3XX_R080_HBLANKHIGH}, /* 00,80,04,cc */
  4870. {0xa0, 0x05, ZC3XX_R081_HBLANKLOW}, /* 00,81,05,cc */
  4871. {0xa0, 0x16, ZC3XX_R083_RGAINADDR}, /* 00,83,16,cc */
  4872. {0xa0, 0x18, ZC3XX_R085_BGAINADDR}, /* 00,85,18,cc */
  4873. {0xa0, 0x1a, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,1a,cc */
  4874. {0xa0, 0x1b, ZC3XX_R087_EXPTIMEMID}, /* 00,87,1b,cc */
  4875. {0xa0, 0x1c, ZC3XX_R088_EXPTIMELOW}, /* 00,88,1c,cc */
  4876. {0xa0, 0xee, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,ee,cc */
  4877. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */
  4878. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */
  4879. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */
  4880. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */
  4881. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */
  4882. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */
  4883. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc */
  4884. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
  4885. {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
  4886. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */
  4887. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */
  4888. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */
  4889. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */
  4890. {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc */
  4891. {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */
  4892. {0xaa, 0x09, 0x00cc}, /* 00,09,cc,aa */
  4893. {0xaa, 0x0b, 0x0005}, /* 00,0b,05,aa */
  4894. {0xaa, 0x0d, 0x0058}, /* 00,0d,58,aa */
  4895. {0xaa, 0x0f, 0x00ed}, /* 00,0f,ed,aa */
  4896. {0xaa, 0x87, 0x0000}, /* 00,87,00,aa */
  4897. {0xaa, 0x88, 0x0004}, /* 00,88,04,aa */
  4898. {0xaa, 0x89, 0x0000}, /* 00,89,00,aa */
  4899. {0xaa, 0x8a, 0x0005}, /* 00,8a,05,aa */
  4900. {0xaa, 0x13, 0x0003}, /* 00,13,03,aa */
  4901. {0xaa, 0x16, 0x0040}, /* 00,16,40,aa */
  4902. {0xaa, 0x18, 0x0040}, /* 00,18,40,aa */
  4903. {0xaa, 0x1d, 0x0002}, /* 00,1d,02,aa */
  4904. {0xaa, 0x29, 0x00e8}, /* 00,29,e8,aa */
  4905. {0xaa, 0x45, 0x0045}, /* 00,45,45,aa */
  4906. {0xaa, 0x50, 0x00ed}, /* 00,50,ed,aa */
  4907. {0xaa, 0x51, 0x0025}, /* 00,51,25,aa */
  4908. {0xaa, 0x52, 0x0042}, /* 00,52,42,aa */
  4909. {0xaa, 0x53, 0x002f}, /* 00,53,2f,aa */
  4910. {0xaa, 0x79, 0x0025}, /* 00,79,25,aa */
  4911. {0xaa, 0x7b, 0x0000}, /* 00,7b,00,aa */
  4912. {0xaa, 0x7e, 0x0025}, /* 00,7e,25,aa */
  4913. {0xaa, 0x7f, 0x0025}, /* 00,7f,25,aa */
  4914. {0xaa, 0x21, 0x0000}, /* 00,21,00,aa */
  4915. {0xaa, 0x33, 0x0036}, /* 00,33,36,aa */
  4916. {0xaa, 0x36, 0x0060}, /* 00,36,60,aa */
  4917. {0xaa, 0x37, 0x0008}, /* 00,37,08,aa */
  4918. {0xaa, 0x3b, 0x0031}, /* 00,3b,31,aa */
  4919. {0xaa, 0x44, 0x000f}, /* 00,44,0f,aa */
  4920. {0xaa, 0x58, 0x0002}, /* 00,58,02,aa */
  4921. {0xaa, 0x66, 0x00c0}, /* 00,66,c0,aa */
  4922. {0xaa, 0x67, 0x0044}, /* 00,67,44,aa */
  4923. {0xaa, 0x6b, 0x00a0}, /* 00,6b,a0,aa */
  4924. {0xaa, 0x6c, 0x0054}, /* 00,6c,54,aa */
  4925. {0xaa, 0xd6, 0x0007}, /* 00,d6,07,aa */
  4926. {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,f7,cc */
  4927. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */
  4928. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */
  4929. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */
  4930. {0xa0, 0x00, 0x01ad}, /* 01,ad,00,cc */
  4931. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */
  4932. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */
  4933. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */
  4934. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */
  4935. {0xa0, 0x7a, ZC3XX_R116_RGAIN}, /* 01,16,7a,cc */
  4936. {0xa0, 0x4a, ZC3XX_R118_BGAIN}, /* 01,18,4a,cc */
  4937. {}
  4938. };
  4939. static const struct usb_action po2030_50HZ[] = {
  4940. {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
  4941. {0xaa, 0x1a, 0x0001}, /* 00,1a,01,aa */
  4942. {0xaa, 0x1b, 0x000a}, /* 00,1b,0a,aa */
  4943. {0xaa, 0x1c, 0x00b0}, /* 00,1c,b0,aa */
  4944. {0xa0, 0x05, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,05,cc */
  4945. {0xa0, 0x35, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,35,cc */
  4946. {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
  4947. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  4948. {0xa0, 0x85, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,85,cc */
  4949. {0xa0, 0x58, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,58,cc */
  4950. {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
  4951. {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
  4952. {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
  4953. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
  4954. {0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,22,cc */
  4955. {0xa0, 0x88, ZC3XX_R18D_YTARGET}, /* 01,8d,88,cc */
  4956. {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc */
  4957. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
  4958. {}
  4959. };
  4960. static const struct usb_action po2030_60HZ[] = {
  4961. {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */
  4962. {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
  4963. {0xaa, 0x1b, 0x00de}, /* 00,1b,de,aa */
  4964. {0xaa, 0x1c, 0x0040}, /* 00,1c,40,aa */
  4965. {0xa0, 0x08, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,08,cc */
  4966. {0xa0, 0xae, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,ae,cc */
  4967. {0xa0, 0x80, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,80,cc */
  4968. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  4969. {0xa0, 0x6f, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,6f,cc */
  4970. {0xa0, 0x20, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,20,cc */
  4971. {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0c,cc */
  4972. {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,18,cc */
  4973. {0xa0, 0x60, ZC3XX_R1A8_DIGITALGAIN}, /* 01,a8,60,cc */
  4974. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc */
  4975. {0xa0, 0x22, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,22,cc */
  4976. {0xa0, 0x88, ZC3XX_R18D_YTARGET}, /* 01,8d,88,cc */
  4977. /* win: 01,8d,80 */
  4978. {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc */
  4979. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc */
  4980. {}
  4981. };
  4982. static const struct usb_action po2030_NoFliker[] = {
  4983. {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */
  4984. {0xaa, 0x8d, 0x000d}, /* 00,8d,0d,aa */
  4985. {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */
  4986. {0xaa, 0x1b, 0x0002}, /* 00,1b,02,aa */
  4987. {0xaa, 0x1c, 0x0078}, /* 00,1c,78,aa */
  4988. {0xaa, 0x46, 0x0000}, /* 00,46,00,aa */
  4989. {0xaa, 0x15, 0x0000}, /* 00,15,00,aa */
  4990. {}
  4991. };
  4992. static const struct usb_action tas5130c_InitialScale[] = { /* 320x240 */
  4993. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  4994. {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT},
  4995. {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
  4996. {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
  4997. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  4998. {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
  4999. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  5000. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  5001. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  5002. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  5003. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  5004. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  5005. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  5006. {0xa0, 0x04, ZC3XX_R098_WINYSTARTLOW},
  5007. {0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
  5008. {0xa0, 0x04, ZC3XX_R11A_FIRSTYLOW},
  5009. {0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
  5010. {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW},
  5011. {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
  5012. {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW},
  5013. {0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
  5014. {0xa0, 0xf7, ZC3XX_R101_SENSORCORRECTION},
  5015. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  5016. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  5017. {0xa0, 0x70, ZC3XX_R18D_YTARGET},
  5018. {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
  5019. {0xa0, 0x00, 0x01ad},
  5020. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  5021. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  5022. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  5023. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  5024. {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
  5025. {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
  5026. {}
  5027. };
  5028. static const struct usb_action tas5130c_Initial[] = { /* 640x480 */
  5029. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
  5030. {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT},
  5031. {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING},
  5032. {0xa0, 0x02, ZC3XX_R010_CMOSSENSORSELECT},
  5033. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  5034. {0xa0, 0x00, ZC3XX_R001_SYSTEMOPERATING},
  5035. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
  5036. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
  5037. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC},
  5038. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH},
  5039. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
  5040. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
  5041. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
  5042. {0xa0, 0x05, ZC3XX_R098_WINYSTARTLOW},
  5043. {0xa0, 0x0f, ZC3XX_R09A_WINXSTARTLOW},
  5044. {0xa0, 0x05, ZC3XX_R11A_FIRSTYLOW},
  5045. {0xa0, 0x0f, ZC3XX_R11C_FIRSTXLOW},
  5046. {0xa0, 0xe6, ZC3XX_R09C_WINHEIGHTLOW},
  5047. {0xa0, 0x02, ZC3XX_R09D_WINWIDTHHIGH},
  5048. {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW},
  5049. {0xa0, 0x06, ZC3XX_R08D_COMPABILITYMODE},
  5050. {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
  5051. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
  5052. {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
  5053. {0xa0, 0x70, ZC3XX_R18D_YTARGET},
  5054. {0xa0, 0x50, ZC3XX_R1A8_DIGITALGAIN},
  5055. {0xa0, 0x00, 0x01ad},
  5056. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
  5057. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
  5058. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
  5059. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
  5060. {0xa0, 0x07, ZC3XX_R0A5_EXPOSUREGAIN},
  5061. {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL},
  5062. {}
  5063. };
  5064. static const struct usb_action tas5130c_50HZ[] = {
  5065. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  5066. {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
  5067. {0xaa, 0xa4, 0x0063}, /* 00,a4,63,aa */
  5068. {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
  5069. {0xa0, 0x63, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,63,cc */
  5070. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  5071. {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID},
  5072. {0xa0, 0xfe, ZC3XX_R192_EXPOSURELIMITLOW},
  5073. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  5074. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  5075. {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,47,cc */
  5076. {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
  5077. {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
  5078. {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
  5079. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
  5080. {0xa0, 0xd3, ZC3XX_R01D_HSYNC_0}, /* 00,1d,d3,cc */
  5081. {0xa0, 0xda, ZC3XX_R01E_HSYNC_1}, /* 00,1e,da,cc */
  5082. {0xa0, 0xea, ZC3XX_R01F_HSYNC_2}, /* 00,1f,ea,cc */
  5083. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  5084. {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
  5085. {0xa0, 0x4c, ZC3XX_R0A0_MAXXLOW},
  5086. {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
  5087. {}
  5088. };
  5089. static const struct usb_action tas5130c_50HZScale[] = {
  5090. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  5091. {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
  5092. {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
  5093. {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
  5094. {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
  5095. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  5096. {0xa0, 0x07, ZC3XX_R191_EXPOSURELIMITMID},
  5097. {0xa0, 0xd0, ZC3XX_R192_EXPOSURELIMITLOW},
  5098. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  5099. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  5100. {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
  5101. {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
  5102. {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
  5103. {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
  5104. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
  5105. {0xa0, 0xf0, ZC3XX_R01D_HSYNC_0}, /* 00,1d,f0,cc */
  5106. {0xa0, 0xf4, ZC3XX_R01E_HSYNC_1}, /* 00,1e,f4,cc */
  5107. {0xa0, 0xf8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,f8,cc */
  5108. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  5109. {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
  5110. {0xa0, 0xc0, ZC3XX_R0A0_MAXXLOW},
  5111. {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
  5112. {}
  5113. };
  5114. static const struct usb_action tas5130c_60HZ[] = {
  5115. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  5116. {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
  5117. {0xaa, 0xa4, 0x0036}, /* 00,a4,36,aa */
  5118. {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
  5119. {0xa0, 0x36, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,36,cc */
  5120. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  5121. {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},
  5122. {0xa0, 0x54, ZC3XX_R192_EXPOSURELIMITLOW},
  5123. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  5124. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  5125. {0xa0, 0x3e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3e,cc */
  5126. {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
  5127. {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
  5128. {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
  5129. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
  5130. {0xa0, 0xca, ZC3XX_R01D_HSYNC_0}, /* 00,1d,ca,cc */
  5131. {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
  5132. {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
  5133. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  5134. {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
  5135. {0xa0, 0x28, ZC3XX_R0A0_MAXXLOW},
  5136. {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
  5137. {}
  5138. };
  5139. static const struct usb_action tas5130c_60HZScale[] = {
  5140. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  5141. {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
  5142. {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */
  5143. {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
  5144. {0xa0, 0x77, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,77,cc */
  5145. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  5146. {0xa0, 0x09, ZC3XX_R191_EXPOSURELIMITMID},
  5147. {0xa0, 0x47, ZC3XX_R192_EXPOSURELIMITLOW},
  5148. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc */
  5149. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */
  5150. {0xa0, 0x7d, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,7d,cc */
  5151. {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
  5152. {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
  5153. {0xa0, 0x08, ZC3XX_R1A9_DIGITALLIMITDIFF},
  5154. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP},
  5155. {0xa0, 0xc8, ZC3XX_R01D_HSYNC_0}, /* 00,1d,c8,cc */
  5156. {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
  5157. {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
  5158. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  5159. {0xa0, 0x03, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,03,cc */
  5160. {0xa0, 0x20, ZC3XX_R0A0_MAXXLOW},
  5161. {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
  5162. {}
  5163. };
  5164. static const struct usb_action tas5130c_NoFliker[] = {
  5165. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  5166. {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
  5167. {0xaa, 0xa4, 0x0040}, /* 00,a4,40,aa */
  5168. {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
  5169. {0xa0, 0x40, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,40,cc */
  5170. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  5171. {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID},
  5172. {0xa0, 0xa0, ZC3XX_R192_EXPOSURELIMITLOW},
  5173. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  5174. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  5175. {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
  5176. {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
  5177. {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
  5178. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
  5179. {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
  5180. {0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
  5181. {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
  5182. {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
  5183. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  5184. {0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
  5185. {0xa0, 0xf0, ZC3XX_R0A0_MAXXLOW},
  5186. {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
  5187. {}
  5188. };
  5189. static const struct usb_action tas5130c_NoFlikerScale[] = {
  5190. {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
  5191. {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */
  5192. {0xaa, 0xa4, 0x0090}, /* 00,a4,90,aa */
  5193. {0xa0, 0x01, ZC3XX_R0A3_EXPOSURETIMEHIGH}, /* 00,a3,01,cc */
  5194. {0xa0, 0x90, ZC3XX_R0A4_EXPOSURETIMELOW}, /* 00,a4,90,cc */
  5195. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
  5196. {0xa0, 0x0a, ZC3XX_R191_EXPOSURELIMITMID},
  5197. {0xa0, 0x00, ZC3XX_R192_EXPOSURELIMITLOW},
  5198. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
  5199. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
  5200. {0xa0, 0x04, ZC3XX_R197_ANTIFLICKERLOW},
  5201. {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
  5202. {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
  5203. {0xa0, 0x00, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,00,cc */
  5204. {0xa0, 0x00, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,00,cc */
  5205. {0xa0, 0xbc, ZC3XX_R01D_HSYNC_0}, /* 00,1d,bc,cc */
  5206. {0xa0, 0xd0, ZC3XX_R01E_HSYNC_1}, /* 00,1e,d0,cc */
  5207. {0xa0, 0xe0, ZC3XX_R01F_HSYNC_2}, /* 00,1f,e0,cc */
  5208. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc */
  5209. {0xa0, 0x02, ZC3XX_R09F_MAXXHIGH}, /* 00,9f,02,cc */
  5210. {0xa0, 0xf0, ZC3XX_R0A0_MAXXLOW},
  5211. {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN},
  5212. {}
  5213. };
  5214. /* from usbvm305.inf 0ac8:305b 07/06/15 (3 - tas5130c) */
  5215. static const struct usb_action gc0303_Initial[] = {
  5216. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc, */
  5217. {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, /* 00,08,02,cc, */
  5218. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc, */
  5219. {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
  5220. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc, */
  5221. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc, */
  5222. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc, */
  5223. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc, */
  5224. {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
  5225. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc, */
  5226. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc, */
  5227. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc, */
  5228. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc, */
  5229. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc, */
  5230. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc, */
  5231. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc, */
  5232. {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e6,cc,
  5233. * 6<->8 */
  5234. {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc,
  5235. * 6<->8 */
  5236. {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID}, /* 00,87,10,cc, */
  5237. {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
  5238. {0xaa, 0x01, 0x0000},
  5239. {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa, */
  5240. {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa, */
  5241. {0xaa, 0x1b, 0x0000},
  5242. {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc, */
  5243. {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc, */
  5244. {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc, */
  5245. {0xaa, 0x05, 0x0010}, /* 00,05,10,aa, */
  5246. {0xaa, 0x0a, 0x0002},
  5247. {0xaa, 0x0b, 0x0000},
  5248. {0xaa, 0x0c, 0x0002},
  5249. {0xaa, 0x0d, 0x0000},
  5250. {0xaa, 0x0e, 0x0002},
  5251. {0xaa, 0x0f, 0x0000},
  5252. {0xaa, 0x10, 0x0002},
  5253. {0xaa, 0x11, 0x0000},
  5254. {0xaa, 0x16, 0x0001}, /* 00,16,01,aa, */
  5255. {0xaa, 0x17, 0x00e8}, /* 00,17,e6,aa, (e6 -> e8) */
  5256. {0xaa, 0x18, 0x0002}, /* 00,18,02,aa, */
  5257. {0xaa, 0x19, 0x0088}, /* 00,19,86,aa, */
  5258. {0xaa, 0x20, 0x0020}, /* 00,20,20,aa, */
  5259. {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc, */
  5260. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc, */
  5261. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc, */
  5262. {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc, */
  5263. {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc, */
  5264. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc, */
  5265. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc, */
  5266. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc, */
  5267. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc, */
  5268. {0xa0, 0x58, ZC3XX_R1A8_DIGITALGAIN},
  5269. {0xa0, 0x61, ZC3XX_R116_RGAIN}, /* 01,16,61,cc, */
  5270. {0xa0, 0x65, ZC3XX_R118_BGAIN}, /* 01,18,65,cc */
  5271. {0xaa, 0x1b, 0x0000},
  5272. {}
  5273. };
  5274. static const struct usb_action gc0303_InitialScale[] = {
  5275. {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc, */
  5276. {0xa0, 0x02, ZC3XX_R008_CLOCKSETTING}, /* 00,08,02,cc, */
  5277. {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc, */
  5278. {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT},
  5279. {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc, */
  5280. {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc, */
  5281. {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc, */
  5282. {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,e0,cc, */
  5283. {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
  5284. {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc, */
  5285. {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc, */
  5286. {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc, */
  5287. {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc, */
  5288. {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc, */
  5289. {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc, */
  5290. {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc, */
  5291. {0xa0, 0xe8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,e8,cc,
  5292. * 8<->6 */
  5293. {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc,
  5294. * 8<->6 */
  5295. {0xa0, 0x10, ZC3XX_R087_EXPTIMEMID}, /* 00,87,10,cc, */
  5296. {0xa0, 0x98, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,98,cc, */
  5297. {0xaa, 0x01, 0x0000},
  5298. {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa, */
  5299. {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa, */
  5300. {0xaa, 0x1b, 0x0000},
  5301. {0xa0, 0x82, ZC3XX_R086_EXPTIMEHIGH}, /* 00,86,82,cc, */
  5302. {0xa0, 0x83, ZC3XX_R087_EXPTIMEMID}, /* 00,87,83,cc, */
  5303. {0xa0, 0x84, ZC3XX_R088_EXPTIMELOW}, /* 00,88,84,cc, */
  5304. {0xaa, 0x05, 0x0010}, /* 00,05,10,aa, */
  5305. {0xaa, 0x0a, 0x0001},
  5306. {0xaa, 0x0b, 0x0000},
  5307. {0xaa, 0x0c, 0x0001},
  5308. {0xaa, 0x0d, 0x0000},
  5309. {0xaa, 0x0e, 0x0001},
  5310. {0xaa, 0x0f, 0x0000},
  5311. {0xaa, 0x10, 0x0001},
  5312. {0xaa, 0x11, 0x0000},
  5313. {0xaa, 0x16, 0x0001}, /* 00,16,01,aa, */
  5314. {0xaa, 0x17, 0x00e8}, /* 00,17,e6,aa (e6 -> e8) */
  5315. {0xaa, 0x18, 0x0002}, /* 00,18,02,aa, */
  5316. {0xaa, 0x19, 0x0088}, /* 00,19,88,aa, */
  5317. {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,b7,cc, */
  5318. {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc, */
  5319. {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc, */
  5320. {0xa0, 0x76, ZC3XX_R189_AWBSTATUS}, /* 01,89,76,cc, */
  5321. {0xa0, 0x09, 0x01ad}, /* 01,ad,09,cc, */
  5322. {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc, */
  5323. {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc, */
  5324. {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc, */
  5325. {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc, */
  5326. {0xa0, 0x58, ZC3XX_R1A8_DIGITALGAIN},
  5327. {0xa0, 0x61, ZC3XX_R116_RGAIN}, /* 01,16,61,cc, */
  5328. {0xa0, 0x65, ZC3XX_R118_BGAIN}, /* 01,18,65,cc */
  5329. {0xaa, 0x1b, 0x0000},
  5330. {}
  5331. };
  5332. static const struct usb_action gc0303_50HZ[] = {
  5333. {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
  5334. {0xaa, 0x83, 0x0001}, /* 00,83,01,aa */
  5335. {0xaa, 0x84, 0x0063},
  5336. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
  5337. {0xa0, 0x06, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0d,cc, */
  5338. {0xa0, 0xa8, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc, */
  5339. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
  5340. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
  5341. {0xa0, 0x47, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,47,cc, */
  5342. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
  5343. {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
  5344. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc, */
  5345. {0xa0, 0x48, ZC3XX_R1AA_DIGITALGAINSTEP},
  5346. {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
  5347. {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
  5348. {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
  5349. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
  5350. {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
  5351. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
  5352. {0xa0, 0x7f, ZC3XX_R18D_YTARGET},
  5353. {}
  5354. };
  5355. static const struct usb_action gc0303_50HZScale[] = {
  5356. {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
  5357. {0xaa, 0x83, 0x0003}, /* 00,83,03,aa */
  5358. {0xaa, 0x84, 0x0054}, /* 00,84,54,aa */
  5359. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
  5360. {0xa0, 0x0d, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,0d,cc, */
  5361. {0xa0, 0x50, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,50,cc, */
  5362. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
  5363. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
  5364. {0xa0, 0x8e, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,8e,cc, */
  5365. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
  5366. {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
  5367. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc, */
  5368. {0xa0, 0x48, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc, */
  5369. {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
  5370. {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
  5371. {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
  5372. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
  5373. {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
  5374. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
  5375. {0xa0, 0x7f, ZC3XX_R18D_YTARGET},
  5376. {}
  5377. };
  5378. static const struct usb_action gc0303_60HZ[] = {
  5379. {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
  5380. {0xaa, 0x83, 0x0000},
  5381. {0xaa, 0x84, 0x003b},
  5382. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
  5383. {0xa0, 0x05, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,05,cc, */
  5384. {0xa0, 0x88, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,88,cc, */
  5385. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
  5386. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
  5387. {0xa0, 0x3b, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,3b,cc, */
  5388. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
  5389. {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
  5390. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,a9,10,cc, */
  5391. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,aa,24,cc, */
  5392. {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
  5393. {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
  5394. {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
  5395. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
  5396. {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
  5397. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
  5398. {0xa0, 0x80, ZC3XX_R18D_YTARGET},
  5399. {}
  5400. };
  5401. static const struct usb_action gc0303_60HZScale[] = {
  5402. {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
  5403. {0xaa, 0x83, 0x0000},
  5404. {0xaa, 0x84, 0x0076},
  5405. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
  5406. {0xa0, 0x0b, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,1,0b,cc, */
  5407. {0xa0, 0x10, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,2,10,cc, */
  5408. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,5,00,cc, */
  5409. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,6,00,cc, */
  5410. {0xa0, 0x76, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,7,76,cc, */
  5411. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,c,0e,cc, */
  5412. {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,f,15,cc, */
  5413. {0xa0, 0x10, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* 01,9,10,cc, */
  5414. {0xa0, 0x24, ZC3XX_R1AA_DIGITALGAINSTEP}, /* 01,a,24,cc, */
  5415. {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,d,62,cc, */
  5416. {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,e,90,cc, */
  5417. {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,f,c8,cc, */
  5418. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,0,ff,cc, */
  5419. {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,d,58,cc, */
  5420. {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,42,cc, */
  5421. {0xa0, 0x80, ZC3XX_R18D_YTARGET},
  5422. {}
  5423. };
  5424. static const struct usb_action gc0303_NoFliker[] = {
  5425. {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc, */
  5426. {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
  5427. {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
  5428. {0xaa, 0x84, 0x0020}, /* 00,84,20,aa */
  5429. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,0,00,cc, */
  5430. {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},
  5431. {0xa0, 0x48, ZC3XX_R192_EXPOSURELIMITLOW},
  5432. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
  5433. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
  5434. {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc, */
  5435. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
  5436. {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
  5437. {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
  5438. {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
  5439. {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
  5440. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
  5441. {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
  5442. {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,03,cc */
  5443. {}
  5444. };
  5445. static const struct usb_action gc0303_NoFlikerScale[] = {
  5446. {0xa0, 0x0c, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0c,cc, */
  5447. {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */
  5448. {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */
  5449. {0xaa, 0x84, 0x0020}, /* 00,84,20,aa */
  5450. {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc, */
  5451. {0xa0, 0x00, ZC3XX_R191_EXPOSURELIMITMID},
  5452. {0xa0, 0x48, ZC3XX_R192_EXPOSURELIMITLOW},
  5453. {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* 01,95,00,cc, */
  5454. {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc, */
  5455. {0xa0, 0x10, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,10,cc, */
  5456. {0xa0, 0x0e, ZC3XX_R18C_AEFREEZE}, /* 01,8c,0e,cc, */
  5457. {0xa0, 0x15, ZC3XX_R18F_AEUNFREEZE}, /* 01,8f,15,cc, */
  5458. {0xa0, 0x62, ZC3XX_R01D_HSYNC_0}, /* 00,1d,62,cc, */
  5459. {0xa0, 0x90, ZC3XX_R01E_HSYNC_1}, /* 00,1e,90,cc, */
  5460. {0xa0, 0xc8, ZC3XX_R01F_HSYNC_2}, /* 00,1f,c8,cc, */
  5461. {0xa0, 0xff, ZC3XX_R020_HSYNC_3}, /* 00,20,ff,cc, */
  5462. {0xa0, 0x58, ZC3XX_R11D_GLOBALGAIN}, /* 01,1d,58,cc, */
  5463. {0xa0, 0x03, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,03,cc */
  5464. {}
  5465. };
  5466. static u8 reg_r(struct gspca_dev *gspca_dev,
  5467. u16 index)
  5468. {
  5469. int ret;
  5470. if (gspca_dev->usb_err < 0)
  5471. return 0;
  5472. ret = usb_control_msg(gspca_dev->dev,
  5473. usb_rcvctrlpipe(gspca_dev->dev, 0),
  5474. 0xa1,
  5475. USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
  5476. 0x01, /* value */
  5477. index, gspca_dev->usb_buf, 1,
  5478. 500);
  5479. if (ret < 0) {
  5480. pr_err("reg_r err %d\n", ret);
  5481. gspca_dev->usb_err = ret;
  5482. return 0;
  5483. }
  5484. return gspca_dev->usb_buf[0];
  5485. }
  5486. static void reg_w(struct gspca_dev *gspca_dev,
  5487. u8 value,
  5488. u16 index)
  5489. {
  5490. int ret;
  5491. if (gspca_dev->usb_err < 0)
  5492. return;
  5493. ret = usb_control_msg(gspca_dev->dev,
  5494. usb_sndctrlpipe(gspca_dev->dev, 0),
  5495. 0xa0,
  5496. USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
  5497. value, index, NULL, 0,
  5498. 500);
  5499. if (ret < 0) {
  5500. pr_err("reg_w_i err %d\n", ret);
  5501. gspca_dev->usb_err = ret;
  5502. }
  5503. }
  5504. static u16 i2c_read(struct gspca_dev *gspca_dev,
  5505. u8 reg)
  5506. {
  5507. u8 retbyte;
  5508. u16 retval;
  5509. if (gspca_dev->usb_err < 0)
  5510. return 0;
  5511. reg_w(gspca_dev, reg, 0x0092);
  5512. reg_w(gspca_dev, 0x02, 0x0090); /* <- read command */
  5513. msleep(20);
  5514. retbyte = reg_r(gspca_dev, 0x0091); /* read status */
  5515. if (retbyte != 0x00)
  5516. pr_err("i2c_r status error %02x\n", retbyte);
  5517. retval = reg_r(gspca_dev, 0x0095); /* read Lowbyte */
  5518. retval |= reg_r(gspca_dev, 0x0096) << 8; /* read Hightbyte */
  5519. return retval;
  5520. }
  5521. static u8 i2c_write(struct gspca_dev *gspca_dev,
  5522. u8 reg,
  5523. u8 valL,
  5524. u8 valH)
  5525. {
  5526. u8 retbyte;
  5527. if (gspca_dev->usb_err < 0)
  5528. return 0;
  5529. reg_w(gspca_dev, reg, 0x92);
  5530. reg_w(gspca_dev, valL, 0x93);
  5531. reg_w(gspca_dev, valH, 0x94);
  5532. reg_w(gspca_dev, 0x01, 0x90); /* <- write command */
  5533. msleep(1);
  5534. retbyte = reg_r(gspca_dev, 0x0091); /* read status */
  5535. if (retbyte != 0x00)
  5536. pr_err("i2c_w status error %02x\n", retbyte);
  5537. return retbyte;
  5538. }
  5539. static void usb_exchange(struct gspca_dev *gspca_dev,
  5540. const struct usb_action *action)
  5541. {
  5542. while (action->req) {
  5543. switch (action->req) {
  5544. case 0xa0: /* write register */
  5545. reg_w(gspca_dev, action->val, action->idx);
  5546. break;
  5547. case 0xa1: /* read status */
  5548. reg_r(gspca_dev, action->idx);
  5549. break;
  5550. case 0xaa:
  5551. i2c_write(gspca_dev,
  5552. action->val, /* reg */
  5553. action->idx & 0xff, /* valL */
  5554. action->idx >> 8); /* valH */
  5555. break;
  5556. case 0xbb:
  5557. i2c_write(gspca_dev,
  5558. action->idx >> 8, /* reg */
  5559. action->idx & 0xff, /* valL */
  5560. action->val); /* valH */
  5561. break;
  5562. default:
  5563. /* case 0xdd: * delay */
  5564. msleep(action->idx);
  5565. break;
  5566. }
  5567. action++;
  5568. msleep(1);
  5569. }
  5570. }
  5571. static void setmatrix(struct gspca_dev *gspca_dev)
  5572. {
  5573. struct sd *sd = (struct sd *) gspca_dev;
  5574. int i;
  5575. const u8 *matrix;
  5576. static const u8 adcm2700_matrix[9] =
  5577. /* {0x66, 0xed, 0xed, 0xed, 0x66, 0xed, 0xed, 0xed, 0x66}; */
  5578. /*ms-win*/
  5579. {0x74, 0xed, 0xed, 0xed, 0x74, 0xed, 0xed, 0xed, 0x74};
  5580. static const u8 gc0305_matrix[9] =
  5581. {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50};
  5582. static const u8 ov7620_matrix[9] =
  5583. {0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58};
  5584. static const u8 pas202b_matrix[9] =
  5585. {0x4c, 0xf5, 0xff, 0xf9, 0x51, 0xf5, 0xfb, 0xed, 0x5f};
  5586. static const u8 po2030_matrix[9] =
  5587. {0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60};
  5588. static const u8 tas5130c_matrix[9] =
  5589. {0x68, 0xec, 0xec, 0xec, 0x68, 0xec, 0xec, 0xec, 0x68};
  5590. static const u8 gc0303_matrix[9] =
  5591. {0x6c, 0xea, 0xea, 0xea, 0x6c, 0xea, 0xea, 0xea, 0x6c};
  5592. static const u8 *matrix_tb[SENSOR_MAX] = {
  5593. [SENSOR_ADCM2700] = adcm2700_matrix,
  5594. [SENSOR_CS2102] = ov7620_matrix,
  5595. [SENSOR_CS2102K] = NULL,
  5596. [SENSOR_GC0303] = gc0303_matrix,
  5597. [SENSOR_GC0305] = gc0305_matrix,
  5598. [SENSOR_HDCS2020] = NULL,
  5599. [SENSOR_HV7131B] = NULL,
  5600. [SENSOR_HV7131R] = po2030_matrix,
  5601. [SENSOR_ICM105A] = po2030_matrix,
  5602. [SENSOR_MC501CB] = NULL,
  5603. [SENSOR_MT9V111_1] = gc0305_matrix,
  5604. [SENSOR_MT9V111_3] = gc0305_matrix,
  5605. [SENSOR_OV7620] = ov7620_matrix,
  5606. [SENSOR_OV7630C] = NULL,
  5607. [SENSOR_PAS106] = NULL,
  5608. [SENSOR_PAS202B] = pas202b_matrix,
  5609. [SENSOR_PB0330] = gc0305_matrix,
  5610. [SENSOR_PO2030] = po2030_matrix,
  5611. [SENSOR_TAS5130C] = tas5130c_matrix,
  5612. };
  5613. matrix = matrix_tb[sd->sensor];
  5614. if (matrix == NULL)
  5615. return; /* matrix already loaded */
  5616. for (i = 0; i < ARRAY_SIZE(ov7620_matrix); i++)
  5617. reg_w(gspca_dev, matrix[i], 0x010a + i);
  5618. }
  5619. static void setsharpness(struct gspca_dev *gspca_dev, s32 val)
  5620. {
  5621. static const u8 sharpness_tb[][2] = {
  5622. {0x02, 0x03},
  5623. {0x04, 0x07},
  5624. {0x08, 0x0f},
  5625. {0x10, 0x1e}
  5626. };
  5627. reg_w(gspca_dev, sharpness_tb[val][0], 0x01c6);
  5628. reg_r(gspca_dev, 0x01c8);
  5629. reg_r(gspca_dev, 0x01c9);
  5630. reg_r(gspca_dev, 0x01ca);
  5631. reg_w(gspca_dev, sharpness_tb[val][1], 0x01cb);
  5632. }
  5633. static void setcontrast(struct gspca_dev *gspca_dev,
  5634. s32 gamma, s32 brightness, s32 contrast)
  5635. {
  5636. const u8 *Tgamma;
  5637. int g, i, adj, gp1, gp2;
  5638. u8 gr[16];
  5639. static const u8 delta_b[16] = /* delta for brightness */
  5640. {0x50, 0x38, 0x2d, 0x28, 0x24, 0x21, 0x1e, 0x1d,
  5641. 0x1d, 0x1b, 0x1b, 0x1b, 0x19, 0x18, 0x18, 0x18};
  5642. static const u8 delta_c[16] = /* delta for contrast */
  5643. {0x2c, 0x1a, 0x12, 0x0c, 0x0a, 0x06, 0x06, 0x06,
  5644. 0x04, 0x06, 0x04, 0x04, 0x03, 0x03, 0x02, 0x02};
  5645. static const u8 gamma_tb[6][16] = {
  5646. {0x00, 0x00, 0x03, 0x0d, 0x1b, 0x2e, 0x45, 0x5f,
  5647. 0x79, 0x93, 0xab, 0xc1, 0xd4, 0xe5, 0xf3, 0xff},
  5648. {0x01, 0x0c, 0x1f, 0x3a, 0x53, 0x6d, 0x85, 0x9c,
  5649. 0xb0, 0xc2, 0xd1, 0xde, 0xe9, 0xf2, 0xf9, 0xff},
  5650. {0x04, 0x16, 0x30, 0x4e, 0x68, 0x81, 0x98, 0xac,
  5651. 0xbe, 0xcd, 0xda, 0xe4, 0xed, 0xf5, 0xfb, 0xff},
  5652. {0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
  5653. 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff},
  5654. {0x20, 0x4b, 0x6e, 0x8d, 0xa3, 0xb5, 0xc5, 0xd2,
  5655. 0xdc, 0xe5, 0xec, 0xf2, 0xf6, 0xfa, 0xfd, 0xff},
  5656. {0x24, 0x44, 0x64, 0x84, 0x9d, 0xb2, 0xc4, 0xd3,
  5657. 0xe0, 0xeb, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff},
  5658. };
  5659. Tgamma = gamma_tb[gamma - 1];
  5660. contrast -= 128; /* -128 / 127 */
  5661. brightness -= 128; /* -128 / 92 */
  5662. adj = 0;
  5663. gp1 = gp2 = 0;
  5664. for (i = 0; i < 16; i++) {
  5665. g = Tgamma[i] + delta_b[i] * brightness / 256
  5666. - delta_c[i] * contrast / 256 - adj / 2;
  5667. if (g > 0xff)
  5668. g = 0xff;
  5669. else if (g < 0)
  5670. g = 0;
  5671. reg_w(gspca_dev, g, 0x0120 + i); /* gamma */
  5672. if (contrast > 0)
  5673. adj--;
  5674. else if (contrast < 0)
  5675. adj++;
  5676. if (i > 1)
  5677. gr[i - 1] = (g - gp2) / 2;
  5678. else if (i != 0)
  5679. gr[0] = gp1 == 0 ? 0 : (g - gp1);
  5680. gp2 = gp1;
  5681. gp1 = g;
  5682. }
  5683. gr[15] = (0xff - gp2) / 2;
  5684. for (i = 0; i < 16; i++)
  5685. reg_w(gspca_dev, gr[i], 0x0130 + i); /* gradient */
  5686. }
  5687. static s32 getexposure(struct gspca_dev *gspca_dev)
  5688. {
  5689. return (i2c_read(gspca_dev, 0x25) << 9)
  5690. | (i2c_read(gspca_dev, 0x26) << 1)
  5691. | (i2c_read(gspca_dev, 0x27) >> 7);
  5692. }
  5693. static void setexposure(struct gspca_dev *gspca_dev, s32 val)
  5694. {
  5695. i2c_write(gspca_dev, 0x25, val >> 9, 0x00);
  5696. i2c_write(gspca_dev, 0x26, val >> 1, 0x00);
  5697. i2c_write(gspca_dev, 0x27, val << 7, 0x00);
  5698. }
  5699. static void setquality(struct gspca_dev *gspca_dev)
  5700. {
  5701. struct sd *sd = (struct sd *) gspca_dev;
  5702. jpeg_set_qual(sd->jpeg_hdr, jpeg_qual[sd->reg08 >> 1]);
  5703. reg_w(gspca_dev, sd->reg08, ZC3XX_R008_CLOCKSETTING);
  5704. }
  5705. /* Matches the sensor's internal frame rate to the lighting frequency.
  5706. * Valid frequencies are:
  5707. * 50Hz, for European and Asian lighting (default)
  5708. * 60Hz, for American lighting
  5709. * 0 = No Fliker (for outdoore usage)
  5710. */
  5711. static void setlightfreq(struct gspca_dev *gspca_dev, s32 val)
  5712. {
  5713. struct sd *sd = (struct sd *) gspca_dev;
  5714. int i, mode;
  5715. const struct usb_action *zc3_freq;
  5716. static const struct usb_action *freq_tb[SENSOR_MAX][6] = {
  5717. [SENSOR_ADCM2700] =
  5718. {adcm2700_NoFliker, adcm2700_NoFliker,
  5719. adcm2700_50HZ, adcm2700_50HZ,
  5720. adcm2700_60HZ, adcm2700_60HZ},
  5721. [SENSOR_CS2102] =
  5722. {cs2102_NoFliker, cs2102_NoFlikerScale,
  5723. cs2102_50HZ, cs2102_50HZScale,
  5724. cs2102_60HZ, cs2102_60HZScale},
  5725. [SENSOR_CS2102K] =
  5726. {cs2102_NoFliker, cs2102_NoFlikerScale,
  5727. NULL, NULL, /* currently disabled */
  5728. NULL, NULL},
  5729. [SENSOR_GC0303] =
  5730. {gc0303_NoFliker, gc0303_NoFlikerScale,
  5731. gc0303_50HZ, gc0303_50HZScale,
  5732. gc0303_60HZ, gc0303_60HZScale},
  5733. [SENSOR_GC0305] =
  5734. {gc0305_NoFliker, gc0305_NoFliker,
  5735. gc0305_50HZ, gc0305_50HZ,
  5736. gc0305_60HZ, gc0305_60HZ},
  5737. [SENSOR_HDCS2020] =
  5738. {hdcs2020_NoFliker, hdcs2020_NoFliker,
  5739. hdcs2020_50HZ, hdcs2020_50HZ,
  5740. hdcs2020_60HZ, hdcs2020_60HZ},
  5741. [SENSOR_HV7131B] =
  5742. {hv7131b_NoFliker, hv7131b_NoFlikerScale,
  5743. hv7131b_50HZ, hv7131b_50HZScale,
  5744. hv7131b_60HZ, hv7131b_60HZScale},
  5745. [SENSOR_HV7131R] =
  5746. {hv7131r_NoFliker, hv7131r_NoFlikerScale,
  5747. hv7131r_50HZ, hv7131r_50HZScale,
  5748. hv7131r_60HZ, hv7131r_60HZScale},
  5749. [SENSOR_ICM105A] =
  5750. {icm105a_NoFliker, icm105a_NoFlikerScale,
  5751. icm105a_50HZ, icm105a_50HZScale,
  5752. icm105a_60HZ, icm105a_60HZScale},
  5753. [SENSOR_MC501CB] =
  5754. {mc501cb_NoFliker, mc501cb_NoFlikerScale,
  5755. mc501cb_50HZ, mc501cb_50HZScale,
  5756. mc501cb_60HZ, mc501cb_60HZScale},
  5757. [SENSOR_MT9V111_1] =
  5758. {mt9v111_1_AENoFliker, mt9v111_1_AENoFlikerScale,
  5759. mt9v111_1_AE50HZ, mt9v111_1_AE50HZScale,
  5760. mt9v111_1_AE60HZ, mt9v111_1_AE60HZScale},
  5761. [SENSOR_MT9V111_3] =
  5762. {mt9v111_3_AENoFliker, mt9v111_3_AENoFlikerScale,
  5763. mt9v111_3_AE50HZ, mt9v111_3_AE50HZScale,
  5764. mt9v111_3_AE60HZ, mt9v111_3_AE60HZScale},
  5765. [SENSOR_OV7620] =
  5766. {ov7620_NoFliker, ov7620_NoFliker,
  5767. ov7620_50HZ, ov7620_50HZ,
  5768. ov7620_60HZ, ov7620_60HZ},
  5769. [SENSOR_OV7630C] =
  5770. {NULL, NULL,
  5771. NULL, NULL,
  5772. NULL, NULL},
  5773. [SENSOR_PAS106] =
  5774. {pas106b_NoFliker, pas106b_NoFliker,
  5775. pas106b_50HZ, pas106b_50HZ,
  5776. pas106b_60HZ, pas106b_60HZ},
  5777. [SENSOR_PAS202B] =
  5778. {pas202b_NoFliker, pas202b_NoFlikerScale,
  5779. pas202b_50HZ, pas202b_50HZScale,
  5780. pas202b_60HZ, pas202b_60HZScale},
  5781. [SENSOR_PB0330] =
  5782. {pb0330_NoFliker, pb0330_NoFlikerScale,
  5783. pb0330_50HZ, pb0330_50HZScale,
  5784. pb0330_60HZ, pb0330_60HZScale},
  5785. [SENSOR_PO2030] =
  5786. {po2030_NoFliker, po2030_NoFliker,
  5787. po2030_50HZ, po2030_50HZ,
  5788. po2030_60HZ, po2030_60HZ},
  5789. [SENSOR_TAS5130C] =
  5790. {tas5130c_NoFliker, tas5130c_NoFlikerScale,
  5791. tas5130c_50HZ, tas5130c_50HZScale,
  5792. tas5130c_60HZ, tas5130c_60HZScale},
  5793. };
  5794. i = val * 2;
  5795. mode = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv;
  5796. if (mode)
  5797. i++; /* 320x240 */
  5798. zc3_freq = freq_tb[sd->sensor][i];
  5799. if (zc3_freq == NULL)
  5800. return;
  5801. usb_exchange(gspca_dev, zc3_freq);
  5802. switch (sd->sensor) {
  5803. case SENSOR_GC0305:
  5804. if (mode /* if 320x240 */
  5805. && val == 1) /* and 50Hz */
  5806. reg_w(gspca_dev, 0x85, 0x018d);
  5807. /* win: 0x80, 0x018d */
  5808. break;
  5809. case SENSOR_OV7620:
  5810. if (!mode) { /* if 640x480 */
  5811. if (val != 0) /* and filter */
  5812. reg_w(gspca_dev, 0x40, 0x0002);
  5813. else
  5814. reg_w(gspca_dev, 0x44, 0x0002);
  5815. }
  5816. break;
  5817. case SENSOR_PAS202B:
  5818. reg_w(gspca_dev, 0x00, 0x01a7);
  5819. break;
  5820. }
  5821. }
  5822. static void setautogain(struct gspca_dev *gspca_dev, s32 val)
  5823. {
  5824. reg_w(gspca_dev, val ? 0x42 : 0x02, 0x0180);
  5825. }
  5826. /*
  5827. * Update the transfer parameters.
  5828. * This function is executed from a work queue.
  5829. */
  5830. static void transfer_update(struct work_struct *work)
  5831. {
  5832. struct sd *sd = container_of(work, struct sd, work);
  5833. struct gspca_dev *gspca_dev = &sd->gspca_dev;
  5834. int change, good;
  5835. u8 reg07, reg11;
  5836. /* reg07 gets set to 0 by sd_start before starting us */
  5837. reg07 = 0;
  5838. good = 0;
  5839. while (1) {
  5840. msleep(100);
  5841. /* To protect gspca_dev->usb_buf and gspca_dev->usb_err */
  5842. mutex_lock(&gspca_dev->usb_lock);
  5843. #ifdef CONFIG_PM
  5844. if (gspca_dev->frozen)
  5845. break;
  5846. #endif
  5847. if (!gspca_dev->present || !gspca_dev->streaming)
  5848. break;
  5849. /* Bit 0 of register 11 indicates FIFO overflow */
  5850. gspca_dev->usb_err = 0;
  5851. reg11 = reg_r(gspca_dev, 0x0011);
  5852. if (gspca_dev->usb_err)
  5853. break;
  5854. change = reg11 & 0x01;
  5855. if (change) { /* overflow */
  5856. good = 0;
  5857. if (reg07 == 0) /* Bit Rate Control not enabled? */
  5858. reg07 = 0x32; /* Allow 98 bytes / unit */
  5859. else if (reg07 > 2)
  5860. reg07 -= 2; /* Decrease allowed bytes / unit */
  5861. else
  5862. change = 0;
  5863. } else { /* no overflow */
  5864. good++;
  5865. if (good >= 10) {
  5866. good = 0;
  5867. if (reg07) { /* BRC enabled? */
  5868. change = 1;
  5869. if (reg07 < 0x32)
  5870. reg07 += 2;
  5871. else
  5872. reg07 = 0;
  5873. }
  5874. }
  5875. }
  5876. if (change) {
  5877. gspca_dev->usb_err = 0;
  5878. reg_w(gspca_dev, reg07, 0x0007);
  5879. if (gspca_dev->usb_err)
  5880. break;
  5881. }
  5882. mutex_unlock(&gspca_dev->usb_lock);
  5883. }
  5884. /* Something went wrong. Unlock and return */
  5885. mutex_unlock(&gspca_dev->usb_lock);
  5886. }
  5887. static void send_unknown(struct gspca_dev *gspca_dev, int sensor)
  5888. {
  5889. reg_w(gspca_dev, 0x01, 0x0000); /* bridge reset */
  5890. switch (sensor) {
  5891. case SENSOR_PAS106:
  5892. reg_w(gspca_dev, 0x03, 0x003a);
  5893. reg_w(gspca_dev, 0x0c, 0x003b);
  5894. reg_w(gspca_dev, 0x08, 0x0038);
  5895. break;
  5896. case SENSOR_ADCM2700:
  5897. case SENSOR_GC0305:
  5898. case SENSOR_OV7620:
  5899. case SENSOR_MT9V111_1:
  5900. case SENSOR_MT9V111_3:
  5901. case SENSOR_PB0330:
  5902. case SENSOR_PO2030:
  5903. reg_w(gspca_dev, 0x0d, 0x003a);
  5904. reg_w(gspca_dev, 0x02, 0x003b);
  5905. reg_w(gspca_dev, 0x00, 0x0038);
  5906. break;
  5907. case SENSOR_HV7131R:
  5908. case SENSOR_PAS202B:
  5909. reg_w(gspca_dev, 0x03, 0x003b);
  5910. reg_w(gspca_dev, 0x0c, 0x003a);
  5911. reg_w(gspca_dev, 0x0b, 0x0039);
  5912. if (sensor == SENSOR_PAS202B)
  5913. reg_w(gspca_dev, 0x0b, 0x0038);
  5914. break;
  5915. }
  5916. }
  5917. /* start probe 2 wires */
  5918. static void start_2wr_probe(struct gspca_dev *gspca_dev, int sensor)
  5919. {
  5920. reg_w(gspca_dev, 0x01, 0x0000);
  5921. reg_w(gspca_dev, sensor, 0x0010);
  5922. reg_w(gspca_dev, 0x01, 0x0001);
  5923. reg_w(gspca_dev, 0x03, 0x0012);
  5924. reg_w(gspca_dev, 0x01, 0x0012);
  5925. /* msleep(2); */
  5926. }
  5927. static int sif_probe(struct gspca_dev *gspca_dev)
  5928. {
  5929. u16 checkword;
  5930. start_2wr_probe(gspca_dev, 0x0f); /* PAS106 */
  5931. reg_w(gspca_dev, 0x08, 0x008d);
  5932. msleep(150);
  5933. checkword = ((i2c_read(gspca_dev, 0x00) & 0x0f) << 4)
  5934. | ((i2c_read(gspca_dev, 0x01) & 0xf0) >> 4);
  5935. PDEBUG(D_PROBE, "probe sif 0x%04x", checkword);
  5936. if (checkword == 0x0007) {
  5937. send_unknown(gspca_dev, SENSOR_PAS106);
  5938. return 0x0f; /* PAS106 */
  5939. }
  5940. return -1;
  5941. }
  5942. static int vga_2wr_probe(struct gspca_dev *gspca_dev)
  5943. {
  5944. u16 retword;
  5945. start_2wr_probe(gspca_dev, 0x00); /* HV7131B */
  5946. i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
  5947. retword = i2c_read(gspca_dev, 0x01);
  5948. if (retword != 0)
  5949. return 0x00; /* HV7131B */
  5950. start_2wr_probe(gspca_dev, 0x04); /* CS2102 */
  5951. i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
  5952. retword = i2c_read(gspca_dev, 0x01);
  5953. if (retword != 0)
  5954. return 0x04; /* CS2102 */
  5955. start_2wr_probe(gspca_dev, 0x06); /* OmniVision */
  5956. reg_w(gspca_dev, 0x08, 0x008d);
  5957. i2c_write(gspca_dev, 0x11, 0xaa, 0x00);
  5958. retword = i2c_read(gspca_dev, 0x11);
  5959. if (retword != 0) {
  5960. /* (should have returned 0xaa) --> Omnivision? */
  5961. /* reg_r 0x10 -> 0x06 --> */
  5962. goto ov_check;
  5963. }
  5964. start_2wr_probe(gspca_dev, 0x08); /* HDCS2020 */
  5965. i2c_write(gspca_dev, 0x1c, 0x00, 0x00);
  5966. i2c_write(gspca_dev, 0x15, 0xaa, 0x00);
  5967. retword = i2c_read(gspca_dev, 0x15);
  5968. if (retword != 0)
  5969. return 0x08; /* HDCS2020 */
  5970. start_2wr_probe(gspca_dev, 0x0a); /* PB0330 */
  5971. i2c_write(gspca_dev, 0x07, 0xaa, 0xaa);
  5972. retword = i2c_read(gspca_dev, 0x07);
  5973. if (retword != 0)
  5974. return 0x0a; /* PB0330 */
  5975. retword = i2c_read(gspca_dev, 0x03);
  5976. if (retword != 0)
  5977. return 0x0a; /* PB0330 ?? */
  5978. retword = i2c_read(gspca_dev, 0x04);
  5979. if (retword != 0)
  5980. return 0x0a; /* PB0330 ?? */
  5981. start_2wr_probe(gspca_dev, 0x0c); /* ICM105A */
  5982. i2c_write(gspca_dev, 0x01, 0x11, 0x00);
  5983. retword = i2c_read(gspca_dev, 0x01);
  5984. if (retword != 0)
  5985. return 0x0c; /* ICM105A */
  5986. start_2wr_probe(gspca_dev, 0x0e); /* PAS202BCB */
  5987. reg_w(gspca_dev, 0x08, 0x008d);
  5988. i2c_write(gspca_dev, 0x03, 0xaa, 0x00);
  5989. msleep(50);
  5990. retword = i2c_read(gspca_dev, 0x03);
  5991. if (retword != 0) {
  5992. send_unknown(gspca_dev, SENSOR_PAS202B);
  5993. return 0x0e; /* PAS202BCB */
  5994. }
  5995. start_2wr_probe(gspca_dev, 0x02); /* TAS5130C */
  5996. i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
  5997. retword = i2c_read(gspca_dev, 0x01);
  5998. if (retword != 0)
  5999. return 0x02; /* TAS5130C */
  6000. ov_check:
  6001. reg_r(gspca_dev, 0x0010); /* ?? */
  6002. reg_r(gspca_dev, 0x0010);
  6003. reg_w(gspca_dev, 0x01, 0x0000);
  6004. reg_w(gspca_dev, 0x01, 0x0001);
  6005. reg_w(gspca_dev, 0x06, 0x0010); /* OmniVision */
  6006. reg_w(gspca_dev, 0xa1, 0x008b);
  6007. reg_w(gspca_dev, 0x08, 0x008d);
  6008. msleep(500);
  6009. reg_w(gspca_dev, 0x01, 0x0012);
  6010. i2c_write(gspca_dev, 0x12, 0x80, 0x00); /* sensor reset */
  6011. retword = i2c_read(gspca_dev, 0x0a) << 8;
  6012. retword |= i2c_read(gspca_dev, 0x0b);
  6013. PDEBUG(D_PROBE, "probe 2wr ov vga 0x%04x", retword);
  6014. switch (retword) {
  6015. case 0x7631: /* OV7630C */
  6016. reg_w(gspca_dev, 0x06, 0x0010);
  6017. break;
  6018. case 0x7620: /* OV7620 */
  6019. case 0x7648: /* OV7648 */
  6020. break;
  6021. default:
  6022. return -1; /* not OmniVision */
  6023. }
  6024. return retword;
  6025. }
  6026. struct sensor_by_chipset_revision {
  6027. u16 revision;
  6028. u8 internal_sensor_id;
  6029. };
  6030. static const struct sensor_by_chipset_revision chipset_revision_sensor[] = {
  6031. {0xc000, 0x12}, /* TAS5130C */
  6032. {0xc001, 0x13}, /* MT9V111 */
  6033. {0xe001, 0x13},
  6034. {0x8001, 0x13},
  6035. {0x8000, 0x14}, /* CS2102K */
  6036. {0x8400, 0x15}, /* MT9V111 */
  6037. {0xe400, 0x15},
  6038. };
  6039. static int vga_3wr_probe(struct gspca_dev *gspca_dev)
  6040. {
  6041. struct sd *sd = (struct sd *) gspca_dev;
  6042. int i;
  6043. u16 retword;
  6044. /*fixme: lack of 8b=b3 (11,12)-> 10, 8b=e0 (14,15,16)-> 12 found in gspcav1*/
  6045. reg_w(gspca_dev, 0x02, 0x0010);
  6046. reg_r(gspca_dev, 0x0010);
  6047. reg_w(gspca_dev, 0x01, 0x0000);
  6048. reg_w(gspca_dev, 0x00, 0x0010);
  6049. reg_w(gspca_dev, 0x01, 0x0001);
  6050. reg_w(gspca_dev, 0x91, 0x008b);
  6051. reg_w(gspca_dev, 0x03, 0x0012);
  6052. reg_w(gspca_dev, 0x01, 0x0012);
  6053. reg_w(gspca_dev, 0x05, 0x0012);
  6054. retword = i2c_read(gspca_dev, 0x14);
  6055. if (retword != 0)
  6056. return 0x11; /* HV7131R */
  6057. retword = i2c_read(gspca_dev, 0x15);
  6058. if (retword != 0)
  6059. return 0x11; /* HV7131R */
  6060. retword = i2c_read(gspca_dev, 0x16);
  6061. if (retword != 0)
  6062. return 0x11; /* HV7131R */
  6063. reg_w(gspca_dev, 0x02, 0x0010);
  6064. retword = reg_r(gspca_dev, 0x000b) << 8;
  6065. retword |= reg_r(gspca_dev, 0x000a);
  6066. PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", retword);
  6067. reg_r(gspca_dev, 0x0010);
  6068. if ((retword & 0xff00) == 0x6400)
  6069. return 0x02; /* TAS5130C */
  6070. for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) {
  6071. if (chipset_revision_sensor[i].revision == retword) {
  6072. sd->chip_revision = retword;
  6073. send_unknown(gspca_dev, SENSOR_PB0330);
  6074. return chipset_revision_sensor[i].internal_sensor_id;
  6075. }
  6076. }
  6077. reg_w(gspca_dev, 0x01, 0x0000); /* check PB0330 */
  6078. reg_w(gspca_dev, 0x01, 0x0001);
  6079. reg_w(gspca_dev, 0xdd, 0x008b);
  6080. reg_w(gspca_dev, 0x0a, 0x0010);
  6081. reg_w(gspca_dev, 0x03, 0x0012);
  6082. reg_w(gspca_dev, 0x01, 0x0012);
  6083. retword = i2c_read(gspca_dev, 0x00);
  6084. if (retword != 0) {
  6085. PDEBUG(D_PROBE, "probe 3wr vga type 0a");
  6086. return 0x0a; /* PB0330 */
  6087. }
  6088. /* probe gc0303 / gc0305 */
  6089. reg_w(gspca_dev, 0x01, 0x0000);
  6090. reg_w(gspca_dev, 0x01, 0x0001);
  6091. reg_w(gspca_dev, 0x98, 0x008b);
  6092. reg_w(gspca_dev, 0x01, 0x0010);
  6093. reg_w(gspca_dev, 0x03, 0x0012);
  6094. msleep(2);
  6095. reg_w(gspca_dev, 0x01, 0x0012);
  6096. retword = i2c_read(gspca_dev, 0x00);
  6097. if (retword != 0) {
  6098. PDEBUG(D_PROBE, "probe 3wr vga type %02x", retword);
  6099. if (retword == 0x0011) /* gc0303 */
  6100. return 0x0303;
  6101. if (retword == 0x0029) /* gc0305 */
  6102. send_unknown(gspca_dev, SENSOR_GC0305);
  6103. return retword;
  6104. }
  6105. reg_w(gspca_dev, 0x01, 0x0000); /* check OmniVision */
  6106. reg_w(gspca_dev, 0x01, 0x0001);
  6107. reg_w(gspca_dev, 0xa1, 0x008b);
  6108. reg_w(gspca_dev, 0x08, 0x008d);
  6109. reg_w(gspca_dev, 0x06, 0x0010);
  6110. reg_w(gspca_dev, 0x01, 0x0012);
  6111. reg_w(gspca_dev, 0x05, 0x0012);
  6112. if (i2c_read(gspca_dev, 0x1c) == 0x007f /* OV7610 - manufacturer ID */
  6113. && i2c_read(gspca_dev, 0x1d) == 0x00a2) {
  6114. send_unknown(gspca_dev, SENSOR_OV7620);
  6115. return 0x06; /* OmniVision confirm ? */
  6116. }
  6117. reg_w(gspca_dev, 0x01, 0x0000);
  6118. reg_w(gspca_dev, 0x00, 0x0002);
  6119. reg_w(gspca_dev, 0x01, 0x0010);
  6120. reg_w(gspca_dev, 0x01, 0x0001);
  6121. reg_w(gspca_dev, 0xee, 0x008b);
  6122. reg_w(gspca_dev, 0x03, 0x0012);
  6123. reg_w(gspca_dev, 0x01, 0x0012);
  6124. reg_w(gspca_dev, 0x05, 0x0012);
  6125. retword = i2c_read(gspca_dev, 0x00) << 8; /* ID 0 */
  6126. retword |= i2c_read(gspca_dev, 0x01); /* ID 1 */
  6127. PDEBUG(D_PROBE, "probe 3wr vga 2 0x%04x", retword);
  6128. if (retword == 0x2030) {
  6129. u8 retbyte;
  6130. retbyte = i2c_read(gspca_dev, 0x02); /* revision number */
  6131. PDEBUG(D_PROBE, "sensor PO2030 rev 0x%02x", retbyte);
  6132. send_unknown(gspca_dev, SENSOR_PO2030);
  6133. return retword;
  6134. }
  6135. reg_w(gspca_dev, 0x01, 0x0000);
  6136. reg_w(gspca_dev, 0x0a, 0x0010);
  6137. reg_w(gspca_dev, 0xd3, 0x008b);
  6138. reg_w(gspca_dev, 0x01, 0x0001);
  6139. reg_w(gspca_dev, 0x03, 0x0012);
  6140. reg_w(gspca_dev, 0x01, 0x0012);
  6141. reg_w(gspca_dev, 0x05, 0x0012);
  6142. reg_w(gspca_dev, 0xd3, 0x008b);
  6143. retword = i2c_read(gspca_dev, 0x01);
  6144. if (retword != 0) {
  6145. PDEBUG(D_PROBE, "probe 3wr vga type 0a ? ret: %04x", retword);
  6146. return 0x16; /* adcm2700 (6100/6200) */
  6147. }
  6148. return -1;
  6149. }
  6150. static int zcxx_probeSensor(struct gspca_dev *gspca_dev)
  6151. {
  6152. struct sd *sd = (struct sd *) gspca_dev;
  6153. int sensor;
  6154. switch (sd->sensor) {
  6155. case SENSOR_MC501CB:
  6156. return -1; /* don't probe */
  6157. case SENSOR_GC0303:
  6158. /* may probe but with no write in reg 0x0010 */
  6159. return -1; /* don't probe */
  6160. case SENSOR_PAS106:
  6161. sensor = sif_probe(gspca_dev);
  6162. if (sensor >= 0)
  6163. return sensor;
  6164. break;
  6165. }
  6166. sensor = vga_2wr_probe(gspca_dev);
  6167. if (sensor >= 0)
  6168. return sensor;
  6169. return vga_3wr_probe(gspca_dev);
  6170. }
  6171. /* this function is called at probe time */
  6172. static int sd_config(struct gspca_dev *gspca_dev,
  6173. const struct usb_device_id *id)
  6174. {
  6175. struct sd *sd = (struct sd *) gspca_dev;
  6176. if (id->idProduct == 0x301b)
  6177. sd->bridge = BRIDGE_ZC301;
  6178. else
  6179. sd->bridge = BRIDGE_ZC303;
  6180. /* define some sensors from the vendor/product */
  6181. sd->sensor = id->driver_info;
  6182. sd->reg08 = REG08_DEF;
  6183. INIT_WORK(&sd->work, transfer_update);
  6184. return 0;
  6185. }
  6186. static int zcxx_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
  6187. {
  6188. struct gspca_dev *gspca_dev =
  6189. container_of(ctrl->handler, struct gspca_dev, ctrl_handler);
  6190. struct sd *sd = (struct sd *)gspca_dev;
  6191. switch (ctrl->id) {
  6192. case V4L2_CID_AUTOGAIN:
  6193. gspca_dev->usb_err = 0;
  6194. if (ctrl->val && sd->exposure && gspca_dev->streaming)
  6195. sd->exposure->val = getexposure(gspca_dev);
  6196. return gspca_dev->usb_err;
  6197. }
  6198. return -EINVAL;
  6199. }
  6200. static int zcxx_s_ctrl(struct v4l2_ctrl *ctrl)
  6201. {
  6202. struct gspca_dev *gspca_dev =
  6203. container_of(ctrl->handler, struct gspca_dev, ctrl_handler);
  6204. struct sd *sd = (struct sd *)gspca_dev;
  6205. int i, qual;
  6206. gspca_dev->usb_err = 0;
  6207. if (ctrl->id == V4L2_CID_JPEG_COMPRESSION_QUALITY) {
  6208. qual = sd->reg08 >> 1;
  6209. for (i = 0; i < ARRAY_SIZE(jpeg_qual); i++) {
  6210. if (ctrl->val <= jpeg_qual[i])
  6211. break;
  6212. }
  6213. if (i == ARRAY_SIZE(jpeg_qual) || (i > 0 && i == qual && ctrl->val < jpeg_qual[i]))
  6214. i--;
  6215. /* With high quality settings we need max bandwidth */
  6216. if (i >= 2 && gspca_dev->streaming &&
  6217. !gspca_dev->cam.needs_full_bandwidth)
  6218. return -EBUSY;
  6219. sd->reg08 = (i << 1) | 1;
  6220. ctrl->val = jpeg_qual[i];
  6221. }
  6222. if (!gspca_dev->streaming)
  6223. return 0;
  6224. switch (ctrl->id) {
  6225. /* gamma/brightness/contrast cluster */
  6226. case V4L2_CID_GAMMA:
  6227. setcontrast(gspca_dev, sd->gamma->val,
  6228. sd->brightness->val, sd->contrast->val);
  6229. break;
  6230. /* autogain/exposure cluster */
  6231. case V4L2_CID_AUTOGAIN:
  6232. setautogain(gspca_dev, ctrl->val);
  6233. if (!gspca_dev->usb_err && !ctrl->val && sd->exposure)
  6234. setexposure(gspca_dev, sd->exposure->val);
  6235. break;
  6236. case V4L2_CID_POWER_LINE_FREQUENCY:
  6237. setlightfreq(gspca_dev, ctrl->val);
  6238. break;
  6239. case V4L2_CID_SHARPNESS:
  6240. setsharpness(gspca_dev, ctrl->val);
  6241. break;
  6242. case V4L2_CID_JPEG_COMPRESSION_QUALITY:
  6243. setquality(gspca_dev);
  6244. break;
  6245. }
  6246. return gspca_dev->usb_err;
  6247. }
  6248. static const struct v4l2_ctrl_ops zcxx_ctrl_ops = {
  6249. .g_volatile_ctrl = zcxx_g_volatile_ctrl,
  6250. .s_ctrl = zcxx_s_ctrl,
  6251. };
  6252. static int sd_init_controls(struct gspca_dev *gspca_dev)
  6253. {
  6254. struct sd *sd = (struct sd *)gspca_dev;
  6255. struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler;
  6256. static const u8 gamma[SENSOR_MAX] = {
  6257. [SENSOR_ADCM2700] = 4,
  6258. [SENSOR_CS2102] = 4,
  6259. [SENSOR_CS2102K] = 5,
  6260. [SENSOR_GC0303] = 3,
  6261. [SENSOR_GC0305] = 4,
  6262. [SENSOR_HDCS2020] = 4,
  6263. [SENSOR_HV7131B] = 4,
  6264. [SENSOR_HV7131R] = 4,
  6265. [SENSOR_ICM105A] = 4,
  6266. [SENSOR_MC501CB] = 4,
  6267. [SENSOR_MT9V111_1] = 4,
  6268. [SENSOR_MT9V111_3] = 4,
  6269. [SENSOR_OV7620] = 3,
  6270. [SENSOR_OV7630C] = 4,
  6271. [SENSOR_PAS106] = 4,
  6272. [SENSOR_PAS202B] = 4,
  6273. [SENSOR_PB0330] = 4,
  6274. [SENSOR_PO2030] = 4,
  6275. [SENSOR_TAS5130C] = 3,
  6276. };
  6277. gspca_dev->vdev.ctrl_handler = hdl;
  6278. v4l2_ctrl_handler_init(hdl, 8);
  6279. sd->brightness = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
  6280. V4L2_CID_BRIGHTNESS, 0, 255, 1, 128);
  6281. sd->contrast = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
  6282. V4L2_CID_CONTRAST, 0, 255, 1, 128);
  6283. sd->gamma = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
  6284. V4L2_CID_GAMMA, 1, 6, 1, gamma[sd->sensor]);
  6285. if (sd->sensor == SENSOR_HV7131R)
  6286. sd->exposure = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
  6287. V4L2_CID_EXPOSURE, 0x30d, 0x493e, 1, 0x927);
  6288. sd->autogain = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
  6289. V4L2_CID_AUTOGAIN, 0, 1, 1, 1);
  6290. if (sd->sensor != SENSOR_OV7630C)
  6291. sd->plfreq = v4l2_ctrl_new_std_menu(hdl, &zcxx_ctrl_ops,
  6292. V4L2_CID_POWER_LINE_FREQUENCY,
  6293. V4L2_CID_POWER_LINE_FREQUENCY_60HZ, 0,
  6294. V4L2_CID_POWER_LINE_FREQUENCY_DISABLED);
  6295. sd->sharpness = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
  6296. V4L2_CID_SHARPNESS, 0, 3, 1,
  6297. sd->sensor == SENSOR_PO2030 ? 0 : 2);
  6298. sd->jpegqual = v4l2_ctrl_new_std(hdl, &zcxx_ctrl_ops,
  6299. V4L2_CID_JPEG_COMPRESSION_QUALITY,
  6300. jpeg_qual[0], jpeg_qual[ARRAY_SIZE(jpeg_qual) - 1], 1,
  6301. jpeg_qual[REG08_DEF >> 1]);
  6302. if (hdl->error) {
  6303. pr_err("Could not initialize controls\n");
  6304. return hdl->error;
  6305. }
  6306. v4l2_ctrl_cluster(3, &sd->gamma);
  6307. if (sd->sensor == SENSOR_HV7131R)
  6308. v4l2_ctrl_auto_cluster(2, &sd->autogain, 0, true);
  6309. return 0;
  6310. }
  6311. /* this function is called at probe and resume time */
  6312. static int sd_init(struct gspca_dev *gspca_dev)
  6313. {
  6314. struct sd *sd = (struct sd *) gspca_dev;
  6315. struct cam *cam;
  6316. int sensor;
  6317. static const u8 mode_tb[SENSOR_MAX] = {
  6318. [SENSOR_ADCM2700] = 2,
  6319. [SENSOR_CS2102] = 1,
  6320. [SENSOR_CS2102K] = 1,
  6321. [SENSOR_GC0303] = 1,
  6322. [SENSOR_GC0305] = 1,
  6323. [SENSOR_HDCS2020] = 1,
  6324. [SENSOR_HV7131B] = 1,
  6325. [SENSOR_HV7131R] = 1,
  6326. [SENSOR_ICM105A] = 1,
  6327. [SENSOR_MC501CB] = 2,
  6328. [SENSOR_MT9V111_1] = 1,
  6329. [SENSOR_MT9V111_3] = 1,
  6330. [SENSOR_OV7620] = 2,
  6331. [SENSOR_OV7630C] = 1,
  6332. [SENSOR_PAS106] = 0,
  6333. [SENSOR_PAS202B] = 1,
  6334. [SENSOR_PB0330] = 1,
  6335. [SENSOR_PO2030] = 1,
  6336. [SENSOR_TAS5130C] = 1,
  6337. };
  6338. sensor = zcxx_probeSensor(gspca_dev);
  6339. if (sensor >= 0)
  6340. PDEBUG(D_PROBE, "probe sensor -> %04x", sensor);
  6341. if ((unsigned) force_sensor < SENSOR_MAX) {
  6342. sd->sensor = force_sensor;
  6343. PDEBUG(D_PROBE, "sensor forced to %d", force_sensor);
  6344. } else {
  6345. switch (sensor) {
  6346. case -1:
  6347. switch (sd->sensor) {
  6348. case SENSOR_MC501CB:
  6349. PDEBUG(D_PROBE, "Sensor MC501CB");
  6350. break;
  6351. case SENSOR_GC0303:
  6352. PDEBUG(D_PROBE, "Sensor GC0303");
  6353. break;
  6354. default:
  6355. pr_warn("Unknown sensor - set to TAS5130C\n");
  6356. sd->sensor = SENSOR_TAS5130C;
  6357. }
  6358. break;
  6359. case 0:
  6360. /* check the sensor type */
  6361. sensor = i2c_read(gspca_dev, 0x00);
  6362. PDEBUG(D_PROBE, "Sensor hv7131 type %d", sensor);
  6363. switch (sensor) {
  6364. case 0: /* hv7131b */
  6365. case 1: /* hv7131e */
  6366. PDEBUG(D_PROBE, "Find Sensor HV7131B");
  6367. sd->sensor = SENSOR_HV7131B;
  6368. break;
  6369. default:
  6370. /* case 2: * hv7131r */
  6371. PDEBUG(D_PROBE, "Find Sensor HV7131R");
  6372. sd->sensor = SENSOR_HV7131R;
  6373. break;
  6374. }
  6375. break;
  6376. case 0x02:
  6377. PDEBUG(D_PROBE, "Sensor TAS5130C");
  6378. sd->sensor = SENSOR_TAS5130C;
  6379. break;
  6380. case 0x04:
  6381. PDEBUG(D_PROBE, "Find Sensor CS2102");
  6382. sd->sensor = SENSOR_CS2102;
  6383. break;
  6384. case 0x08:
  6385. PDEBUG(D_PROBE, "Find Sensor HDCS2020");
  6386. sd->sensor = SENSOR_HDCS2020;
  6387. break;
  6388. case 0x0a:
  6389. PDEBUG(D_PROBE,
  6390. "Find Sensor PB0330. Chip revision %x",
  6391. sd->chip_revision);
  6392. sd->sensor = SENSOR_PB0330;
  6393. break;
  6394. case 0x0c:
  6395. PDEBUG(D_PROBE, "Find Sensor ICM105A");
  6396. sd->sensor = SENSOR_ICM105A;
  6397. break;
  6398. case 0x0e:
  6399. PDEBUG(D_PROBE, "Find Sensor PAS202B");
  6400. sd->sensor = SENSOR_PAS202B;
  6401. break;
  6402. case 0x0f:
  6403. PDEBUG(D_PROBE, "Find Sensor PAS106");
  6404. sd->sensor = SENSOR_PAS106;
  6405. break;
  6406. case 0x10:
  6407. case 0x12:
  6408. PDEBUG(D_PROBE, "Find Sensor TAS5130C");
  6409. sd->sensor = SENSOR_TAS5130C;
  6410. break;
  6411. case 0x11:
  6412. PDEBUG(D_PROBE, "Find Sensor HV7131R");
  6413. sd->sensor = SENSOR_HV7131R;
  6414. break;
  6415. case 0x13:
  6416. case 0x15:
  6417. PDEBUG(D_PROBE,
  6418. "Sensor MT9V111. Chip revision %04x",
  6419. sd->chip_revision);
  6420. sd->sensor = sd->bridge == BRIDGE_ZC301
  6421. ? SENSOR_MT9V111_1
  6422. : SENSOR_MT9V111_3;
  6423. break;
  6424. case 0x14:
  6425. PDEBUG(D_PROBE,
  6426. "Find Sensor CS2102K?. Chip revision %x",
  6427. sd->chip_revision);
  6428. sd->sensor = SENSOR_CS2102K;
  6429. break;
  6430. case 0x16:
  6431. PDEBUG(D_PROBE, "Find Sensor ADCM2700");
  6432. sd->sensor = SENSOR_ADCM2700;
  6433. break;
  6434. case 0x29:
  6435. PDEBUG(D_PROBE, "Find Sensor GC0305");
  6436. sd->sensor = SENSOR_GC0305;
  6437. break;
  6438. case 0x0303:
  6439. PDEBUG(D_PROBE, "Sensor GC0303");
  6440. sd->sensor = SENSOR_GC0303;
  6441. break;
  6442. case 0x2030:
  6443. PDEBUG(D_PROBE, "Find Sensor PO2030");
  6444. sd->sensor = SENSOR_PO2030;
  6445. break;
  6446. case 0x7620:
  6447. PDEBUG(D_PROBE, "Find Sensor OV7620");
  6448. sd->sensor = SENSOR_OV7620;
  6449. break;
  6450. case 0x7631:
  6451. PDEBUG(D_PROBE, "Find Sensor OV7630C");
  6452. sd->sensor = SENSOR_OV7630C;
  6453. break;
  6454. case 0x7648:
  6455. PDEBUG(D_PROBE, "Find Sensor OV7648");
  6456. sd->sensor = SENSOR_OV7620; /* same sensor (?) */
  6457. break;
  6458. default:
  6459. pr_err("Unknown sensor %04x\n", sensor);
  6460. return -EINVAL;
  6461. }
  6462. }
  6463. if (sensor < 0x20) {
  6464. if (sensor == -1 || sensor == 0x10 || sensor == 0x12)
  6465. reg_w(gspca_dev, 0x02, 0x0010);
  6466. reg_r(gspca_dev, 0x0010);
  6467. }
  6468. cam = &gspca_dev->cam;
  6469. switch (mode_tb[sd->sensor]) {
  6470. case 0:
  6471. cam->cam_mode = sif_mode;
  6472. cam->nmodes = ARRAY_SIZE(sif_mode);
  6473. break;
  6474. case 1:
  6475. cam->cam_mode = vga_mode;
  6476. cam->nmodes = ARRAY_SIZE(vga_mode);
  6477. break;
  6478. default:
  6479. /* case 2: */
  6480. cam->cam_mode = broken_vga_mode;
  6481. cam->nmodes = ARRAY_SIZE(broken_vga_mode);
  6482. break;
  6483. }
  6484. /* switch off the led */
  6485. reg_w(gspca_dev, 0x01, 0x0000);
  6486. return gspca_dev->usb_err;
  6487. }
  6488. static int sd_pre_start(struct gspca_dev *gspca_dev)
  6489. {
  6490. struct sd *sd = (struct sd *) gspca_dev;
  6491. gspca_dev->cam.needs_full_bandwidth = (sd->reg08 >= 4) ? 1 : 0;
  6492. return 0;
  6493. }
  6494. static int sd_start(struct gspca_dev *gspca_dev)
  6495. {
  6496. struct sd *sd = (struct sd *) gspca_dev;
  6497. int mode;
  6498. static const struct usb_action *init_tb[SENSOR_MAX][2] = {
  6499. [SENSOR_ADCM2700] =
  6500. {adcm2700_Initial, adcm2700_InitialScale},
  6501. [SENSOR_CS2102] =
  6502. {cs2102_Initial, cs2102_InitialScale},
  6503. [SENSOR_CS2102K] =
  6504. {cs2102K_Initial, cs2102K_InitialScale},
  6505. [SENSOR_GC0303] =
  6506. {gc0303_Initial, gc0303_InitialScale},
  6507. [SENSOR_GC0305] =
  6508. {gc0305_Initial, gc0305_InitialScale},
  6509. [SENSOR_HDCS2020] =
  6510. {hdcs2020_Initial, hdcs2020_InitialScale},
  6511. [SENSOR_HV7131B] =
  6512. {hv7131b_Initial, hv7131b_InitialScale},
  6513. [SENSOR_HV7131R] =
  6514. {hv7131r_Initial, hv7131r_InitialScale},
  6515. [SENSOR_ICM105A] =
  6516. {icm105a_Initial, icm105a_InitialScale},
  6517. [SENSOR_MC501CB] =
  6518. {mc501cb_Initial, mc501cb_InitialScale},
  6519. [SENSOR_MT9V111_1] =
  6520. {mt9v111_1_Initial, mt9v111_1_InitialScale},
  6521. [SENSOR_MT9V111_3] =
  6522. {mt9v111_3_Initial, mt9v111_3_InitialScale},
  6523. [SENSOR_OV7620] =
  6524. {ov7620_Initial, ov7620_InitialScale},
  6525. [SENSOR_OV7630C] =
  6526. {ov7630c_Initial, ov7630c_InitialScale},
  6527. [SENSOR_PAS106] =
  6528. {pas106b_Initial, pas106b_InitialScale},
  6529. [SENSOR_PAS202B] =
  6530. {pas202b_Initial, pas202b_InitialScale},
  6531. [SENSOR_PB0330] =
  6532. {pb0330_Initial, pb0330_InitialScale},
  6533. [SENSOR_PO2030] =
  6534. {po2030_Initial, po2030_InitialScale},
  6535. [SENSOR_TAS5130C] =
  6536. {tas5130c_Initial, tas5130c_InitialScale},
  6537. };
  6538. /* create the JPEG header */
  6539. jpeg_define(sd->jpeg_hdr, gspca_dev->pixfmt.height,
  6540. gspca_dev->pixfmt.width,
  6541. 0x21); /* JPEG 422 */
  6542. mode = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv;
  6543. switch (sd->sensor) {
  6544. case SENSOR_HV7131R:
  6545. zcxx_probeSensor(gspca_dev);
  6546. break;
  6547. case SENSOR_PAS106:
  6548. usb_exchange(gspca_dev, pas106b_Initial_com);
  6549. break;
  6550. }
  6551. usb_exchange(gspca_dev, init_tb[sd->sensor][mode]);
  6552. switch (sd->sensor) {
  6553. case SENSOR_ADCM2700:
  6554. case SENSOR_GC0305:
  6555. case SENSOR_OV7620:
  6556. case SENSOR_PO2030:
  6557. case SENSOR_TAS5130C:
  6558. case SENSOR_GC0303:
  6559. /* msleep(100); * ?? */
  6560. reg_r(gspca_dev, 0x0002); /* --> 0x40 */
  6561. reg_w(gspca_dev, 0x09, 0x01ad); /* (from win traces) */
  6562. reg_w(gspca_dev, 0x15, 0x01ae);
  6563. if (sd->sensor == SENSOR_TAS5130C)
  6564. break;
  6565. reg_w(gspca_dev, 0x0d, 0x003a);
  6566. reg_w(gspca_dev, 0x02, 0x003b);
  6567. reg_w(gspca_dev, 0x00, 0x0038);
  6568. break;
  6569. case SENSOR_HV7131R:
  6570. case SENSOR_PAS202B:
  6571. reg_w(gspca_dev, 0x03, 0x003b);
  6572. reg_w(gspca_dev, 0x0c, 0x003a);
  6573. reg_w(gspca_dev, 0x0b, 0x0039);
  6574. if (sd->sensor == SENSOR_HV7131R)
  6575. reg_w(gspca_dev, 0x50, ZC3XX_R11D_GLOBALGAIN);
  6576. break;
  6577. }
  6578. setmatrix(gspca_dev);
  6579. switch (sd->sensor) {
  6580. case SENSOR_ADCM2700:
  6581. case SENSOR_OV7620:
  6582. reg_r(gspca_dev, 0x0008);
  6583. reg_w(gspca_dev, 0x00, 0x0008);
  6584. break;
  6585. case SENSOR_PAS202B:
  6586. case SENSOR_GC0305:
  6587. case SENSOR_HV7131R:
  6588. case SENSOR_TAS5130C:
  6589. reg_r(gspca_dev, 0x0008);
  6590. /* fall thru */
  6591. case SENSOR_PO2030:
  6592. reg_w(gspca_dev, 0x03, 0x0008);
  6593. break;
  6594. }
  6595. setsharpness(gspca_dev, v4l2_ctrl_g_ctrl(sd->sharpness));
  6596. /* set the gamma tables when not set */
  6597. switch (sd->sensor) {
  6598. case SENSOR_CS2102K: /* gamma set in xxx_Initial */
  6599. case SENSOR_HDCS2020:
  6600. case SENSOR_OV7630C:
  6601. break;
  6602. default:
  6603. setcontrast(gspca_dev, v4l2_ctrl_g_ctrl(sd->gamma),
  6604. v4l2_ctrl_g_ctrl(sd->brightness),
  6605. v4l2_ctrl_g_ctrl(sd->contrast));
  6606. break;
  6607. }
  6608. setmatrix(gspca_dev); /* one more time? */
  6609. switch (sd->sensor) {
  6610. case SENSOR_OV7620:
  6611. case SENSOR_PAS202B:
  6612. reg_r(gspca_dev, 0x0180); /* from win */
  6613. reg_w(gspca_dev, 0x00, 0x0180);
  6614. break;
  6615. }
  6616. setquality(gspca_dev);
  6617. /* Start with BRC disabled, transfer_update will enable it if needed */
  6618. reg_w(gspca_dev, 0x00, 0x0007);
  6619. if (sd->plfreq)
  6620. setlightfreq(gspca_dev, v4l2_ctrl_g_ctrl(sd->plfreq));
  6621. switch (sd->sensor) {
  6622. case SENSOR_ADCM2700:
  6623. reg_w(gspca_dev, 0x09, 0x01ad); /* (from win traces) */
  6624. reg_w(gspca_dev, 0x15, 0x01ae);
  6625. reg_w(gspca_dev, 0x02, 0x0180);
  6626. /* ms-win + */
  6627. reg_w(gspca_dev, 0x40, 0x0117);
  6628. break;
  6629. case SENSOR_HV7131R:
  6630. setexposure(gspca_dev, v4l2_ctrl_g_ctrl(sd->exposure));
  6631. reg_w(gspca_dev, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN);
  6632. break;
  6633. case SENSOR_GC0305:
  6634. case SENSOR_TAS5130C:
  6635. reg_w(gspca_dev, 0x09, 0x01ad); /* (from win traces) */
  6636. reg_w(gspca_dev, 0x15, 0x01ae);
  6637. /* fall thru */
  6638. case SENSOR_PAS202B:
  6639. case SENSOR_PO2030:
  6640. /* reg_w(gspca_dev, 0x40, ZC3XX_R117_GGAIN); in win traces */
  6641. reg_r(gspca_dev, 0x0180);
  6642. break;
  6643. case SENSOR_OV7620:
  6644. reg_w(gspca_dev, 0x09, 0x01ad);
  6645. reg_w(gspca_dev, 0x15, 0x01ae);
  6646. i2c_read(gspca_dev, 0x13); /*fixme: returns 0xa3 */
  6647. i2c_write(gspca_dev, 0x13, 0xa3, 0x00);
  6648. /*fixme: returned value to send? */
  6649. reg_w(gspca_dev, 0x40, 0x0117);
  6650. reg_r(gspca_dev, 0x0180);
  6651. break;
  6652. }
  6653. setautogain(gspca_dev, v4l2_ctrl_g_ctrl(sd->autogain));
  6654. if (gspca_dev->usb_err < 0)
  6655. return gspca_dev->usb_err;
  6656. /* Start the transfer parameters update thread */
  6657. sd->work_thread = create_singlethread_workqueue(KBUILD_MODNAME);
  6658. queue_work(sd->work_thread, &sd->work);
  6659. return 0;
  6660. }
  6661. /* called on streamoff with alt==0 and on disconnect */
  6662. /* the usb_lock is held at entry - restore on exit */
  6663. static void sd_stop0(struct gspca_dev *gspca_dev)
  6664. {
  6665. struct sd *sd = (struct sd *) gspca_dev;
  6666. if (sd->work_thread != NULL) {
  6667. mutex_unlock(&gspca_dev->usb_lock);
  6668. destroy_workqueue(sd->work_thread);
  6669. mutex_lock(&gspca_dev->usb_lock);
  6670. sd->work_thread = NULL;
  6671. }
  6672. if (!gspca_dev->present)
  6673. return;
  6674. send_unknown(gspca_dev, sd->sensor);
  6675. }
  6676. static void sd_pkt_scan(struct gspca_dev *gspca_dev,
  6677. u8 *data,
  6678. int len)
  6679. {
  6680. struct sd *sd = (struct sd *) gspca_dev;
  6681. /* check the JPEG end of frame */
  6682. if (len >= 3
  6683. && data[len - 3] == 0xff && data[len - 2] == 0xd9) {
  6684. /*fixme: what does the last byte mean?*/
  6685. gspca_frame_add(gspca_dev, LAST_PACKET,
  6686. data, len - 1);
  6687. return;
  6688. }
  6689. /* check the JPEG start of a frame */
  6690. if (data[0] == 0xff && data[1] == 0xd8) {
  6691. /* put the JPEG header in the new frame */
  6692. gspca_frame_add(gspca_dev, FIRST_PACKET,
  6693. sd->jpeg_hdr, JPEG_HDR_SZ);
  6694. /* remove the webcam's header:
  6695. * ff d8 ff fe 00 0e 00 00 ss ss 00 01 ww ww hh hh pp pp
  6696. * - 'ss ss' is the frame sequence number (BE)
  6697. * - 'ww ww' and 'hh hh' are the window dimensions (BE)
  6698. * - 'pp pp' is the packet sequence number (BE)
  6699. */
  6700. data += 18;
  6701. len -= 18;
  6702. }
  6703. gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
  6704. }
  6705. static int sd_set_jcomp(struct gspca_dev *gspca_dev,
  6706. const struct v4l2_jpegcompression *jcomp)
  6707. {
  6708. struct sd *sd = (struct sd *) gspca_dev;
  6709. return v4l2_ctrl_s_ctrl(sd->jpegqual, jcomp->quality);
  6710. }
  6711. static int sd_get_jcomp(struct gspca_dev *gspca_dev,
  6712. struct v4l2_jpegcompression *jcomp)
  6713. {
  6714. struct sd *sd = (struct sd *) gspca_dev;
  6715. memset(jcomp, 0, sizeof *jcomp);
  6716. jcomp->quality = v4l2_ctrl_g_ctrl(sd->jpegqual);
  6717. jcomp->jpeg_markers = V4L2_JPEG_MARKER_DHT
  6718. | V4L2_JPEG_MARKER_DQT;
  6719. return 0;
  6720. }
  6721. #if IS_ENABLED(CONFIG_INPUT)
  6722. static int sd_int_pkt_scan(struct gspca_dev *gspca_dev,
  6723. u8 *data, /* interrupt packet data */
  6724. int len) /* interrupt packet length */
  6725. {
  6726. if (len == 8 && data[4] == 1) {
  6727. input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1);
  6728. input_sync(gspca_dev->input_dev);
  6729. input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0);
  6730. input_sync(gspca_dev->input_dev);
  6731. }
  6732. return 0;
  6733. }
  6734. #endif
  6735. static const struct sd_desc sd_desc = {
  6736. .name = KBUILD_MODNAME,
  6737. .config = sd_config,
  6738. .init = sd_init,
  6739. .init_controls = sd_init_controls,
  6740. .isoc_init = sd_pre_start,
  6741. .start = sd_start,
  6742. .stop0 = sd_stop0,
  6743. .pkt_scan = sd_pkt_scan,
  6744. .get_jcomp = sd_get_jcomp,
  6745. .set_jcomp = sd_set_jcomp,
  6746. #if IS_ENABLED(CONFIG_INPUT)
  6747. .int_pkt_scan = sd_int_pkt_scan,
  6748. #endif
  6749. };
  6750. static const struct usb_device_id device_table[] = {
  6751. {USB_DEVICE(0x03f0, 0x1b07)},
  6752. {USB_DEVICE(0x041e, 0x041e)},
  6753. {USB_DEVICE(0x041e, 0x4017)},
  6754. {USB_DEVICE(0x041e, 0x401c), .driver_info = SENSOR_PAS106},
  6755. {USB_DEVICE(0x041e, 0x401e)},
  6756. {USB_DEVICE(0x041e, 0x401f)},
  6757. {USB_DEVICE(0x041e, 0x4022)},
  6758. {USB_DEVICE(0x041e, 0x4029)},
  6759. {USB_DEVICE(0x041e, 0x4034), .driver_info = SENSOR_PAS106},
  6760. {USB_DEVICE(0x041e, 0x4035), .driver_info = SENSOR_PAS106},
  6761. {USB_DEVICE(0x041e, 0x4036)},
  6762. {USB_DEVICE(0x041e, 0x403a)},
  6763. {USB_DEVICE(0x041e, 0x4051), .driver_info = SENSOR_GC0303},
  6764. {USB_DEVICE(0x041e, 0x4053), .driver_info = SENSOR_GC0303},
  6765. {USB_DEVICE(0x0458, 0x7007)},
  6766. {USB_DEVICE(0x0458, 0x700c)},
  6767. {USB_DEVICE(0x0458, 0x700f)},
  6768. {USB_DEVICE(0x0461, 0x0a00)},
  6769. {USB_DEVICE(0x046d, 0x089d), .driver_info = SENSOR_MC501CB},
  6770. {USB_DEVICE(0x046d, 0x08a0)},
  6771. {USB_DEVICE(0x046d, 0x08a1)},
  6772. {USB_DEVICE(0x046d, 0x08a2)},
  6773. {USB_DEVICE(0x046d, 0x08a3)},
  6774. {USB_DEVICE(0x046d, 0x08a6)},
  6775. {USB_DEVICE(0x046d, 0x08a7)},
  6776. {USB_DEVICE(0x046d, 0x08a9)},
  6777. {USB_DEVICE(0x046d, 0x08aa)},
  6778. {USB_DEVICE(0x046d, 0x08ac)},
  6779. {USB_DEVICE(0x046d, 0x08ad)},
  6780. {USB_DEVICE(0x046d, 0x08ae)},
  6781. {USB_DEVICE(0x046d, 0x08af)},
  6782. {USB_DEVICE(0x046d, 0x08b9)},
  6783. {USB_DEVICE(0x046d, 0x08d7)},
  6784. {USB_DEVICE(0x046d, 0x08d8)},
  6785. {USB_DEVICE(0x046d, 0x08d9)},
  6786. {USB_DEVICE(0x046d, 0x08da)},
  6787. {USB_DEVICE(0x046d, 0x08dd), .driver_info = SENSOR_MC501CB},
  6788. {USB_DEVICE(0x0471, 0x0325), .driver_info = SENSOR_PAS106},
  6789. {USB_DEVICE(0x0471, 0x0326), .driver_info = SENSOR_PAS106},
  6790. {USB_DEVICE(0x0471, 0x032d), .driver_info = SENSOR_PAS106},
  6791. {USB_DEVICE(0x0471, 0x032e), .driver_info = SENSOR_PAS106},
  6792. {USB_DEVICE(0x055f, 0xc005)},
  6793. {USB_DEVICE(0x055f, 0xd003)},
  6794. {USB_DEVICE(0x055f, 0xd004)},
  6795. {USB_DEVICE(0x0698, 0x2003)},
  6796. {USB_DEVICE(0x0ac8, 0x0301), .driver_info = SENSOR_PAS106},
  6797. {USB_DEVICE(0x0ac8, 0x0302), .driver_info = SENSOR_PAS106},
  6798. {USB_DEVICE(0x0ac8, 0x301b)},
  6799. {USB_DEVICE(0x0ac8, 0x303b)},
  6800. {USB_DEVICE(0x0ac8, 0x305b)},
  6801. {USB_DEVICE(0x0ac8, 0x307b)},
  6802. {USB_DEVICE(0x10fd, 0x0128)},
  6803. {USB_DEVICE(0x10fd, 0x804d)},
  6804. {USB_DEVICE(0x10fd, 0x8050)},
  6805. {} /* end of entry */
  6806. };
  6807. MODULE_DEVICE_TABLE(usb, device_table);
  6808. /* -- device connect -- */
  6809. static int sd_probe(struct usb_interface *intf,
  6810. const struct usb_device_id *id)
  6811. {
  6812. return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
  6813. THIS_MODULE);
  6814. }
  6815. /* USB driver */
  6816. static struct usb_driver sd_driver = {
  6817. .name = KBUILD_MODNAME,
  6818. .id_table = device_table,
  6819. .probe = sd_probe,
  6820. .disconnect = gspca_disconnect,
  6821. #ifdef CONFIG_PM
  6822. .suspend = gspca_suspend,
  6823. .resume = gspca_resume,
  6824. .reset_resume = gspca_resume,
  6825. #endif
  6826. };
  6827. module_usb_driver(sd_driver);
  6828. module_param(force_sensor, int, 0644);
  6829. MODULE_PARM_DESC(force_sensor,
  6830. "Force sensor. Only for experts!!!");