vc032x.c 111 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843
  1. /*
  2. * Z-star vc0321 library
  3. *
  4. * Copyright (C) 2009-2010 Jean-François Moine <http://moinejf.free.fr>
  5. * Copyright (C) 2006 Koninski Artur takeshi87@o2.pl
  6. * Copyright (C) 2006 Michel Xhaard
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. */
  22. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  23. #define MODULE_NAME "vc032x"
  24. #include "gspca.h"
  25. MODULE_AUTHOR("Jean-François Moine <http://moinejf.free.fr>");
  26. MODULE_DESCRIPTION("GSPCA/VC032X USB Camera Driver");
  27. MODULE_LICENSE("GPL");
  28. /* specific webcam descriptor */
  29. struct sd {
  30. struct gspca_dev gspca_dev; /* !! must be the first item */
  31. struct { /* hvflip cluster */
  32. struct v4l2_ctrl *hflip;
  33. struct v4l2_ctrl *vflip;
  34. };
  35. u8 image_offset;
  36. u8 bridge;
  37. u8 sensor;
  38. u8 flags;
  39. #define FL_SAMSUNG 0x01 /* SamsungQ1 (2 sensors) */
  40. #define FL_HFLIP 0x02 /* mirrored by default */
  41. #define FL_VFLIP 0x04 /* vertical flipped by default */
  42. };
  43. enum bridges {
  44. BRIDGE_VC0321,
  45. BRIDGE_VC0323,
  46. };
  47. enum sensors {
  48. SENSOR_HV7131R,
  49. SENSOR_MI0360,
  50. SENSOR_MI1310_SOC,
  51. SENSOR_MI1320,
  52. SENSOR_MI1320_SOC,
  53. SENSOR_OV7660,
  54. SENSOR_OV7670,
  55. SENSOR_PO1200,
  56. SENSOR_PO3130NC,
  57. SENSOR_POxxxx,
  58. NSENSORS
  59. };
  60. static const struct v4l2_pix_format vc0321_mode[] = {
  61. {320, 240, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
  62. .bytesperline = 320 * 2,
  63. .sizeimage = 320 * 240 * 2,
  64. .colorspace = V4L2_COLORSPACE_SRGB,
  65. .priv = 1},
  66. {640, 480, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
  67. .bytesperline = 640 * 2,
  68. .sizeimage = 640 * 480 * 2,
  69. .colorspace = V4L2_COLORSPACE_SRGB,
  70. .priv = 0},
  71. };
  72. static const struct v4l2_pix_format vc0323_mode[] = {
  73. {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
  74. .bytesperline = 320,
  75. .sizeimage = 320 * 240 * 3 / 8 + 590,
  76. .colorspace = V4L2_COLORSPACE_JPEG,
  77. .priv = 1},
  78. {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
  79. .bytesperline = 640,
  80. .sizeimage = 640 * 480 * 3 / 8 + 590,
  81. .colorspace = V4L2_COLORSPACE_JPEG,
  82. .priv = 0},
  83. {1280, 960, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, /* mi1310_soc only */
  84. .bytesperline = 1280,
  85. .sizeimage = 1280 * 960 * 3 / 8 + 590,
  86. .colorspace = V4L2_COLORSPACE_JPEG,
  87. .priv = 2},
  88. };
  89. static const struct v4l2_pix_format bi_mode[] = {
  90. {320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
  91. .bytesperline = 320 * 2,
  92. .sizeimage = 320 * 240 * 2,
  93. .colorspace = V4L2_COLORSPACE_SRGB,
  94. .priv = 2},
  95. {640, 480, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
  96. .bytesperline = 640 * 2,
  97. .sizeimage = 640 * 480 * 2,
  98. .colorspace = V4L2_COLORSPACE_SRGB,
  99. .priv = 1},
  100. {1280, 1024, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
  101. .bytesperline = 1280 * 2,
  102. .sizeimage = 1280 * 1024 * 2,
  103. .colorspace = V4L2_COLORSPACE_SRGB,
  104. .priv = 0},
  105. };
  106. static const struct v4l2_pix_format svga_mode[] = {
  107. {800, 600, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
  108. .bytesperline = 800,
  109. .sizeimage = 800 * 600 * 1 / 4 + 590,
  110. .colorspace = V4L2_COLORSPACE_JPEG,
  111. .priv = 0},
  112. };
  113. /* OV7660/7670 registers */
  114. #define OV7660_REG_MVFP 0x1e
  115. #define OV7660_MVFP_MIRROR 0x20
  116. #define OV7660_MVFP_VFLIP 0x10
  117. static const u8 mi0360_matrix[9] = {
  118. 0x50, 0xf8, 0xf8, 0xf5, 0x50, 0xfb, 0xff, 0xf1, 0x50
  119. };
  120. static const u8 mi0360_initVGA_JPG[][4] = {
  121. {0xb0, 0x03, 0x19, 0xcc},
  122. {0xb0, 0x04, 0x02, 0xcc},
  123. {0xb3, 0x00, 0x24, 0xcc},
  124. {0xb3, 0x00, 0x25, 0xcc},
  125. {0xb3, 0x08, 0x01, 0xcc},
  126. {0xb3, 0x09, 0x0c, 0xcc},
  127. {0xb3, 0x05, 0x01, 0xcc},
  128. {0xb3, 0x06, 0x03, 0xcc},
  129. {0xb3, 0x03, 0x0a, 0xcc},
  130. {0xb3, 0x20, 0x00, 0xcc},
  131. {0xb3, 0x21, 0x00, 0xcc},
  132. {0xb3, 0x22, 0x01, 0xcc},
  133. {0xb3, 0x23, 0xe0, 0xcc},
  134. {0xb3, 0x04, 0x05, 0xcc},
  135. {0xb3, 0x14, 0x00, 0xcc},
  136. {0xb3, 0x15, 0x00, 0xcc},
  137. {0xb3, 0x16, 0x02, 0xcc},
  138. {0xb3, 0x17, 0x7f, 0xcc},
  139. {0xb3, 0x35, 0xdd, 0xcc}, /* i2c add: 5d */
  140. {0xb3, 0x34, 0x02, 0xcc},
  141. {0xb3, 0x00, 0x25, 0xcc},
  142. {0xbc, 0x00, 0x71, 0xcc},
  143. {0xb8, 0x00, 0x13, 0xcc},
  144. {0xb8, 0x27, 0x20, 0xcc},
  145. {0xb8, 0x2c, 0x50, 0xcc},
  146. {0xb8, 0x2d, 0xf8, 0xcc},
  147. {0xb8, 0x2e, 0xf8, 0xcc},
  148. {0xb8, 0x2f, 0xf8, 0xcc},
  149. {0xb8, 0x30, 0x50, 0xcc},
  150. {0xb8, 0x31, 0xf8, 0xcc},
  151. {0xb8, 0x32, 0xf8, 0xcc},
  152. {0xb8, 0x33, 0xf8, 0xcc},
  153. {0xb8, 0x34, 0x50, 0xcc},
  154. {0xb8, 0x35, 0x00, 0xcc},
  155. {0xb8, 0x36, 0x00, 0xcc},
  156. {0xb8, 0x37, 0x00, 0xcc},
  157. {0xb8, 0x01, 0x79, 0xcc},
  158. {0xb8, 0x08, 0xe0, 0xcc},
  159. {0xb3, 0x01, 0x41, 0xcc},
  160. {0xb8, 0x01, 0x79, 0xcc},
  161. {0xb8, 0x14, 0x18, 0xcc},
  162. {0xb8, 0xb2, 0x0a, 0xcc},
  163. {0xb8, 0xb4, 0x0a, 0xcc},
  164. {0xb8, 0xb5, 0x0a, 0xcc},
  165. {0xb8, 0xfe, 0x00, 0xcc},
  166. {0xb8, 0xff, 0x28, 0xcc},
  167. {0xb9, 0x00, 0x28, 0xcc},
  168. {0xb9, 0x01, 0x28, 0xcc},
  169. {0xb9, 0x02, 0x28, 0xcc},
  170. {0xb9, 0x03, 0x00, 0xcc},
  171. {0xb9, 0x04, 0x00, 0xcc},
  172. {0xb9, 0x05, 0x3c, 0xcc},
  173. {0xb9, 0x06, 0x3c, 0xcc},
  174. {0xb9, 0x07, 0x3c, 0xcc},
  175. {0xb9, 0x08, 0x3c, 0xcc},
  176. {0xb8, 0x8e, 0x00, 0xcc},
  177. {0xb8, 0x8f, 0xff, 0xcc},
  178. {0xb8, 0x81, 0x09, 0xcc},
  179. {0x31, 0x00, 0x00, 0xbb},
  180. {0x09, 0x01, 0xc7, 0xbb},
  181. {0x34, 0x01, 0x00, 0xbb},
  182. {0x2b, 0x00, 0x28, 0xbb},
  183. {0x2c, 0x00, 0x30, 0xbb},
  184. {0x2d, 0x00, 0x30, 0xbb},
  185. {0x2e, 0x00, 0x28, 0xbb},
  186. {0x62, 0x04, 0x11, 0xbb},
  187. {0x03, 0x01, 0xe0, 0xbb},
  188. {0x2c, 0x00, 0x2c, 0xbb},
  189. {0x20, 0xd0, 0x00, 0xbb},
  190. {0x01, 0x00, 0x08, 0xbb},
  191. {0x06, 0x00, 0x10, 0xbb},
  192. {0x05, 0x00, 0x20, 0xbb},
  193. {0x20, 0x00, 0x00, 0xbb},
  194. {0xb6, 0x00, 0x00, 0xcc},
  195. {0xb6, 0x03, 0x02, 0xcc},
  196. {0xb6, 0x02, 0x80, 0xcc},
  197. {0xb6, 0x05, 0x01, 0xcc},
  198. {0xb6, 0x04, 0xe0, 0xcc},
  199. {0xb6, 0x12, 0x78, 0xcc},
  200. {0xb6, 0x18, 0x02, 0xcc},
  201. {0xb6, 0x17, 0x58, 0xcc},
  202. {0xb6, 0x16, 0x00, 0xcc},
  203. {0xb6, 0x22, 0x12, 0xcc},
  204. {0xb6, 0x23, 0x0b, 0xcc},
  205. {0xb3, 0x02, 0x02, 0xcc},
  206. {0xbf, 0xc0, 0x39, 0xcc},
  207. {0xbf, 0xc1, 0x04, 0xcc},
  208. {0xbf, 0xcc, 0x10, 0xcc},
  209. {0xb9, 0x12, 0x00, 0xcc},
  210. {0xb9, 0x13, 0x0a, 0xcc},
  211. {0xb9, 0x14, 0x0a, 0xcc},
  212. {0xb9, 0x15, 0x0a, 0xcc},
  213. {0xb9, 0x16, 0x0a, 0xcc},
  214. {0xb9, 0x18, 0x00, 0xcc},
  215. {0xb9, 0x19, 0x0f, 0xcc},
  216. {0xb9, 0x1a, 0x0f, 0xcc},
  217. {0xb9, 0x1b, 0x0f, 0xcc},
  218. {0xb9, 0x1c, 0x0f, 0xcc},
  219. {0xb8, 0x8e, 0x00, 0xcc},
  220. {0xb8, 0x8f, 0xff, 0xcc},
  221. {0xb6, 0x12, 0xf8, 0xcc},
  222. {0xb8, 0x0c, 0x20, 0xcc},
  223. {0xb8, 0x0d, 0x70, 0xcc},
  224. {0xb6, 0x13, 0x13, 0xcc},
  225. {0x35, 0x00, 0x60, 0xbb},
  226. {0xb3, 0x5c, 0x01, 0xcc},
  227. {}
  228. };
  229. static const u8 mi0360_initQVGA_JPG[][4] = {
  230. {0xb0, 0x03, 0x19, 0xcc},
  231. {0xb0, 0x04, 0x02, 0xcc},
  232. {0xb3, 0x00, 0x24, 0xcc},
  233. {0xb3, 0x00, 0x25, 0xcc},
  234. {0xb3, 0x08, 0x01, 0xcc},
  235. {0xb3, 0x09, 0x0c, 0xcc},
  236. {0xb3, 0x05, 0x01, 0xcc},
  237. {0xb3, 0x06, 0x03, 0xcc},
  238. {0xb3, 0x03, 0x0a, 0xcc},
  239. {0xb3, 0x20, 0x00, 0xcc},
  240. {0xb3, 0x21, 0x00, 0xcc},
  241. {0xb3, 0x22, 0x01, 0xcc},
  242. {0xb3, 0x23, 0xe0, 0xcc},
  243. {0xb3, 0x04, 0x05, 0xcc},
  244. {0xb3, 0x14, 0x00, 0xcc},
  245. {0xb3, 0x15, 0x00, 0xcc},
  246. {0xb3, 0x16, 0x02, 0xcc},
  247. {0xb3, 0x17, 0x7f, 0xcc},
  248. {0xb3, 0x35, 0xdd, 0xcc},
  249. {0xb3, 0x34, 0x02, 0xcc},
  250. {0xb3, 0x00, 0x25, 0xcc},
  251. {0xbc, 0x00, 0xd1, 0xcc},
  252. {0xb8, 0x00, 0x13, 0xcc},
  253. {0xb8, 0x27, 0x20, 0xcc},
  254. {0xb8, 0x2c, 0x50, 0xcc},
  255. {0xb8, 0x2d, 0xf8, 0xcc},
  256. {0xb8, 0x2e, 0xf8, 0xcc},
  257. {0xb8, 0x2f, 0xf8, 0xcc},
  258. {0xb8, 0x30, 0x50, 0xcc},
  259. {0xb8, 0x31, 0xf8, 0xcc},
  260. {0xb8, 0x32, 0xf8, 0xcc},
  261. {0xb8, 0x33, 0xf8, 0xcc},
  262. {0xb8, 0x34, 0x50, 0xcc},
  263. {0xb8, 0x35, 0x00, 0xcc},
  264. {0xb8, 0x36, 0x00, 0xcc},
  265. {0xb8, 0x37, 0x00, 0xcc},
  266. {0xb8, 0x01, 0x79, 0xcc},
  267. {0xb8, 0x08, 0xe0, 0xcc},
  268. {0xb3, 0x01, 0x41, 0xcc},
  269. {0xb8, 0x01, 0x79, 0xcc},
  270. {0xb8, 0x14, 0x18, 0xcc},
  271. {0xb8, 0xb2, 0x0a, 0xcc},
  272. {0xb8, 0xb4, 0x0a, 0xcc},
  273. {0xb8, 0xb5, 0x0a, 0xcc},
  274. {0xb8, 0xfe, 0x00, 0xcc},
  275. {0xb8, 0xff, 0x28, 0xcc},
  276. {0xb9, 0x00, 0x28, 0xcc},
  277. {0xb9, 0x01, 0x28, 0xcc},
  278. {0xb9, 0x02, 0x28, 0xcc},
  279. {0xb9, 0x03, 0x00, 0xcc},
  280. {0xb9, 0x04, 0x00, 0xcc},
  281. {0xb9, 0x05, 0x3c, 0xcc},
  282. {0xb9, 0x06, 0x3c, 0xcc},
  283. {0xb9, 0x07, 0x3c, 0xcc},
  284. {0xb9, 0x08, 0x3c, 0xcc},
  285. {0xb8, 0x8e, 0x00, 0xcc},
  286. {0xb8, 0x8f, 0xff, 0xcc},
  287. {0xb8, 0x81, 0x09, 0xcc},
  288. {0x31, 0x00, 0x00, 0xbb},
  289. {0x09, 0x01, 0xc7, 0xbb},
  290. {0x34, 0x01, 0x00, 0xbb},
  291. {0x2b, 0x00, 0x28, 0xbb},
  292. {0x2c, 0x00, 0x30, 0xbb},
  293. {0x2d, 0x00, 0x30, 0xbb},
  294. {0x2e, 0x00, 0x28, 0xbb},
  295. {0x62, 0x04, 0x11, 0xbb},
  296. {0x03, 0x01, 0xe0, 0xbb},
  297. {0x2c, 0x00, 0x2c, 0xbb},
  298. {0x20, 0xd0, 0x00, 0xbb},
  299. {0x01, 0x00, 0x08, 0xbb},
  300. {0x06, 0x00, 0x10, 0xbb},
  301. {0x05, 0x00, 0x20, 0xbb},
  302. {0x20, 0x00, 0x00, 0xbb},
  303. {0xb6, 0x00, 0x00, 0xcc},
  304. {0xb6, 0x03, 0x01, 0xcc},
  305. {0xb6, 0x02, 0x40, 0xcc},
  306. {0xb6, 0x05, 0x00, 0xcc},
  307. {0xb6, 0x04, 0xf0, 0xcc},
  308. {0xb6, 0x12, 0x78, 0xcc},
  309. {0xb6, 0x18, 0x00, 0xcc},
  310. {0xb6, 0x17, 0x96, 0xcc},
  311. {0xb6, 0x16, 0x00, 0xcc},
  312. {0xb6, 0x22, 0x12, 0xcc},
  313. {0xb6, 0x23, 0x0b, 0xcc},
  314. {0xb3, 0x02, 0x02, 0xcc},
  315. {0xbf, 0xc0, 0x39, 0xcc},
  316. {0xbf, 0xc1, 0x04, 0xcc},
  317. {0xbf, 0xcc, 0x10, 0xcc},
  318. {0xb9, 0x12, 0x00, 0xcc},
  319. {0xb9, 0x13, 0x0a, 0xcc},
  320. {0xb9, 0x14, 0x0a, 0xcc},
  321. {0xb9, 0x15, 0x0a, 0xcc},
  322. {0xb9, 0x16, 0x0a, 0xcc},
  323. {0xb9, 0x18, 0x00, 0xcc},
  324. {0xb9, 0x19, 0x0f, 0xcc},
  325. {0xb9, 0x1a, 0x0f, 0xcc},
  326. {0xb9, 0x1b, 0x0f, 0xcc},
  327. {0xb9, 0x1c, 0x0f, 0xcc},
  328. {0xb8, 0x8e, 0x00, 0xcc},
  329. {0xb8, 0x8f, 0xff, 0xcc},
  330. {0xb6, 0x12, 0xf8, 0xcc},
  331. {0xb6, 0x13, 0x13, 0xcc},
  332. {0xbc, 0x02, 0x18, 0xcc},
  333. {0xbc, 0x03, 0x50, 0xcc},
  334. {0xbc, 0x04, 0x18, 0xcc},
  335. {0xbc, 0x05, 0x00, 0xcc},
  336. {0xbc, 0x06, 0x00, 0xcc},
  337. {0xbc, 0x08, 0x30, 0xcc},
  338. {0xbc, 0x09, 0x40, 0xcc},
  339. {0xbc, 0x0a, 0x10, 0xcc},
  340. {0xb8, 0x0c, 0x20, 0xcc},
  341. {0xb8, 0x0d, 0x70, 0xcc},
  342. {0xbc, 0x0b, 0x00, 0xcc},
  343. {0xbc, 0x0c, 0x00, 0xcc},
  344. {0x35, 0x00, 0xef, 0xbb},
  345. {0xb3, 0x5c, 0x01, 0xcc},
  346. {}
  347. };
  348. static const u8 mi1310_socinitVGA_JPG[][4] = {
  349. {0xb0, 0x03, 0x19, 0xcc},
  350. {0xb0, 0x04, 0x02, 0xcc},
  351. {0xb3, 0x00, 0x64, 0xcc},
  352. {0xb3, 0x00, 0x65, 0xcc},
  353. {0xb3, 0x05, 0x00, 0xcc},
  354. {0xb3, 0x06, 0x00, 0xcc},
  355. {0xb3, 0x08, 0x01, 0xcc},
  356. {0xb3, 0x09, 0x0c, 0xcc},
  357. {0xb3, 0x34, 0x02, 0xcc},
  358. {0xb3, 0x35, 0xdd, 0xcc}, /* i2c add: 5d */
  359. {0xb3, 0x02, 0x00, 0xcc},
  360. {0xb3, 0x03, 0x0a, 0xcc},
  361. {0xb3, 0x04, 0x05, 0xcc},
  362. {0xb3, 0x20, 0x00, 0xcc},
  363. {0xb3, 0x21, 0x00, 0xcc},
  364. {0xb3, 0x22, 0x03, 0xcc},
  365. {0xb3, 0x23, 0xc0, 0xcc},
  366. {0xb3, 0x14, 0x00, 0xcc},
  367. {0xb3, 0x15, 0x00, 0xcc},
  368. {0xb3, 0x16, 0x04, 0xcc},
  369. {0xb3, 0x17, 0xff, 0xcc},
  370. {0xb3, 0x00, 0x65, 0xcc},
  371. {0xb8, 0x00, 0x00, 0xcc},
  372. {0xbc, 0x00, 0xd0, 0xcc},
  373. {0xbc, 0x01, 0x01, 0xcc},
  374. {0xf0, 0x00, 0x02, 0xbb},
  375. {0xc8, 0x9f, 0x0b, 0xbb},
  376. {0x5b, 0x00, 0x01, 0xbb},
  377. {0x2f, 0xde, 0x20, 0xbb},
  378. {0xf0, 0x00, 0x00, 0xbb},
  379. {0x20, 0x03, 0x02, 0xbb}, /* h/v flip */
  380. {0xf0, 0x00, 0x01, 0xbb},
  381. {0x05, 0x00, 0x07, 0xbb},
  382. {0x34, 0x00, 0x00, 0xbb},
  383. {0x35, 0xff, 0x00, 0xbb},
  384. {0xdc, 0x07, 0x02, 0xbb},
  385. {0xdd, 0x3c, 0x18, 0xbb},
  386. {0xde, 0x92, 0x6d, 0xbb},
  387. {0xdf, 0xcd, 0xb1, 0xbb},
  388. {0xe0, 0xff, 0xe7, 0xbb},
  389. {0x06, 0xf0, 0x0d, 0xbb},
  390. {0x06, 0x70, 0x0e, 0xbb},
  391. {0x4c, 0x00, 0x01, 0xbb},
  392. {0x4d, 0x00, 0x01, 0xbb},
  393. {0xf0, 0x00, 0x02, 0xbb},
  394. {0x2e, 0x0c, 0x55, 0xbb},
  395. {0x21, 0xb6, 0x6e, 0xbb},
  396. {0x36, 0x30, 0x10, 0xbb},
  397. {0x37, 0x00, 0xc1, 0xbb},
  398. {0xf0, 0x00, 0x00, 0xbb},
  399. {0x07, 0x00, 0x84, 0xbb},
  400. {0x08, 0x02, 0x4a, 0xbb},
  401. {0x05, 0x01, 0x10, 0xbb},
  402. {0x06, 0x00, 0x39, 0xbb},
  403. {0xf0, 0x00, 0x02, 0xbb},
  404. {0x58, 0x02, 0x67, 0xbb},
  405. {0x57, 0x02, 0x00, 0xbb},
  406. {0x5a, 0x02, 0x67, 0xbb},
  407. {0x59, 0x02, 0x00, 0xbb},
  408. {0x5c, 0x12, 0x0d, 0xbb},
  409. {0x5d, 0x16, 0x11, 0xbb},
  410. {0x39, 0x06, 0x18, 0xbb},
  411. {0x3a, 0x06, 0x18, 0xbb},
  412. {0x3b, 0x06, 0x18, 0xbb},
  413. {0x3c, 0x06, 0x18, 0xbb},
  414. {0x64, 0x7b, 0x5b, 0xbb},
  415. {0xf0, 0x00, 0x02, 0xbb},
  416. {0x36, 0x30, 0x10, 0xbb},
  417. {0x37, 0x00, 0xc0, 0xbb},
  418. {0xbc, 0x0e, 0x00, 0xcc},
  419. {0xbc, 0x0f, 0x05, 0xcc},
  420. {0xbc, 0x10, 0xc0, 0xcc},
  421. {0xbc, 0x11, 0x03, 0xcc},
  422. {0xb6, 0x00, 0x00, 0xcc},
  423. {0xb6, 0x03, 0x02, 0xcc},
  424. {0xb6, 0x02, 0x80, 0xcc},
  425. {0xb6, 0x05, 0x01, 0xcc},
  426. {0xb6, 0x04, 0xe0, 0xcc},
  427. {0xb6, 0x12, 0xf8, 0xcc},
  428. {0xb6, 0x13, 0x25, 0xcc},
  429. {0xb6, 0x18, 0x02, 0xcc},
  430. {0xb6, 0x17, 0x58, 0xcc},
  431. {0xb6, 0x16, 0x00, 0xcc},
  432. {0xb6, 0x22, 0x12, 0xcc},
  433. {0xb6, 0x23, 0x0b, 0xcc},
  434. {0xbf, 0xc0, 0x39, 0xcc},
  435. {0xbf, 0xc1, 0x04, 0xcc},
  436. {0xbf, 0xcc, 0x00, 0xcc},
  437. {0xbc, 0x02, 0x18, 0xcc},
  438. {0xbc, 0x03, 0x50, 0xcc},
  439. {0xbc, 0x04, 0x18, 0xcc},
  440. {0xbc, 0x05, 0x00, 0xcc},
  441. {0xbc, 0x06, 0x00, 0xcc},
  442. {0xbc, 0x08, 0x30, 0xcc},
  443. {0xbc, 0x09, 0x40, 0xcc},
  444. {0xbc, 0x0a, 0x10, 0xcc},
  445. {0xbc, 0x0b, 0x00, 0xcc},
  446. {0xbc, 0x0c, 0x00, 0xcc},
  447. {0xb3, 0x5c, 0x01, 0xcc},
  448. {0xf0, 0x00, 0x01, 0xbb},
  449. {0x80, 0x00, 0x03, 0xbb},
  450. {0x81, 0xc7, 0x14, 0xbb},
  451. {0x82, 0xeb, 0xe8, 0xbb},
  452. {0x83, 0xfe, 0xf4, 0xbb},
  453. {0x84, 0xcd, 0x10, 0xbb},
  454. {0x85, 0xf3, 0xee, 0xbb},
  455. {0x86, 0xff, 0xf1, 0xbb},
  456. {0x87, 0xcd, 0x10, 0xbb},
  457. {0x88, 0xf3, 0xee, 0xbb},
  458. {0x89, 0x01, 0xf1, 0xbb},
  459. {0x8a, 0xe5, 0x17, 0xbb},
  460. {0x8b, 0xe8, 0xe2, 0xbb},
  461. {0x8c, 0xf7, 0xed, 0xbb},
  462. {0x8d, 0x00, 0xff, 0xbb},
  463. {0x8e, 0xec, 0x10, 0xbb},
  464. {0x8f, 0xf0, 0xed, 0xbb},
  465. {0x90, 0xf9, 0xf2, 0xbb},
  466. {0x91, 0x00, 0x00, 0xbb},
  467. {0x92, 0xe9, 0x0d, 0xbb},
  468. {0x93, 0xf4, 0xf2, 0xbb},
  469. {0x94, 0xfb, 0xf5, 0xbb},
  470. {0x95, 0x00, 0xff, 0xbb},
  471. {0xb6, 0x0f, 0x08, 0xbb},
  472. {0xb7, 0x3d, 0x16, 0xbb},
  473. {0xb8, 0x0c, 0x04, 0xbb},
  474. {0xb9, 0x1c, 0x07, 0xbb},
  475. {0xba, 0x0a, 0x03, 0xbb},
  476. {0xbb, 0x1b, 0x09, 0xbb},
  477. {0xbc, 0x17, 0x0d, 0xbb},
  478. {0xbd, 0x23, 0x1d, 0xbb},
  479. {0xbe, 0x00, 0x28, 0xbb},
  480. {0xbf, 0x11, 0x09, 0xbb},
  481. {0xc0, 0x16, 0x15, 0xbb},
  482. {0xc1, 0x00, 0x1b, 0xbb},
  483. {0xc2, 0x0e, 0x07, 0xbb},
  484. {0xc3, 0x14, 0x10, 0xbb},
  485. {0xc4, 0x00, 0x17, 0xbb},
  486. {0x06, 0x74, 0x8e, 0xbb},
  487. {0xf0, 0x00, 0x01, 0xbb},
  488. {0x06, 0xf4, 0x8e, 0xbb},
  489. {0x00, 0x00, 0x50, 0xdd},
  490. {0x06, 0x74, 0x8e, 0xbb},
  491. {0xf0, 0x00, 0x02, 0xbb},
  492. {0x24, 0x50, 0x20, 0xbb},
  493. {0xf0, 0x00, 0x02, 0xbb},
  494. {0x34, 0x0c, 0x50, 0xbb},
  495. {0xb3, 0x01, 0x41, 0xcc},
  496. {0xf0, 0x00, 0x00, 0xbb},
  497. {0x03, 0x03, 0xc0, 0xbb},
  498. {},
  499. };
  500. static const u8 mi1310_socinitQVGA_JPG[][4] = {
  501. {0xb0, 0x03, 0x19, 0xcc}, {0xb0, 0x04, 0x02, 0xcc},
  502. {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
  503. {0xb3, 0x05, 0x00, 0xcc}, {0xb3, 0x06, 0x00, 0xcc},
  504. {0xb3, 0x08, 0x01, 0xcc}, {0xb3, 0x09, 0x0c, 0xcc},
  505. {0xb3, 0x34, 0x02, 0xcc}, {0xb3, 0x35, 0xdd, 0xcc},
  506. {0xb3, 0x02, 0x00, 0xcc}, {0xb3, 0x03, 0x0a, 0xcc},
  507. {0xb3, 0x04, 0x05, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
  508. {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x03, 0xcc},
  509. {0xb3, 0x23, 0xc0, 0xcc}, {0xb3, 0x14, 0x00, 0xcc},
  510. {0xb3, 0x15, 0x00, 0xcc}, {0xb3, 0x16, 0x04, 0xcc},
  511. {0xb3, 0x17, 0xff, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
  512. {0xb8, 0x00, 0x00, 0xcc}, {0xbc, 0x00, 0xf0, 0xcc},
  513. {0xbc, 0x01, 0x01, 0xcc}, {0xf0, 0x00, 0x02, 0xbb},
  514. {0xc8, 0x9f, 0x0b, 0xbb}, {0x5b, 0x00, 0x01, 0xbb},
  515. {0x2f, 0xde, 0x20, 0xbb}, {0xf0, 0x00, 0x00, 0xbb},
  516. {0x20, 0x03, 0x02, 0xbb}, /* h/v flip */
  517. {0xf0, 0x00, 0x01, 0xbb},
  518. {0x05, 0x00, 0x07, 0xbb}, {0x34, 0x00, 0x00, 0xbb},
  519. {0x35, 0xff, 0x00, 0xbb}, {0xdc, 0x07, 0x02, 0xbb},
  520. {0xdd, 0x3c, 0x18, 0xbb}, {0xde, 0x92, 0x6d, 0xbb},
  521. {0xdf, 0xcd, 0xb1, 0xbb}, {0xe0, 0xff, 0xe7, 0xbb},
  522. {0x06, 0xf0, 0x0d, 0xbb}, {0x06, 0x70, 0x0e, 0xbb},
  523. {0x4c, 0x00, 0x01, 0xbb}, {0x4d, 0x00, 0x01, 0xbb},
  524. {0xf0, 0x00, 0x02, 0xbb}, {0x2e, 0x0c, 0x55, 0xbb},
  525. {0x21, 0xb6, 0x6e, 0xbb}, {0x36, 0x30, 0x10, 0xbb},
  526. {0x37, 0x00, 0xc1, 0xbb}, {0xf0, 0x00, 0x00, 0xbb},
  527. {0x07, 0x00, 0x84, 0xbb}, {0x08, 0x02, 0x4a, 0xbb},
  528. {0x05, 0x01, 0x10, 0xbb}, {0x06, 0x00, 0x39, 0xbb},
  529. {0xf0, 0x00, 0x02, 0xbb}, {0x58, 0x02, 0x67, 0xbb},
  530. {0x57, 0x02, 0x00, 0xbb}, {0x5a, 0x02, 0x67, 0xbb},
  531. {0x59, 0x02, 0x00, 0xbb}, {0x5c, 0x12, 0x0d, 0xbb},
  532. {0x5d, 0x16, 0x11, 0xbb}, {0x39, 0x06, 0x18, 0xbb},
  533. {0x3a, 0x06, 0x18, 0xbb}, {0x3b, 0x06, 0x18, 0xbb},
  534. {0x3c, 0x06, 0x18, 0xbb}, {0x64, 0x7b, 0x5b, 0xbb},
  535. {0xf0, 0x00, 0x02, 0xbb}, {0x36, 0x30, 0x10, 0xbb},
  536. {0x37, 0x00, 0xc0, 0xbb}, {0xbc, 0x0e, 0x00, 0xcc},
  537. {0xbc, 0x0f, 0x05, 0xcc}, {0xbc, 0x10, 0xc0, 0xcc},
  538. {0xbc, 0x11, 0x03, 0xcc}, {0xb6, 0x00, 0x00, 0xcc},
  539. {0xb6, 0x03, 0x01, 0xcc}, {0xb6, 0x02, 0x40, 0xcc},
  540. {0xb6, 0x05, 0x00, 0xcc}, {0xb6, 0x04, 0xf0, 0xcc},
  541. {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x25, 0xcc},
  542. {0xb6, 0x18, 0x00, 0xcc}, {0xb6, 0x17, 0x96, 0xcc},
  543. {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
  544. {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x39, 0xcc},
  545. {0xbf, 0xc1, 0x04, 0xcc}, {0xbf, 0xcc, 0x00, 0xcc},
  546. {0xb3, 0x5c, 0x01, 0xcc}, {0xf0, 0x00, 0x01, 0xbb},
  547. {0x80, 0x00, 0x03, 0xbb}, {0x81, 0xc7, 0x14, 0xbb},
  548. {0x82, 0xeb, 0xe8, 0xbb}, {0x83, 0xfe, 0xf4, 0xbb},
  549. {0x84, 0xcd, 0x10, 0xbb}, {0x85, 0xf3, 0xee, 0xbb},
  550. {0x86, 0xff, 0xf1, 0xbb}, {0x87, 0xcd, 0x10, 0xbb},
  551. {0x88, 0xf3, 0xee, 0xbb}, {0x89, 0x01, 0xf1, 0xbb},
  552. {0x8a, 0xe5, 0x17, 0xbb}, {0x8b, 0xe8, 0xe2, 0xbb},
  553. {0x8c, 0xf7, 0xed, 0xbb}, {0x8d, 0x00, 0xff, 0xbb},
  554. {0x8e, 0xec, 0x10, 0xbb}, {0x8f, 0xf0, 0xed, 0xbb},
  555. {0x90, 0xf9, 0xf2, 0xbb}, {0x91, 0x00, 0x00, 0xbb},
  556. {0x92, 0xe9, 0x0d, 0xbb}, {0x93, 0xf4, 0xf2, 0xbb},
  557. {0x94, 0xfb, 0xf5, 0xbb}, {0x95, 0x00, 0xff, 0xbb},
  558. {0xb6, 0x0f, 0x08, 0xbb}, {0xb7, 0x3d, 0x16, 0xbb},
  559. {0xb8, 0x0c, 0x04, 0xbb}, {0xb9, 0x1c, 0x07, 0xbb},
  560. {0xba, 0x0a, 0x03, 0xbb}, {0xbb, 0x1b, 0x09, 0xbb},
  561. {0xbc, 0x17, 0x0d, 0xbb}, {0xbd, 0x23, 0x1d, 0xbb},
  562. {0xbe, 0x00, 0x28, 0xbb}, {0xbf, 0x11, 0x09, 0xbb},
  563. {0xc0, 0x16, 0x15, 0xbb}, {0xc1, 0x00, 0x1b, 0xbb},
  564. {0xc2, 0x0e, 0x07, 0xbb}, {0xc3, 0x14, 0x10, 0xbb},
  565. {0xc4, 0x00, 0x17, 0xbb}, {0x06, 0x74, 0x8e, 0xbb},
  566. {0xf0, 0x00, 0x01, 0xbb}, {0x06, 0xf4, 0x8e, 0xbb},
  567. {0x00, 0x00, 0x50, 0xdd}, {0x06, 0x74, 0x8e, 0xbb},
  568. {0xf0, 0x00, 0x02, 0xbb}, {0x24, 0x50, 0x20, 0xbb},
  569. {0xf0, 0x00, 0x02, 0xbb}, {0x34, 0x0c, 0x50, 0xbb},
  570. {0xb3, 0x01, 0x41, 0xcc}, {0xf0, 0x00, 0x00, 0xbb},
  571. {0x03, 0x03, 0xc0, 0xbb},
  572. {},
  573. };
  574. static const u8 mi1310_soc_InitSXGA_JPG[][4] = {
  575. {0xb0, 0x03, 0x19, 0xcc},
  576. {0xb0, 0x04, 0x02, 0xcc},
  577. {0xb3, 0x00, 0x64, 0xcc},
  578. {0xb3, 0x00, 0x65, 0xcc},
  579. {0xb3, 0x05, 0x00, 0xcc},
  580. {0xb3, 0x06, 0x00, 0xcc},
  581. {0xb3, 0x08, 0x01, 0xcc},
  582. {0xb3, 0x09, 0x0c, 0xcc},
  583. {0xb3, 0x34, 0x02, 0xcc},
  584. {0xb3, 0x35, 0xdd, 0xcc},
  585. {0xb3, 0x02, 0x00, 0xcc},
  586. {0xb3, 0x03, 0x0a, 0xcc},
  587. {0xb3, 0x04, 0x0d, 0xcc},
  588. {0xb3, 0x20, 0x00, 0xcc},
  589. {0xb3, 0x21, 0x00, 0xcc},
  590. {0xb3, 0x22, 0x03, 0xcc},
  591. {0xb3, 0x23, 0xc0, 0xcc},
  592. {0xb3, 0x14, 0x00, 0xcc},
  593. {0xb3, 0x15, 0x00, 0xcc},
  594. {0xb3, 0x16, 0x04, 0xcc},
  595. {0xb3, 0x17, 0xff, 0xcc},
  596. {0xb3, 0x00, 0x65, 0xcc},
  597. {0xb8, 0x00, 0x00, 0xcc},
  598. {0xbc, 0x00, 0x70, 0xcc},
  599. {0xbc, 0x01, 0x01, 0xcc},
  600. {0xf0, 0x00, 0x02, 0xbb},
  601. {0xc8, 0x9f, 0x0b, 0xbb},
  602. {0x5b, 0x00, 0x01, 0xbb},
  603. {0xf0, 0x00, 0x00, 0xbb},
  604. {0x20, 0x03, 0x02, 0xbb}, /* h/v flip */
  605. {0xf0, 0x00, 0x01, 0xbb},
  606. {0x05, 0x00, 0x07, 0xbb},
  607. {0x34, 0x00, 0x00, 0xbb},
  608. {0x35, 0xff, 0x00, 0xbb},
  609. {0xdc, 0x07, 0x02, 0xbb},
  610. {0xdd, 0x3c, 0x18, 0xbb},
  611. {0xde, 0x92, 0x6d, 0xbb},
  612. {0xdf, 0xcd, 0xb1, 0xbb},
  613. {0xe0, 0xff, 0xe7, 0xbb},
  614. {0x06, 0xf0, 0x0d, 0xbb},
  615. {0x06, 0x70, 0x0e, 0xbb},
  616. {0x4c, 0x00, 0x01, 0xbb},
  617. {0x4d, 0x00, 0x01, 0xbb},
  618. {0xf0, 0x00, 0x02, 0xbb},
  619. {0x2e, 0x0c, 0x60, 0xbb},
  620. {0x21, 0xb6, 0x6e, 0xbb},
  621. {0x37, 0x01, 0x40, 0xbb},
  622. {0xf0, 0x00, 0x00, 0xbb},
  623. {0x07, 0x00, 0x84, 0xbb},
  624. {0x08, 0x02, 0x4a, 0xbb},
  625. {0x05, 0x01, 0x10, 0xbb},
  626. {0x06, 0x00, 0x39, 0xbb},
  627. {0xf0, 0x00, 0x02, 0xbb},
  628. {0x58, 0x02, 0x67, 0xbb},
  629. {0x57, 0x02, 0x00, 0xbb},
  630. {0x5a, 0x02, 0x67, 0xbb},
  631. {0x59, 0x02, 0x00, 0xbb},
  632. {0x5c, 0x12, 0x0d, 0xbb},
  633. {0x5d, 0x16, 0x11, 0xbb},
  634. {0x39, 0x06, 0x18, 0xbb},
  635. {0x3a, 0x06, 0x18, 0xbb},
  636. {0x3b, 0x06, 0x18, 0xbb},
  637. {0x3c, 0x06, 0x18, 0xbb},
  638. {0x64, 0x7b, 0x5b, 0xbb},
  639. {0xb6, 0x00, 0x00, 0xcc},
  640. {0xb6, 0x03, 0x05, 0xcc},
  641. {0xb6, 0x02, 0x00, 0xcc},
  642. {0xb6, 0x05, 0x03, 0xcc},
  643. {0xb6, 0x04, 0xc0, 0xcc},
  644. {0xb6, 0x12, 0xf8, 0xcc},
  645. {0xb6, 0x13, 0x29, 0xcc},
  646. {0xb6, 0x18, 0x09, 0xcc},
  647. {0xb6, 0x17, 0x60, 0xcc},
  648. {0xb6, 0x16, 0x00, 0xcc},
  649. {0xb6, 0x22, 0x12, 0xcc},
  650. {0xb6, 0x23, 0x0b, 0xcc},
  651. {0xbf, 0xc0, 0x39, 0xcc},
  652. {0xbf, 0xc1, 0x04, 0xcc},
  653. {0xbf, 0xcc, 0x00, 0xcc},
  654. {0xb3, 0x01, 0x41, 0xcc},
  655. {0x00, 0x00, 0x80, 0xdd},
  656. {0xf0, 0x00, 0x02, 0xbb},
  657. {0x00, 0x00, 0x10, 0xdd},
  658. {0x22, 0xa0, 0x78, 0xbb},
  659. {0x23, 0xa0, 0x78, 0xbb},
  660. {0x24, 0x7f, 0x00, 0xbb},
  661. {0x28, 0xea, 0x02, 0xbb},
  662. {0x29, 0x86, 0x7a, 0xbb},
  663. {0x5e, 0x52, 0x4c, 0xbb},
  664. {0x5f, 0x20, 0x24, 0xbb},
  665. {0x60, 0x00, 0x02, 0xbb},
  666. {0x02, 0x00, 0xee, 0xbb},
  667. {0x03, 0x39, 0x23, 0xbb},
  668. {0x04, 0x07, 0x24, 0xbb},
  669. {0x09, 0x00, 0xc0, 0xbb},
  670. {0x0a, 0x00, 0x79, 0xbb},
  671. {0x0b, 0x00, 0x04, 0xbb},
  672. {0x0c, 0x00, 0x5c, 0xbb},
  673. {0x0d, 0x00, 0xd9, 0xbb},
  674. {0x0e, 0x00, 0x53, 0xbb},
  675. {0x0f, 0x00, 0x21, 0xbb},
  676. {0x10, 0x00, 0xa4, 0xbb},
  677. {0x11, 0x00, 0xe5, 0xbb},
  678. {0x15, 0x00, 0x00, 0xbb},
  679. {0x16, 0x00, 0x00, 0xbb},
  680. {0x17, 0x00, 0x00, 0xbb},
  681. {0x18, 0x00, 0x00, 0xbb},
  682. {0x19, 0x00, 0x00, 0xbb},
  683. {0x1a, 0x00, 0x00, 0xbb},
  684. {0x1b, 0x00, 0x00, 0xbb},
  685. {0x1c, 0x00, 0x00, 0xbb},
  686. {0x1d, 0x00, 0x00, 0xbb},
  687. {0x1e, 0x00, 0x00, 0xbb},
  688. {0xf0, 0x00, 0x01, 0xbb},
  689. {0x00, 0x00, 0x20, 0xdd},
  690. {0x06, 0xf0, 0x8e, 0xbb},
  691. {0x00, 0x00, 0x80, 0xdd},
  692. {0x06, 0x70, 0x8e, 0xbb},
  693. {0xf0, 0x00, 0x02, 0xbb},
  694. {0x00, 0x00, 0x20, 0xdd},
  695. {0x5e, 0x6a, 0x53, 0xbb},
  696. {0x5f, 0x40, 0x2c, 0xbb},
  697. {0xf0, 0x00, 0x01, 0xbb},
  698. {0x00, 0x00, 0x20, 0xdd},
  699. {0x58, 0x00, 0x00, 0xbb},
  700. {0x53, 0x09, 0x03, 0xbb},
  701. {0x54, 0x31, 0x18, 0xbb},
  702. {0x55, 0x8b, 0x5f, 0xbb},
  703. {0x56, 0xc0, 0xa9, 0xbb},
  704. {0x57, 0xe0, 0xd2, 0xbb},
  705. {0xe1, 0x00, 0x00, 0xbb},
  706. {0xdc, 0x09, 0x03, 0xbb},
  707. {0xdd, 0x31, 0x18, 0xbb},
  708. {0xde, 0x8b, 0x5f, 0xbb},
  709. {0xdf, 0xc0, 0xa9, 0xbb},
  710. {0xe0, 0xe0, 0xd2, 0xbb},
  711. {0xb3, 0x5c, 0x01, 0xcc},
  712. {0xf0, 0x00, 0x01, 0xbb},
  713. {0x06, 0xf0, 0x8e, 0xbb},
  714. {0xf0, 0x00, 0x02, 0xbb},
  715. {0x2f, 0xde, 0x20, 0xbb},
  716. {0xf0, 0x00, 0x02, 0xbb},
  717. {0x24, 0x50, 0x20, 0xbb},
  718. {0xbc, 0x0e, 0x00, 0xcc},
  719. {0xbc, 0x0f, 0x05, 0xcc},
  720. {0xbc, 0x10, 0xc0, 0xcc},
  721. {0xf0, 0x00, 0x02, 0xbb},
  722. {0x34, 0x0c, 0x50, 0xbb},
  723. {0xbc, 0x11, 0x03, 0xcc},
  724. {0xf0, 0x00, 0x01, 0xbb},
  725. {0x80, 0x00, 0x03, 0xbb},
  726. {0x81, 0xc7, 0x14, 0xbb},
  727. {0x82, 0xeb, 0xe8, 0xbb},
  728. {0x83, 0xfe, 0xf4, 0xbb},
  729. {0x84, 0xcd, 0x10, 0xbb},
  730. {0x85, 0xf3, 0xee, 0xbb},
  731. {0x86, 0xff, 0xf1, 0xbb},
  732. {0x87, 0xcd, 0x10, 0xbb},
  733. {0x88, 0xf3, 0xee, 0xbb},
  734. {0x89, 0x01, 0xf1, 0xbb},
  735. {0x8a, 0xe5, 0x17, 0xbb},
  736. {0x8b, 0xe8, 0xe2, 0xbb},
  737. {0x8c, 0xf7, 0xed, 0xbb},
  738. {0x8d, 0x00, 0xff, 0xbb},
  739. {0x8e, 0xec, 0x10, 0xbb},
  740. {0x8f, 0xf0, 0xed, 0xbb},
  741. {0x90, 0xf9, 0xf2, 0xbb},
  742. {0x91, 0x00, 0x00, 0xbb},
  743. {0x92, 0xe9, 0x0d, 0xbb},
  744. {0x93, 0xf4, 0xf2, 0xbb},
  745. {0x94, 0xfb, 0xf5, 0xbb},
  746. {0x95, 0x00, 0xff, 0xbb},
  747. {0xb6, 0x0f, 0x08, 0xbb},
  748. {0xb7, 0x3d, 0x16, 0xbb},
  749. {0xb8, 0x0c, 0x04, 0xbb},
  750. {0xb9, 0x1c, 0x07, 0xbb},
  751. {0xba, 0x0a, 0x03, 0xbb},
  752. {0xbb, 0x1b, 0x09, 0xbb},
  753. {0xbc, 0x17, 0x0d, 0xbb},
  754. {0xbd, 0x23, 0x1d, 0xbb},
  755. {0xbe, 0x00, 0x28, 0xbb},
  756. {0xbf, 0x11, 0x09, 0xbb},
  757. {0xc0, 0x16, 0x15, 0xbb},
  758. {0xc1, 0x00, 0x1b, 0xbb},
  759. {0xc2, 0x0e, 0x07, 0xbb},
  760. {0xc3, 0x14, 0x10, 0xbb},
  761. {0xc4, 0x00, 0x17, 0xbb},
  762. {0x06, 0x74, 0x8e, 0xbb},
  763. {0xf0, 0x00, 0x00, 0xbb},
  764. {0x03, 0x03, 0xc0, 0xbb},
  765. {}
  766. };
  767. static const u8 mi1320_gamma[17] = {
  768. 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
  769. 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
  770. };
  771. static const u8 mi1320_matrix[9] = {
  772. 0x54, 0xda, 0x06, 0xf1, 0x50, 0xf4, 0xf7, 0xea, 0x52
  773. };
  774. static const u8 mi1320_initVGA_data[][4] = {
  775. {0xb3, 0x01, 0x01, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
  776. {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
  777. {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
  778. {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
  779. {0xb0, 0x16, 0x03, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
  780. {0xb3, 0x06, 0x00, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
  781. {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x34, 0x02, 0xcc},
  782. {0xb3, 0x35, 0xc8, 0xcc}, /* i2c add: 48 */
  783. {0xb3, 0x02, 0x00, 0xcc},
  784. {0xb3, 0x03, 0x0a, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
  785. {0xb3, 0x20, 0x00, 0xcc}, {0xb3, 0x21, 0x00, 0xcc},
  786. {0xb3, 0x22, 0x03, 0xcc}, {0xb3, 0x23, 0xc0, 0xcc},
  787. {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
  788. {0xb3, 0x16, 0x04, 0xcc}, {0xb3, 0x17, 0xff, 0xcc},
  789. {0xb3, 0x00, 0x67, 0xcc}, {0xbc, 0x00, 0xd0, 0xcc},
  790. {0xbc, 0x01, 0x01, 0xcc}, {0xf0, 0x00, 0x00, 0xbb},
  791. {0x0d, 0x00, 0x09, 0xbb}, {0x00, 0x01, 0x00, 0xdd},
  792. {0x0d, 0x00, 0x08, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
  793. {0xa1, 0x05, 0x00, 0xbb}, {0xa4, 0x03, 0xc0, 0xbb},
  794. {0xf0, 0x00, 0x02, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
  795. {0xc8, 0x9f, 0x0b, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
  796. {0xf0, 0x00, 0x00, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
  797. {0x20, 0x01, 0x00, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
  798. {0xf0, 0x00, 0x01, 0xbb}, {0x9d, 0x3c, 0xa0, 0xbb},
  799. {0x47, 0x30, 0x30, 0xbb}, {0xf0, 0x00, 0x00, 0xbb},
  800. {0x0a, 0x80, 0x11, 0xbb}, {0x35, 0x00, 0x22, 0xbb},
  801. {0xf0, 0x00, 0x02, 0xbb}, {0x9d, 0xc5, 0x05, 0xbb},
  802. {0xdc, 0x0f, 0xfc, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
  803. {0x06, 0x74, 0x0e, 0xbb}, {0x80, 0x00, 0x06, 0xbb},
  804. {0x81, 0x04, 0x00, 0xbb}, {0x82, 0x01, 0x02, 0xbb},
  805. {0x83, 0x03, 0x02, 0xbb}, {0x84, 0x05, 0x00, 0xbb},
  806. {0x85, 0x01, 0x00, 0xbb}, {0x86, 0x03, 0x02, 0xbb},
  807. {0x87, 0x05, 0x00, 0xbb}, {0x88, 0x01, 0x00, 0xbb},
  808. {0x89, 0x02, 0x02, 0xbb}, {0x8a, 0xfd, 0x04, 0xbb},
  809. {0x8b, 0xfc, 0xfd, 0xbb}, {0x8c, 0xff, 0xfd, 0xbb},
  810. {0x8d, 0x00, 0x00, 0xbb}, {0x8e, 0xfe, 0x05, 0xbb},
  811. {0x8f, 0xfc, 0xfd, 0xbb}, {0x90, 0xfe, 0xfd, 0xbb},
  812. {0x91, 0x00, 0x00, 0xbb}, {0x92, 0xfe, 0x03, 0xbb},
  813. {0x93, 0xfd, 0xfe, 0xbb}, {0x94, 0xff, 0xfd, 0xbb},
  814. {0x95, 0x00, 0x00, 0xbb}, {0xb6, 0x07, 0x05, 0xbb},
  815. {0xb7, 0x13, 0x06, 0xbb}, {0xb8, 0x08, 0x06, 0xbb},
  816. {0xb9, 0x14, 0x08, 0xbb}, {0xba, 0x06, 0x05, 0xbb},
  817. {0xbb, 0x13, 0x06, 0xbb}, {0xbc, 0x03, 0x01, 0xbb},
  818. {0xbd, 0x03, 0x04, 0xbb}, {0xbe, 0x00, 0x02, 0xbb},
  819. {0xbf, 0x03, 0x01, 0xbb}, {0xc0, 0x02, 0x04, 0xbb},
  820. {0xc1, 0x00, 0x04, 0xbb}, {0xc2, 0x02, 0x01, 0xbb},
  821. {0xc3, 0x01, 0x03, 0xbb}, {0xc4, 0x00, 0x04, 0xbb},
  822. {0xf0, 0x00, 0x00, 0xbb}, {0x05, 0x01, 0x13, 0xbb},
  823. {0x06, 0x00, 0x11, 0xbb}, {0x07, 0x00, 0x85, 0xbb},
  824. {0x08, 0x00, 0x27, 0xbb},
  825. {0x20, 0x01, 0x00, 0xbb}, /* h/v flips - was 03 */
  826. {0x21, 0x80, 0x00, 0xbb}, {0x22, 0x0d, 0x0f, 0xbb},
  827. {0x24, 0x80, 0x00, 0xbb}, {0x59, 0x00, 0xff, 0xbb},
  828. {0xf0, 0x00, 0x02, 0xbb}, {0x39, 0x03, 0x0d, 0xbb},
  829. {0x3a, 0x06, 0x1b, 0xbb}, {0x3b, 0x00, 0x95, 0xbb},
  830. {0x3c, 0x04, 0xdb, 0xbb}, {0x57, 0x02, 0x00, 0xbb},
  831. {0x58, 0x02, 0x66, 0xbb}, {0x59, 0x00, 0xff, 0xbb},
  832. {0x5a, 0x01, 0x33, 0xbb}, {0x5c, 0x12, 0x0d, 0xbb},
  833. {0x5d, 0x16, 0x11, 0xbb}, {0x64, 0x5e, 0x1c, 0xbb},
  834. {0xf0, 0x00, 0x02, 0xbb}, {0x2f, 0xd1, 0x00, 0xbb},
  835. {0x5b, 0x00, 0x01, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
  836. {0x36, 0x68, 0x10, 0xbb}, {0x00, 0x00, 0x30, 0xdd},
  837. {0x37, 0x82, 0x00, 0xbb}, {0xbc, 0x0e, 0x00, 0xcc},
  838. {0xbc, 0x0f, 0x05, 0xcc}, {0xbc, 0x10, 0xc0, 0xcc},
  839. {0xbc, 0x11, 0x03, 0xcc}, {0xb6, 0x00, 0x00, 0xcc},
  840. {0xb6, 0x03, 0x05, 0xcc}, {0xb6, 0x02, 0x00, 0xcc},
  841. {0xb6, 0x05, 0x04, 0xcc}, {0xb6, 0x04, 0x00, 0xcc},
  842. {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x29, 0xcc},
  843. {0xb6, 0x18, 0x0a, 0xcc}, {0xb6, 0x17, 0x00, 0xcc},
  844. {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
  845. {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x26, 0xcc},
  846. {0xbf, 0xc1, 0x02, 0xcc}, {0xbf, 0xcc, 0x04, 0xcc},
  847. {0xbc, 0x02, 0x18, 0xcc}, {0xbc, 0x03, 0x50, 0xcc},
  848. {0xbc, 0x04, 0x18, 0xcc}, {0xbc, 0x05, 0x00, 0xcc},
  849. {0xbc, 0x06, 0x00, 0xcc}, {0xbc, 0x08, 0x30, 0xcc},
  850. {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x10, 0xcc},
  851. {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
  852. {0xb3, 0x5c, 0x01, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
  853. {}
  854. };
  855. static const u8 mi1320_initQVGA_data[][4] = {
  856. {0xb3, 0x01, 0x01, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
  857. {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
  858. {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
  859. {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
  860. {0xb0, 0x16, 0x03, 0xcc}, {0xb3, 0x05, 0x01, 0xcc},
  861. {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
  862. {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x34, 0x02, 0xcc},
  863. {0xb3, 0x35, 0xc8, 0xcc}, {0xb3, 0x02, 0x00, 0xcc},
  864. {0xb3, 0x03, 0x0a, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
  865. {0xb3, 0x20, 0x00, 0xcc}, {0xb3, 0x21, 0x00, 0xcc},
  866. {0xb3, 0x22, 0x01, 0xcc}, {0xb3, 0x23, 0xe0, 0xcc},
  867. {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
  868. {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
  869. {0xb3, 0x00, 0x65, 0xcc}, {0xb8, 0x00, 0x00, 0xcc},
  870. {0xbc, 0x00, 0xd0, 0xcc}, {0xbc, 0x01, 0x01, 0xcc},
  871. {0xf0, 0x00, 0x00, 0xbb}, {0x0d, 0x00, 0x09, 0xbb},
  872. {0x00, 0x01, 0x00, 0xdd}, {0x0d, 0x00, 0x08, 0xbb},
  873. {0xf0, 0x00, 0x00, 0xbb}, {0x02, 0x00, 0x64, 0xbb},
  874. {0x05, 0x01, 0x78, 0xbb}, {0x06, 0x00, 0x11, 0xbb},
  875. {0x07, 0x01, 0x42, 0xbb}, {0x08, 0x00, 0x11, 0xbb},
  876. {0x20, 0x01, 0x00, 0xbb}, {0x21, 0x80, 0x00, 0xbb},
  877. {0x22, 0x0d, 0x0f, 0xbb}, {0x24, 0x80, 0x00, 0xbb},
  878. {0x59, 0x00, 0xff, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
  879. {0x9d, 0x3c, 0xa0, 0xbb}, {0x47, 0x30, 0x30, 0xbb},
  880. {0xf0, 0x00, 0x00, 0xbb}, {0x0a, 0x80, 0x11, 0xbb},
  881. {0x35, 0x00, 0x22, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
  882. {0x9d, 0xc5, 0x05, 0xbb}, {0xdc, 0x0f, 0xfc, 0xbb},
  883. {0xf0, 0x00, 0x01, 0xbb}, {0x06, 0x74, 0x0e, 0xbb},
  884. {0x80, 0x00, 0x06, 0xbb}, {0x81, 0x04, 0x00, 0xbb},
  885. {0x82, 0x01, 0x02, 0xbb}, {0x83, 0x03, 0x02, 0xbb},
  886. {0x84, 0x05, 0x00, 0xbb}, {0x85, 0x01, 0x00, 0xbb},
  887. {0x86, 0x03, 0x02, 0xbb}, {0x87, 0x05, 0x00, 0xbb},
  888. {0x88, 0x01, 0x00, 0xbb}, {0x89, 0x02, 0x02, 0xbb},
  889. {0x8a, 0xfd, 0x04, 0xbb}, {0x8b, 0xfc, 0xfd, 0xbb},
  890. {0x8c, 0xff, 0xfd, 0xbb}, {0x8d, 0x00, 0x00, 0xbb},
  891. {0x8e, 0xfe, 0x05, 0xbb}, {0x8f, 0xfc, 0xfd, 0xbb},
  892. {0x90, 0xfe, 0xfd, 0xbb}, {0x91, 0x00, 0x00, 0xbb},
  893. {0x92, 0xfe, 0x03, 0xbb}, {0x93, 0xfd, 0xfe, 0xbb},
  894. {0x94, 0xff, 0xfd, 0xbb}, {0x95, 0x00, 0x00, 0xbb},
  895. {0xb6, 0x07, 0x05, 0xbb}, {0xb7, 0x13, 0x06, 0xbb},
  896. {0xb8, 0x08, 0x06, 0xbb}, {0xb9, 0x14, 0x08, 0xbb},
  897. {0xba, 0x06, 0x05, 0xbb}, {0xbb, 0x13, 0x06, 0xbb},
  898. {0xbc, 0x03, 0x01, 0xbb}, {0xbd, 0x03, 0x04, 0xbb},
  899. {0xbe, 0x00, 0x02, 0xbb}, {0xbf, 0x03, 0x01, 0xbb},
  900. {0xc0, 0x02, 0x04, 0xbb}, {0xc1, 0x00, 0x04, 0xbb},
  901. {0xc2, 0x02, 0x01, 0xbb}, {0xc3, 0x01, 0x03, 0xbb},
  902. {0xc4, 0x00, 0x04, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
  903. {0xc8, 0x00, 0x00, 0xbb}, {0x2e, 0x00, 0x00, 0xbb},
  904. {0x2e, 0x0c, 0x5b, 0xbb}, {0x2f, 0xd1, 0x00, 0xbb},
  905. {0x39, 0x03, 0xca, 0xbb}, {0x3a, 0x06, 0x80, 0xbb},
  906. {0x3b, 0x01, 0x52, 0xbb}, {0x3c, 0x05, 0x40, 0xbb},
  907. {0x57, 0x01, 0x9c, 0xbb}, {0x58, 0x01, 0xee, 0xbb},
  908. {0x59, 0x00, 0xf0, 0xbb}, {0x5a, 0x01, 0x20, 0xbb},
  909. {0x5c, 0x1d, 0x17, 0xbb}, {0x5d, 0x22, 0x1c, 0xbb},
  910. {0x64, 0x1e, 0x1c, 0xbb}, {0x5b, 0x00, 0x01, 0xbb},
  911. {0xf0, 0x00, 0x02, 0xbb}, {0x36, 0x68, 0x10, 0xbb},
  912. {0x00, 0x00, 0x30, 0xdd}, {0x37, 0x81, 0x00, 0xbb},
  913. {0xbc, 0x02, 0x18, 0xcc}, {0xbc, 0x03, 0x50, 0xcc},
  914. {0xbc, 0x04, 0x18, 0xcc}, {0xbc, 0x05, 0x00, 0xcc},
  915. {0xbc, 0x06, 0x00, 0xcc}, {0xbc, 0x08, 0x30, 0xcc},
  916. {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x10, 0xcc},
  917. {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
  918. {0xbf, 0xc0, 0x26, 0xcc}, {0xbf, 0xc1, 0x02, 0xcc},
  919. {0xbf, 0xcc, 0x04, 0xcc}, {0xb3, 0x5c, 0x01, 0xcc},
  920. {0xb3, 0x01, 0x41, 0xcc},
  921. {}
  922. };
  923. static const u8 mi1320_soc_InitVGA[][4] = {
  924. {0xb3, 0x01, 0x01, 0xcc},
  925. {0xb0, 0x03, 0x19, 0xcc},
  926. {0xb0, 0x04, 0x02, 0xcc},
  927. {0x00, 0x00, 0x30, 0xdd},
  928. {0xb3, 0x00, 0x64, 0xcc},
  929. {0xb3, 0x00, 0x67, 0xcc},
  930. {0xb3, 0x05, 0x01, 0xcc},
  931. {0xb3, 0x06, 0x01, 0xcc},
  932. {0xb3, 0x08, 0x01, 0xcc},
  933. {0xb3, 0x09, 0x0c, 0xcc},
  934. {0xb3, 0x34, 0x02, 0xcc},
  935. {0xb3, 0x35, 0xc8, 0xcc}, /* i2c add: 48 */
  936. {0xb3, 0x02, 0x00, 0xcc},
  937. {0xb3, 0x03, 0x0a, 0xcc},
  938. {0xb3, 0x04, 0x05, 0xcc},
  939. {0xb3, 0x20, 0x00, 0xcc},
  940. {0xb3, 0x21, 0x00, 0xcc},
  941. {0xb3, 0x22, 0x01, 0xcc},
  942. {0xb3, 0x23, 0xe0, 0xcc},
  943. {0xb3, 0x14, 0x00, 0xcc},
  944. {0xb3, 0x15, 0x00, 0xcc},
  945. {0xb3, 0x16, 0x02, 0xcc},
  946. {0xb3, 0x17, 0x7f, 0xcc},
  947. {0xb3, 0x00, 0x67, 0xcc},
  948. {0xb8, 0x00, 0x00, 0xcc},
  949. {0xbc, 0x00, 0x71, 0xcc},
  950. {0xbc, 0x01, 0x01, 0xcc},
  951. {0xb3, 0x5c, 0x01, 0xcc},
  952. {0xf0, 0x00, 0x02, 0xbb},
  953. {0x00, 0x00, 0x10, 0xdd},
  954. {0xc8, 0x00, 0x00, 0xbb},
  955. {0x00, 0x00, 0x30, 0xdd},
  956. {0xf0, 0x00, 0x00, 0xbb},
  957. {0x00, 0x00, 0x10, 0xdd},
  958. {0x07, 0x00, 0xe0, 0xbb},
  959. {0x08, 0x00, 0x0b, 0xbb},
  960. {0x21, 0x00, 0x0c, 0xbb},
  961. {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
  962. {0xbf, 0xc0, 0x26, 0xcc},
  963. {0xbf, 0xc1, 0x02, 0xcc},
  964. {0xbf, 0xcc, 0x04, 0xcc},
  965. {0xb3, 0x01, 0x41, 0xcc},
  966. {0xf0, 0x00, 0x00, 0xbb},
  967. {0x05, 0x01, 0x78, 0xbb},
  968. {0x06, 0x00, 0x11, 0xbb},
  969. {0x07, 0x01, 0x42, 0xbb},
  970. {0x08, 0x00, 0x11, 0xbb},
  971. {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
  972. {0x21, 0x80, 0x00, 0xbb},
  973. {0x22, 0x0d, 0x0f, 0xbb},
  974. {0x24, 0x80, 0x00, 0xbb},
  975. {0x59, 0x00, 0xff, 0xbb},
  976. {0xf0, 0x00, 0x02, 0xbb},
  977. {0x39, 0x03, 0xca, 0xbb},
  978. {0x3a, 0x06, 0x80, 0xbb},
  979. {0x3b, 0x01, 0x52, 0xbb},
  980. {0x3c, 0x05, 0x40, 0xbb},
  981. {0x57, 0x01, 0x9c, 0xbb},
  982. {0x58, 0x01, 0xee, 0xbb},
  983. {0x59, 0x00, 0xf0, 0xbb},
  984. {0x5a, 0x01, 0x20, 0xbb},
  985. {0x5c, 0x1d, 0x17, 0xbb},
  986. {0x5d, 0x22, 0x1c, 0xbb},
  987. {0x64, 0x1e, 0x1c, 0xbb},
  988. {0x5b, 0x00, 0x00, 0xbb},
  989. {0xf0, 0x00, 0x02, 0xbb},
  990. {0x22, 0xa0, 0x78, 0xbb},
  991. {0x23, 0xa0, 0x78, 0xbb},
  992. {0x24, 0x7f, 0x00, 0xbb},
  993. {0x28, 0xea, 0x02, 0xbb},
  994. {0x29, 0x86, 0x7a, 0xbb},
  995. {0x5e, 0x52, 0x4c, 0xbb},
  996. {0x5f, 0x20, 0x24, 0xbb},
  997. {0x60, 0x00, 0x02, 0xbb},
  998. {0x02, 0x00, 0xee, 0xbb},
  999. {0x03, 0x39, 0x23, 0xbb},
  1000. {0x04, 0x07, 0x24, 0xbb},
  1001. {0x09, 0x00, 0xc0, 0xbb},
  1002. {0x0a, 0x00, 0x79, 0xbb},
  1003. {0x0b, 0x00, 0x04, 0xbb},
  1004. {0x0c, 0x00, 0x5c, 0xbb},
  1005. {0x0d, 0x00, 0xd9, 0xbb},
  1006. {0x0e, 0x00, 0x53, 0xbb},
  1007. {0x0f, 0x00, 0x21, 0xbb},
  1008. {0x10, 0x00, 0xa4, 0xbb},
  1009. {0x11, 0x00, 0xe5, 0xbb},
  1010. {0x15, 0x00, 0x00, 0xbb},
  1011. {0x16, 0x00, 0x00, 0xbb},
  1012. {0x17, 0x00, 0x00, 0xbb},
  1013. {0x18, 0x00, 0x00, 0xbb},
  1014. {0x19, 0x00, 0x00, 0xbb},
  1015. {0x1a, 0x00, 0x00, 0xbb},
  1016. {0x1b, 0x00, 0x00, 0xbb},
  1017. {0x1c, 0x00, 0x00, 0xbb},
  1018. {0x1d, 0x00, 0x00, 0xbb},
  1019. {0x1e, 0x00, 0x00, 0xbb},
  1020. {0xf0, 0x00, 0x01, 0xbb},
  1021. {0x06, 0xe0, 0x0e, 0xbb},
  1022. {0x06, 0x60, 0x0e, 0xbb},
  1023. {0xb3, 0x5c, 0x01, 0xcc},
  1024. {}
  1025. };
  1026. static const u8 mi1320_soc_InitQVGA[][4] = {
  1027. {0xb3, 0x01, 0x01, 0xcc},
  1028. {0xb0, 0x03, 0x19, 0xcc},
  1029. {0xb0, 0x04, 0x02, 0xcc},
  1030. {0x00, 0x00, 0x30, 0xdd},
  1031. {0xb3, 0x00, 0x64, 0xcc},
  1032. {0xb3, 0x00, 0x67, 0xcc},
  1033. {0xb3, 0x05, 0x01, 0xcc},
  1034. {0xb3, 0x06, 0x01, 0xcc},
  1035. {0xb3, 0x08, 0x01, 0xcc},
  1036. {0xb3, 0x09, 0x0c, 0xcc},
  1037. {0xb3, 0x34, 0x02, 0xcc},
  1038. {0xb3, 0x35, 0xc8, 0xcc},
  1039. {0xb3, 0x02, 0x00, 0xcc},
  1040. {0xb3, 0x03, 0x0a, 0xcc},
  1041. {0xb3, 0x04, 0x05, 0xcc},
  1042. {0xb3, 0x20, 0x00, 0xcc},
  1043. {0xb3, 0x21, 0x00, 0xcc},
  1044. {0xb3, 0x22, 0x01, 0xcc},
  1045. {0xb3, 0x23, 0xe0, 0xcc},
  1046. {0xb3, 0x14, 0x00, 0xcc},
  1047. {0xb3, 0x15, 0x00, 0xcc},
  1048. {0xb3, 0x16, 0x02, 0xcc},
  1049. {0xb3, 0x17, 0x7f, 0xcc},
  1050. {0xb3, 0x00, 0x67, 0xcc},
  1051. {0xb8, 0x00, 0x00, 0xcc},
  1052. {0xbc, 0x00, 0xd1, 0xcc},
  1053. {0xbc, 0x01, 0x01, 0xcc},
  1054. {0xb3, 0x5c, 0x01, 0xcc},
  1055. {0xf0, 0x00, 0x02, 0xbb},
  1056. {0x00, 0x00, 0x10, 0xdd},
  1057. {0xc8, 0x00, 0x00, 0xbb},
  1058. {0x00, 0x00, 0x30, 0xdd},
  1059. {0xf0, 0x00, 0x00, 0xbb},
  1060. {0x00, 0x00, 0x10, 0xdd},
  1061. {0x07, 0x00, 0xe0, 0xbb},
  1062. {0x08, 0x00, 0x0b, 0xbb},
  1063. {0x21, 0x00, 0x0c, 0xbb},
  1064. {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
  1065. {0xbf, 0xc0, 0x26, 0xcc},
  1066. {0xbf, 0xc1, 0x02, 0xcc},
  1067. {0xbf, 0xcc, 0x04, 0xcc},
  1068. {0xbc, 0x02, 0x18, 0xcc},
  1069. {0xbc, 0x03, 0x50, 0xcc},
  1070. {0xbc, 0x04, 0x18, 0xcc},
  1071. {0xbc, 0x05, 0x00, 0xcc},
  1072. {0xbc, 0x06, 0x00, 0xcc},
  1073. {0xbc, 0x08, 0x30, 0xcc},
  1074. {0xbc, 0x09, 0x40, 0xcc},
  1075. {0xbc, 0x0a, 0x10, 0xcc},
  1076. {0xbc, 0x0b, 0x00, 0xcc},
  1077. {0xbc, 0x0c, 0x00, 0xcc},
  1078. {0xb3, 0x01, 0x41, 0xcc},
  1079. {0xf0, 0x00, 0x00, 0xbb},
  1080. {0x05, 0x01, 0x78, 0xbb},
  1081. {0x06, 0x00, 0x11, 0xbb},
  1082. {0x07, 0x01, 0x42, 0xbb},
  1083. {0x08, 0x00, 0x11, 0xbb},
  1084. {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
  1085. {0x21, 0x80, 0x00, 0xbb},
  1086. {0x22, 0x0d, 0x0f, 0xbb},
  1087. {0x24, 0x80, 0x00, 0xbb},
  1088. {0x59, 0x00, 0xff, 0xbb},
  1089. {0xf0, 0x00, 0x02, 0xbb},
  1090. {0x39, 0x03, 0xca, 0xbb},
  1091. {0x3a, 0x06, 0x80, 0xbb},
  1092. {0x3b, 0x01, 0x52, 0xbb},
  1093. {0x3c, 0x05, 0x40, 0xbb},
  1094. {0x57, 0x01, 0x9c, 0xbb},
  1095. {0x58, 0x01, 0xee, 0xbb},
  1096. {0x59, 0x00, 0xf0, 0xbb},
  1097. {0x5a, 0x01, 0x20, 0xbb},
  1098. {0x5c, 0x1d, 0x17, 0xbb},
  1099. {0x5d, 0x22, 0x1c, 0xbb},
  1100. {0x64, 0x1e, 0x1c, 0xbb},
  1101. {0x5b, 0x00, 0x00, 0xbb},
  1102. {0xf0, 0x00, 0x02, 0xbb},
  1103. {0x22, 0xa0, 0x78, 0xbb},
  1104. {0x23, 0xa0, 0x78, 0xbb},
  1105. {0x24, 0x7f, 0x00, 0xbb},
  1106. {0x28, 0xea, 0x02, 0xbb},
  1107. {0x29, 0x86, 0x7a, 0xbb},
  1108. {0x5e, 0x52, 0x4c, 0xbb},
  1109. {0x5f, 0x20, 0x24, 0xbb},
  1110. {0x60, 0x00, 0x02, 0xbb},
  1111. {0x02, 0x00, 0xee, 0xbb},
  1112. {0x03, 0x39, 0x23, 0xbb},
  1113. {0x04, 0x07, 0x24, 0xbb},
  1114. {0x09, 0x00, 0xc0, 0xbb},
  1115. {0x0a, 0x00, 0x79, 0xbb},
  1116. {0x0b, 0x00, 0x04, 0xbb},
  1117. {0x0c, 0x00, 0x5c, 0xbb},
  1118. {0x0d, 0x00, 0xd9, 0xbb},
  1119. {0x0e, 0x00, 0x53, 0xbb},
  1120. {0x0f, 0x00, 0x21, 0xbb},
  1121. {0x10, 0x00, 0xa4, 0xbb},
  1122. {0x11, 0x00, 0xe5, 0xbb},
  1123. {0x15, 0x00, 0x00, 0xbb},
  1124. {0x16, 0x00, 0x00, 0xbb},
  1125. {0x17, 0x00, 0x00, 0xbb},
  1126. {0x18, 0x00, 0x00, 0xbb},
  1127. {0x19, 0x00, 0x00, 0xbb},
  1128. {0x1a, 0x00, 0x00, 0xbb},
  1129. {0x1b, 0x00, 0x00, 0xbb},
  1130. {0x1c, 0x00, 0x00, 0xbb},
  1131. {0x1d, 0x00, 0x00, 0xbb},
  1132. {0x1e, 0x00, 0x00, 0xbb},
  1133. {0xf0, 0x00, 0x01, 0xbb},
  1134. {0x06, 0xe0, 0x0e, 0xbb},
  1135. {0x06, 0x60, 0x0e, 0xbb},
  1136. {0xb3, 0x5c, 0x01, 0xcc},
  1137. {}
  1138. };
  1139. static const u8 mi1320_soc_InitSXGA[][4] = {
  1140. {0xb3, 0x01, 0x01, 0xcc},
  1141. {0xb0, 0x03, 0x19, 0xcc},
  1142. {0x00, 0x00, 0x30, 0xdd},
  1143. {0xb3, 0x00, 0x64, 0xcc},
  1144. {0xb3, 0x00, 0x67, 0xcc},
  1145. {0xb3, 0x05, 0x01, 0xcc},
  1146. {0xb3, 0x06, 0x01, 0xcc},
  1147. {0xb3, 0x08, 0x01, 0xcc},
  1148. {0xb3, 0x09, 0x0c, 0xcc},
  1149. {0xb3, 0x34, 0x02, 0xcc},
  1150. {0xb3, 0x35, 0xc8, 0xcc},
  1151. {0xb3, 0x02, 0x00, 0xcc},
  1152. {0xb3, 0x03, 0x0a, 0xcc},
  1153. {0xb3, 0x04, 0x05, 0xcc},
  1154. {0xb3, 0x20, 0x00, 0xcc},
  1155. {0xb3, 0x21, 0x00, 0xcc},
  1156. {0xb3, 0x22, 0x04, 0xcc},
  1157. {0xb3, 0x23, 0x00, 0xcc},
  1158. {0xb3, 0x14, 0x00, 0xcc},
  1159. {0xb3, 0x15, 0x00, 0xcc},
  1160. {0xb3, 0x16, 0x04, 0xcc},
  1161. {0xb3, 0x17, 0xff, 0xcc},
  1162. {0xb3, 0x00, 0x67, 0xcc},
  1163. {0xbc, 0x00, 0x71, 0xcc},
  1164. {0xbc, 0x01, 0x01, 0xcc},
  1165. {0xb3, 0x5c, 0x01, 0xcc},
  1166. {0xf0, 0x00, 0x02, 0xbb},
  1167. {0x00, 0x00, 0x30, 0xdd},
  1168. {0xc8, 0x9f, 0x0b, 0xbb},
  1169. {0x00, 0x00, 0x20, 0xdd},
  1170. {0x5b, 0x00, 0x01, 0xbb},
  1171. {0x00, 0x00, 0x20, 0xdd},
  1172. {0xf0, 0x00, 0x00, 0xbb},
  1173. {0x00, 0x00, 0x30, 0xdd},
  1174. {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
  1175. {0x00, 0x00, 0x20, 0xdd},
  1176. {0xbf, 0xc0, 0x26, 0xcc},
  1177. {0xbf, 0xc1, 0x02, 0xcc},
  1178. {0xbf, 0xcc, 0x04, 0xcc},
  1179. {0xb3, 0x01, 0x41, 0xcc},
  1180. {0xf0, 0x00, 0x00, 0xbb},
  1181. {0x05, 0x01, 0x78, 0xbb},
  1182. {0x06, 0x00, 0x11, 0xbb},
  1183. {0x07, 0x01, 0x42, 0xbb},
  1184. {0x08, 0x00, 0x11, 0xbb},
  1185. {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
  1186. {0x21, 0x80, 0x00, 0xbb},
  1187. {0x22, 0x0d, 0x0f, 0xbb},
  1188. {0x24, 0x80, 0x00, 0xbb},
  1189. {0x59, 0x00, 0xff, 0xbb},
  1190. {0xf0, 0x00, 0x02, 0xbb},
  1191. {0x39, 0x03, 0xca, 0xbb},
  1192. {0x3a, 0x06, 0x80, 0xbb},
  1193. {0x3b, 0x01, 0x52, 0xbb},
  1194. {0x3c, 0x05, 0x40, 0xbb},
  1195. {0x57, 0x01, 0x9c, 0xbb},
  1196. {0x58, 0x01, 0xee, 0xbb},
  1197. {0x59, 0x00, 0xf0, 0xbb},
  1198. {0x5a, 0x01, 0x20, 0xbb},
  1199. {0x5c, 0x1d, 0x17, 0xbb},
  1200. {0x5d, 0x22, 0x1c, 0xbb},
  1201. {0x64, 0x1e, 0x1c, 0xbb},
  1202. {0x5b, 0x00, 0x00, 0xbb},
  1203. {0xf0, 0x00, 0x02, 0xbb},
  1204. {0x22, 0xa0, 0x78, 0xbb},
  1205. {0x23, 0xa0, 0x78, 0xbb},
  1206. {0x24, 0x7f, 0x00, 0xbb},
  1207. {0x28, 0xea, 0x02, 0xbb},
  1208. {0x29, 0x86, 0x7a, 0xbb},
  1209. {0x5e, 0x52, 0x4c, 0xbb},
  1210. {0x5f, 0x20, 0x24, 0xbb},
  1211. {0x60, 0x00, 0x02, 0xbb},
  1212. {0x02, 0x00, 0xee, 0xbb},
  1213. {0x03, 0x39, 0x23, 0xbb},
  1214. {0x04, 0x07, 0x24, 0xbb},
  1215. {0x09, 0x00, 0xc0, 0xbb},
  1216. {0x0a, 0x00, 0x79, 0xbb},
  1217. {0x0b, 0x00, 0x04, 0xbb},
  1218. {0x0c, 0x00, 0x5c, 0xbb},
  1219. {0x0d, 0x00, 0xd9, 0xbb},
  1220. {0x0e, 0x00, 0x53, 0xbb},
  1221. {0x0f, 0x00, 0x21, 0xbb},
  1222. {0x10, 0x00, 0xa4, 0xbb},
  1223. {0x11, 0x00, 0xe5, 0xbb},
  1224. {0x15, 0x00, 0x00, 0xbb},
  1225. {0x16, 0x00, 0x00, 0xbb},
  1226. {0x17, 0x00, 0x00, 0xbb},
  1227. {0x18, 0x00, 0x00, 0xbb},
  1228. {0x19, 0x00, 0x00, 0xbb},
  1229. {0x1a, 0x00, 0x00, 0xbb},
  1230. {0x1b, 0x00, 0x00, 0xbb},
  1231. {0x1c, 0x00, 0x00, 0xbb},
  1232. {0x1d, 0x00, 0x00, 0xbb},
  1233. {0x1e, 0x00, 0x00, 0xbb},
  1234. {0xf0, 0x00, 0x01, 0xbb},
  1235. {0x06, 0xe0, 0x0e, 0xbb},
  1236. {0x06, 0x60, 0x0e, 0xbb},
  1237. {0xb3, 0x5c, 0x01, 0xcc},
  1238. {0xf0, 0x00, 0x00, 0xbb},
  1239. {0x05, 0x01, 0x13, 0xbb},
  1240. {0x06, 0x00, 0x11, 0xbb},
  1241. {0x07, 0x00, 0x85, 0xbb},
  1242. {0x08, 0x00, 0x27, 0xbb},
  1243. {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
  1244. {0x21, 0x80, 0x00, 0xbb},
  1245. {0x22, 0x0d, 0x0f, 0xbb},
  1246. {0x24, 0x80, 0x00, 0xbb},
  1247. {0x59, 0x00, 0xff, 0xbb},
  1248. {0xf0, 0x00, 0x02, 0xbb},
  1249. {0x39, 0x03, 0x0d, 0xbb},
  1250. {0x3a, 0x06, 0x1b, 0xbb},
  1251. {0x3b, 0x00, 0x95, 0xbb},
  1252. {0x3c, 0x04, 0xdb, 0xbb},
  1253. {0x57, 0x02, 0x00, 0xbb},
  1254. {0x58, 0x02, 0x66, 0xbb},
  1255. {0x59, 0x00, 0xff, 0xbb},
  1256. {0x5a, 0x01, 0x33, 0xbb},
  1257. {0x5c, 0x12, 0x0d, 0xbb},
  1258. {0x5d, 0x16, 0x11, 0xbb},
  1259. {0x64, 0x5e, 0x1c, 0xbb},
  1260. {}
  1261. };
  1262. static const u8 po3130_gamma[17] = {
  1263. 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
  1264. 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
  1265. };
  1266. static const u8 po3130_matrix[9] = {
  1267. 0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63
  1268. };
  1269. static const u8 po3130_initVGA_data[][4] = {
  1270. {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
  1271. {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc},
  1272. {0xb3, 0x00, 0x04, 0xcc}, {0xb3, 0x00, 0x24, 0xcc},
  1273. {0xb3, 0x00, 0x25, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
  1274. {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
  1275. {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x03, 0x1a, 0xcc},
  1276. {0xb3, 0x04, 0x15, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
  1277. {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
  1278. {0xb3, 0x23, 0xe8, 0xcc}, {0xb8, 0x08, 0xe8, 0xcc},
  1279. {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
  1280. {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
  1281. {0xb3, 0x34, 0x01, 0xcc},
  1282. {0xb3, 0x35, 0xf6, 0xcc}, /* i2c add: 76 */
  1283. {0xb3, 0x00, 0x27, 0xcc}, {0xbc, 0x00, 0x71, 0xcc},
  1284. {0xb8, 0x00, 0x21, 0xcc}, {0xb8, 0x27, 0x20, 0xcc},
  1285. {0xb8, 0x01, 0x79, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
  1286. {0xb8, 0x2c, 0x50, 0xcc}, {0xb8, 0x2d, 0xf8, 0xcc},
  1287. {0xb8, 0x2e, 0xf8, 0xcc}, {0xb8, 0x2f, 0xf8, 0xcc},
  1288. {0xb8, 0x30, 0x50, 0xcc}, {0xb8, 0x31, 0xf8, 0xcc},
  1289. {0xb8, 0x32, 0xf8, 0xcc}, {0xb8, 0x33, 0xf8, 0xcc},
  1290. {0xb8, 0x34, 0x50, 0xcc}, {0xb8, 0x35, 0x00, 0xcc},
  1291. {0xb8, 0x36, 0x00, 0xcc}, {0xb8, 0x37, 0x00, 0xcc},
  1292. {0x00, 0x1e, 0xc6, 0xaa}, {0x00, 0x20, 0x44, 0xaa},
  1293. {0x00, 0xad, 0x02, 0xaa}, {0x00, 0xae, 0x2c, 0xaa},
  1294. {0x00, 0x12, 0x08, 0xaa}, {0x00, 0x17, 0x41, 0xaa},
  1295. {0x00, 0x19, 0x41, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
  1296. {0x00, 0x21, 0x00, 0xaa}, {0x00, 0x36, 0xc0, 0xaa},
  1297. {0x00, 0x37, 0xc8, 0xaa}, {0x00, 0x3b, 0x36, 0xaa},
  1298. {0x00, 0x4b, 0xfe, 0xaa}, {0x00, 0x51, 0x1c, 0xaa},
  1299. {0x00, 0x52, 0x01, 0xaa}, {0x00, 0x55, 0x0a, 0xaa},
  1300. {0x00, 0x59, 0x02, 0xaa}, {0x00, 0x5a, 0x04, 0xaa},
  1301. {0x00, 0x5c, 0x10, 0xaa}, {0x00, 0x5d, 0x10, 0xaa},
  1302. {0x00, 0x5e, 0x10, 0xaa}, {0x00, 0x5f, 0x10, 0xaa},
  1303. {0x00, 0x61, 0x00, 0xaa}, {0x00, 0x62, 0x18, 0xaa},
  1304. {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x70, 0x68, 0xaa},
  1305. {0x00, 0x80, 0x71, 0xaa}, {0x00, 0x81, 0x08, 0xaa},
  1306. {0x00, 0x82, 0x00, 0xaa}, {0x00, 0x83, 0x55, 0xaa},
  1307. {0x00, 0x84, 0x06, 0xaa}, {0x00, 0x85, 0x06, 0xaa},
  1308. {0x00, 0x86, 0x13, 0xaa}, {0x00, 0x87, 0x18, 0xaa},
  1309. {0x00, 0xaa, 0x3f, 0xaa}, {0x00, 0xab, 0x44, 0xaa},
  1310. {0x00, 0xb0, 0x68, 0xaa}, {0x00, 0xb5, 0x10, 0xaa},
  1311. {0x00, 0xb8, 0x20, 0xaa}, {0x00, 0xb9, 0xa0, 0xaa},
  1312. {0x00, 0xbc, 0x04, 0xaa}, {0x00, 0x8b, 0x40, 0xaa},
  1313. {0x00, 0x8c, 0x91, 0xaa}, {0x00, 0x8d, 0x8f, 0xaa},
  1314. {0x00, 0x8e, 0x91, 0xaa}, {0x00, 0x8f, 0x43, 0xaa},
  1315. {0x00, 0x90, 0x92, 0xaa}, {0x00, 0x91, 0x89, 0xaa},
  1316. {0x00, 0x92, 0x9d, 0xaa}, {0x00, 0x93, 0x46, 0xaa},
  1317. {0x00, 0xd6, 0x22, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
  1318. {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
  1319. {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
  1320. {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
  1321. {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
  1322. {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
  1323. {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0xd6, 0x62, 0xaa},
  1324. {0x00, 0x73, 0x00, 0xaa}, {0x00, 0x74, 0x10, 0xaa},
  1325. {0x00, 0x75, 0x20, 0xaa}, {0x00, 0x76, 0x2b, 0xaa},
  1326. {0x00, 0x77, 0x36, 0xaa}, {0x00, 0x78, 0x49, 0xaa},
  1327. {0x00, 0x79, 0x5a, 0xaa}, {0x00, 0x7a, 0x7f, 0xaa},
  1328. {0x00, 0x7b, 0x9b, 0xaa}, {0x00, 0x7c, 0xba, 0xaa},
  1329. {0x00, 0x7d, 0xd4, 0xaa}, {0x00, 0x7e, 0xea, 0xaa},
  1330. {0x00, 0xd6, 0xa2, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
  1331. {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
  1332. {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
  1333. {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
  1334. {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
  1335. {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
  1336. {0x00, 0x7e, 0xea, 0xaa},
  1337. {0x00, 0x4c, 0x07, 0xaa},
  1338. {0x00, 0x4b, 0xe0, 0xaa}, {0x00, 0x4e, 0x77, 0xaa},
  1339. {0x00, 0x59, 0x02, 0xaa}, {0x00, 0x4d, 0x0a, 0xaa},
  1340. /* {0x00, 0xd1, 0x00, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
  1341. {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc}, */
  1342. {0x00, 0xd1, 0x3c, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
  1343. {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
  1344. {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
  1345. {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
  1346. {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
  1347. {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
  1348. {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
  1349. {0xb9, 0x08, 0x3c, 0xcc}, {0x00, 0x05, 0x00, 0xaa},
  1350. {0xb3, 0x5c, 0x00, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
  1351. {}
  1352. };
  1353. static const u8 po3130_rundata[][4] = {
  1354. {0x00, 0x47, 0x45, 0xaa}, {0x00, 0x48, 0x9b, 0xaa},
  1355. {0x00, 0x49, 0x3a, 0xaa}, {0x00, 0x4a, 0x01, 0xaa},
  1356. {0x00, 0x44, 0x40, 0xaa},
  1357. /* {0x00, 0xd5, 0x7c, 0xaa}, */
  1358. {0x00, 0xad, 0x04, 0xaa}, {0x00, 0xae, 0x00, 0xaa},
  1359. {0x00, 0xb0, 0x78, 0xaa}, {0x00, 0x98, 0x02, 0xaa},
  1360. {0x00, 0x94, 0x25, 0xaa}, {0x00, 0x95, 0x25, 0xaa},
  1361. {0x00, 0x59, 0x68, 0xaa}, {0x00, 0x44, 0x20, 0xaa},
  1362. {0x00, 0x17, 0x50, 0xaa}, {0x00, 0x19, 0x50, 0xaa},
  1363. {0x00, 0xd1, 0x3c, 0xaa}, {0x00, 0xd1, 0x3c, 0xaa},
  1364. {0x00, 0x1e, 0x06, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
  1365. {}
  1366. };
  1367. static const u8 po3130_initQVGA_data[][4] = {
  1368. {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
  1369. {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x09, 0xcc},
  1370. {0xb3, 0x00, 0x04, 0xcc}, {0xb3, 0x00, 0x24, 0xcc},
  1371. {0xb3, 0x00, 0x25, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
  1372. {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
  1373. {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x03, 0x1a, 0xcc},
  1374. {0xb3, 0x04, 0x15, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
  1375. {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
  1376. {0xb3, 0x23, 0xe0, 0xcc}, {0xb8, 0x08, 0xe0, 0xcc},
  1377. {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
  1378. {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
  1379. {0xb3, 0x34, 0x01, 0xcc}, {0xb3, 0x35, 0xf6, 0xcc},
  1380. {0xb3, 0x00, 0x27, 0xcc}, {0xbc, 0x00, 0xd1, 0xcc},
  1381. {0xb8, 0x00, 0x21, 0xcc}, {0xb8, 0x27, 0x20, 0xcc},
  1382. {0xb8, 0x01, 0x79, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
  1383. {0xb8, 0x2c, 0x50, 0xcc}, {0xb8, 0x2d, 0xf8, 0xcc},
  1384. {0xb8, 0x2e, 0xf8, 0xcc}, {0xb8, 0x2f, 0xf8, 0xcc},
  1385. {0xb8, 0x30, 0x50, 0xcc}, {0xb8, 0x31, 0xf8, 0xcc},
  1386. {0xb8, 0x32, 0xf8, 0xcc}, {0xb8, 0x33, 0xf8, 0xcc},
  1387. {0xb8, 0x34, 0x50, 0xcc}, {0xb8, 0x35, 0x00, 0xcc},
  1388. {0xb8, 0x36, 0x00, 0xcc}, {0xb8, 0x37, 0x00, 0xcc},
  1389. {0x00, 0x1e, 0xc6, 0xaa}, {0x00, 0x20, 0x44, 0xaa},
  1390. {0x00, 0xad, 0x02, 0xaa}, {0x00, 0xae, 0x2c, 0xaa},
  1391. {0x00, 0x12, 0x08, 0xaa}, {0x00, 0x17, 0x41, 0xaa},
  1392. {0x00, 0x19, 0x41, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
  1393. {0x00, 0x21, 0x00, 0xaa}, {0x00, 0x36, 0xc0, 0xaa},
  1394. {0x00, 0x37, 0xc8, 0xaa}, {0x00, 0x3b, 0x36, 0xaa},
  1395. {0x00, 0x4b, 0xfe, 0xaa}, {0x00, 0x51, 0x1c, 0xaa},
  1396. {0x00, 0x52, 0x01, 0xaa}, {0x00, 0x55, 0x0a, 0xaa},
  1397. {0x00, 0x59, 0x6f, 0xaa}, {0x00, 0x5a, 0x04, 0xaa},
  1398. {0x00, 0x5c, 0x10, 0xaa}, {0x00, 0x5d, 0x10, 0xaa},
  1399. {0x00, 0x5e, 0x10, 0xaa}, {0x00, 0x5f, 0x10, 0xaa},
  1400. {0x00, 0x61, 0x00, 0xaa}, {0x00, 0x62, 0x18, 0xaa},
  1401. {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x70, 0x68, 0xaa},
  1402. {0x00, 0x80, 0x71, 0xaa}, {0x00, 0x81, 0x08, 0xaa},
  1403. {0x00, 0x82, 0x00, 0xaa}, {0x00, 0x83, 0x55, 0xaa},
  1404. {0x00, 0x84, 0x06, 0xaa}, {0x00, 0x85, 0x06, 0xaa},
  1405. {0x00, 0x86, 0x13, 0xaa}, {0x00, 0x87, 0x18, 0xaa},
  1406. {0x00, 0xaa, 0x3f, 0xaa}, {0x00, 0xab, 0x44, 0xaa},
  1407. {0x00, 0xb0, 0x68, 0xaa}, {0x00, 0xb5, 0x10, 0xaa},
  1408. {0x00, 0xb8, 0x20, 0xaa}, {0x00, 0xb9, 0xa0, 0xaa},
  1409. {0x00, 0xbc, 0x04, 0xaa}, {0x00, 0x8b, 0x40, 0xaa},
  1410. {0x00, 0x8c, 0x91, 0xaa}, {0x00, 0x8d, 0x8f, 0xaa},
  1411. {0x00, 0x8e, 0x91, 0xaa}, {0x00, 0x8f, 0x43, 0xaa},
  1412. {0x00, 0x90, 0x92, 0xaa}, {0x00, 0x91, 0x89, 0xaa},
  1413. {0x00, 0x92, 0x9d, 0xaa}, {0x00, 0x93, 0x46, 0xaa},
  1414. {0x00, 0xd6, 0x22, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
  1415. {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
  1416. {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
  1417. {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
  1418. {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
  1419. {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
  1420. {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0xd6, 0x62, 0xaa},
  1421. {0x00, 0x73, 0x00, 0xaa}, {0x00, 0x74, 0x10, 0xaa},
  1422. {0x00, 0x75, 0x20, 0xaa}, {0x00, 0x76, 0x2b, 0xaa},
  1423. {0x00, 0x77, 0x36, 0xaa}, {0x00, 0x78, 0x49, 0xaa},
  1424. {0x00, 0x79, 0x5a, 0xaa}, {0x00, 0x7a, 0x7f, 0xaa},
  1425. {0x00, 0x7b, 0x9b, 0xaa}, {0x00, 0x7c, 0xba, 0xaa},
  1426. {0x00, 0x7d, 0xd4, 0xaa}, {0x00, 0x7e, 0xea, 0xaa},
  1427. {0x00, 0xd6, 0xa2, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
  1428. {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
  1429. {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
  1430. {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
  1431. {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
  1432. {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
  1433. {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0x4c, 0x07, 0xaa},
  1434. {0x00, 0x4b, 0xe0, 0xaa}, {0x00, 0x4e, 0x77, 0xaa},
  1435. {0x00, 0x59, 0x66, 0xaa}, {0x00, 0x4d, 0x0a, 0xaa},
  1436. {0x00, 0xd1, 0x00, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
  1437. {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
  1438. {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
  1439. {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
  1440. {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
  1441. {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
  1442. {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
  1443. {0xb9, 0x08, 0x3c, 0xcc}, {0xbc, 0x02, 0x18, 0xcc},
  1444. {0xbc, 0x03, 0x50, 0xcc}, {0xbc, 0x04, 0x18, 0xcc},
  1445. {0xbc, 0x05, 0x00, 0xcc}, {0xbc, 0x06, 0x00, 0xcc},
  1446. {0xbc, 0x08, 0x30, 0xcc}, {0xbc, 0x09, 0x40, 0xcc},
  1447. {0xbc, 0x0a, 0x10, 0xcc}, {0xbc, 0x0b, 0x00, 0xcc},
  1448. {0xbc, 0x0c, 0x00, 0xcc}, {0x00, 0x05, 0x00, 0xaa},
  1449. {0xb3, 0x5c, 0x00, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
  1450. {}
  1451. };
  1452. static const u8 hv7131r_gamma[17] = {
  1453. 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
  1454. 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
  1455. };
  1456. static const u8 hv7131r_matrix[9] = {
  1457. 0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63
  1458. };
  1459. static const u8 hv7131r_initVGA_data[][4] = {
  1460. {0xb3, 0x01, 0x01, 0xcc},
  1461. {0xb0, 0x03, 0x19, 0xcc},
  1462. {0xb0, 0x04, 0x02, 0xcc},
  1463. {0x00, 0x00, 0x20, 0xdd},
  1464. {0xb3, 0x00, 0x24, 0xcc},
  1465. {0xb3, 0x00, 0x25, 0xcc},
  1466. {0xb3, 0x08, 0x01, 0xcc},
  1467. {0xb3, 0x09, 0x0c, 0xcc},
  1468. {0xb3, 0x05, 0x01, 0xcc},
  1469. {0xb3, 0x06, 0x03, 0xcc},
  1470. {0xb3, 0x01, 0x45, 0xcc},
  1471. {0xb3, 0x03, 0x0b, 0xcc},
  1472. {0xb3, 0x04, 0x05, 0xcc},
  1473. {0xb3, 0x20, 0x00, 0xcc},
  1474. {0xb3, 0x21, 0x00, 0xcc},
  1475. {0xb3, 0x22, 0x01, 0xcc},
  1476. {0xb3, 0x23, 0xe0, 0xcc},
  1477. {0xb3, 0x14, 0x00, 0xcc},
  1478. {0xb3, 0x15, 0x02, 0xcc},
  1479. {0xb3, 0x16, 0x02, 0xcc},
  1480. {0xb3, 0x17, 0x7f, 0xcc},
  1481. {0xb3, 0x34, 0x01, 0xcc},
  1482. {0xb3, 0x35, 0x91, 0xcc}, /* i2c add: 11 */
  1483. {0xb3, 0x00, 0x27, 0xcc},
  1484. {0xbc, 0x00, 0x73, 0xcc},
  1485. {0xb8, 0x00, 0x23, 0xcc},
  1486. {0xb8, 0x2c, 0x50, 0xcc},
  1487. {0xb8, 0x2d, 0xf8, 0xcc},
  1488. {0xb8, 0x2e, 0xf8, 0xcc},
  1489. {0xb8, 0x2f, 0xf8, 0xcc},
  1490. {0xb8, 0x30, 0x50, 0xcc},
  1491. {0xb8, 0x31, 0xf8, 0xcc},
  1492. {0xb8, 0x32, 0xf8, 0xcc},
  1493. {0xb8, 0x33, 0xf8, 0xcc},
  1494. {0xb8, 0x34, 0x58, 0xcc},
  1495. {0xb8, 0x35, 0x00, 0xcc},
  1496. {0xb8, 0x36, 0x00, 0xcc},
  1497. {0xb8, 0x37, 0x00, 0xcc},
  1498. {0xb8, 0x27, 0x20, 0xcc},
  1499. {0xb8, 0x01, 0x7d, 0xcc},
  1500. {0xb8, 0x81, 0x09, 0xcc},
  1501. {0xb3, 0x01, 0x41, 0xcc},
  1502. {0xb8, 0x8e, 0x00, 0xcc},
  1503. {0xb8, 0x8f, 0xff, 0xcc},
  1504. {0x00, 0x01, 0x0c, 0xaa},
  1505. {0x00, 0x14, 0x01, 0xaa},
  1506. {0x00, 0x15, 0xe6, 0xaa},
  1507. {0x00, 0x16, 0x02, 0xaa},
  1508. {0x00, 0x17, 0x86, 0xaa},
  1509. {0x00, 0x23, 0x00, 0xaa},
  1510. {0x00, 0x25, 0x03, 0xaa},
  1511. {0x00, 0x26, 0xa9, 0xaa},
  1512. {0x00, 0x27, 0x80, 0xaa},
  1513. {0x00, 0x30, 0x18, 0xaa},
  1514. {0xb6, 0x00, 0x00, 0xcc},
  1515. {0xb6, 0x03, 0x02, 0xcc},
  1516. {0xb6, 0x02, 0x80, 0xcc},
  1517. {0xb6, 0x05, 0x01, 0xcc},
  1518. {0xb6, 0x04, 0xe0, 0xcc},
  1519. {0xb6, 0x12, 0x78, 0xcc},
  1520. {0xb6, 0x18, 0x02, 0xcc},
  1521. {0xb6, 0x17, 0x58, 0xcc},
  1522. {0xb6, 0x16, 0x00, 0xcc},
  1523. {0xb6, 0x22, 0x12, 0xcc},
  1524. {0xb6, 0x23, 0x0b, 0xcc},
  1525. {0xb3, 0x02, 0x02, 0xcc},
  1526. {0xbf, 0xc0, 0x39, 0xcc},
  1527. {0xbf, 0xc1, 0x04, 0xcc},
  1528. {0xbf, 0xcc, 0x10, 0xcc},
  1529. {0xb6, 0x12, 0xf8, 0xcc},
  1530. {0xb6, 0x13, 0x13, 0xcc},
  1531. {0xb9, 0x12, 0x00, 0xcc},
  1532. {0xb9, 0x13, 0x0a, 0xcc},
  1533. {0xb9, 0x14, 0x0a, 0xcc},
  1534. {0xb9, 0x15, 0x0a, 0xcc},
  1535. {0xb9, 0x16, 0x0a, 0xcc},
  1536. {0xb8, 0x0c, 0x20, 0xcc},
  1537. {0xb8, 0x0d, 0x70, 0xcc},
  1538. {0xb9, 0x18, 0x00, 0xcc},
  1539. {0xb9, 0x19, 0x0f, 0xcc},
  1540. {0xb9, 0x1a, 0x0f, 0xcc},
  1541. {0xb9, 0x1b, 0x0f, 0xcc},
  1542. {0xb9, 0x1c, 0x0f, 0xcc},
  1543. {0xb3, 0x5c, 0x01, 0xcc},
  1544. {}
  1545. };
  1546. static const u8 hv7131r_initQVGA_data[][4] = {
  1547. {0xb3, 0x01, 0x01, 0xcc},
  1548. {0xb0, 0x03, 0x19, 0xcc},
  1549. {0xb0, 0x04, 0x02, 0xcc},
  1550. {0x00, 0x00, 0x20, 0xdd},
  1551. {0xb3, 0x00, 0x24, 0xcc},
  1552. {0xb3, 0x00, 0x25, 0xcc},
  1553. {0xb3, 0x08, 0x01, 0xcc},
  1554. {0xb3, 0x09, 0x0c, 0xcc},
  1555. {0xb3, 0x05, 0x01, 0xcc},
  1556. {0xb3, 0x06, 0x03, 0xcc},
  1557. {0xb3, 0x01, 0x45, 0xcc},
  1558. {0xb3, 0x03, 0x0b, 0xcc},
  1559. {0xb3, 0x04, 0x05, 0xcc},
  1560. {0xb3, 0x20, 0x00, 0xcc},
  1561. {0xb3, 0x21, 0x00, 0xcc},
  1562. {0xb3, 0x22, 0x01, 0xcc},
  1563. {0xb3, 0x23, 0xe0, 0xcc},
  1564. {0xb3, 0x14, 0x00, 0xcc},
  1565. {0xb3, 0x15, 0x02, 0xcc},
  1566. {0xb3, 0x16, 0x02, 0xcc},
  1567. {0xb3, 0x17, 0x7f, 0xcc},
  1568. {0xb3, 0x34, 0x01, 0xcc},
  1569. {0xb3, 0x35, 0x91, 0xcc},
  1570. {0xb3, 0x00, 0x27, 0xcc},
  1571. {0xbc, 0x00, 0xd3, 0xcc},
  1572. {0xb8, 0x00, 0x23, 0xcc},
  1573. {0xb8, 0x2c, 0x50, 0xcc},
  1574. {0xb8, 0x2d, 0xf8, 0xcc},
  1575. {0xb8, 0x2e, 0xf8, 0xcc},
  1576. {0xb8, 0x2f, 0xf8, 0xcc},
  1577. {0xb8, 0x30, 0x50, 0xcc},
  1578. {0xb8, 0x31, 0xf8, 0xcc},
  1579. {0xb8, 0x32, 0xf8, 0xcc},
  1580. {0xb8, 0x33, 0xf8, 0xcc},
  1581. {0xb8, 0x34, 0x58, 0xcc},
  1582. {0xb8, 0x35, 0x00, 0xcc},
  1583. {0xb8, 0x36, 0x00, 0xcc},
  1584. {0xb8, 0x37, 0x00, 0xcc},
  1585. {0xb8, 0x27, 0x20, 0xcc},
  1586. {0xb8, 0x01, 0x7d, 0xcc},
  1587. {0xb8, 0x81, 0x09, 0xcc},
  1588. {0xb3, 0x01, 0x41, 0xcc},
  1589. {0xb8, 0x8e, 0x00, 0xcc},
  1590. {0xb8, 0x8f, 0xff, 0xcc},
  1591. {0x00, 0x01, 0x0c, 0xaa},
  1592. {0x00, 0x14, 0x01, 0xaa},
  1593. {0x00, 0x15, 0xe6, 0xaa},
  1594. {0x00, 0x16, 0x02, 0xaa},
  1595. {0x00, 0x17, 0x86, 0xaa},
  1596. {0x00, 0x23, 0x00, 0xaa},
  1597. {0x00, 0x25, 0x03, 0xaa},
  1598. {0x00, 0x26, 0xa9, 0xaa},
  1599. {0x00, 0x27, 0x80, 0xaa},
  1600. {0x00, 0x30, 0x18, 0xaa},
  1601. {0xb6, 0x00, 0x00, 0xcc},
  1602. {0xb6, 0x03, 0x01, 0xcc},
  1603. {0xb6, 0x02, 0x40, 0xcc},
  1604. {0xb6, 0x05, 0x00, 0xcc},
  1605. {0xb6, 0x04, 0xf0, 0xcc},
  1606. {0xb6, 0x12, 0x78, 0xcc},
  1607. {0xb6, 0x18, 0x00, 0xcc},
  1608. {0xb6, 0x17, 0x96, 0xcc},
  1609. {0xb6, 0x16, 0x00, 0xcc},
  1610. {0xb6, 0x22, 0x12, 0xcc},
  1611. {0xb6, 0x23, 0x0b, 0xcc},
  1612. {0xb3, 0x02, 0x02, 0xcc},
  1613. {0xbf, 0xc0, 0x39, 0xcc},
  1614. {0xbf, 0xc1, 0x04, 0xcc},
  1615. {0xbf, 0xcc, 0x10, 0xcc},
  1616. {0xbc, 0x02, 0x18, 0xcc},
  1617. {0xbc, 0x03, 0x50, 0xcc},
  1618. {0xbc, 0x04, 0x18, 0xcc},
  1619. {0xbc, 0x05, 0x00, 0xcc},
  1620. {0xbc, 0x06, 0x00, 0xcc},
  1621. {0xbc, 0x08, 0x30, 0xcc},
  1622. {0xbc, 0x09, 0x40, 0xcc},
  1623. {0xbc, 0x0a, 0x10, 0xcc},
  1624. {0xbc, 0x0b, 0x00, 0xcc},
  1625. {0xbc, 0x0c, 0x00, 0xcc},
  1626. {0xb9, 0x12, 0x00, 0xcc},
  1627. {0xb9, 0x13, 0x0a, 0xcc},
  1628. {0xb9, 0x14, 0x0a, 0xcc},
  1629. {0xb9, 0x15, 0x0a, 0xcc},
  1630. {0xb9, 0x16, 0x0a, 0xcc},
  1631. {0xb9, 0x18, 0x00, 0xcc},
  1632. {0xb9, 0x19, 0x0f, 0xcc},
  1633. {0xb8, 0x0c, 0x20, 0xcc},
  1634. {0xb8, 0x0d, 0x70, 0xcc},
  1635. {0xb9, 0x1a, 0x0f, 0xcc},
  1636. {0xb9, 0x1b, 0x0f, 0xcc},
  1637. {0xb9, 0x1c, 0x0f, 0xcc},
  1638. {0xb6, 0x12, 0xf8, 0xcc},
  1639. {0xb6, 0x13, 0x13, 0xcc},
  1640. {0xb3, 0x5c, 0x01, 0xcc},
  1641. {}
  1642. };
  1643. static const u8 ov7660_gamma[17] = {
  1644. 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
  1645. 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
  1646. };
  1647. static const u8 ov7660_matrix[9] = {
  1648. 0x5a, 0xf0, 0xf6, 0xf3, 0x57, 0xf6, 0xf3, 0xef, 0x62
  1649. };
  1650. static const u8 ov7660_initVGA_data[][4] = {
  1651. {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
  1652. {0x00, 0x00, 0x50, 0xdd},
  1653. {0xb0, 0x03, 0x01, 0xcc},
  1654. {0xb3, 0x00, 0x21, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
  1655. {0xb3, 0x05, 0x01, 0xcc},
  1656. {0xb3, 0x06, 0x03, 0xcc},
  1657. {0xb3, 0x03, 0x1f, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
  1658. {0xb3, 0x05, 0x00, 0xcc},
  1659. {0xb3, 0x06, 0x01, 0xcc},
  1660. {0xb3, 0x15, 0x00, 0xcc},/* 0xb315 <-0 href startl */
  1661. {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
  1662. {0xb3, 0x21, 0x00, 0xcc},
  1663. {0xb3, 0x23, 0xe0, 0xcc}, {0xb3, 0x1d, 0x01, 0xcc},
  1664. {0xb3, 0x1f, 0x02, 0xcc},
  1665. {0xb3, 0x34, 0x01, 0xcc},
  1666. {0xb3, 0x35, 0xa1, 0xcc}, /* i2c add: 21 */
  1667. {0xb3, 0x00, 0x26, 0xcc},
  1668. {0xb8, 0x00, 0x33, 0xcc}, /* 13 */
  1669. {0xb8, 0x01, 0x7d, 0xcc},
  1670. {0xbc, 0x00, 0x73, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
  1671. {0xb8, 0x27, 0x20, 0xcc},
  1672. {0xb8, 0x8f, 0x50, 0xcc},
  1673. {0x00, 0x01, 0x80, 0xaa}, {0x00, 0x02, 0x80, 0xaa},
  1674. {0x00, 0x12, 0x80, 0xaa},
  1675. {0x00, 0x12, 0x05, 0xaa},
  1676. {0x00, 0x1e, 0x01, 0xaa}, /* MVFP */
  1677. {0x00, 0x3d, 0x40, 0xaa}, /* 0x3d <-40 gamma 01 */
  1678. {0x00, 0x41, 0x00, 0xaa}, /* edge 00 */
  1679. {0x00, 0x0d, 0x48, 0xaa}, {0x00, 0x0e, 0x04, 0xaa},
  1680. {0x00, 0x13, 0xa7, 0xaa},
  1681. {0x00, 0x40, 0xc1, 0xaa}, {0x00, 0x35, 0x00, 0xaa},
  1682. {0x00, 0x36, 0x00, 0xaa},
  1683. {0x00, 0x3c, 0x68, 0xaa}, {0x00, 0x1b, 0x05, 0xaa},
  1684. {0x00, 0x39, 0x43, 0xaa},
  1685. {0x00, 0x8d, 0xcf, 0xaa},
  1686. {0x00, 0x8b, 0xcc, 0xaa}, {0x00, 0x8c, 0xcc, 0xaa},
  1687. {0x00, 0x0f, 0x62, 0xaa},
  1688. {0x00, 0x35, 0x84, 0xaa},
  1689. {0x00, 0x3b, 0x08, 0xaa}, /* 0 * Nightframe 1/4 + 50Hz -> 0xC8 */
  1690. {0x00, 0x3a, 0x00, 0xaa}, /* mx change yuyv format 00, 04, 01; 08, 0c*/
  1691. {0x00, 0x14, 0x2a, 0xaa}, /* agc ampli */
  1692. {0x00, 0x9e, 0x40, 0xaa}, {0xb8, 0x8f, 0x50, 0xcc},
  1693. {0x00, 0x01, 0x80, 0xaa},
  1694. {0x00, 0x02, 0x80, 0xaa},
  1695. {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
  1696. {0xb9, 0x00, 0x28, 0xcc},
  1697. {0xb9, 0x01, 0x28, 0xcc}, {0xb9, 0x02, 0x28, 0xcc},
  1698. {0xb9, 0x03, 0x00, 0xcc},
  1699. {0xb9, 0x04, 0x00, 0xcc},
  1700. {0xb9, 0x05, 0x3c, 0xcc}, {0xb9, 0x06, 0x3c, 0xcc},
  1701. {0xb9, 0x07, 0x3c, 0xcc},
  1702. {0xb9, 0x08, 0x3c, 0xcc},
  1703. {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
  1704. {0x00, 0x29, 0x3c, 0xaa}, {0xb3, 0x01, 0x45, 0xcc},
  1705. {}
  1706. };
  1707. static const u8 ov7660_initQVGA_data[][4] = {
  1708. {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
  1709. {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc},
  1710. {0xb3, 0x00, 0x21, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
  1711. {0xb3, 0x05, 0x01, 0xcc}, {0xb3, 0x06, 0x03, 0xcc},
  1712. {0xb3, 0x03, 0x1f, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
  1713. {0xb3, 0x05, 0x00, 0xcc}, {0xb3, 0x06, 0x01, 0xcc},
  1714. {0xb3, 0x15, 0x00, 0xcc},/* 0xb315 <-0 href startl */
  1715. {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
  1716. {0xb3, 0x21, 0x00, 0xcc},
  1717. {0xb3, 0x23, 0xe0, 0xcc}, {0xb3, 0x1d, 0x01, 0xcc},
  1718. {0xb3, 0x1f, 0x02, 0xcc}, {0xb3, 0x34, 0x01, 0xcc},
  1719. {0xb3, 0x35, 0xa1, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
  1720. {0xb8, 0x00, 0x33, 0xcc}, /* 13 */
  1721. {0xb8, 0x01, 0x7d, 0xcc},
  1722. /* sizer */
  1723. {0xbc, 0x00, 0xd3, 0xcc},
  1724. {0xb8, 0x81, 0x09, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
  1725. {0xb8, 0x27, 0x20, 0xcc}, {0xb8, 0x8f, 0x50, 0xcc},
  1726. {0x00, 0x01, 0x80, 0xaa}, {0x00, 0x02, 0x80, 0xaa},
  1727. {0x00, 0x12, 0x80, 0xaa}, {0x00, 0x12, 0x05, 0xaa},
  1728. {0x00, 0x1e, 0x01, 0xaa}, /* MVFP */
  1729. {0x00, 0x3d, 0x40, 0xaa}, /* 0x3d <-40 gamma 01 */
  1730. {0x00, 0x41, 0x00, 0xaa}, /* edge 00 */
  1731. {0x00, 0x0d, 0x48, 0xaa}, {0x00, 0x0e, 0x04, 0xaa},
  1732. {0x00, 0x13, 0xa7, 0xaa},
  1733. {0x00, 0x40, 0xc1, 0xaa}, {0x00, 0x35, 0x00, 0xaa},
  1734. {0x00, 0x36, 0x00, 0xaa},
  1735. {0x00, 0x3c, 0x68, 0xaa}, {0x00, 0x1b, 0x05, 0xaa},
  1736. {0x00, 0x39, 0x43, 0xaa}, {0x00, 0x8d, 0xcf, 0xaa},
  1737. {0x00, 0x8b, 0xcc, 0xaa}, {0x00, 0x8c, 0xcc, 0xaa},
  1738. {0x00, 0x0f, 0x62, 0xaa}, {0x00, 0x35, 0x84, 0xaa},
  1739. {0x00, 0x3b, 0x08, 0xaa}, /* 0 * Nightframe 1/4 + 50Hz -> 0xC8 */
  1740. {0x00, 0x3a, 0x00, 0xaa}, /* mx change yuyv format 00, 04, 01; 08, 0c*/
  1741. {0x00, 0x14, 0x2a, 0xaa}, /* agc ampli */
  1742. {0x00, 0x9e, 0x40, 0xaa}, {0xb8, 0x8f, 0x50, 0xcc},
  1743. {0x00, 0x01, 0x80, 0xaa},
  1744. {0x00, 0x02, 0x80, 0xaa},
  1745. /* sizer filters */
  1746. {0xbc, 0x02, 0x08, 0xcc},
  1747. {0xbc, 0x03, 0x70, 0xcc},
  1748. {0xb8, 0x35, 0x00, 0xcc},
  1749. {0xb8, 0x36, 0x00, 0xcc},
  1750. {0xb8, 0x37, 0x00, 0xcc},
  1751. {0xbc, 0x04, 0x08, 0xcc},
  1752. {0xbc, 0x05, 0x00, 0xcc},
  1753. {0xbc, 0x06, 0x00, 0xcc},
  1754. {0xbc, 0x08, 0x3c, 0xcc},
  1755. {0xbc, 0x09, 0x40, 0xcc},
  1756. {0xbc, 0x0a, 0x04, 0xcc},
  1757. {0xbc, 0x0b, 0x00, 0xcc},
  1758. {0xbc, 0x0c, 0x00, 0xcc},
  1759. /* */
  1760. {0xb8, 0xfe, 0x00, 0xcc},
  1761. {0xb8, 0xff, 0x28, 0xcc},
  1762. /* */
  1763. {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
  1764. {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
  1765. {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
  1766. {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
  1767. {0xb9, 0x08, 0x3c, 0xcc},
  1768. /* */
  1769. {0xb8, 0x8e, 0x00, 0xcc},
  1770. {0xb8, 0x8f, 0xff, 0xcc}, /* ff */
  1771. {0x00, 0x29, 0x3c, 0xaa},
  1772. {0xb3, 0x01, 0x45, 0xcc}, /* 45 */
  1773. {}
  1774. };
  1775. static const u8 ov7660_50HZ[][4] = {
  1776. {0x00, 0x3b, 0x08, 0xaa},
  1777. {0x00, 0x9d, 0x40, 0xaa},
  1778. {0x00, 0x13, 0xa7, 0xaa},
  1779. {}
  1780. };
  1781. static const u8 ov7660_60HZ[][4] = {
  1782. {0x00, 0x3b, 0x00, 0xaa},
  1783. {0x00, 0x9e, 0x40, 0xaa},
  1784. {0x00, 0x13, 0xa7, 0xaa},
  1785. {}
  1786. };
  1787. static const u8 ov7660_NoFliker[][4] = {
  1788. {0x00, 0x13, 0x87, 0xaa},
  1789. {}
  1790. };
  1791. static const u8 ov7670_InitVGA[][4] = {
  1792. {0xb3, 0x01, 0x05, 0xcc},
  1793. {0x00, 0x00, 0x30, 0xdd},
  1794. {0xb0, 0x03, 0x19, 0xcc},
  1795. {0x00, 0x00, 0x10, 0xdd},
  1796. {0xb0, 0x04, 0x02, 0xcc},
  1797. {0x00, 0x00, 0x10, 0xdd},
  1798. {0xb3, 0x00, 0x66, 0xcc},
  1799. {0xb3, 0x00, 0x67, 0xcc},
  1800. {0xb0, 0x16, 0x01, 0xcc},
  1801. {0xb3, 0x35, 0xa1, 0xcc}, /* i2c add: 21 */
  1802. {0xb3, 0x34, 0x01, 0xcc},
  1803. {0xb3, 0x05, 0x01, 0xcc},
  1804. {0xb3, 0x06, 0x01, 0xcc},
  1805. {0xb3, 0x08, 0x01, 0xcc},
  1806. {0xb3, 0x09, 0x0c, 0xcc},
  1807. {0xb3, 0x02, 0x02, 0xcc},
  1808. {0xb3, 0x03, 0x1f, 0xcc},
  1809. {0xb3, 0x14, 0x00, 0xcc},
  1810. {0xb3, 0x15, 0x00, 0xcc},
  1811. {0xb3, 0x16, 0x02, 0xcc},
  1812. {0xb3, 0x17, 0x7f, 0xcc},
  1813. {0xb3, 0x04, 0x05, 0xcc},
  1814. {0xb3, 0x20, 0x00, 0xcc},
  1815. {0xb3, 0x21, 0x00, 0xcc},
  1816. {0xb3, 0x22, 0x01, 0xcc},
  1817. {0xb3, 0x23, 0xe0, 0xcc},
  1818. {0xbc, 0x00, 0x41, 0xcc},
  1819. {0xbc, 0x01, 0x01, 0xcc},
  1820. {0x00, 0x12, 0x80, 0xaa},
  1821. {0x00, 0x00, 0x20, 0xdd},
  1822. {0x00, 0x12, 0x00, 0xaa},
  1823. {0x00, 0x11, 0x40, 0xaa},
  1824. {0x00, 0x6b, 0x0a, 0xaa},
  1825. {0x00, 0x3a, 0x04, 0xaa},
  1826. {0x00, 0x40, 0xc0, 0xaa},
  1827. {0x00, 0x8c, 0x00, 0xaa},
  1828. {0x00, 0x7a, 0x29, 0xaa},
  1829. {0x00, 0x7b, 0x0e, 0xaa},
  1830. {0x00, 0x7c, 0x1a, 0xaa},
  1831. {0x00, 0x7d, 0x31, 0xaa},
  1832. {0x00, 0x7e, 0x53, 0xaa},
  1833. {0x00, 0x7f, 0x60, 0xaa},
  1834. {0x00, 0x80, 0x6b, 0xaa},
  1835. {0x00, 0x81, 0x73, 0xaa},
  1836. {0x00, 0x82, 0x7b, 0xaa},
  1837. {0x00, 0x83, 0x82, 0xaa},
  1838. {0x00, 0x84, 0x89, 0xaa},
  1839. {0x00, 0x85, 0x96, 0xaa},
  1840. {0x00, 0x86, 0xa1, 0xaa},
  1841. {0x00, 0x87, 0xb7, 0xaa},
  1842. {0x00, 0x88, 0xcc, 0xaa},
  1843. {0x00, 0x89, 0xe1, 0xaa},
  1844. {0x00, 0x13, 0xe0, 0xaa},
  1845. {0x00, 0x00, 0x00, 0xaa},
  1846. {0x00, 0x10, 0x00, 0xaa},
  1847. {0x00, 0x0d, 0x40, 0xaa},
  1848. {0x00, 0x14, 0x28, 0xaa},
  1849. {0x00, 0xa5, 0x05, 0xaa},
  1850. {0x00, 0xab, 0x07, 0xaa},
  1851. {0x00, 0x24, 0x95, 0xaa},
  1852. {0x00, 0x25, 0x33, 0xaa},
  1853. {0x00, 0x26, 0xe3, 0xaa},
  1854. {0x00, 0x9f, 0x88, 0xaa},
  1855. {0x00, 0xa0, 0x78, 0xaa},
  1856. {0x00, 0x55, 0x90, 0xaa},
  1857. {0x00, 0xa1, 0x03, 0xaa},
  1858. {0x00, 0xa6, 0xe0, 0xaa},
  1859. {0x00, 0xa7, 0xd8, 0xaa},
  1860. {0x00, 0xa8, 0xf0, 0xaa},
  1861. {0x00, 0xa9, 0x90, 0xaa},
  1862. {0x00, 0xaa, 0x14, 0xaa},
  1863. {0x00, 0x13, 0xe5, 0xaa},
  1864. {0x00, 0x0e, 0x61, 0xaa},
  1865. {0x00, 0x0f, 0x4b, 0xaa},
  1866. {0x00, 0x16, 0x02, 0xaa},
  1867. {0x00, 0x1e, 0x07, 0xaa}, /* MVFP */
  1868. {0x00, 0x21, 0x02, 0xaa},
  1869. {0x00, 0x22, 0x91, 0xaa},
  1870. {0x00, 0x29, 0x07, 0xaa},
  1871. {0x00, 0x33, 0x0b, 0xaa},
  1872. {0x00, 0x35, 0x0b, 0xaa},
  1873. {0x00, 0x37, 0x1d, 0xaa},
  1874. {0x00, 0x38, 0x71, 0xaa},
  1875. {0x00, 0x39, 0x2a, 0xaa},
  1876. {0x00, 0x3c, 0x78, 0xaa},
  1877. {0x00, 0x4d, 0x40, 0xaa},
  1878. {0x00, 0x4e, 0x20, 0xaa},
  1879. {0x00, 0x74, 0x19, 0xaa},
  1880. {0x00, 0x8d, 0x4f, 0xaa},
  1881. {0x00, 0x8e, 0x00, 0xaa},
  1882. {0x00, 0x8f, 0x00, 0xaa},
  1883. {0x00, 0x90, 0x00, 0xaa},
  1884. {0x00, 0x91, 0x00, 0xaa},
  1885. {0x00, 0x96, 0x00, 0xaa},
  1886. {0x00, 0x9a, 0x80, 0xaa},
  1887. {0x00, 0xb0, 0x84, 0xaa},
  1888. {0x00, 0xb1, 0x0c, 0xaa},
  1889. {0x00, 0xb2, 0x0e, 0xaa},
  1890. {0x00, 0xb3, 0x82, 0xaa},
  1891. {0x00, 0xb8, 0x0a, 0xaa},
  1892. {0x00, 0x43, 0x14, 0xaa},
  1893. {0x00, 0x44, 0xf0, 0xaa},
  1894. {0x00, 0x45, 0x45, 0xaa},
  1895. {0x00, 0x46, 0x63, 0xaa},
  1896. {0x00, 0x47, 0x2d, 0xaa},
  1897. {0x00, 0x48, 0x46, 0xaa},
  1898. {0x00, 0x59, 0x88, 0xaa},
  1899. {0x00, 0x5a, 0xa0, 0xaa},
  1900. {0x00, 0x5b, 0xc6, 0xaa},
  1901. {0x00, 0x5c, 0x7d, 0xaa},
  1902. {0x00, 0x5d, 0x5f, 0xaa},
  1903. {0x00, 0x5e, 0x19, 0xaa},
  1904. {0x00, 0x6c, 0x0a, 0xaa},
  1905. {0x00, 0x6d, 0x55, 0xaa},
  1906. {0x00, 0x6e, 0x11, 0xaa},
  1907. {0x00, 0x6f, 0x9e, 0xaa},
  1908. {0x00, 0x69, 0x00, 0xaa},
  1909. {0x00, 0x6a, 0x40, 0xaa},
  1910. {0x00, 0x01, 0x40, 0xaa},
  1911. {0x00, 0x02, 0x40, 0xaa},
  1912. {0x00, 0x13, 0xe7, 0xaa},
  1913. {0x00, 0x5f, 0xf0, 0xaa},
  1914. {0x00, 0x60, 0xf0, 0xaa},
  1915. {0x00, 0x61, 0xf0, 0xaa},
  1916. {0x00, 0x27, 0xa0, 0xaa},
  1917. {0x00, 0x28, 0x80, 0xaa},
  1918. {0x00, 0x2c, 0x90, 0xaa},
  1919. {0x00, 0x4f, 0x66, 0xaa},
  1920. {0x00, 0x50, 0x66, 0xaa},
  1921. {0x00, 0x51, 0x00, 0xaa},
  1922. {0x00, 0x52, 0x22, 0xaa},
  1923. {0x00, 0x53, 0x5e, 0xaa},
  1924. {0x00, 0x54, 0x80, 0xaa},
  1925. {0x00, 0x58, 0x9e, 0xaa},
  1926. {0x00, 0x41, 0x08, 0xaa},
  1927. {0x00, 0x3f, 0x00, 0xaa},
  1928. {0x00, 0x75, 0x85, 0xaa},
  1929. {0x00, 0x76, 0xe1, 0xaa},
  1930. {0x00, 0x4c, 0x00, 0xaa},
  1931. {0x00, 0x77, 0x0a, 0xaa},
  1932. {0x00, 0x3d, 0x88, 0xaa},
  1933. {0x00, 0x4b, 0x09, 0xaa},
  1934. {0x00, 0xc9, 0x60, 0xaa},
  1935. {0x00, 0x41, 0x38, 0xaa},
  1936. {0x00, 0x62, 0x30, 0xaa},
  1937. {0x00, 0x63, 0x30, 0xaa},
  1938. {0x00, 0x64, 0x08, 0xaa},
  1939. {0x00, 0x94, 0x07, 0xaa},
  1940. {0x00, 0x95, 0x0b, 0xaa},
  1941. {0x00, 0x65, 0x00, 0xaa},
  1942. {0x00, 0x66, 0x05, 0xaa},
  1943. {0x00, 0x56, 0x50, 0xaa},
  1944. {0x00, 0x34, 0x11, 0xaa},
  1945. {0x00, 0xa4, 0x88, 0xaa},
  1946. {0x00, 0x96, 0x00, 0xaa},
  1947. {0x00, 0x97, 0x30, 0xaa},
  1948. {0x00, 0x98, 0x20, 0xaa},
  1949. {0x00, 0x99, 0x30, 0xaa},
  1950. {0x00, 0x9a, 0x84, 0xaa},
  1951. {0x00, 0x9b, 0x29, 0xaa},
  1952. {0x00, 0x9c, 0x03, 0xaa},
  1953. {0x00, 0x78, 0x04, 0xaa},
  1954. {0x00, 0x79, 0x01, 0xaa},
  1955. {0x00, 0xc8, 0xf0, 0xaa},
  1956. {0x00, 0x79, 0x0f, 0xaa},
  1957. {0x00, 0xc8, 0x00, 0xaa},
  1958. {0x00, 0x79, 0x10, 0xaa},
  1959. {0x00, 0xc8, 0x7e, 0xaa},
  1960. {0x00, 0x79, 0x0a, 0xaa},
  1961. {0x00, 0xc8, 0x80, 0xaa},
  1962. {0x00, 0x79, 0x0b, 0xaa},
  1963. {0x00, 0xc8, 0x01, 0xaa},
  1964. {0x00, 0x79, 0x0c, 0xaa},
  1965. {0x00, 0xc8, 0x0f, 0xaa},
  1966. {0x00, 0x79, 0x0d, 0xaa},
  1967. {0x00, 0xc8, 0x20, 0xaa},
  1968. {0x00, 0x79, 0x09, 0xaa},
  1969. {0x00, 0xc8, 0x80, 0xaa},
  1970. {0x00, 0x79, 0x02, 0xaa},
  1971. {0x00, 0xc8, 0xc0, 0xaa},
  1972. {0x00, 0x79, 0x03, 0xaa},
  1973. {0x00, 0xc8, 0x40, 0xaa},
  1974. {0x00, 0x79, 0x05, 0xaa},
  1975. {0x00, 0xc8, 0x30, 0xaa},
  1976. {0x00, 0x79, 0x26, 0xaa},
  1977. {0x00, 0x11, 0x40, 0xaa},
  1978. {0x00, 0x3a, 0x04, 0xaa},
  1979. {0x00, 0x12, 0x00, 0xaa},
  1980. {0x00, 0x40, 0xc0, 0xaa},
  1981. {0x00, 0x8c, 0x00, 0xaa},
  1982. {0x00, 0x17, 0x14, 0xaa},
  1983. {0x00, 0x18, 0x02, 0xaa},
  1984. {0x00, 0x32, 0x92, 0xaa},
  1985. {0x00, 0x19, 0x02, 0xaa},
  1986. {0x00, 0x1a, 0x7a, 0xaa},
  1987. {0x00, 0x03, 0x0a, 0xaa},
  1988. {0x00, 0x0c, 0x00, 0xaa},
  1989. {0x00, 0x3e, 0x00, 0xaa},
  1990. {0x00, 0x70, 0x3a, 0xaa},
  1991. {0x00, 0x71, 0x35, 0xaa},
  1992. {0x00, 0x72, 0x11, 0xaa},
  1993. {0x00, 0x73, 0xf0, 0xaa},
  1994. {0x00, 0xa2, 0x02, 0xaa},
  1995. {0x00, 0xb1, 0x00, 0xaa},
  1996. {0x00, 0xb1, 0x0c, 0xaa},
  1997. {0x00, 0x1e, 0x37, 0xaa}, /* MVFP */
  1998. {0x00, 0xaa, 0x14, 0xaa},
  1999. {0x00, 0x24, 0x80, 0xaa},
  2000. {0x00, 0x25, 0x74, 0xaa},
  2001. {0x00, 0x26, 0xd3, 0xaa},
  2002. {0x00, 0x0d, 0x00, 0xaa},
  2003. {0x00, 0x14, 0x18, 0xaa},
  2004. {0x00, 0x9d, 0x99, 0xaa},
  2005. {0x00, 0x9e, 0x7f, 0xaa},
  2006. {0x00, 0x64, 0x08, 0xaa},
  2007. {0x00, 0x94, 0x07, 0xaa},
  2008. {0x00, 0x95, 0x06, 0xaa},
  2009. {0x00, 0x66, 0x05, 0xaa},
  2010. {0x00, 0x41, 0x08, 0xaa},
  2011. {0x00, 0x3f, 0x00, 0xaa},
  2012. {0x00, 0x75, 0x07, 0xaa},
  2013. {0x00, 0x76, 0xe1, 0xaa},
  2014. {0x00, 0x4c, 0x00, 0xaa},
  2015. {0x00, 0x77, 0x00, 0xaa},
  2016. {0x00, 0x3d, 0xc2, 0xaa},
  2017. {0x00, 0x4b, 0x09, 0xaa},
  2018. {0x00, 0xc9, 0x60, 0xaa},
  2019. {0x00, 0x41, 0x38, 0xaa},
  2020. {0xbf, 0xc0, 0x26, 0xcc},
  2021. {0xbf, 0xc1, 0x02, 0xcc},
  2022. {0xbf, 0xcc, 0x04, 0xcc},
  2023. {0xb3, 0x5c, 0x01, 0xcc},
  2024. {0xb3, 0x01, 0x45, 0xcc},
  2025. {0x00, 0x77, 0x05, 0xaa},
  2026. {},
  2027. };
  2028. static const u8 ov7670_InitQVGA[][4] = {
  2029. {0xb3, 0x01, 0x05, 0xcc},
  2030. {0x00, 0x00, 0x30, 0xdd},
  2031. {0xb0, 0x03, 0x19, 0xcc},
  2032. {0x00, 0x00, 0x10, 0xdd},
  2033. {0xb0, 0x04, 0x02, 0xcc},
  2034. {0x00, 0x00, 0x10, 0xdd},
  2035. {0xb3, 0x00, 0x66, 0xcc},
  2036. {0xb3, 0x00, 0x67, 0xcc},
  2037. {0xb0, 0x16, 0x01, 0xcc},
  2038. {0xb3, 0x35, 0xa1, 0xcc}, /* i2c add: 21 */
  2039. {0xb3, 0x34, 0x01, 0xcc},
  2040. {0xb3, 0x05, 0x01, 0xcc},
  2041. {0xb3, 0x06, 0x01, 0xcc},
  2042. {0xb3, 0x08, 0x01, 0xcc},
  2043. {0xb3, 0x09, 0x0c, 0xcc},
  2044. {0xb3, 0x02, 0x02, 0xcc},
  2045. {0xb3, 0x03, 0x1f, 0xcc},
  2046. {0xb3, 0x14, 0x00, 0xcc},
  2047. {0xb3, 0x15, 0x00, 0xcc},
  2048. {0xb3, 0x16, 0x02, 0xcc},
  2049. {0xb3, 0x17, 0x7f, 0xcc},
  2050. {0xb3, 0x04, 0x05, 0xcc},
  2051. {0xb3, 0x20, 0x00, 0xcc},
  2052. {0xb3, 0x21, 0x00, 0xcc},
  2053. {0xb3, 0x22, 0x01, 0xcc},
  2054. {0xb3, 0x23, 0xe0, 0xcc},
  2055. {0xbc, 0x00, 0xd1, 0xcc},
  2056. {0xbc, 0x01, 0x01, 0xcc},
  2057. {0x00, 0x12, 0x80, 0xaa},
  2058. {0x00, 0x00, 0x20, 0xdd},
  2059. {0x00, 0x12, 0x00, 0xaa},
  2060. {0x00, 0x11, 0x40, 0xaa},
  2061. {0x00, 0x6b, 0x0a, 0xaa},
  2062. {0x00, 0x3a, 0x04, 0xaa},
  2063. {0x00, 0x40, 0xc0, 0xaa},
  2064. {0x00, 0x8c, 0x00, 0xaa},
  2065. {0x00, 0x7a, 0x29, 0xaa},
  2066. {0x00, 0x7b, 0x0e, 0xaa},
  2067. {0x00, 0x7c, 0x1a, 0xaa},
  2068. {0x00, 0x7d, 0x31, 0xaa},
  2069. {0x00, 0x7e, 0x53, 0xaa},
  2070. {0x00, 0x7f, 0x60, 0xaa},
  2071. {0x00, 0x80, 0x6b, 0xaa},
  2072. {0x00, 0x81, 0x73, 0xaa},
  2073. {0x00, 0x82, 0x7b, 0xaa},
  2074. {0x00, 0x83, 0x82, 0xaa},
  2075. {0x00, 0x84, 0x89, 0xaa},
  2076. {0x00, 0x85, 0x96, 0xaa},
  2077. {0x00, 0x86, 0xa1, 0xaa},
  2078. {0x00, 0x87, 0xb7, 0xaa},
  2079. {0x00, 0x88, 0xcc, 0xaa},
  2080. {0x00, 0x89, 0xe1, 0xaa},
  2081. {0x00, 0x13, 0xe0, 0xaa},
  2082. {0x00, 0x00, 0x00, 0xaa},
  2083. {0x00, 0x10, 0x00, 0xaa},
  2084. {0x00, 0x0d, 0x40, 0xaa},
  2085. {0x00, 0x14, 0x28, 0xaa},
  2086. {0x00, 0xa5, 0x05, 0xaa},
  2087. {0x00, 0xab, 0x07, 0xaa},
  2088. {0x00, 0x24, 0x95, 0xaa},
  2089. {0x00, 0x25, 0x33, 0xaa},
  2090. {0x00, 0x26, 0xe3, 0xaa},
  2091. {0x00, 0x9f, 0x88, 0xaa},
  2092. {0x00, 0xa0, 0x78, 0xaa},
  2093. {0x00, 0x55, 0x90, 0xaa},
  2094. {0x00, 0xa1, 0x03, 0xaa},
  2095. {0x00, 0xa6, 0xe0, 0xaa},
  2096. {0x00, 0xa7, 0xd8, 0xaa},
  2097. {0x00, 0xa8, 0xf0, 0xaa},
  2098. {0x00, 0xa9, 0x90, 0xaa},
  2099. {0x00, 0xaa, 0x14, 0xaa},
  2100. {0x00, 0x13, 0xe5, 0xaa},
  2101. {0x00, 0x0e, 0x61, 0xaa},
  2102. {0x00, 0x0f, 0x4b, 0xaa},
  2103. {0x00, 0x16, 0x02, 0xaa},
  2104. {0x00, 0x1e, 0x07, 0xaa}, /* MVFP */
  2105. {0x00, 0x21, 0x02, 0xaa},
  2106. {0x00, 0x22, 0x91, 0xaa},
  2107. {0x00, 0x29, 0x07, 0xaa},
  2108. {0x00, 0x33, 0x0b, 0xaa},
  2109. {0x00, 0x35, 0x0b, 0xaa},
  2110. {0x00, 0x37, 0x1d, 0xaa},
  2111. {0x00, 0x38, 0x71, 0xaa},
  2112. {0x00, 0x39, 0x2a, 0xaa},
  2113. {0x00, 0x3c, 0x78, 0xaa},
  2114. {0x00, 0x4d, 0x40, 0xaa},
  2115. {0x00, 0x4e, 0x20, 0xaa},
  2116. {0x00, 0x74, 0x19, 0xaa},
  2117. {0x00, 0x8d, 0x4f, 0xaa},
  2118. {0x00, 0x8e, 0x00, 0xaa},
  2119. {0x00, 0x8f, 0x00, 0xaa},
  2120. {0x00, 0x90, 0x00, 0xaa},
  2121. {0x00, 0x91, 0x00, 0xaa},
  2122. {0x00, 0x96, 0x00, 0xaa},
  2123. {0x00, 0x9a, 0x80, 0xaa},
  2124. {0x00, 0xb0, 0x84, 0xaa},
  2125. {0x00, 0xb1, 0x0c, 0xaa},
  2126. {0x00, 0xb2, 0x0e, 0xaa},
  2127. {0x00, 0xb3, 0x82, 0xaa},
  2128. {0x00, 0xb8, 0x0a, 0xaa},
  2129. {0x00, 0x43, 0x14, 0xaa},
  2130. {0x00, 0x44, 0xf0, 0xaa},
  2131. {0x00, 0x45, 0x45, 0xaa},
  2132. {0x00, 0x46, 0x63, 0xaa},
  2133. {0x00, 0x47, 0x2d, 0xaa},
  2134. {0x00, 0x48, 0x46, 0xaa},
  2135. {0x00, 0x59, 0x88, 0xaa},
  2136. {0x00, 0x5a, 0xa0, 0xaa},
  2137. {0x00, 0x5b, 0xc6, 0xaa},
  2138. {0x00, 0x5c, 0x7d, 0xaa},
  2139. {0x00, 0x5d, 0x5f, 0xaa},
  2140. {0x00, 0x5e, 0x19, 0xaa},
  2141. {0x00, 0x6c, 0x0a, 0xaa},
  2142. {0x00, 0x6d, 0x55, 0xaa},
  2143. {0x00, 0x6e, 0x11, 0xaa},
  2144. {0x00, 0x6f, 0x9e, 0xaa},
  2145. {0x00, 0x69, 0x00, 0xaa},
  2146. {0x00, 0x6a, 0x40, 0xaa},
  2147. {0x00, 0x01, 0x40, 0xaa},
  2148. {0x00, 0x02, 0x40, 0xaa},
  2149. {0x00, 0x13, 0xe7, 0xaa},
  2150. {0x00, 0x5f, 0xf0, 0xaa},
  2151. {0x00, 0x60, 0xf0, 0xaa},
  2152. {0x00, 0x61, 0xf0, 0xaa},
  2153. {0x00, 0x27, 0xa0, 0xaa},
  2154. {0x00, 0x28, 0x80, 0xaa},
  2155. {0x00, 0x2c, 0x90, 0xaa},
  2156. {0x00, 0x4f, 0x66, 0xaa},
  2157. {0x00, 0x50, 0x66, 0xaa},
  2158. {0x00, 0x51, 0x00, 0xaa},
  2159. {0x00, 0x52, 0x22, 0xaa},
  2160. {0x00, 0x53, 0x5e, 0xaa},
  2161. {0x00, 0x54, 0x80, 0xaa},
  2162. {0x00, 0x58, 0x9e, 0xaa},
  2163. {0x00, 0x41, 0x08, 0xaa},
  2164. {0x00, 0x3f, 0x00, 0xaa},
  2165. {0x00, 0x75, 0x85, 0xaa},
  2166. {0x00, 0x76, 0xe1, 0xaa},
  2167. {0x00, 0x4c, 0x00, 0xaa},
  2168. {0x00, 0x77, 0x0a, 0xaa},
  2169. {0x00, 0x3d, 0x88, 0xaa},
  2170. {0x00, 0x4b, 0x09, 0xaa},
  2171. {0x00, 0xc9, 0x60, 0xaa},
  2172. {0x00, 0x41, 0x38, 0xaa},
  2173. {0x00, 0x62, 0x30, 0xaa},
  2174. {0x00, 0x63, 0x30, 0xaa},
  2175. {0x00, 0x64, 0x08, 0xaa},
  2176. {0x00, 0x94, 0x07, 0xaa},
  2177. {0x00, 0x95, 0x0b, 0xaa},
  2178. {0x00, 0x65, 0x00, 0xaa},
  2179. {0x00, 0x66, 0x05, 0xaa},
  2180. {0x00, 0x56, 0x50, 0xaa},
  2181. {0x00, 0x34, 0x11, 0xaa},
  2182. {0x00, 0xa4, 0x88, 0xaa},
  2183. {0x00, 0x96, 0x00, 0xaa},
  2184. {0x00, 0x97, 0x30, 0xaa},
  2185. {0x00, 0x98, 0x20, 0xaa},
  2186. {0x00, 0x99, 0x30, 0xaa},
  2187. {0x00, 0x9a, 0x84, 0xaa},
  2188. {0x00, 0x9b, 0x29, 0xaa},
  2189. {0x00, 0x9c, 0x03, 0xaa},
  2190. {0x00, 0x78, 0x04, 0xaa},
  2191. {0x00, 0x79, 0x01, 0xaa},
  2192. {0x00, 0xc8, 0xf0, 0xaa},
  2193. {0x00, 0x79, 0x0f, 0xaa},
  2194. {0x00, 0xc8, 0x00, 0xaa},
  2195. {0x00, 0x79, 0x10, 0xaa},
  2196. {0x00, 0xc8, 0x7e, 0xaa},
  2197. {0x00, 0x79, 0x0a, 0xaa},
  2198. {0x00, 0xc8, 0x80, 0xaa},
  2199. {0x00, 0x79, 0x0b, 0xaa},
  2200. {0x00, 0xc8, 0x01, 0xaa},
  2201. {0x00, 0x79, 0x0c, 0xaa},
  2202. {0x00, 0xc8, 0x0f, 0xaa},
  2203. {0x00, 0x79, 0x0d, 0xaa},
  2204. {0x00, 0xc8, 0x20, 0xaa},
  2205. {0x00, 0x79, 0x09, 0xaa},
  2206. {0x00, 0xc8, 0x80, 0xaa},
  2207. {0x00, 0x79, 0x02, 0xaa},
  2208. {0x00, 0xc8, 0xc0, 0xaa},
  2209. {0x00, 0x79, 0x03, 0xaa},
  2210. {0x00, 0xc8, 0x40, 0xaa},
  2211. {0x00, 0x79, 0x05, 0xaa},
  2212. {0x00, 0xc8, 0x30, 0xaa},
  2213. {0x00, 0x79, 0x26, 0xaa},
  2214. {0x00, 0x11, 0x40, 0xaa},
  2215. {0x00, 0x3a, 0x04, 0xaa},
  2216. {0x00, 0x12, 0x00, 0xaa},
  2217. {0x00, 0x40, 0xc0, 0xaa},
  2218. {0x00, 0x8c, 0x00, 0xaa},
  2219. {0x00, 0x17, 0x14, 0xaa},
  2220. {0x00, 0x18, 0x02, 0xaa},
  2221. {0x00, 0x32, 0x92, 0xaa},
  2222. {0x00, 0x19, 0x02, 0xaa},
  2223. {0x00, 0x1a, 0x7a, 0xaa},
  2224. {0x00, 0x03, 0x0a, 0xaa},
  2225. {0x00, 0x0c, 0x00, 0xaa},
  2226. {0x00, 0x3e, 0x00, 0xaa},
  2227. {0x00, 0x70, 0x3a, 0xaa},
  2228. {0x00, 0x71, 0x35, 0xaa},
  2229. {0x00, 0x72, 0x11, 0xaa},
  2230. {0x00, 0x73, 0xf0, 0xaa},
  2231. {0x00, 0xa2, 0x02, 0xaa},
  2232. {0x00, 0xb1, 0x00, 0xaa},
  2233. {0x00, 0xb1, 0x0c, 0xaa},
  2234. {0x00, 0x1e, 0x37, 0xaa}, /* MVFP */
  2235. {0x00, 0xaa, 0x14, 0xaa},
  2236. {0x00, 0x24, 0x80, 0xaa},
  2237. {0x00, 0x25, 0x74, 0xaa},
  2238. {0x00, 0x26, 0xd3, 0xaa},
  2239. {0x00, 0x0d, 0x00, 0xaa},
  2240. {0x00, 0x14, 0x18, 0xaa},
  2241. {0x00, 0x9d, 0x99, 0xaa},
  2242. {0x00, 0x9e, 0x7f, 0xaa},
  2243. {0x00, 0x64, 0x08, 0xaa},
  2244. {0x00, 0x94, 0x07, 0xaa},
  2245. {0x00, 0x95, 0x06, 0xaa},
  2246. {0x00, 0x66, 0x05, 0xaa},
  2247. {0x00, 0x41, 0x08, 0xaa},
  2248. {0x00, 0x3f, 0x00, 0xaa},
  2249. {0x00, 0x75, 0x07, 0xaa},
  2250. {0x00, 0x76, 0xe1, 0xaa},
  2251. {0x00, 0x4c, 0x00, 0xaa},
  2252. {0x00, 0x77, 0x00, 0xaa},
  2253. {0x00, 0x3d, 0xc2, 0xaa},
  2254. {0x00, 0x4b, 0x09, 0xaa},
  2255. {0x00, 0xc9, 0x60, 0xaa},
  2256. {0x00, 0x41, 0x38, 0xaa},
  2257. {0xbc, 0x02, 0x18, 0xcc},
  2258. {0xbc, 0x03, 0x50, 0xcc},
  2259. {0xbc, 0x04, 0x18, 0xcc},
  2260. {0xbc, 0x05, 0x00, 0xcc},
  2261. {0xbc, 0x06, 0x00, 0xcc},
  2262. {0xbc, 0x08, 0x30, 0xcc},
  2263. {0xbc, 0x09, 0x40, 0xcc},
  2264. {0xbc, 0x0a, 0x10, 0xcc},
  2265. {0xbc, 0x0b, 0x00, 0xcc},
  2266. {0xbc, 0x0c, 0x00, 0xcc},
  2267. {0xbf, 0xc0, 0x26, 0xcc},
  2268. {0xbf, 0xc1, 0x02, 0xcc},
  2269. {0xbf, 0xcc, 0x04, 0xcc},
  2270. {0xb3, 0x5c, 0x01, 0xcc},
  2271. {0xb3, 0x01, 0x45, 0xcc},
  2272. {0x00, 0x77, 0x05, 0xaa},
  2273. {},
  2274. };
  2275. /* PO1200 - values from usbvm326.inf and ms-win trace */
  2276. static const u8 po1200_gamma[17] = {
  2277. 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
  2278. 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
  2279. };
  2280. static const u8 po1200_matrix[9] = {
  2281. 0x60, 0xf9, 0xe5, 0xe7, 0x50, 0x05, 0xf3, 0xe6, 0x5e
  2282. };
  2283. static const u8 po1200_initVGA_data[][4] = {
  2284. {0xb0, 0x03, 0x19, 0xcc}, /* reset? */
  2285. {0xb0, 0x03, 0x19, 0xcc},
  2286. /* {0x00, 0x00, 0x33, 0xdd}, */
  2287. {0xb0, 0x04, 0x02, 0xcc},
  2288. {0xb0, 0x02, 0x02, 0xcc},
  2289. {0xb3, 0x5d, 0x00, 0xcc},
  2290. {0xb3, 0x01, 0x01, 0xcc},
  2291. {0xb3, 0x00, 0x64, 0xcc},
  2292. {0xb3, 0x00, 0x65, 0xcc},
  2293. {0xb3, 0x05, 0x01, 0xcc},
  2294. {0xb3, 0x06, 0x01, 0xcc},
  2295. {0xb3, 0x5c, 0x01, 0xcc},
  2296. {0xb3, 0x08, 0x01, 0xcc},
  2297. {0xb3, 0x09, 0x0c, 0xcc},
  2298. {0xb3, 0x00, 0x67, 0xcc},
  2299. {0xb3, 0x02, 0xb2, 0xcc},
  2300. {0xb3, 0x03, 0x18, 0xcc},
  2301. {0xb3, 0x04, 0x15, 0xcc},
  2302. {0xb3, 0x20, 0x00, 0xcc},
  2303. {0xb3, 0x21, 0x00, 0xcc},
  2304. {0xb3, 0x22, 0x02, 0xcc},
  2305. {0xb3, 0x23, 0x58, 0xcc},
  2306. {0xb3, 0x14, 0x00, 0xcc},
  2307. {0xb3, 0x15, 0x00, 0xcc},
  2308. {0xb3, 0x16, 0x03, 0xcc},
  2309. {0xb3, 0x17, 0x1f, 0xcc},
  2310. {0xbc, 0x00, 0x71, 0xcc},
  2311. {0xbc, 0x01, 0x01, 0xcc},
  2312. {0xb0, 0x54, 0x13, 0xcc},
  2313. {0xb3, 0x00, 0x67, 0xcc},
  2314. {0xb3, 0x34, 0x01, 0xcc},
  2315. {0xb3, 0x35, 0xdc, 0xcc}, /* i2c add: 5c */
  2316. {0x00, 0x03, 0x00, 0xaa},
  2317. {0x00, 0x12, 0x05, 0xaa},
  2318. {0x00, 0x13, 0x02, 0xaa},
  2319. {0x00, 0x1e, 0xc6, 0xaa}, /* h/v flip */
  2320. {0x00, 0x21, 0x00, 0xaa},
  2321. {0x00, 0x25, 0x02, 0xaa},
  2322. {0x00, 0x3c, 0x4f, 0xaa},
  2323. {0x00, 0x3f, 0xe0, 0xaa},
  2324. {0x00, 0x42, 0xff, 0xaa},
  2325. {0x00, 0x45, 0x34, 0xaa},
  2326. {0x00, 0x55, 0xfe, 0xaa},
  2327. {0x00, 0x59, 0xd3, 0xaa},
  2328. {0x00, 0x5e, 0x04, 0xaa},
  2329. {0x00, 0x61, 0xb8, 0xaa}, /* sharpness */
  2330. {0x00, 0x62, 0x02, 0xaa},
  2331. {0x00, 0xa7, 0x31, 0xaa},
  2332. {0x00, 0xa9, 0x66, 0xaa},
  2333. {0x00, 0xb0, 0x00, 0xaa},
  2334. {0x00, 0xb1, 0x00, 0xaa},
  2335. {0x00, 0xb3, 0x11, 0xaa},
  2336. {0x00, 0xb6, 0x26, 0xaa},
  2337. {0x00, 0xb7, 0x20, 0xaa},
  2338. {0x00, 0xba, 0x04, 0xaa},
  2339. {0x00, 0x88, 0x42, 0xaa},
  2340. {0x00, 0x89, 0x9a, 0xaa},
  2341. {0x00, 0x8a, 0x88, 0xaa},
  2342. {0x00, 0x8b, 0x8e, 0xaa},
  2343. {0x00, 0x8c, 0x3e, 0xaa},
  2344. {0x00, 0x8d, 0x90, 0xaa},
  2345. {0x00, 0x8e, 0x87, 0xaa},
  2346. {0x00, 0x8f, 0x96, 0xaa},
  2347. {0x00, 0x90, 0x3d, 0xaa},
  2348. {0x00, 0x64, 0x00, 0xaa},
  2349. {0x00, 0x65, 0x10, 0xaa},
  2350. {0x00, 0x66, 0x20, 0xaa},
  2351. {0x00, 0x67, 0x2b, 0xaa},
  2352. {0x00, 0x68, 0x36, 0xaa},
  2353. {0x00, 0x69, 0x49, 0xaa},
  2354. {0x00, 0x6a, 0x5a, 0xaa},
  2355. {0x00, 0x6b, 0x7f, 0xaa},
  2356. {0x00, 0x6c, 0x9b, 0xaa},
  2357. {0x00, 0x6d, 0xba, 0xaa},
  2358. {0x00, 0x6e, 0xd4, 0xaa},
  2359. {0x00, 0x6f, 0xea, 0xaa},
  2360. {0x00, 0x70, 0x00, 0xaa},
  2361. {0x00, 0x71, 0x10, 0xaa},
  2362. {0x00, 0x72, 0x20, 0xaa},
  2363. {0x00, 0x73, 0x2b, 0xaa},
  2364. {0x00, 0x74, 0x36, 0xaa},
  2365. {0x00, 0x75, 0x49, 0xaa},
  2366. {0x00, 0x76, 0x5a, 0xaa},
  2367. {0x00, 0x77, 0x7f, 0xaa},
  2368. {0x00, 0x78, 0x9b, 0xaa},
  2369. {0x00, 0x79, 0xba, 0xaa},
  2370. {0x00, 0x7a, 0xd4, 0xaa},
  2371. {0x00, 0x7b, 0xea, 0xaa},
  2372. {0x00, 0x7c, 0x00, 0xaa},
  2373. {0x00, 0x7d, 0x10, 0xaa},
  2374. {0x00, 0x7e, 0x20, 0xaa},
  2375. {0x00, 0x7f, 0x2b, 0xaa},
  2376. {0x00, 0x80, 0x36, 0xaa},
  2377. {0x00, 0x81, 0x49, 0xaa},
  2378. {0x00, 0x82, 0x5a, 0xaa},
  2379. {0x00, 0x83, 0x7f, 0xaa},
  2380. {0x00, 0x84, 0x9b, 0xaa},
  2381. {0x00, 0x85, 0xba, 0xaa},
  2382. {0x00, 0x86, 0xd4, 0xaa},
  2383. {0x00, 0x87, 0xea, 0xaa},
  2384. {0x00, 0x57, 0x2a, 0xaa},
  2385. {0x00, 0x03, 0x01, 0xaa},
  2386. {0x00, 0x04, 0x10, 0xaa},
  2387. {0x00, 0x05, 0x10, 0xaa},
  2388. {0x00, 0x06, 0x10, 0xaa},
  2389. {0x00, 0x07, 0x10, 0xaa},
  2390. {0x00, 0x08, 0x13, 0xaa},
  2391. {0x00, 0x0a, 0x00, 0xaa},
  2392. {0x00, 0x0b, 0x10, 0xaa},
  2393. {0x00, 0x0c, 0x20, 0xaa},
  2394. {0x00, 0x0d, 0x18, 0xaa},
  2395. {0x00, 0x22, 0x01, 0xaa},
  2396. {0x00, 0x23, 0x60, 0xaa},
  2397. {0x00, 0x25, 0x08, 0xaa},
  2398. {0x00, 0x26, 0x82, 0xaa},
  2399. {0x00, 0x2e, 0x0f, 0xaa},
  2400. {0x00, 0x2f, 0x1e, 0xaa},
  2401. {0x00, 0x30, 0x2d, 0xaa},
  2402. {0x00, 0x31, 0x3c, 0xaa},
  2403. {0x00, 0x32, 0x4b, 0xaa},
  2404. {0x00, 0x33, 0x5a, 0xaa},
  2405. {0x00, 0x34, 0x69, 0xaa},
  2406. {0x00, 0x35, 0x78, 0xaa},
  2407. {0x00, 0x36, 0x87, 0xaa},
  2408. {0x00, 0x37, 0x96, 0xaa},
  2409. {0x00, 0x38, 0xa5, 0xaa},
  2410. {0x00, 0x39, 0xb4, 0xaa},
  2411. {0x00, 0x3a, 0xc3, 0xaa},
  2412. {0x00, 0x3b, 0xd2, 0xaa},
  2413. {0x00, 0x3c, 0xe1, 0xaa},
  2414. {0x00, 0x3e, 0xff, 0xaa},
  2415. {0x00, 0x3f, 0xff, 0xaa},
  2416. {0x00, 0x40, 0xff, 0xaa},
  2417. {0x00, 0x41, 0xff, 0xaa},
  2418. {0x00, 0x42, 0xff, 0xaa},
  2419. {0x00, 0x43, 0xff, 0xaa},
  2420. {0x00, 0x03, 0x00, 0xaa},
  2421. {0x00, 0x03, 0x00, 0xaa},
  2422. {0x00, 0x20, 0xc4, 0xaa},
  2423. {0x00, 0x13, 0x03, 0xaa},
  2424. {0x00, 0x3c, 0x50, 0xaa},
  2425. {0x00, 0x61, 0x6a, 0xaa}, /* sharpness? */
  2426. {0x00, 0x51, 0x5b, 0xaa},
  2427. {0x00, 0x52, 0x91, 0xaa},
  2428. {0x00, 0x53, 0x4c, 0xaa},
  2429. {0x00, 0x54, 0x50, 0xaa},
  2430. {0x00, 0x56, 0x02, 0xaa},
  2431. {0xb6, 0x00, 0x00, 0xcc},
  2432. {0xb6, 0x03, 0x03, 0xcc},
  2433. {0xb6, 0x02, 0x20, 0xcc},
  2434. {0xb6, 0x05, 0x02, 0xcc},
  2435. {0xb6, 0x04, 0x58, 0xcc},
  2436. {0xb6, 0x12, 0xf8, 0xcc},
  2437. {0xb6, 0x13, 0x21, 0xcc},
  2438. {0xb6, 0x18, 0x03, 0xcc},
  2439. {0xb6, 0x17, 0xa9, 0xcc},
  2440. {0xb6, 0x16, 0x80, 0xcc},
  2441. {0xb6, 0x22, 0x12, 0xcc},
  2442. {0xb6, 0x23, 0x0b, 0xcc},
  2443. {0xbf, 0xc0, 0x39, 0xcc},
  2444. {0xbf, 0xc1, 0x04, 0xcc},
  2445. {0xbf, 0xcc, 0x00, 0xcc},
  2446. {0xb8, 0x06, 0x20, 0xcc},
  2447. {0xb8, 0x07, 0x03, 0xcc},
  2448. {0xb8, 0x08, 0x58, 0xcc},
  2449. {0xb8, 0x09, 0x02, 0xcc},
  2450. {0xb3, 0x01, 0x41, 0xcc},
  2451. {0x00, 0x03, 0x00, 0xaa},
  2452. {0x00, 0xd9, 0x0f, 0xaa},
  2453. {0x00, 0xda, 0xaa, 0xaa},
  2454. {0x00, 0xd9, 0x10, 0xaa},
  2455. {0x00, 0xda, 0xaa, 0xaa},
  2456. {0x00, 0xd9, 0x11, 0xaa},
  2457. {0x00, 0xda, 0x00, 0xaa},
  2458. {0x00, 0xd9, 0x12, 0xaa},
  2459. {0x00, 0xda, 0xff, 0xaa},
  2460. {0x00, 0xd9, 0x13, 0xaa},
  2461. {0x00, 0xda, 0xff, 0xaa},
  2462. {0x00, 0xe8, 0x11, 0xaa},
  2463. {0x00, 0xe9, 0x12, 0xaa},
  2464. {0x00, 0xea, 0x5c, 0xaa},
  2465. {0x00, 0xeb, 0xff, 0xaa},
  2466. {0x00, 0xd8, 0x80, 0xaa},
  2467. {0x00, 0xe6, 0x02, 0xaa},
  2468. {0x00, 0xd6, 0x40, 0xaa},
  2469. {0x00, 0xe3, 0x05, 0xaa},
  2470. {0x00, 0xe0, 0x40, 0xaa},
  2471. {0x00, 0xde, 0x03, 0xaa},
  2472. {0x00, 0xdf, 0x03, 0xaa},
  2473. {0x00, 0xdb, 0x02, 0xaa},
  2474. {0x00, 0xdc, 0x00, 0xaa},
  2475. {0x00, 0xdd, 0x03, 0xaa},
  2476. {0x00, 0xe1, 0x08, 0xaa},
  2477. {0x00, 0xe2, 0x01, 0xaa},
  2478. {0x00, 0xd6, 0x40, 0xaa},
  2479. {0x00, 0xe4, 0x40, 0xaa},
  2480. {0x00, 0xa8, 0x8f, 0xaa},
  2481. {0x00, 0xb4, 0x16, 0xaa},
  2482. {0xb0, 0x02, 0x06, 0xcc},
  2483. {0xb0, 0x18, 0x06, 0xcc},
  2484. {0xb0, 0x19, 0x06, 0xcc},
  2485. {0xb3, 0x5d, 0x18, 0xcc},
  2486. {0xb3, 0x05, 0x00, 0xcc},
  2487. {0xb3, 0x06, 0x00, 0xcc},
  2488. {0x00, 0xb4, 0x0e, 0xaa},
  2489. {0x00, 0xb5, 0x49, 0xaa},
  2490. {0x00, 0xb6, 0x1c, 0xaa},
  2491. {0x00, 0xb7, 0x96, 0xaa},
  2492. /* end of usbvm326.inf - start of ms-win trace */
  2493. {0xb6, 0x12, 0xf8, 0xcc},
  2494. {0xb6, 0x13, 0x3d, 0xcc},
  2495. /*read b306*/
  2496. {0x00, 0x03, 0x00, 0xaa},
  2497. {0x00, 0x1a, 0x09, 0xaa},
  2498. {0x00, 0x1b, 0x8a, 0xaa},
  2499. /*read b827*/
  2500. {0xb8, 0x27, 0x00, 0xcc},
  2501. {0xb8, 0x26, 0x60, 0xcc},
  2502. {0xb8, 0x26, 0x60, 0xcc},
  2503. /*gamma - to do?*/
  2504. {0x00, 0x03, 0x00, 0xaa},
  2505. {0x00, 0xae, 0x84, 0xaa},
  2506. /*gamma again*/
  2507. {0x00, 0x03, 0x00, 0xaa},
  2508. {0x00, 0x96, 0xa0, 0xaa},
  2509. /*matrix*/
  2510. {0x00, 0x03, 0x00, 0xaa},
  2511. {0x00, 0x91, 0x35, 0xaa},
  2512. {0x00, 0x92, 0x22, 0xaa},
  2513. /*gamma*/
  2514. {0x00, 0x03, 0x00, 0xaa},
  2515. {0x00, 0x95, 0x85, 0xaa},
  2516. /*matrix*/
  2517. {0x00, 0x03, 0x00, 0xaa},
  2518. {0x00, 0x4d, 0x20, 0xaa},
  2519. {0xb8, 0x22, 0x40, 0xcc},
  2520. {0xb8, 0x23, 0x40, 0xcc},
  2521. {0xb8, 0x24, 0x40, 0xcc},
  2522. {0xb8, 0x81, 0x09, 0xcc},
  2523. {0x00, 0x00, 0x64, 0xdd},
  2524. {0x00, 0x03, 0x01, 0xaa},
  2525. /*read 46*/
  2526. {0x00, 0x46, 0x3c, 0xaa},
  2527. {0x00, 0x03, 0x00, 0xaa},
  2528. {0x00, 0x16, 0x40, 0xaa},
  2529. {0x00, 0x17, 0x40, 0xaa},
  2530. {0x00, 0x18, 0x40, 0xaa},
  2531. {0x00, 0x19, 0x41, 0xaa},
  2532. {0x00, 0x03, 0x01, 0xaa},
  2533. {0x00, 0x46, 0x3c, 0xaa},
  2534. {0x00, 0x00, 0x18, 0xdd},
  2535. /*read bfff*/
  2536. {0x00, 0x03, 0x00, 0xaa},
  2537. {0x00, 0xb4, 0x1c, 0xaa},
  2538. {0x00, 0xb5, 0x92, 0xaa},
  2539. {0x00, 0xb6, 0x39, 0xaa},
  2540. {0x00, 0xb7, 0x24, 0xaa},
  2541. /*write 89 0400 1415*/
  2542. {}
  2543. };
  2544. static const u8 poxxxx_init_common[][4] = {
  2545. {0xb3, 0x00, 0x04, 0xcc},
  2546. {0x00, 0x00, 0x10, 0xdd},
  2547. {0xb3, 0x00, 0x64, 0xcc},
  2548. {0x00, 0x00, 0x10, 0xdd},
  2549. {0xb3, 0x00, 0x65, 0xcc},
  2550. {0x00, 0x00, 0x10, 0xdd},
  2551. {0xb3, 0x00, 0x67, 0xcc},
  2552. {0xb0, 0x03, 0x09, 0xcc},
  2553. {0xb3, 0x05, 0x00, 0xcc},
  2554. {0xb3, 0x06, 0x00, 0xcc},
  2555. {0xb3, 0x5c, 0x01, 0xcc},
  2556. {0xb3, 0x08, 0x01, 0xcc},
  2557. {0xb3, 0x09, 0x0c, 0xcc},
  2558. {0xb3, 0x34, 0x01, 0xcc},
  2559. {0xb3, 0x35, 0xf6, 0xcc}, /* i2c add: 76 */
  2560. {0xb3, 0x02, 0xb0, 0xcc},
  2561. {0xb3, 0x03, 0x18, 0xcc},
  2562. {0xb3, 0x04, 0x15, 0xcc},
  2563. {0xb3, 0x20, 0x00, 0xcc},
  2564. {0xb3, 0x21, 0x00, 0xcc},
  2565. {0xb3, 0x22, 0x04, 0xcc}, /* sensor height = 1024 */
  2566. {0xb3, 0x23, 0x00, 0xcc},
  2567. {0xb3, 0x14, 0x00, 0xcc},
  2568. {0xb3, 0x15, 0x00, 0xcc},
  2569. {0xb3, 0x16, 0x04, 0xcc}, /* sensor width = 1280 */
  2570. {0xb3, 0x17, 0xff, 0xcc},
  2571. {0xb3, 0x2c, 0x03, 0xcc},
  2572. {0xb3, 0x2d, 0x56, 0xcc},
  2573. {0xb3, 0x2e, 0x02, 0xcc},
  2574. {0xb3, 0x2f, 0x0a, 0xcc},
  2575. {0xb3, 0x40, 0x00, 0xcc},
  2576. {0xb3, 0x41, 0x34, 0xcc},
  2577. {0xb3, 0x42, 0x01, 0xcc},
  2578. {0xb3, 0x43, 0xe0, 0xcc},
  2579. {0xbc, 0x00, 0x71, 0xcc},
  2580. {0xbc, 0x01, 0x01, 0xcc},
  2581. {0xb3, 0x01, 0x41, 0xcc},
  2582. {0xb3, 0x4d, 0x00, 0xcc},
  2583. {0x00, 0x0b, 0x2a, 0xaa},
  2584. {0x00, 0x0e, 0x03, 0xaa},
  2585. {0x00, 0x0f, 0xea, 0xaa},
  2586. {0x00, 0x12, 0x08, 0xaa},
  2587. {0x00, 0x1e, 0x06, 0xaa},
  2588. {0x00, 0x21, 0x00, 0xaa},
  2589. {0x00, 0x31, 0x1f, 0xaa},
  2590. {0x00, 0x33, 0x38, 0xaa},
  2591. {0x00, 0x36, 0xc0, 0xaa},
  2592. {0x00, 0x37, 0xc8, 0xaa},
  2593. {0x00, 0x3b, 0x36, 0xaa},
  2594. {0x00, 0x4b, 0xfe, 0xaa},
  2595. {0x00, 0x4d, 0x2e, 0xaa},
  2596. {0x00, 0x51, 0x1c, 0xaa},
  2597. {0x00, 0x52, 0x01, 0xaa},
  2598. {0x00, 0x55, 0x0a, 0xaa},
  2599. {0x00, 0x56, 0x0a, 0xaa},
  2600. {0x00, 0x57, 0x07, 0xaa},
  2601. {0x00, 0x58, 0x07, 0xaa},
  2602. {0x00, 0x59, 0x04, 0xaa},
  2603. {0x00, 0x70, 0x68, 0xaa},
  2604. {0x00, 0x71, 0x04, 0xaa},
  2605. {0x00, 0x72, 0x10, 0xaa},
  2606. {0x00, 0x80, 0x71, 0xaa},
  2607. {0x00, 0x81, 0x08, 0xaa},
  2608. {0x00, 0x82, 0x00, 0xaa},
  2609. {0x00, 0x83, 0x55, 0xaa},
  2610. {0x00, 0x84, 0x06, 0xaa},
  2611. {0x00, 0x85, 0x06, 0xaa},
  2612. {0x00, 0x8b, 0x25, 0xaa},
  2613. {0x00, 0x8c, 0x00, 0xaa},
  2614. {0x00, 0x8d, 0x86, 0xaa},
  2615. {0x00, 0x8e, 0x82, 0xaa},
  2616. {0x00, 0x8f, 0x2d, 0xaa},
  2617. {0x00, 0x90, 0x8b, 0xaa},
  2618. {0x00, 0x91, 0x81, 0xaa},
  2619. {0x00, 0x92, 0x81, 0xaa},
  2620. {0x00, 0x93, 0x23, 0xaa},
  2621. {0x00, 0xa3, 0x2a, 0xaa},
  2622. {0x00, 0xa4, 0x03, 0xaa},
  2623. {0x00, 0xa5, 0xea, 0xaa},
  2624. {0x00, 0xb0, 0x68, 0xaa},
  2625. {0x00, 0xbc, 0x04, 0xaa},
  2626. {0x00, 0xbe, 0x3b, 0xaa},
  2627. {0x00, 0x4e, 0x40, 0xaa},
  2628. {0x00, 0x06, 0x04, 0xaa},
  2629. {0x00, 0x07, 0x03, 0xaa},
  2630. {0x00, 0xcd, 0x18, 0xaa},
  2631. {0x00, 0x28, 0x03, 0xaa},
  2632. {0x00, 0x29, 0xef, 0xaa},
  2633. /* reinit on alt 2 (qvga) or alt7 (vga) */
  2634. {0xb3, 0x05, 0x00, 0xcc},
  2635. {0xb3, 0x06, 0x00, 0xcc},
  2636. {0xb8, 0x00, 0x01, 0xcc},
  2637. {0x00, 0x1d, 0x85, 0xaa},
  2638. {0x00, 0x1e, 0xc6, 0xaa},
  2639. {0x00, 0x00, 0x40, 0xdd},
  2640. {0x00, 0x1d, 0x05, 0xaa},
  2641. {}
  2642. };
  2643. static const u8 poxxxx_gamma[][4] = {
  2644. {0x00, 0xd6, 0x22, 0xaa}, /* gamma 0 */
  2645. {0x00, 0x73, 0x00, 0xaa},
  2646. {0x00, 0x74, 0x0a, 0xaa},
  2647. {0x00, 0x75, 0x16, 0xaa},
  2648. {0x00, 0x76, 0x25, 0xaa},
  2649. {0x00, 0x77, 0x34, 0xaa},
  2650. {0x00, 0x78, 0x49, 0xaa},
  2651. {0x00, 0x79, 0x5a, 0xaa},
  2652. {0x00, 0x7a, 0x7f, 0xaa},
  2653. {0x00, 0x7b, 0x9b, 0xaa},
  2654. {0x00, 0x7c, 0xba, 0xaa},
  2655. {0x00, 0x7d, 0xd4, 0xaa},
  2656. {0x00, 0x7e, 0xea, 0xaa},
  2657. {0x00, 0xd6, 0x62, 0xaa}, /* gamma 1 */
  2658. {0x00, 0x73, 0x00, 0xaa},
  2659. {0x00, 0x74, 0x0a, 0xaa},
  2660. {0x00, 0x75, 0x16, 0xaa},
  2661. {0x00, 0x76, 0x25, 0xaa},
  2662. {0x00, 0x77, 0x34, 0xaa},
  2663. {0x00, 0x78, 0x49, 0xaa},
  2664. {0x00, 0x79, 0x5a, 0xaa},
  2665. {0x00, 0x7a, 0x7f, 0xaa},
  2666. {0x00, 0x7b, 0x9b, 0xaa},
  2667. {0x00, 0x7c, 0xba, 0xaa},
  2668. {0x00, 0x7d, 0xd4, 0xaa},
  2669. {0x00, 0x7e, 0xea, 0xaa},
  2670. {0x00, 0xd6, 0xa2, 0xaa}, /* gamma 2 */
  2671. {0x00, 0x73, 0x00, 0xaa},
  2672. {0x00, 0x74, 0x0a, 0xaa},
  2673. {0x00, 0x75, 0x16, 0xaa},
  2674. {0x00, 0x76, 0x25, 0xaa},
  2675. {0x00, 0x77, 0x34, 0xaa},
  2676. {0x00, 0x78, 0x49, 0xaa},
  2677. {0x00, 0x79, 0x5a, 0xaa},
  2678. {0x00, 0x7a, 0x7f, 0xaa},
  2679. {0x00, 0x7b, 0x9b, 0xaa},
  2680. {0x00, 0x7c, 0xba, 0xaa},
  2681. {0x00, 0x7d, 0xd4, 0xaa},
  2682. {0x00, 0x7e, 0xea, 0xaa},
  2683. {}
  2684. };
  2685. static const u8 poxxxx_init_start_3[][4] = {
  2686. {0x00, 0xb8, 0x28, 0xaa},
  2687. {0x00, 0xb9, 0x1e, 0xaa},
  2688. {0x00, 0xb6, 0x14, 0xaa},
  2689. {0x00, 0xb7, 0x0f, 0xaa},
  2690. {0x00, 0x5c, 0x10, 0xaa},
  2691. {0x00, 0x5d, 0x18, 0xaa},
  2692. {0x00, 0x5e, 0x24, 0xaa},
  2693. {0x00, 0x5f, 0x24, 0xaa},
  2694. {0x00, 0x86, 0x1a, 0xaa},
  2695. {0x00, 0x60, 0x00, 0xaa},
  2696. {0x00, 0x61, 0x1b, 0xaa},
  2697. {0x00, 0x62, 0x30, 0xaa},
  2698. {0x00, 0x63, 0x40, 0xaa},
  2699. {0x00, 0x87, 0x1a, 0xaa},
  2700. {0x00, 0x64, 0x00, 0xaa},
  2701. {0x00, 0x65, 0x08, 0xaa},
  2702. {0x00, 0x66, 0x10, 0xaa},
  2703. {0x00, 0x67, 0x20, 0xaa},
  2704. {0x00, 0x88, 0x10, 0xaa},
  2705. {0x00, 0x68, 0x00, 0xaa},
  2706. {0x00, 0x69, 0x08, 0xaa},
  2707. {0x00, 0x6a, 0x0f, 0xaa},
  2708. {0x00, 0x6b, 0x0f, 0xaa},
  2709. {0x00, 0x89, 0x07, 0xaa},
  2710. {0x00, 0xd5, 0x4c, 0xaa},
  2711. {0x00, 0x0a, 0x00, 0xaa},
  2712. {0x00, 0x0b, 0x2a, 0xaa},
  2713. {0x00, 0x0e, 0x03, 0xaa},
  2714. {0x00, 0x0f, 0xea, 0xaa},
  2715. {0x00, 0xa2, 0x00, 0xaa},
  2716. {0x00, 0xa3, 0x2a, 0xaa},
  2717. {0x00, 0xa4, 0x03, 0xaa},
  2718. {0x00, 0xa5, 0xea, 0xaa},
  2719. {}
  2720. };
  2721. static const u8 poxxxx_initVGA[][4] = {
  2722. {0x00, 0x20, 0x11, 0xaa},
  2723. {0x00, 0x33, 0x38, 0xaa},
  2724. {0x00, 0xbb, 0x0d, 0xaa},
  2725. {0xb3, 0x22, 0x01, 0xcc}, /* change to 640x480 */
  2726. {0xb3, 0x23, 0xe0, 0xcc},
  2727. {0xb3, 0x16, 0x02, 0xcc},
  2728. {0xb3, 0x17, 0x7f, 0xcc},
  2729. {0xb3, 0x02, 0xb0, 0xcc},
  2730. {0xb3, 0x06, 0x00, 0xcc},
  2731. {0xb3, 0x5c, 0x01, 0xcc},
  2732. {0x00, 0x04, 0x06, 0xaa},
  2733. {0x00, 0x05, 0x3f, 0xaa},
  2734. {0x00, 0x04, 0x00, 0xdd}, /* delay 1s */
  2735. {}
  2736. };
  2737. static const u8 poxxxx_initQVGA[][4] = {
  2738. {0x00, 0x20, 0x33, 0xaa},
  2739. {0x00, 0x33, 0x38, 0xaa},
  2740. {0x00, 0xbb, 0x0d, 0xaa},
  2741. {0xb3, 0x22, 0x00, 0xcc}, /* change to 320x240 */
  2742. {0xb3, 0x23, 0xf0, 0xcc},
  2743. {0xb3, 0x16, 0x01, 0xcc},
  2744. {0xb3, 0x17, 0x3f, 0xcc},
  2745. {0xb3, 0x02, 0xb0, 0xcc},
  2746. {0xb3, 0x06, 0x01, 0xcc},
  2747. {0xb3, 0x5c, 0x00, 0xcc},
  2748. {0x00, 0x04, 0x06, 0xaa},
  2749. {0x00, 0x05, 0x3f, 0xaa},
  2750. {0x00, 0x04, 0x00, 0xdd}, /* delay 1s */
  2751. {}
  2752. };
  2753. static const u8 poxxxx_init_end_1[][4] = {
  2754. {0x00, 0x47, 0x25, 0xaa},
  2755. {0x00, 0x48, 0x80, 0xaa},
  2756. {0x00, 0x49, 0x1f, 0xaa},
  2757. {0x00, 0x4a, 0x40, 0xaa},
  2758. {0x00, 0x44, 0x40, 0xaa},
  2759. {0x00, 0xab, 0x4a, 0xaa},
  2760. {0x00, 0xb1, 0x00, 0xaa},
  2761. {0x00, 0xb2, 0x04, 0xaa},
  2762. {0x00, 0xb3, 0x08, 0xaa},
  2763. {0x00, 0xb4, 0x0b, 0xaa},
  2764. {0x00, 0xb5, 0x0d, 0xaa},
  2765. {}
  2766. };
  2767. static const u8 poxxxx_init_end_2[][4] = {
  2768. {0x00, 0x1d, 0x85, 0xaa},
  2769. {0x00, 0x1e, 0x06, 0xaa},
  2770. {0x00, 0x1d, 0x05, 0xaa},
  2771. {}
  2772. };
  2773. struct sensor_info {
  2774. s8 sensorId;
  2775. u8 I2cAdd;
  2776. u8 IdAdd;
  2777. u16 VpId;
  2778. u8 m1;
  2779. u8 m2;
  2780. u8 op;
  2781. };
  2782. /* probe values */
  2783. static const struct sensor_info vc0321_probe_data[] = {
  2784. /* sensorId, I2cAdd, IdAdd, VpId, m1, m2, op */
  2785. /* 0 OV9640 */
  2786. {-1, 0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05},
  2787. /* 1 ICM108T (may respond on IdAdd == 0x83 - tested in vc032x_probe_sensor) */
  2788. {-1, 0x80 | 0x20, 0x82, 0x0000, 0x24, 0x25, 0x01},
  2789. /* 2 PO2130 (may detect PO3130NC - tested in vc032x_probe_sensor)*/
  2790. {-1, 0x80 | 0x76, 0x00, 0x0000, 0x24, 0x25, 0x01},
  2791. /* 3 MI1310 */
  2792. {-1, 0x80 | 0x5d, 0x00, 0x0000, 0x24, 0x25, 0x01},
  2793. /* 4 MI360 - tested in vc032x_probe_sensor */
  2794. /* {SENSOR_MI0360, 0x80 | 0x5d, 0x00, 0x8243, 0x24, 0x25, 0x01}, */
  2795. /* 5 7131R */
  2796. {SENSOR_HV7131R, 0x80 | 0x11, 0x00, 0x0209, 0x24, 0x25, 0x01},
  2797. /* 6 OV7649 */
  2798. {-1, 0x80 | 0x21, 0x0a, 0x0000, 0x21, 0x20, 0x05},
  2799. /* 7 PAS302BCW */
  2800. {-1, 0x80 | 0x40, 0x00, 0x0000, 0x20, 0x22, 0x05},
  2801. /* 8 OV7660 */
  2802. {SENSOR_OV7660, 0x80 | 0x21, 0x0a, 0x7660, 0x26, 0x26, 0x05},
  2803. /* 9 PO3130NC - (tested in vc032x_probe_sensor) */
  2804. /* {SENSOR_PO3130NC, 0x80 | 0x76, 0x00, 0x3130, 0x24, 0x25, 0x01}, */
  2805. /* 10 PO1030KC */
  2806. {-1, 0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
  2807. /* 11 MI1310_SOC */
  2808. {SENSOR_MI1310_SOC, 0x80 | 0x5d, 0x00, 0x143a, 0x24, 0x25, 0x01},
  2809. /* 12 OV9650 */
  2810. {-1, 0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05},
  2811. /* 13 S5K532 */
  2812. {-1, 0x80 | 0x11, 0x39, 0x0000, 0x24, 0x25, 0x01},
  2813. /* 14 MI360_SOC - ??? */
  2814. /* 15 PO1200N */
  2815. {SENSOR_PO1200, 0x80 | 0x5c, 0x00, 0x1200, 0x67, 0x67, 0x01},
  2816. /* 16 PO3030K */
  2817. {-1, 0x80 | 0x18, 0x00, 0x0000, 0x24, 0x25, 0x01},
  2818. /* 17 PO2030 */
  2819. {-1, 0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
  2820. /* ?? */
  2821. {-1, 0x80 | 0x56, 0x01, 0x0000, 0x64, 0x67, 0x01},
  2822. {SENSOR_MI1320, 0x80 | 0x48, 0x00, 0x148c, 0x64, 0x65, 0x01},
  2823. };
  2824. static const struct sensor_info vc0323_probe_data[] = {
  2825. /* sensorId, I2cAdd, IdAdd, VpId, m1, m2, op */
  2826. /* 0 OV9640 */
  2827. {-1, 0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05},
  2828. /* 1 ICM108T (may respond on IdAdd == 0x83 - tested in vc032x_probe_sensor) */
  2829. {-1, 0x80 | 0x20, 0x82, 0x0000, 0x24, 0x25, 0x01},
  2830. /* 2 PO2130 (may detect PO3130NC - tested in vc032x_probe_sensor)*/
  2831. {-1, 0x80 | 0x76, 0x00, 0x0000, 0x24, 0x25, 0x01},
  2832. /* 3 MI1310 */
  2833. {-1, 0x80 | 0x5d, 0x00, 0x0000, 0x24, 0x25, 0x01},
  2834. /* 4 MI360 - tested in vc032x_probe_sensor */
  2835. /* {SENSOR_MI0360, 0x80 | 0x5d, 0x00, 0x8243, 0x24, 0x25, 0x01}, */
  2836. /* 5 7131R */
  2837. {SENSOR_HV7131R, 0x80 | 0x11, 0x00, 0x0209, 0x24, 0x25, 0x01},
  2838. /* 6 OV7649 */
  2839. {-1, 0x80 | 0x21, 0x0a, 0x0000, 0x21, 0x20, 0x05},
  2840. /* 7 PAS302BCW */
  2841. {-1, 0x80 | 0x40, 0x00, 0x0000, 0x20, 0x22, 0x05},
  2842. /* 8 OV7660 */
  2843. {SENSOR_OV7660, 0x80 | 0x21, 0x0a, 0x7660, 0x26, 0x26, 0x05},
  2844. /* 9 PO3130NC - (tested in vc032x_probe_sensor) */
  2845. /* {SENSOR_PO3130NC, 0x80 | 0x76, 0x00, 0x3130, 0x24, 0x25, 0x01}, */
  2846. /* 10 PO1030KC */
  2847. {-1, 0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
  2848. /* 11 MI1310_SOC */
  2849. {SENSOR_MI1310_SOC, 0x80 | 0x5d, 0x00, 0x143a, 0x24, 0x25, 0x01},
  2850. /* 12 OV9650 */
  2851. {-1, 0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05},
  2852. /* 13 S5K532 */
  2853. {-1, 0x80 | 0x11, 0x39, 0x0000, 0x24, 0x25, 0x01},
  2854. /* 14 MI360_SOC - ??? */
  2855. /* 15 PO1200N */
  2856. {SENSOR_PO1200, 0x80 | 0x5c, 0x00, 0x1200, 0x67, 0x67, 0x01},
  2857. /* 16 ?? */
  2858. {-1, 0x80 | 0x2d, 0x00, 0x0000, 0x65, 0x67, 0x01},
  2859. /* 17 PO2030 */
  2860. {-1, 0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
  2861. /* ?? */
  2862. {-1, 0x80 | 0x56, 0x01, 0x0000, 0x64, 0x67, 0x01},
  2863. {SENSOR_MI1320_SOC, 0x80 | 0x48, 0x00, 0x148c, 0x64, 0x67, 0x01},
  2864. /*fixme: not in the ms-win probe - may be found before? */
  2865. {SENSOR_OV7670, 0x80 | 0x21, 0x0a, 0x7673, 0x66, 0x67, 0x05},
  2866. };
  2867. /* read 'len' bytes in gspca_dev->usb_buf */
  2868. static void reg_r_i(struct gspca_dev *gspca_dev,
  2869. u16 req,
  2870. u16 index,
  2871. u16 len)
  2872. {
  2873. int ret;
  2874. if (gspca_dev->usb_err < 0)
  2875. return;
  2876. ret = usb_control_msg(gspca_dev->dev,
  2877. usb_rcvctrlpipe(gspca_dev->dev, 0),
  2878. req,
  2879. USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
  2880. 1, /* value */
  2881. index, gspca_dev->usb_buf, len,
  2882. 500);
  2883. if (ret < 0) {
  2884. pr_err("reg_r err %d\n", ret);
  2885. gspca_dev->usb_err = ret;
  2886. }
  2887. }
  2888. static void reg_r(struct gspca_dev *gspca_dev,
  2889. u16 req,
  2890. u16 index,
  2891. u16 len)
  2892. {
  2893. reg_r_i(gspca_dev, req, index, len);
  2894. if (gspca_dev->usb_err < 0)
  2895. return;
  2896. if (len == 1)
  2897. PDEBUG(D_USBI, "GET %02x 0001 %04x %02x", req, index,
  2898. gspca_dev->usb_buf[0]);
  2899. else
  2900. PDEBUG(D_USBI, "GET %02x 0001 %04x %*ph",
  2901. req, index, 3, gspca_dev->usb_buf);
  2902. }
  2903. static void reg_w_i(struct gspca_dev *gspca_dev,
  2904. u16 req,
  2905. u16 value,
  2906. u16 index)
  2907. {
  2908. int ret;
  2909. if (gspca_dev->usb_err < 0)
  2910. return;
  2911. ret = usb_control_msg(gspca_dev->dev,
  2912. usb_sndctrlpipe(gspca_dev->dev, 0),
  2913. req,
  2914. USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
  2915. value, index, NULL, 0,
  2916. 500);
  2917. if (ret < 0) {
  2918. pr_err("reg_w err %d\n", ret);
  2919. gspca_dev->usb_err = ret;
  2920. }
  2921. }
  2922. static void reg_w(struct gspca_dev *gspca_dev,
  2923. u16 req,
  2924. u16 value,
  2925. u16 index)
  2926. {
  2927. if (gspca_dev->usb_err < 0)
  2928. return;
  2929. PDEBUG(D_USBO, "SET %02x %04x %04x", req, value, index);
  2930. reg_w_i(gspca_dev, req, value, index);
  2931. }
  2932. static u16 read_sensor_register(struct gspca_dev *gspca_dev,
  2933. u16 address)
  2934. {
  2935. u8 ldata, mdata, hdata;
  2936. int retry = 50;
  2937. reg_r(gspca_dev, 0xa1, 0xb33f, 1);
  2938. if (!(gspca_dev->usb_buf[0] & 0x02)) {
  2939. pr_err("I2c Bus Busy Wait %02x\n", gspca_dev->usb_buf[0]);
  2940. return 0;
  2941. }
  2942. reg_w(gspca_dev, 0xa0, address, 0xb33a);
  2943. reg_w(gspca_dev, 0xa0, 0x02, 0xb339);
  2944. do {
  2945. reg_r(gspca_dev, 0xa1, 0xb33b, 1);
  2946. if (gspca_dev->usb_buf[0] == 0x00)
  2947. break;
  2948. msleep(40);
  2949. } while (--retry >= 0);
  2950. reg_r(gspca_dev, 0xa1, 0xb33e, 1);
  2951. ldata = gspca_dev->usb_buf[0];
  2952. reg_r(gspca_dev, 0xa1, 0xb33d, 1);
  2953. mdata = gspca_dev->usb_buf[0];
  2954. reg_r(gspca_dev, 0xa1, 0xb33c, 1);
  2955. hdata = gspca_dev->usb_buf[0];
  2956. if (hdata != 0 && mdata != 0 && ldata != 0)
  2957. PDEBUG(D_PROBE, "Read Sensor %02x%02x %02x",
  2958. hdata, mdata, ldata);
  2959. reg_r(gspca_dev, 0xa1, 0xb334, 1);
  2960. if (gspca_dev->usb_buf[0] == 0x02)
  2961. return (hdata << 8) + mdata;
  2962. return hdata;
  2963. }
  2964. static int vc032x_probe_sensor(struct gspca_dev *gspca_dev)
  2965. {
  2966. struct sd *sd = (struct sd *) gspca_dev;
  2967. int i, n;
  2968. u16 value;
  2969. const struct sensor_info *ptsensor_info;
  2970. /*fixme: should also check the other sensor (back mi1320_soc, front mc501cb)*/
  2971. if (sd->flags & FL_SAMSUNG) {
  2972. reg_w(gspca_dev, 0xa0, 0x01, 0xb301);
  2973. reg_w(gspca_dev, 0x89, 0xf0ff, 0xffff);
  2974. /* select the back sensor */
  2975. }
  2976. reg_r(gspca_dev, 0xa1, 0xbfcf, 1);
  2977. PDEBUG(D_PROBE, "vc032%d check sensor header %02x",
  2978. sd->bridge == BRIDGE_VC0321 ? 1 : 3, gspca_dev->usb_buf[0]);
  2979. if (sd->bridge == BRIDGE_VC0321) {
  2980. ptsensor_info = vc0321_probe_data;
  2981. n = ARRAY_SIZE(vc0321_probe_data);
  2982. } else {
  2983. ptsensor_info = vc0323_probe_data;
  2984. n = ARRAY_SIZE(vc0323_probe_data);
  2985. }
  2986. for (i = 0; i < n; i++) {
  2987. reg_w(gspca_dev, 0xa0, 0x02, 0xb334);
  2988. reg_w(gspca_dev, 0xa0, ptsensor_info->m1, 0xb300);
  2989. reg_w(gspca_dev, 0xa0, ptsensor_info->m2, 0xb300);
  2990. reg_w(gspca_dev, 0xa0, 0x01, 0xb308);
  2991. reg_w(gspca_dev, 0xa0, 0x0c, 0xb309);
  2992. reg_w(gspca_dev, 0xa0, ptsensor_info->I2cAdd, 0xb335);
  2993. reg_w(gspca_dev, 0xa0, ptsensor_info->op, 0xb301);
  2994. value = read_sensor_register(gspca_dev, ptsensor_info->IdAdd);
  2995. if (value == 0 && ptsensor_info->IdAdd == 0x82)
  2996. value = read_sensor_register(gspca_dev, 0x83);
  2997. if (value != 0) {
  2998. PDEBUG(D_PROBE, "Sensor ID %04x (%d)", value, i);
  2999. if (value == ptsensor_info->VpId)
  3000. return ptsensor_info->sensorId;
  3001. switch (value) {
  3002. case 0x3130:
  3003. return SENSOR_PO3130NC;
  3004. case 0x7673:
  3005. return SENSOR_OV7670;
  3006. case 0x8243:
  3007. return SENSOR_MI0360;
  3008. }
  3009. }
  3010. ptsensor_info++;
  3011. }
  3012. return -1;
  3013. }
  3014. static void i2c_write(struct gspca_dev *gspca_dev,
  3015. u8 reg, const u8 *val,
  3016. u8 size) /* 1 or 2 */
  3017. {
  3018. int retry;
  3019. if (gspca_dev->usb_err < 0)
  3020. return;
  3021. if (size == 1)
  3022. PDEBUG(D_USBO, "i2c_w %02x %02x", reg, *val);
  3023. else
  3024. PDEBUG(D_USBO, "i2c_w %02x %02x%02x", reg, *val, val[1]);
  3025. reg_r_i(gspca_dev, 0xa1, 0xb33f, 1);
  3026. /*fixme:should check if (!(gspca_dev->usb_buf[0] & 0x02)) error*/
  3027. reg_w_i(gspca_dev, 0xa0, size, 0xb334);
  3028. reg_w_i(gspca_dev, 0xa0, reg, 0xb33a);
  3029. reg_w_i(gspca_dev, 0xa0, val[0], 0xb336);
  3030. if (size > 1)
  3031. reg_w_i(gspca_dev, 0xa0, val[1], 0xb337);
  3032. reg_w_i(gspca_dev, 0xa0, 0x01, 0xb339);
  3033. retry = 4;
  3034. do {
  3035. reg_r_i(gspca_dev, 0xa1, 0xb33b, 1);
  3036. if (gspca_dev->usb_buf[0] == 0)
  3037. break;
  3038. msleep(20);
  3039. } while (--retry > 0);
  3040. if (retry <= 0)
  3041. pr_err("i2c_write timeout\n");
  3042. }
  3043. static void put_tab_to_reg(struct gspca_dev *gspca_dev,
  3044. const u8 *tab, u8 tabsize, u16 addr)
  3045. {
  3046. int j;
  3047. u16 ad = addr;
  3048. for (j = 0; j < tabsize; j++)
  3049. reg_w(gspca_dev, 0xa0, tab[j], ad++);
  3050. }
  3051. static void usb_exchange(struct gspca_dev *gspca_dev,
  3052. const u8 data[][4])
  3053. {
  3054. int i = 0;
  3055. for (;;) {
  3056. switch (data[i][3]) {
  3057. default:
  3058. return;
  3059. case 0xcc: /* normal write */
  3060. reg_w(gspca_dev, 0xa0, data[i][2],
  3061. (data[i][0]) << 8 | data[i][1]);
  3062. break;
  3063. case 0xaa: /* i2c op */
  3064. i2c_write(gspca_dev, data[i][1], &data[i][2], 1);
  3065. break;
  3066. case 0xbb: /* i2c op */
  3067. i2c_write(gspca_dev, data[i][0], &data[i][1], 2);
  3068. break;
  3069. case 0xdd:
  3070. msleep(data[i][1] * 256 + data[i][2] + 10);
  3071. break;
  3072. }
  3073. i++;
  3074. }
  3075. /*not reached*/
  3076. }
  3077. /* this function is called at probe time */
  3078. static int sd_config(struct gspca_dev *gspca_dev,
  3079. const struct usb_device_id *id)
  3080. {
  3081. struct sd *sd = (struct sd *) gspca_dev;
  3082. sd->bridge = id->driver_info >> 8;
  3083. sd->flags = id->driver_info & 0xff;
  3084. if (id->idVendor == 0x046d &&
  3085. (id->idProduct == 0x0892 || id->idProduct == 0x0896))
  3086. sd->sensor = SENSOR_POxxxx; /* no probe */
  3087. return 0;
  3088. }
  3089. /* this function is called at probe and resume time */
  3090. static int sd_init(struct gspca_dev *gspca_dev)
  3091. {
  3092. struct sd *sd = (struct sd *) gspca_dev;
  3093. struct cam *cam;
  3094. int sensor;
  3095. /* number of packets per ISOC message */
  3096. static u8 npkt[NSENSORS] = {
  3097. [SENSOR_HV7131R] = 64,
  3098. [SENSOR_MI0360] = 32,
  3099. [SENSOR_MI1310_SOC] = 32,
  3100. [SENSOR_MI1320] = 64,
  3101. [SENSOR_MI1320_SOC] = 128,
  3102. [SENSOR_OV7660] = 32,
  3103. [SENSOR_OV7670] = 64,
  3104. [SENSOR_PO1200] = 128,
  3105. [SENSOR_PO3130NC] = 128,
  3106. [SENSOR_POxxxx] = 128,
  3107. };
  3108. if (sd->sensor != SENSOR_POxxxx)
  3109. sensor = vc032x_probe_sensor(gspca_dev);
  3110. else
  3111. sensor = sd->sensor;
  3112. switch (sensor) {
  3113. case -1:
  3114. pr_err("Unknown sensor...\n");
  3115. return -EINVAL;
  3116. case SENSOR_HV7131R:
  3117. PDEBUG(D_PROBE, "Find Sensor HV7131R");
  3118. break;
  3119. case SENSOR_MI0360:
  3120. PDEBUG(D_PROBE, "Find Sensor MI0360");
  3121. sd->bridge = BRIDGE_VC0323;
  3122. break;
  3123. case SENSOR_MI1310_SOC:
  3124. PDEBUG(D_PROBE, "Find Sensor MI1310_SOC");
  3125. break;
  3126. case SENSOR_MI1320:
  3127. PDEBUG(D_PROBE, "Find Sensor MI1320");
  3128. break;
  3129. case SENSOR_MI1320_SOC:
  3130. PDEBUG(D_PROBE, "Find Sensor MI1320_SOC");
  3131. break;
  3132. case SENSOR_OV7660:
  3133. PDEBUG(D_PROBE, "Find Sensor OV7660");
  3134. break;
  3135. case SENSOR_OV7670:
  3136. PDEBUG(D_PROBE, "Find Sensor OV7670");
  3137. break;
  3138. case SENSOR_PO1200:
  3139. PDEBUG(D_PROBE, "Find Sensor PO1200");
  3140. break;
  3141. case SENSOR_PO3130NC:
  3142. PDEBUG(D_PROBE, "Find Sensor PO3130NC");
  3143. break;
  3144. case SENSOR_POxxxx:
  3145. PDEBUG(D_PROBE, "Sensor POxxxx");
  3146. break;
  3147. }
  3148. sd->sensor = sensor;
  3149. cam = &gspca_dev->cam;
  3150. if (sd->bridge == BRIDGE_VC0321) {
  3151. cam->cam_mode = vc0321_mode;
  3152. cam->nmodes = ARRAY_SIZE(vc0321_mode);
  3153. } else {
  3154. switch (sensor) {
  3155. case SENSOR_PO1200:
  3156. cam->cam_mode = svga_mode;
  3157. cam->nmodes = ARRAY_SIZE(svga_mode);
  3158. break;
  3159. case SENSOR_MI1310_SOC:
  3160. cam->cam_mode = vc0323_mode;
  3161. cam->nmodes = ARRAY_SIZE(vc0323_mode);
  3162. break;
  3163. case SENSOR_MI1320_SOC:
  3164. cam->cam_mode = bi_mode;
  3165. cam->nmodes = ARRAY_SIZE(bi_mode);
  3166. break;
  3167. case SENSOR_OV7670:
  3168. cam->cam_mode = bi_mode;
  3169. cam->nmodes = ARRAY_SIZE(bi_mode) - 1;
  3170. break;
  3171. default:
  3172. cam->cam_mode = vc0323_mode;
  3173. cam->nmodes = ARRAY_SIZE(vc0323_mode) - 1;
  3174. break;
  3175. }
  3176. }
  3177. cam->npkt = npkt[sd->sensor];
  3178. if (sd->sensor == SENSOR_OV7670)
  3179. sd->flags |= FL_HFLIP | FL_VFLIP;
  3180. if (sd->bridge == BRIDGE_VC0321) {
  3181. reg_r(gspca_dev, 0x8a, 0, 3);
  3182. reg_w(gspca_dev, 0x87, 0x00, 0x0f0f);
  3183. reg_r(gspca_dev, 0x8b, 0, 3);
  3184. reg_w(gspca_dev, 0x88, 0x00, 0x0202);
  3185. if (sd->sensor == SENSOR_POxxxx) {
  3186. reg_r(gspca_dev, 0xa1, 0xb300, 1);
  3187. if (gspca_dev->usb_buf[0] != 0) {
  3188. reg_w(gspca_dev, 0xa0, 0x26, 0xb300);
  3189. reg_w(gspca_dev, 0xa0, 0x04, 0xb300);
  3190. }
  3191. reg_w(gspca_dev, 0xa0, 0x00, 0xb300);
  3192. }
  3193. }
  3194. return gspca_dev->usb_err;
  3195. }
  3196. static void setbrightness(struct gspca_dev *gspca_dev, s32 val)
  3197. {
  3198. u8 data;
  3199. data = val;
  3200. if (data >= 0x80)
  3201. data &= 0x7f;
  3202. else
  3203. data = 0xff ^ data;
  3204. i2c_write(gspca_dev, 0x98, &data, 1);
  3205. }
  3206. static void setcontrast(struct gspca_dev *gspca_dev, u8 val)
  3207. {
  3208. i2c_write(gspca_dev, 0x99, &val, 1);
  3209. }
  3210. static void setcolors(struct gspca_dev *gspca_dev, u8 val)
  3211. {
  3212. u8 data;
  3213. data = val - (val >> 3) - 1;
  3214. i2c_write(gspca_dev, 0x94, &data, 1);
  3215. i2c_write(gspca_dev, 0x95, &val, 1);
  3216. }
  3217. static void sethvflip(struct gspca_dev *gspca_dev, bool hflip, bool vflip)
  3218. {
  3219. struct sd *sd = (struct sd *) gspca_dev;
  3220. u8 data[2];
  3221. if (sd->flags & FL_HFLIP)
  3222. hflip = !hflip;
  3223. if (sd->flags & FL_VFLIP)
  3224. vflip = !vflip;
  3225. switch (sd->sensor) {
  3226. case SENSOR_MI1310_SOC:
  3227. case SENSOR_MI1320:
  3228. case SENSOR_MI1320_SOC:
  3229. data[0] = data[1] = 0; /* select page 0 */
  3230. i2c_write(gspca_dev, 0xf0, data, 2);
  3231. data[0] = sd->sensor == SENSOR_MI1310_SOC ? 0x03 : 0x01;
  3232. data[1] = 0x02 * hflip
  3233. | 0x01 * vflip;
  3234. i2c_write(gspca_dev, 0x20, data, 2);
  3235. break;
  3236. case SENSOR_OV7660:
  3237. case SENSOR_OV7670:
  3238. data[0] = sd->sensor == SENSOR_OV7660 ? 0x01 : 0x07;
  3239. data[0] |= OV7660_MVFP_MIRROR * hflip
  3240. | OV7660_MVFP_VFLIP * vflip;
  3241. i2c_write(gspca_dev, OV7660_REG_MVFP, data, 1);
  3242. break;
  3243. case SENSOR_PO1200:
  3244. data[0] = 0;
  3245. i2c_write(gspca_dev, 0x03, data, 1);
  3246. data[0] = 0x80 * hflip
  3247. | 0x40 * vflip
  3248. | 0x06;
  3249. i2c_write(gspca_dev, 0x1e, data, 1);
  3250. break;
  3251. }
  3252. }
  3253. static void setlightfreq(struct gspca_dev *gspca_dev, s32 val)
  3254. {
  3255. struct sd *sd = (struct sd *) gspca_dev;
  3256. static const u8 (*ov7660_freq_tb[3])[4] =
  3257. {ov7660_NoFliker, ov7660_50HZ, ov7660_60HZ};
  3258. if (sd->sensor != SENSOR_OV7660)
  3259. return;
  3260. usb_exchange(gspca_dev, ov7660_freq_tb[val]);
  3261. }
  3262. static void setsharpness(struct gspca_dev *gspca_dev, s32 val)
  3263. {
  3264. struct sd *sd = (struct sd *) gspca_dev;
  3265. u8 data;
  3266. switch (sd->sensor) {
  3267. case SENSOR_PO1200:
  3268. data = 0;
  3269. i2c_write(gspca_dev, 0x03, &data, 1);
  3270. if (val < 0)
  3271. data = 0x6a;
  3272. else
  3273. data = 0xb5 + val * 3;
  3274. i2c_write(gspca_dev, 0x61, &data, 1);
  3275. break;
  3276. case SENSOR_POxxxx:
  3277. if (val < 0)
  3278. data = 0x7e; /* def = max */
  3279. else
  3280. data = 0x60 + val * 0x0f;
  3281. i2c_write(gspca_dev, 0x59, &data, 1);
  3282. break;
  3283. }
  3284. }
  3285. static void setgain(struct gspca_dev *gspca_dev, u8 val)
  3286. {
  3287. i2c_write(gspca_dev, 0x15, &val, 1);
  3288. }
  3289. static void setexposure(struct gspca_dev *gspca_dev, s32 val)
  3290. {
  3291. u8 data;
  3292. data = val >> 8;
  3293. i2c_write(gspca_dev, 0x1a, &data, 1);
  3294. data = val;
  3295. i2c_write(gspca_dev, 0x1b, &data, 1);
  3296. }
  3297. static void setautogain(struct gspca_dev *gspca_dev, s32 val)
  3298. {
  3299. static const u8 data[2] = {0x28, 0x3c};
  3300. i2c_write(gspca_dev, 0xd1, &data[val], 1);
  3301. }
  3302. static void setgamma(struct gspca_dev *gspca_dev)
  3303. {
  3304. /*fixme:to do */
  3305. usb_exchange(gspca_dev, poxxxx_gamma);
  3306. }
  3307. static void setbacklight(struct gspca_dev *gspca_dev, s32 val)
  3308. {
  3309. u16 v;
  3310. u8 data;
  3311. data = (val << 4) | 0x0f;
  3312. i2c_write(gspca_dev, 0xaa, &data, 1);
  3313. v = 613 + 12 * val;
  3314. data = v >> 8;
  3315. i2c_write(gspca_dev, 0xc4, &data, 1);
  3316. data = v;
  3317. i2c_write(gspca_dev, 0xc5, &data, 1);
  3318. v = 1093 - 12 * val;
  3319. data = v >> 8;
  3320. i2c_write(gspca_dev, 0xc6, &data, 1);
  3321. data = v;
  3322. i2c_write(gspca_dev, 0xc7, &data, 1);
  3323. v = 342 + 9 * val;
  3324. data = v >> 8;
  3325. i2c_write(gspca_dev, 0xc8, &data, 1);
  3326. data = v;
  3327. i2c_write(gspca_dev, 0xc9, &data, 1);
  3328. v = 702 - 9 * val;
  3329. data = v >> 8;
  3330. i2c_write(gspca_dev, 0xca, &data, 1);
  3331. data = v;
  3332. i2c_write(gspca_dev, 0xcb, &data, 1);
  3333. }
  3334. static void setwb(struct gspca_dev *gspca_dev)
  3335. {
  3336. /*fixme:to do - valid when reg d1 = 0x1c - (reg16 + reg15 = 0xa3)*/
  3337. static const u8 data[2] = {0x00, 0x00};
  3338. i2c_write(gspca_dev, 0x16, &data[0], 1);
  3339. i2c_write(gspca_dev, 0x18, &data[1], 1);
  3340. }
  3341. static int sd_start(struct gspca_dev *gspca_dev)
  3342. {
  3343. struct sd *sd = (struct sd *) gspca_dev;
  3344. const u8 (*init)[4];
  3345. const u8 *GammaT = NULL;
  3346. const u8 *MatrixT = NULL;
  3347. int mode;
  3348. static const u8 (*mi1320_soc_init[])[4] = {
  3349. mi1320_soc_InitSXGA,
  3350. mi1320_soc_InitVGA,
  3351. mi1320_soc_InitQVGA,
  3352. };
  3353. /*fixme: back sensor only*/
  3354. if (sd->flags & FL_SAMSUNG) {
  3355. reg_w(gspca_dev, 0x89, 0xf0ff, 0xffff);
  3356. reg_w(gspca_dev, 0xa9, 0x8348, 0x000e);
  3357. reg_w(gspca_dev, 0xa9, 0x0000, 0x001a);
  3358. }
  3359. /* Assume start use the good resolution from gspca_dev->mode */
  3360. if (sd->bridge == BRIDGE_VC0321) {
  3361. reg_w(gspca_dev, 0xa0, 0xff, 0xbfec);
  3362. reg_w(gspca_dev, 0xa0, 0xff, 0xbfed);
  3363. reg_w(gspca_dev, 0xa0, 0xff, 0xbfee);
  3364. reg_w(gspca_dev, 0xa0, 0xff, 0xbfef);
  3365. sd->image_offset = 46;
  3366. } else {
  3367. if (gspca_dev->cam.cam_mode[gspca_dev->curr_mode].pixelformat
  3368. == V4L2_PIX_FMT_JPEG)
  3369. sd->image_offset = 0;
  3370. else
  3371. sd->image_offset = 32;
  3372. }
  3373. mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
  3374. switch (sd->sensor) {
  3375. case SENSOR_HV7131R:
  3376. GammaT = hv7131r_gamma;
  3377. MatrixT = hv7131r_matrix;
  3378. if (mode)
  3379. init = hv7131r_initQVGA_data; /* 320x240 */
  3380. else
  3381. init = hv7131r_initVGA_data; /* 640x480 */
  3382. break;
  3383. case SENSOR_OV7660:
  3384. GammaT = ov7660_gamma;
  3385. MatrixT = ov7660_matrix;
  3386. if (mode)
  3387. init = ov7660_initQVGA_data; /* 320x240 */
  3388. else
  3389. init = ov7660_initVGA_data; /* 640x480 */
  3390. break;
  3391. case SENSOR_MI0360:
  3392. GammaT = mi1320_gamma;
  3393. MatrixT = mi0360_matrix;
  3394. if (mode)
  3395. init = mi0360_initQVGA_JPG; /* 320x240 */
  3396. else
  3397. init = mi0360_initVGA_JPG; /* 640x480 */
  3398. break;
  3399. case SENSOR_MI1310_SOC:
  3400. GammaT = mi1320_gamma;
  3401. MatrixT = mi1320_matrix;
  3402. switch (mode) {
  3403. case 1:
  3404. init = mi1310_socinitQVGA_JPG; /* 320x240 */
  3405. break;
  3406. case 0:
  3407. init = mi1310_socinitVGA_JPG; /* 640x480 */
  3408. break;
  3409. default:
  3410. init = mi1310_soc_InitSXGA_JPG; /* 1280x1024 */
  3411. break;
  3412. }
  3413. break;
  3414. case SENSOR_MI1320:
  3415. GammaT = mi1320_gamma;
  3416. MatrixT = mi1320_matrix;
  3417. if (mode)
  3418. init = mi1320_initQVGA_data; /* 320x240 */
  3419. else
  3420. init = mi1320_initVGA_data; /* 640x480 */
  3421. break;
  3422. case SENSOR_MI1320_SOC:
  3423. GammaT = mi1320_gamma;
  3424. MatrixT = mi1320_matrix;
  3425. init = mi1320_soc_init[mode];
  3426. break;
  3427. case SENSOR_OV7670:
  3428. init = mode == 1 ? ov7670_InitVGA : ov7670_InitQVGA;
  3429. break;
  3430. case SENSOR_PO3130NC:
  3431. GammaT = po3130_gamma;
  3432. MatrixT = po3130_matrix;
  3433. if (mode)
  3434. init = po3130_initQVGA_data; /* 320x240 */
  3435. else
  3436. init = po3130_initVGA_data; /* 640x480 */
  3437. usb_exchange(gspca_dev, init);
  3438. init = po3130_rundata;
  3439. break;
  3440. case SENSOR_PO1200:
  3441. GammaT = po1200_gamma;
  3442. MatrixT = po1200_matrix;
  3443. init = po1200_initVGA_data;
  3444. break;
  3445. default:
  3446. /* case SENSOR_POxxxx: */
  3447. usb_exchange(gspca_dev, poxxxx_init_common);
  3448. setgamma(gspca_dev);
  3449. usb_exchange(gspca_dev, poxxxx_init_start_3);
  3450. if (mode)
  3451. init = poxxxx_initQVGA;
  3452. else
  3453. init = poxxxx_initVGA;
  3454. usb_exchange(gspca_dev, init);
  3455. reg_r(gspca_dev, 0x8c, 0x0000, 3);
  3456. reg_w(gspca_dev, 0xa0,
  3457. gspca_dev->usb_buf[2] & 1 ? 0 : 1,
  3458. 0xb35c);
  3459. msleep(300);
  3460. /*fixme: i2c read 04 and 05*/
  3461. init = poxxxx_init_end_1;
  3462. break;
  3463. }
  3464. usb_exchange(gspca_dev, init);
  3465. if (GammaT && MatrixT) {
  3466. put_tab_to_reg(gspca_dev, GammaT, 17, 0xb84a);
  3467. put_tab_to_reg(gspca_dev, GammaT, 17, 0xb85b);
  3468. put_tab_to_reg(gspca_dev, GammaT, 17, 0xb86c);
  3469. put_tab_to_reg(gspca_dev, MatrixT, 9, 0xb82c);
  3470. switch (sd->sensor) {
  3471. case SENSOR_PO1200:
  3472. case SENSOR_HV7131R:
  3473. reg_w(gspca_dev, 0x89, 0x0400, 0x1415);
  3474. break;
  3475. case SENSOR_MI1310_SOC:
  3476. reg_w(gspca_dev, 0x89, 0x058c, 0x0000);
  3477. break;
  3478. }
  3479. msleep(100);
  3480. }
  3481. switch (sd->sensor) {
  3482. case SENSOR_OV7670:
  3483. reg_w(gspca_dev, 0x87, 0xffff, 0xffff);
  3484. reg_w(gspca_dev, 0x88, 0xff00, 0xf0f1);
  3485. reg_w(gspca_dev, 0xa0, 0x0000, 0xbfff);
  3486. break;
  3487. case SENSOR_POxxxx:
  3488. usb_exchange(gspca_dev, poxxxx_init_end_2);
  3489. setwb(gspca_dev);
  3490. msleep(80); /* led on */
  3491. reg_w(gspca_dev, 0x89, 0xffff, 0xfdff);
  3492. break;
  3493. }
  3494. return gspca_dev->usb_err;
  3495. }
  3496. static void sd_stopN(struct gspca_dev *gspca_dev)
  3497. {
  3498. struct sd *sd = (struct sd *) gspca_dev;
  3499. switch (sd->sensor) {
  3500. case SENSOR_MI1310_SOC:
  3501. reg_w(gspca_dev, 0x89, 0x058c, 0x00ff);
  3502. break;
  3503. case SENSOR_POxxxx:
  3504. return;
  3505. default:
  3506. if (!(sd->flags & FL_SAMSUNG))
  3507. reg_w(gspca_dev, 0x89, 0xffff, 0xffff);
  3508. break;
  3509. }
  3510. reg_w(gspca_dev, 0xa0, 0x01, 0xb301);
  3511. reg_w(gspca_dev, 0xa0, 0x09, 0xb003);
  3512. }
  3513. /* called on streamoff with alt 0 and on disconnect */
  3514. static void sd_stop0(struct gspca_dev *gspca_dev)
  3515. {
  3516. struct sd *sd = (struct sd *) gspca_dev;
  3517. if (!gspca_dev->present)
  3518. return;
  3519. /*fixme: is this useful?*/
  3520. if (sd->sensor == SENSOR_MI1310_SOC)
  3521. reg_w(gspca_dev, 0x89, 0x058c, 0x00ff);
  3522. else if (!(sd->flags & FL_SAMSUNG))
  3523. reg_w(gspca_dev, 0x89, 0xffff, 0xffff);
  3524. if (sd->sensor == SENSOR_POxxxx) {
  3525. reg_w(gspca_dev, 0xa0, 0x26, 0xb300);
  3526. reg_w(gspca_dev, 0xa0, 0x04, 0xb300);
  3527. reg_w(gspca_dev, 0xa0, 0x00, 0xb300);
  3528. }
  3529. }
  3530. static void sd_pkt_scan(struct gspca_dev *gspca_dev,
  3531. u8 *data, /* isoc packet */
  3532. int len) /* iso pkt length */
  3533. {
  3534. struct sd *sd = (struct sd *) gspca_dev;
  3535. if (data[0] == 0xff && data[1] == 0xd8) {
  3536. PDEBUG(D_PACK,
  3537. "vc032x header packet found len %d", len);
  3538. gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
  3539. data += sd->image_offset;
  3540. len -= sd->image_offset;
  3541. gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
  3542. return;
  3543. }
  3544. /* The vc0321 sends some additional data after sending the complete
  3545. * frame, we ignore this. */
  3546. if (sd->bridge == BRIDGE_VC0321) {
  3547. int size, l;
  3548. l = gspca_dev->image_len;
  3549. size = gspca_dev->frsz;
  3550. if (len > size - l)
  3551. len = size - l;
  3552. }
  3553. gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
  3554. }
  3555. static int sd_s_ctrl(struct v4l2_ctrl *ctrl)
  3556. {
  3557. struct gspca_dev *gspca_dev =
  3558. container_of(ctrl->handler, struct gspca_dev, ctrl_handler);
  3559. struct sd *sd = (struct sd *)gspca_dev;
  3560. gspca_dev->usb_err = 0;
  3561. if (!gspca_dev->streaming && ctrl->id != V4L2_CID_POWER_LINE_FREQUENCY)
  3562. return 0;
  3563. switch (ctrl->id) {
  3564. case V4L2_CID_BRIGHTNESS:
  3565. setbrightness(gspca_dev, ctrl->val);
  3566. break;
  3567. case V4L2_CID_CONTRAST:
  3568. setcontrast(gspca_dev, ctrl->val);
  3569. break;
  3570. case V4L2_CID_SATURATION:
  3571. setcolors(gspca_dev, ctrl->val);
  3572. break;
  3573. case V4L2_CID_HFLIP:
  3574. sethvflip(gspca_dev, sd->hflip->val, sd->vflip->val);
  3575. break;
  3576. case V4L2_CID_SHARPNESS:
  3577. setsharpness(gspca_dev, ctrl->val);
  3578. break;
  3579. case V4L2_CID_AUTOGAIN:
  3580. setautogain(gspca_dev, ctrl->val);
  3581. break;
  3582. case V4L2_CID_GAIN:
  3583. setgain(gspca_dev, ctrl->val);
  3584. break;
  3585. case V4L2_CID_EXPOSURE:
  3586. setexposure(gspca_dev, ctrl->val);
  3587. break;
  3588. case V4L2_CID_BACKLIGHT_COMPENSATION:
  3589. setbacklight(gspca_dev, ctrl->val);
  3590. break;
  3591. case V4L2_CID_POWER_LINE_FREQUENCY:
  3592. setlightfreq(gspca_dev, ctrl->val);
  3593. break;
  3594. }
  3595. return gspca_dev->usb_err;
  3596. }
  3597. static const struct v4l2_ctrl_ops sd_ctrl_ops = {
  3598. .s_ctrl = sd_s_ctrl,
  3599. };
  3600. static int sd_init_controls(struct gspca_dev *gspca_dev)
  3601. {
  3602. struct sd *sd = (struct sd *)gspca_dev;
  3603. struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler;
  3604. bool has_brightness = false;
  3605. bool has_contrast = false;
  3606. bool has_sat = false;
  3607. bool has_hvflip = false;
  3608. bool has_freq = false;
  3609. bool has_backlight = false;
  3610. bool has_exposure = false;
  3611. bool has_autogain = false;
  3612. bool has_gain = false;
  3613. bool has_sharpness = false;
  3614. switch (sd->sensor) {
  3615. case SENSOR_HV7131R:
  3616. case SENSOR_MI0360:
  3617. case SENSOR_PO3130NC:
  3618. break;
  3619. case SENSOR_MI1310_SOC:
  3620. case SENSOR_MI1320:
  3621. case SENSOR_MI1320_SOC:
  3622. case SENSOR_OV7660:
  3623. has_hvflip = true;
  3624. break;
  3625. case SENSOR_OV7670:
  3626. has_hvflip = has_freq = true;
  3627. break;
  3628. case SENSOR_PO1200:
  3629. has_hvflip = has_sharpness = true;
  3630. break;
  3631. case SENSOR_POxxxx:
  3632. has_brightness = has_contrast = has_sat = has_backlight =
  3633. has_exposure = has_autogain = has_gain =
  3634. has_sharpness = true;
  3635. break;
  3636. }
  3637. gspca_dev->vdev.ctrl_handler = hdl;
  3638. v4l2_ctrl_handler_init(hdl, 8);
  3639. if (has_brightness)
  3640. v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
  3641. V4L2_CID_BRIGHTNESS, 0, 255, 1, 128);
  3642. if (has_contrast)
  3643. v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
  3644. V4L2_CID_CONTRAST, 0, 255, 1, 127);
  3645. if (has_sat)
  3646. v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
  3647. V4L2_CID_SATURATION, 1, 127, 1, 63);
  3648. if (has_hvflip) {
  3649. sd->hflip = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
  3650. V4L2_CID_HFLIP, 0, 1, 1, 0);
  3651. sd->vflip = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
  3652. V4L2_CID_VFLIP, 0, 1, 1, 0);
  3653. }
  3654. if (has_sharpness)
  3655. v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
  3656. V4L2_CID_SHARPNESS, -1, 2, 1, -1);
  3657. if (has_freq)
  3658. v4l2_ctrl_new_std_menu(hdl, &sd_ctrl_ops,
  3659. V4L2_CID_POWER_LINE_FREQUENCY,
  3660. V4L2_CID_POWER_LINE_FREQUENCY_60HZ, 0,
  3661. V4L2_CID_POWER_LINE_FREQUENCY_50HZ);
  3662. if (has_autogain)
  3663. v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
  3664. V4L2_CID_AUTOGAIN, 0, 1, 1, 1);
  3665. if (has_gain)
  3666. v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
  3667. V4L2_CID_GAIN, 0, 78, 1, 0);
  3668. if (has_exposure)
  3669. v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
  3670. V4L2_CID_EXPOSURE, 0, 4095, 1, 450);
  3671. if (has_backlight)
  3672. v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
  3673. V4L2_CID_BACKLIGHT_COMPENSATION, 0, 15, 1, 15);
  3674. if (hdl->error) {
  3675. pr_err("Could not initialize controls\n");
  3676. return hdl->error;
  3677. }
  3678. if (sd->hflip)
  3679. v4l2_ctrl_cluster(2, &sd->hflip);
  3680. return 0;
  3681. }
  3682. /* sub-driver description */
  3683. static const struct sd_desc sd_desc = {
  3684. .name = MODULE_NAME,
  3685. .init_controls = sd_init_controls,
  3686. .config = sd_config,
  3687. .init = sd_init,
  3688. .start = sd_start,
  3689. .stopN = sd_stopN,
  3690. .stop0 = sd_stop0,
  3691. .pkt_scan = sd_pkt_scan,
  3692. };
  3693. /* -- module initialisation -- */
  3694. #define BF(bridge, flags) \
  3695. .driver_info = (BRIDGE_ ## bridge << 8) \
  3696. | (flags)
  3697. static const struct usb_device_id device_table[] = {
  3698. {USB_DEVICE(0x041e, 0x405b), BF(VC0323, FL_VFLIP)},
  3699. {USB_DEVICE(0x046d, 0x0892), BF(VC0321, 0)},
  3700. {USB_DEVICE(0x046d, 0x0896), BF(VC0321, 0)},
  3701. {USB_DEVICE(0x046d, 0x0897), BF(VC0321, 0)},
  3702. {USB_DEVICE(0x0ac8, 0x0321), BF(VC0321, 0)},
  3703. {USB_DEVICE(0x0ac8, 0x0323), BF(VC0323, 0)},
  3704. {USB_DEVICE(0x0ac8, 0x0328), BF(VC0321, 0)},
  3705. {USB_DEVICE(0x0ac8, 0xc001), BF(VC0321, 0)},
  3706. {USB_DEVICE(0x0ac8, 0xc002), BF(VC0321, 0)},
  3707. {USB_DEVICE(0x0ac8, 0xc301), BF(VC0323, FL_SAMSUNG)},
  3708. {USB_DEVICE(0x15b8, 0x6001), BF(VC0323, 0)},
  3709. {USB_DEVICE(0x15b8, 0x6002), BF(VC0323, 0)},
  3710. {USB_DEVICE(0x17ef, 0x4802), BF(VC0323, 0)},
  3711. {}
  3712. };
  3713. MODULE_DEVICE_TABLE(usb, device_table);
  3714. /* -- device connect -- */
  3715. static int sd_probe(struct usb_interface *intf,
  3716. const struct usb_device_id *id)
  3717. {
  3718. return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
  3719. THIS_MODULE);
  3720. }
  3721. static struct usb_driver sd_driver = {
  3722. .name = MODULE_NAME,
  3723. .id_table = device_table,
  3724. .probe = sd_probe,
  3725. .disconnect = gspca_disconnect,
  3726. #ifdef CONFIG_PM
  3727. .suspend = gspca_suspend,
  3728. .resume = gspca_resume,
  3729. .reset_resume = gspca_resume,
  3730. #endif
  3731. };
  3732. module_usb_driver(sd_driver);