nw80x.c 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111
  1. /*
  2. * DivIO nw80x subdriver
  3. *
  4. * Copyright (C) 2011 Jean-François Moine (http://moinejf.free.fr)
  5. * Copyright (C) 2003 Sylvain Munaut <tnt@246tNt.com>
  6. * Kjell Claesson <keyson@users.sourceforge.net>
  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 "nw80x"
  24. #include "gspca.h"
  25. MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>");
  26. MODULE_DESCRIPTION("NW80x USB Camera Driver");
  27. MODULE_LICENSE("GPL");
  28. static int webcam;
  29. /* specific webcam descriptor */
  30. struct sd {
  31. struct gspca_dev gspca_dev; /* !! must be the first item */
  32. u32 ae_res;
  33. s8 ag_cnt;
  34. #define AG_CNT_START 13
  35. u8 exp_too_low_cnt;
  36. u8 exp_too_high_cnt;
  37. u8 bridge;
  38. u8 webcam;
  39. };
  40. enum bridges {
  41. BRIDGE_NW800, /* and et31x110 */
  42. BRIDGE_NW801,
  43. BRIDGE_NW802,
  44. };
  45. enum webcams {
  46. Generic800,
  47. SpaceCam, /* Trust 120 SpaceCam */
  48. SpaceCam2, /* other Trust 120 SpaceCam */
  49. Cvideopro, /* Conceptronic Video Pro */
  50. Dlink350c,
  51. DS3303u,
  52. Kr651us,
  53. Kritter,
  54. Mustek300,
  55. Proscope,
  56. Twinkle,
  57. DvcV6,
  58. P35u,
  59. Generic802,
  60. NWEBCAMS /* number of webcams */
  61. };
  62. static const u8 webcam_chip[NWEBCAMS] = {
  63. [Generic800] = BRIDGE_NW800, /* 06a5:0000
  64. * Typhoon Webcam 100 USB */
  65. [SpaceCam] = BRIDGE_NW800, /* 06a5:d800
  66. * Trust SpaceCam120 or SpaceCam100 PORTABLE */
  67. [SpaceCam2] = BRIDGE_NW800, /* 06a5:d800 - pas106
  68. * other Trust SpaceCam120 or SpaceCam100 PORTABLE */
  69. [Cvideopro] = BRIDGE_NW802, /* 06a5:d001
  70. * Conceptronic Video Pro 'CVIDEOPRO USB Webcam CCD' */
  71. [Dlink350c] = BRIDGE_NW802, /* 06a5:d001
  72. * D-Link NetQam Pro 250plus */
  73. [DS3303u] = BRIDGE_NW801, /* 06a5:d001
  74. * Plustek Opticam 500U or ProLink DS3303u */
  75. [Kr651us] = BRIDGE_NW802, /* 06a5:d001
  76. * Panasonic GP-KR651US */
  77. [Kritter] = BRIDGE_NW802, /* 06a5:d001
  78. * iRez Kritter cam */
  79. [Mustek300] = BRIDGE_NW802, /* 055f:d001
  80. * Mustek Wcam 300 mini */
  81. [Proscope] = BRIDGE_NW802, /* 06a5:d001
  82. * Scalar USB Microscope (ProScope) */
  83. [Twinkle] = BRIDGE_NW800, /* 06a5:d800 - hv7121b? (seems pas106)
  84. * Divio Chicony TwinkleCam
  85. * DSB-C110 */
  86. [DvcV6] = BRIDGE_NW802, /* 0502:d001
  87. * DVC V6 */
  88. [P35u] = BRIDGE_NW801, /* 052b:d001, 06a5:d001 and 06be:d001
  89. * EZCam Pro p35u */
  90. [Generic802] = BRIDGE_NW802,
  91. };
  92. /*
  93. * other webcams:
  94. * - nw801 046d:d001
  95. * Logitech QuickCam Pro (dark focus ring)
  96. * - nw801 0728:d001
  97. * AVerMedia Camguard
  98. * - nw??? 06a5:d001
  99. * D-Link NetQam Pro 250plus
  100. * - nw800 065a:d800
  101. * Showcam NGS webcam
  102. * - nw??? ????:????
  103. * Sceptre svc300
  104. */
  105. /*
  106. * registers
  107. * nw800/et31x110 nw801 nw802
  108. * 0000..009e 0000..00a1 0000..009e
  109. * 0200..0211 id id
  110. * 0300..0302 id id
  111. * 0400..0406 (inex) 0400..0406
  112. * 0500..0505 0500..0506 (inex)
  113. * 0600..061a 0600..0601 0600..0601
  114. * 0800..0814 id id
  115. * 1000..109c 1000..10a1 1000..109a
  116. */
  117. /* resolutions
  118. * nw800: 320x240, 352x288
  119. * nw801/802: 320x240, 640x480
  120. */
  121. static const struct v4l2_pix_format cif_mode[] = {
  122. {320, 240, V4L2_PIX_FMT_JPGL, V4L2_FIELD_NONE,
  123. .bytesperline = 320,
  124. .sizeimage = 320 * 240 * 4 / 8,
  125. .colorspace = V4L2_COLORSPACE_JPEG},
  126. {352, 288, V4L2_PIX_FMT_JPGL, V4L2_FIELD_NONE,
  127. .bytesperline = 352,
  128. .sizeimage = 352 * 288 * 4 / 8,
  129. .colorspace = V4L2_COLORSPACE_JPEG}
  130. };
  131. static const struct v4l2_pix_format vga_mode[] = {
  132. {320, 240, V4L2_PIX_FMT_JPGL, V4L2_FIELD_NONE,
  133. .bytesperline = 320,
  134. .sizeimage = 320 * 240 * 4 / 8,
  135. .colorspace = V4L2_COLORSPACE_JPEG},
  136. {640, 480, V4L2_PIX_FMT_JPGL, V4L2_FIELD_NONE,
  137. .bytesperline = 640,
  138. .sizeimage = 640 * 480 * 3 / 8,
  139. .colorspace = V4L2_COLORSPACE_JPEG},
  140. };
  141. /*
  142. * The sequences below contain:
  143. * - 1st and 2nd bytes: either
  144. * - register number (BE)
  145. * - I2C0 + i2c address
  146. * - 3rd byte: data length (=0 for end of sequence)
  147. * - n bytes: data
  148. */
  149. #define I2C0 0xff
  150. static const u8 nw800_init[] = {
  151. 0x04, 0x05, 0x01, 0x61,
  152. 0x04, 0x04, 0x01, 0x01,
  153. 0x04, 0x06, 0x01, 0x04,
  154. 0x04, 0x04, 0x03, 0x00, 0x00, 0x00,
  155. 0x05, 0x05, 0x01, 0x00,
  156. 0, 0, 0
  157. };
  158. static const u8 nw800_start[] = {
  159. 0x04, 0x06, 0x01, 0xc0,
  160. 0x00, 0x00, 0x40, 0x10, 0x43, 0x00, 0xb4, 0x01, 0x10, 0x00, 0x4f,
  161. 0xef, 0x0e, 0x00, 0x74, 0x01, 0x01, 0x00, 0x19,
  162. 0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
  163. 0x00, 0x01, 0x00, 0x19, 0x00, 0x3e, 0x00, 0x24,
  164. 0x03, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
  165. 0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
  166. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
  167. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
  168. 0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  169. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  170. 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  171. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  172. 0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
  173. 0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
  174. 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
  175. 0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
  176. 0x00, 0x80, 0x1f, 0xa0, 0x48, 0xc3, 0x02, 0x88, 0x0c, 0x68, 0x00,
  177. 0x00, 0x00, 0x00, 0x00, 0xa8, 0x06, 0x00, 0x08,
  178. 0x00, 0x32, 0x01, 0x01, 0x00, 0x16, 0x00, 0x04,
  179. 0x00, 0x4b, 0x00, 0x76, 0x00, 0x86, 0x00,
  180. 0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
  181. 0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
  182. 0x40, 0x20,
  183. 0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
  184. 0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x61, 0xc0,
  185. 0x05, 0x00, 0x06, 0xe8, 0x00, 0x00, 0x00, 0x20, 0x20,
  186. 0x06, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  187. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  188. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  189. 0x00, 0x00, 0x00,
  190. 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  191. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  192. 0x00, 0x00, 0x00, 0x00, 0x00,
  193. 0x10, 0x00, 0x40, 0x83, 0x02, 0x20, 0x00, 0x13, 0x00, 0x00, 0x00,
  194. 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
  195. 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  196. 0x00, 0x49, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00,
  197. 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
  198. 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
  199. 0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
  200. 0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
  201. 0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
  202. 0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
  203. 0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
  204. 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
  205. 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
  206. 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
  207. 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
  208. 0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
  209. 0x10, 0x80, 0x1d, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
  210. 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x62,
  211. 0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01, 0x20,
  212. 0x01, 0x60, 0x01, 0x00, 0x00,
  213. 0x04, 0x04, 0x01, 0xff,
  214. 0x04, 0x06, 0x01, 0xc4,
  215. 0x04, 0x06, 0x01, 0xc0,
  216. 0x00, 0x00, 0x40, 0x10, 0x43, 0x00, 0xb4, 0x01, 0x10, 0x00, 0x4f,
  217. 0xef, 0x0e, 0x00, 0x74, 0x01, 0x01, 0x00, 0x19,
  218. 0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
  219. 0x00, 0x01, 0x00, 0x19, 0x00, 0x3e, 0x00, 0x24,
  220. 0x03, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
  221. 0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
  222. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
  223. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
  224. 0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  225. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  226. 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  227. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  228. 0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
  229. 0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
  230. 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
  231. 0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
  232. 0x00, 0x80, 0x1f, 0xa0, 0x48, 0xc3, 0x02, 0x88, 0x0c, 0x68, 0x00,
  233. 0x00, 0x00, 0x00, 0x00, 0xa8, 0x06, 0x00, 0x08,
  234. 0x00, 0x32, 0x01, 0x01, 0x00, 0x16, 0x00, 0x04,
  235. 0x00, 0x4b, 0x00, 0x76, 0x00, 0x86, 0x00,
  236. 0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
  237. 0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
  238. 0x40, 0x20,
  239. 0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
  240. 0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x61, 0xc0,
  241. 0x05, 0x00, 0x06, 0xe8, 0x00, 0x00, 0x00, 0x20, 0x20,
  242. 0x06, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  243. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  244. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  245. 0x00, 0x00, 0x00,
  246. 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  247. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  248. 0x00, 0x00, 0x00, 0x00, 0x00,
  249. 0x10, 0x00, 0x40, 0x83, 0x02, 0x20, 0x00, 0x13, 0x00, 0x00, 0x00,
  250. 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
  251. 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  252. 0x00, 0x49, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00,
  253. 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
  254. 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
  255. 0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
  256. 0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
  257. 0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
  258. 0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
  259. 0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
  260. 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
  261. 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
  262. 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
  263. 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
  264. 0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
  265. 0x10, 0x80, 0x1d, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
  266. 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x62,
  267. 0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01, 0x20,
  268. 0x01, 0x60, 0x01, 0x00, 0x00,
  269. 0x02, 0x00, 0x11, 0x48, 0x58, 0x9e, 0x48, 0x58, 0x00, 0x00, 0x00,
  270. 0x00, 0x84, 0x36, 0x05, 0x01, 0xf2, 0x86, 0x65,
  271. 0x40,
  272. 0x00, 0x80, 0x01, 0xa0,
  273. 0x10, 0x1a, 0x01, 0x00,
  274. 0x00, 0x91, 0x02, 0x6c, 0x01,
  275. 0x00, 0x03, 0x02, 0xc8, 0x01,
  276. 0x10, 0x1a, 0x01, 0x00,
  277. 0x10, 0x00, 0x01, 0x83,
  278. 0x10, 0x8f, 0x0c, 0x62, 0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01,
  279. 0x20, 0x01, 0x60, 0x01,
  280. 0x10, 0x85, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
  281. 0x10, 0x1b, 0x02, 0x69, 0x00,
  282. 0x10, 0x11, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
  283. 0x05, 0x02, 0x01, 0x02,
  284. 0x06, 0x00, 0x02, 0x04, 0xd9,
  285. 0x05, 0x05, 0x01, 0x20,
  286. 0x05, 0x05, 0x01, 0x21,
  287. 0x10, 0x0e, 0x01, 0x08,
  288. 0x10, 0x41, 0x11, 0x00, 0x08, 0x21, 0x3d, 0x52, 0x63, 0x75, 0x83,
  289. 0x91, 0x9e, 0xaa, 0xb6, 0xc1, 0xcc, 0xd6, 0xe0,
  290. 0xea,
  291. 0x10, 0x03, 0x01, 0x00,
  292. 0x10, 0x0f, 0x02, 0x13, 0x13,
  293. 0x10, 0x03, 0x01, 0x14,
  294. 0x10, 0x41, 0x11, 0x00, 0x08, 0x21, 0x3d, 0x52, 0x63, 0x75, 0x83,
  295. 0x91, 0x9e, 0xaa, 0xb6, 0xc1, 0xcc, 0xd6, 0xe0,
  296. 0xea,
  297. 0x10, 0x0b, 0x01, 0x14,
  298. 0x10, 0x0d, 0x01, 0x20,
  299. 0x10, 0x0c, 0x01, 0x34,
  300. 0x04, 0x06, 0x01, 0xc3,
  301. 0x04, 0x04, 0x01, 0x00,
  302. 0x05, 0x02, 0x01, 0x02,
  303. 0x06, 0x00, 0x02, 0x00, 0x48,
  304. 0x05, 0x05, 0x01, 0x20,
  305. 0x05, 0x05, 0x01, 0x21,
  306. 0, 0, 0
  307. };
  308. /* 06a5:d001 - nw801 - Panasonic
  309. * P35u */
  310. static const u8 nw801_start_1[] = {
  311. 0x05, 0x06, 0x01, 0x04,
  312. 0x00, 0x00, 0x40, 0x0e, 0x00, 0x00, 0xf9, 0x02, 0x11, 0x00, 0x0e,
  313. 0x01, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
  314. 0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
  315. 0x00, 0x01, 0x00, 0x19, 0x00, 0xce, 0x00, 0xf4,
  316. 0x05, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
  317. 0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
  318. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
  319. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
  320. 0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  321. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  322. 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  323. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  324. 0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
  325. 0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
  326. 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
  327. 0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
  328. 0x00, 0x80, 0x22, 0xb4, 0x6f, 0x3f, 0x0f, 0x88, 0x20, 0x08, 0x00,
  329. 0x00, 0x00, 0x00, 0x00, 0x69, 0xa8, 0x1f, 0x00,
  330. 0x0d, 0x02, 0x07, 0x00, 0x01, 0x00, 0x19, 0x00,
  331. 0xf2, 0x00, 0x18, 0x06, 0x10, 0x06, 0x10, 0x00,
  332. 0x36, 0x00,
  333. 0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
  334. 0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
  335. 0x40, 0x20,
  336. 0x03, 0x00, 0x03, 0x00, 0x00, 0x00,
  337. 0x05, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
  338. 0x06, 0x00, 0x02, 0x09, 0x99,
  339. 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  340. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  341. 0x00, 0x00, 0x00, 0x00, 0x00,
  342. 0x10, 0x00, 0x40, 0x22, 0x02, 0x80, 0x00, 0x1e, 0x00, 0x00, 0x00,
  343. 0x00, 0x00, 0x00, 0x0a, 0x15, 0x08, 0x08, 0x0a,
  344. 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  345. 0x00, 0x01, 0x35, 0xfd, 0x07, 0x3d, 0x00, 0x00,
  346. 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x14, 0x02,
  347. 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
  348. 0x40, 0x00, 0x00, 0x00, 0x40, 0x20, 0x10, 0x06,
  349. 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06, 0xf7,
  350. 0x10, 0x40, 0x40, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80, 0x80,
  351. 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99, 0xa4,
  352. 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc, 0xcf,
  353. 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54, 0x64,
  354. 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2, 0xe2,
  355. 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
  356. 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
  357. 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
  358. 0x10, 0x80, 0x22, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
  359. 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00, 0x00,
  360. 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x82, 0x02,
  361. 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40, 0x01,
  362. 0xf0, 0x00,
  363. 0, 0, 0,
  364. };
  365. static const u8 nw801_start_qvga[] = {
  366. 0x02, 0x00, 0x10, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
  367. 0x00, 0x78, 0x18, 0x0b, 0x06, 0xa2, 0x86, 0x78,
  368. 0x02, 0x0f, 0x01, 0x6b,
  369. 0x10, 0x1a, 0x01, 0x15,
  370. 0x00, 0x00, 0x01, 0x1e,
  371. 0x10, 0x00, 0x01, 0x2f,
  372. 0x10, 0x8c, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
  373. 0x10, 0x11, 0x08, 0x29, 0x00, 0x18, 0x01, 0x1f, 0x00, 0xd2, 0x00,
  374. /* AE window */
  375. 0, 0, 0,
  376. };
  377. static const u8 nw801_start_vga[] = {
  378. 0x02, 0x00, 0x10, 0x78, 0xa0, 0x97, 0x78, 0xa0, 0x00, 0x00, 0x00,
  379. 0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xf0,
  380. 0x02, 0x0f, 0x01, 0xd5,
  381. 0x10, 0x1a, 0x01, 0x15,
  382. 0x00, 0x00, 0x01, 0x0e,
  383. 0x10, 0x00, 0x01, 0x22,
  384. 0x10, 0x8c, 0x08, 0x00, 0x00, 0x7f, 0x02, 0x00, 0x00, 0xdf, 0x01,
  385. 0x10, 0x11, 0x08, 0x51, 0x00, 0x30, 0x02, 0x3d, 0x00, 0xa4, 0x01,
  386. 0, 0, 0,
  387. };
  388. static const u8 nw801_start_2[] = {
  389. 0x10, 0x04, 0x01, 0x1a,
  390. 0x10, 0x19, 0x01, 0x09, /* clock */
  391. 0x10, 0x24, 0x06, 0xc0, 0x00, 0x3f, 0x02, 0x00, 0x01,
  392. /* .. gain .. */
  393. 0x00, 0x03, 0x02, 0x92, 0x03,
  394. 0x00, 0x1d, 0x04, 0xf2, 0x00, 0x24, 0x07,
  395. 0x00, 0x7b, 0x01, 0xcf,
  396. 0x10, 0x94, 0x01, 0x07,
  397. 0x05, 0x05, 0x01, 0x01,
  398. 0x05, 0x04, 0x01, 0x01,
  399. 0x10, 0x0e, 0x01, 0x08,
  400. 0x10, 0x48, 0x11, 0x00, 0x37, 0x55, 0x6b, 0x7d, 0x8d, 0x9b, 0xa8,
  401. 0xb4, 0xbf, 0xca, 0xd4, 0xdd, 0xe6, 0xef, 0xf0,
  402. 0xf0,
  403. 0x10, 0x03, 0x01, 0x00,
  404. 0x10, 0x0f, 0x02, 0x0c, 0x0c,
  405. 0x10, 0x03, 0x01, 0x08,
  406. 0x10, 0x48, 0x11, 0x00, 0x37, 0x55, 0x6b, 0x7d, 0x8d, 0x9b, 0xa8,
  407. 0xb4, 0xbf, 0xca, 0xd4, 0xdd, 0xe6, 0xef, 0xf0,
  408. 0xf0,
  409. 0x10, 0x0b, 0x01, 0x0b,
  410. 0x10, 0x0d, 0x01, 0x0b,
  411. 0x10, 0x0c, 0x01, 0x1f,
  412. 0x05, 0x06, 0x01, 0x03,
  413. 0, 0, 0
  414. };
  415. /* nw802 (sharp IR3Y38M?) */
  416. static const u8 nw802_start[] = {
  417. 0x04, 0x06, 0x01, 0x04,
  418. 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0xf9, 0x02, 0x10, 0x00, 0x4d,
  419. 0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
  420. 0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
  421. 0x00, 0x01, 0x00, 0x19, 0x00, 0xce, 0x00, 0xf4,
  422. 0x05, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
  423. 0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
  424. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
  425. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
  426. 0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  427. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  428. 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  429. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  430. 0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
  431. 0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
  432. 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
  433. 0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
  434. 0x00, 0x80, 0x1f, 0xb4, 0x6f, 0x3f, 0x0f, 0x88, 0x20, 0x68, 0x00,
  435. 0x00, 0x00, 0x00, 0x00, 0xa8, 0x08, 0x00, 0x11,
  436. 0x00, 0x0c, 0x02, 0x01, 0x00, 0x16, 0x00, 0x94,
  437. 0x00, 0x10, 0x06, 0x08, 0x00, 0x18, 0x00,
  438. 0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
  439. 0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
  440. 0x40, 0x20,
  441. 0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
  442. 0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x21, 0x00,
  443. 0x06, 0x00, 0x02, 0x09, 0x99,
  444. 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  445. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  446. 0x00, 0x00, 0x00, 0x00, 0x00,
  447. 0x10, 0x00, 0x40, 0xa1, 0x02, 0x80, 0x00, 0x1d, 0x00, 0x00, 0x00,
  448. 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
  449. 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  450. 0x00, 0x49, 0x13, 0xff, 0x01, 0xc0, 0x00, 0x14,
  451. 0x02, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00,
  452. 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
  453. 0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
  454. 0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
  455. 0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
  456. 0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
  457. 0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
  458. 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
  459. 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
  460. 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
  461. 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
  462. 0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
  463. 0x10, 0x80, 0x1b, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
  464. 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x05, 0x82,
  465. 0x02, 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40,
  466. 0x01, 0xf0, 0x00,
  467. 0x02, 0x00, 0x11, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
  468. 0x00, 0x78, 0x3f, 0x10, 0x02, 0xf2, 0x8f, 0x78,
  469. 0x40,
  470. 0x10, 0x1a, 0x01, 0x00,
  471. 0x10, 0x00, 0x01, 0xad,
  472. 0x00, 0x00, 0x01, 0x08,
  473. 0x10, 0x85, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
  474. 0x10, 0x1b, 0x02, 0x00, 0x00,
  475. 0x10, 0x11, 0x08, 0x51, 0x00, 0xf0, 0x00, 0x3d, 0x00, 0xb4, 0x00,
  476. 0x10, 0x1d, 0x08, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0,
  477. 0x10, 0x0e, 0x01, 0x27,
  478. 0x10, 0x41, 0x11, 0x00, 0x0e, 0x35, 0x4f, 0x62, 0x71, 0x7f, 0x8b,
  479. 0x96, 0xa0, 0xa9, 0xb2, 0xbb, 0xc3, 0xca, 0xd2,
  480. 0xd8,
  481. 0x10, 0x03, 0x01, 0x00,
  482. 0x10, 0x0f, 0x02, 0x14, 0x14,
  483. 0x10, 0x03, 0x01, 0x0c,
  484. 0x10, 0x41, 0x11, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54, 0x64, 0x74,
  485. 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2, 0xe2, 0xf1,
  486. 0xff,
  487. /* 0x00, 0x0e, 0x35, 0x4f, 0x62, 0x71, 0x7f, 0x8b,
  488. * 0x96, 0xa0, 0xa9, 0xb2, 0xbb, 0xc3, 0xca, 0xd2,
  489. * 0xd8, */
  490. 0x10, 0x0b, 0x01, 0x10,
  491. 0x10, 0x0d, 0x01, 0x11,
  492. 0x10, 0x0c, 0x01, 0x1c,
  493. 0x04, 0x06, 0x01, 0x03,
  494. 0x04, 0x04, 0x01, 0x00,
  495. 0, 0, 0
  496. };
  497. /* et31x110 - Trust 120 SpaceCam */
  498. static const u8 spacecam_init[] = {
  499. 0x04, 0x05, 0x01, 0x01,
  500. 0x04, 0x04, 0x01, 0x01,
  501. 0x04, 0x06, 0x01, 0x04,
  502. 0x04, 0x04, 0x03, 0x00, 0x00, 0x00,
  503. 0x05, 0x05, 0x01, 0x00,
  504. 0, 0, 0
  505. };
  506. static const u8 spacecam_start[] = {
  507. 0x04, 0x06, 0x01, 0x44,
  508. 0x00, 0x00, 0x40, 0x10, 0x43, 0x00, 0xb4, 0x01, 0x10, 0x00, 0x4f,
  509. 0xef, 0x0e, 0x00, 0x74, 0x01, 0x01, 0x00, 0x19,
  510. 0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
  511. 0x00, 0x01, 0x00, 0x19, 0x00, 0x3e, 0x00, 0x24,
  512. 0x03, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
  513. 0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
  514. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
  515. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
  516. 0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  517. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  518. 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  519. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  520. 0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
  521. 0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
  522. 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
  523. 0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
  524. 0x00, 0x80, 0x1f, 0xa0, 0x48, 0xc3, 0x02, 0x88, 0x0c, 0x68, 0x00,
  525. 0x00, 0x00, 0x00, 0x00, 0xa8, 0x06, 0x00, 0x08,
  526. 0x00, 0x32, 0x01, 0x01, 0x00, 0x16, 0x00, 0x04,
  527. 0x00, 0x4b, 0x00, 0x7c, 0x00, 0x80, 0x00,
  528. 0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
  529. 0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
  530. 0x40, 0x20,
  531. 0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
  532. 0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
  533. 0x05, 0x00, 0x06, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00,
  534. 0x06, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  535. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  536. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  537. 0x00, 0x00, 0x00,
  538. 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  539. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  540. 0x00, 0x00, 0x00, 0x00, 0x00,
  541. 0x10, 0x00, 0x40, 0x83, 0x02, 0x20, 0x00, 0x11, 0x00, 0x00, 0x00,
  542. 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
  543. 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  544. 0x00, 0x49, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00,
  545. 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
  546. 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
  547. 0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
  548. 0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
  549. 0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
  550. 0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
  551. 0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
  552. 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
  553. 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
  554. 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
  555. 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
  556. 0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
  557. 0x10, 0x80, 0x1d, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
  558. 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x62,
  559. 0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01, 0x20,
  560. 0x01, 0x60, 0x01, 0x00, 0x00,
  561. 0x04, 0x06, 0x01, 0xc0,
  562. 0x10, 0x85, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
  563. 0x02, 0x00, 0x11, 0x48, 0x58, 0x9e, 0x48, 0x58, 0x00, 0x00, 0x00,
  564. 0x00, 0x84, 0x36, 0x05, 0x01, 0xf2, 0x86, 0x65,
  565. 0x40,
  566. 0x00, 0x80, 0x01, 0xa0,
  567. 0x10, 0x1a, 0x01, 0x00,
  568. 0x00, 0x91, 0x02, 0x32, 0x01,
  569. 0x00, 0x03, 0x02, 0x08, 0x02,
  570. 0x10, 0x00, 0x01, 0x83,
  571. 0x10, 0x8f, 0x0c, 0x62, 0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01,
  572. 0x20, 0x01, 0x60, 0x01,
  573. 0x10, 0x11, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
  574. 0x10, 0x0e, 0x01, 0x08,
  575. 0x10, 0x41, 0x11, 0x00, 0x64, 0x99, 0xc0, 0xe2, 0xf9, 0xf9, 0xf9,
  576. 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9,
  577. 0xf9,
  578. 0x10, 0x03, 0x01, 0x00,
  579. 0x10, 0x0f, 0x02, 0x13, 0x13,
  580. 0x10, 0x03, 0x01, 0x06,
  581. 0x10, 0x41, 0x11, 0x00, 0x64, 0x99, 0xc0, 0xe2, 0xf9, 0xf9, 0xf9,
  582. 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9,
  583. 0xf9,
  584. 0x10, 0x0b, 0x01, 0x08,
  585. 0x10, 0x0d, 0x01, 0x10,
  586. 0x10, 0x0c, 0x01, 0x1f,
  587. 0x04, 0x06, 0x01, 0xc3,
  588. 0x04, 0x05, 0x01, 0x40,
  589. 0x04, 0x04, 0x01, 0x40,
  590. 0, 0, 0
  591. };
  592. /* et31x110 - pas106 - other Trust SpaceCam120 */
  593. static const u8 spacecam2_start[] = {
  594. 0x04, 0x06, 0x01, 0x44,
  595. 0x04, 0x06, 0x01, 0x00,
  596. 0x00, 0x00, 0x40, 0x14, 0x83, 0x00, 0xba, 0x01, 0x10, 0x00, 0x4f,
  597. 0xef, 0x00, 0x00, 0x60, 0x00, 0x01, 0x00, 0x19,
  598. 0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
  599. 0x00, 0x01, 0x00, 0x19, 0x00, 0x06, 0x00, 0xfc,
  600. 0x01, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
  601. 0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
  602. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
  603. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
  604. 0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  605. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  606. 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  607. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  608. 0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
  609. 0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
  610. 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
  611. 0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
  612. 0x00, 0x80, 0x1f, 0xb8, 0x48, 0x0f, 0x04, 0x88, 0x14, 0x68, 0x00,
  613. 0x00, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x03,
  614. 0x00, 0x24, 0x01, 0x01, 0x00, 0x16, 0x00, 0x04,
  615. 0x00, 0x4b, 0x00, 0x76, 0x00, 0x86, 0x00,
  616. 0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
  617. 0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
  618. 0x40, 0x20,
  619. 0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
  620. 0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x61, 0x00,
  621. 0x05, 0x00, 0x06, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00,
  622. 0x06, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  623. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  624. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  625. 0x00, 0x00, 0x00,
  626. 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  627. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  628. 0x00, 0x00, 0x00, 0x00, 0x00,
  629. 0x10, 0x00, 0x40, 0x80, 0x02, 0x20, 0x00, 0x13, 0x00, 0x00, 0x00,
  630. 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
  631. 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  632. 0x00, 0x49, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00,
  633. 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
  634. 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
  635. 0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
  636. 0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
  637. 0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
  638. 0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
  639. 0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
  640. 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
  641. 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
  642. 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
  643. 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
  644. 0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
  645. 0x10, 0x80, 0x1d, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
  646. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x62,
  647. 0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01, 0x20,
  648. 0x01, 0x60, 0x01, 0x00, 0x00,
  649. 0x10, 0x85, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
  650. 0x04, 0x04, 0x01, 0x40,
  651. 0x04, 0x04, 0x01, 0x00,
  652. I2C0, 0x40, 0x0c, 0x02, 0x0c, 0x12, 0x07, 0x00, 0x00, 0x00, 0x05,
  653. 0x00, 0x00, 0x05, 0x05,
  654. I2C0, 0x40, 0x02, 0x11, 0x06,
  655. I2C0, 0x40, 0x02, 0x14, 0x00,
  656. I2C0, 0x40, 0x02, 0x13, 0x01, /* i2c end */
  657. 0x02, 0x00, 0x11, 0x48, 0x58, 0x9e, 0x48, 0x58, 0x00, 0x00, 0x00,
  658. 0x00, 0x84, 0x36, 0x05, 0x01, 0xf2, 0x86, 0x65,
  659. 0x40,
  660. I2C0, 0x40, 0x02, 0x02, 0x0c, /* pixel clock */
  661. I2C0, 0x40, 0x02, 0x0f, 0x00,
  662. I2C0, 0x40, 0x02, 0x13, 0x01, /* i2c end */
  663. 0x10, 0x00, 0x01, 0x01,
  664. 0x10, 0x8f, 0x0c, 0x62, 0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01,
  665. 0x20, 0x01, 0x60, 0x01,
  666. I2C0, 0x40, 0x02, 0x05, 0x0f, /* exposure */
  667. I2C0, 0x40, 0x02, 0x13, 0x01, /* i2c end */
  668. I2C0, 0x40, 0x07, 0x09, 0x0b, 0x0f, 0x05, 0x05, 0x0f, 0x00,
  669. /* gains */
  670. I2C0, 0x40, 0x03, 0x12, 0x04, 0x01,
  671. 0x10, 0x11, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
  672. 0x10, 0x0e, 0x01, 0x08,
  673. 0x10, 0x41, 0x11, 0x00, 0x17, 0x3f, 0x69, 0x7b, 0x8c, 0x9a, 0xa7,
  674. 0xb3, 0xbf, 0xc9, 0xd3, 0xdd, 0xe6, 0xef, 0xf7,
  675. 0xf9,
  676. 0x10, 0x03, 0x01, 0x00,
  677. 0x10, 0x0f, 0x02, 0x13, 0x13,
  678. 0x10, 0x03, 0x01, 0x06,
  679. 0x10, 0x41, 0x11, 0x00, 0x17, 0x3f, 0x69, 0x7b, 0x8c, 0x9a, 0xa7,
  680. 0xb3, 0xbf, 0xc9, 0xd3, 0xdd, 0xe6, 0xef, 0xf7,
  681. 0xf9,
  682. 0x10, 0x0b, 0x01, 0x11,
  683. 0x10, 0x0d, 0x01, 0x10,
  684. 0x10, 0x0c, 0x01, 0x14,
  685. 0x04, 0x06, 0x01, 0x03,
  686. 0x04, 0x05, 0x01, 0x61,
  687. 0x04, 0x04, 0x01, 0x00,
  688. 0, 0, 0
  689. };
  690. /* nw802 - Conceptronic Video Pro */
  691. static const u8 cvideopro_start[] = {
  692. 0x04, 0x06, 0x01, 0x04,
  693. 0x00, 0x00, 0x40, 0x54, 0x96, 0x98, 0xf9, 0x02, 0x18, 0x00, 0x4c,
  694. 0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
  695. 0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
  696. 0x00, 0x0b, 0x00, 0x1b, 0x00, 0xc8, 0x00, 0xf4,
  697. 0x05, 0xb4, 0x00, 0xcc, 0x00, 0x01, 0x00, 0x01,
  698. 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
  699. 0x00, 0xa2, 0x00, 0xc6, 0x00, 0x60, 0x00, 0xc6,
  700. 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
  701. 0x00, 0x40, 0x40, 0x00, 0xae, 0x00, 0xd2, 0x00, 0xae, 0x00, 0xd2,
  702. 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
  703. 0x00, 0xa8, 0x00, 0xc0, 0x00, 0x66, 0x00, 0xc0,
  704. 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
  705. 0x00, 0x0a, 0x00, 0x54, 0x00, 0x0a, 0x00, 0x54,
  706. 0x00, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
  707. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6,
  708. 0x00, 0x5d, 0x00, 0xc7, 0x00, 0x7e, 0x00, 0x30,
  709. 0x00, 0x80, 0x1f, 0x98, 0x43, 0x3f, 0x0d, 0x88, 0x20, 0x80, 0x3f,
  710. 0x47, 0xaf, 0x00, 0x00, 0xa8, 0x08, 0x00, 0x11,
  711. 0x00, 0x0c, 0x02, 0x0c, 0x00, 0x1c, 0x00, 0x94,
  712. 0x00, 0x10, 0x06, 0x24, 0x00, 0x4a, 0x00,
  713. 0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
  714. 0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
  715. 0x40, 0x20,
  716. 0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
  717. 0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0xff, 0x00,
  718. 0x06, 0x00, 0x02, 0x09, 0x99,
  719. 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  720. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  721. 0x00, 0x00, 0x00, 0x00, 0x00,
  722. 0x10, 0x00, 0x40, 0xa0, 0x02, 0x80, 0x00, 0x12, 0x00, 0x00, 0x00,
  723. 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
  724. 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  725. 0x00, 0x49, 0x13, 0x00, 0x00, 0xe0, 0x00, 0x0c,
  726. 0x00, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
  727. 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
  728. 0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
  729. 0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
  730. 0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
  731. 0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
  732. 0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
  733. 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
  734. 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
  735. 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
  736. 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
  737. 0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
  738. 0x10, 0x80, 0x1b, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
  739. 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x05, 0x82,
  740. 0x02, 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40,
  741. 0x01, 0xf0, 0x00,
  742. 0x02, 0x00, 0x11, 0x3c, 0x50, 0x8c, 0x3c, 0x50, 0x00, 0x00, 0x00,
  743. 0x00, 0x78, 0x3f, 0x3f, 0x06, 0xf2, 0x8f, 0xf0,
  744. 0x40,
  745. 0x10, 0x1a, 0x01, 0x03,
  746. 0x10, 0x00, 0x01, 0xac,
  747. 0x10, 0x85, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
  748. 0x10, 0x1b, 0x02, 0x3b, 0x01,
  749. 0x10, 0x11, 0x08, 0x61, 0x00, 0xe0, 0x00, 0x49, 0x00, 0xa8, 0x00,
  750. 0x10, 0x1f, 0x06, 0x01, 0x20, 0x02, 0xe8, 0x03, 0x00,
  751. 0x10, 0x1d, 0x02, 0x40, 0x06,
  752. 0x10, 0x0e, 0x01, 0x08,
  753. 0x10, 0x41, 0x11, 0x00, 0x0f, 0x46, 0x62, 0x76, 0x86, 0x94, 0xa0,
  754. 0xab, 0xb6, 0xbf, 0xc8, 0xcf, 0xd7, 0xdc, 0xdc,
  755. 0xdc,
  756. 0x10, 0x03, 0x01, 0x00,
  757. 0x10, 0x0f, 0x02, 0x12, 0x12,
  758. 0x10, 0x03, 0x01, 0x0c,
  759. 0x10, 0x41, 0x11, 0x00, 0x0f, 0x46, 0x62, 0x76, 0x86, 0x94, 0xa0,
  760. 0xab, 0xb6, 0xbf, 0xc8, 0xcf, 0xd7, 0xdc, 0xdc,
  761. 0xdc,
  762. 0x10, 0x0b, 0x01, 0x09,
  763. 0x10, 0x0d, 0x01, 0x10,
  764. 0x10, 0x0c, 0x01, 0x2f,
  765. 0x04, 0x06, 0x01, 0x03,
  766. 0x04, 0x04, 0x01, 0x00,
  767. 0, 0, 0
  768. };
  769. /* nw802 - D-link dru-350c cam */
  770. static const u8 dlink_start[] = {
  771. 0x04, 0x06, 0x01, 0x04,
  772. 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x92, 0x03, 0x10, 0x00, 0x4d,
  773. 0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
  774. 0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
  775. 0x00, 0x01, 0x00, 0x19, 0x00, 0xce, 0x00, 0xf4,
  776. 0x05, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
  777. 0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
  778. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
  779. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
  780. 0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  781. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  782. 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  783. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  784. 0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
  785. 0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
  786. 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
  787. 0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
  788. 0x00, 0x80, 0x1f, 0xb4, 0x6f, 0x3f, 0x0f, 0x88, 0x20, 0x68, 0x00,
  789. 0x00, 0x00, 0x00, 0x00, 0xa8, 0x08, 0x00, 0x11,
  790. 0x00, 0x0c, 0x02, 0x01, 0x00, 0x16, 0x00, 0x94,
  791. 0x00, 0x10, 0x06, 0x10, 0x00, 0x36, 0x00,
  792. 0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
  793. 0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
  794. 0x40, 0x20,
  795. 0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
  796. 0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x21, 0x00,
  797. 0x06, 0x00, 0x02, 0x09, 0x99,
  798. 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  799. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  800. 0x00, 0x00, 0x00, 0x00, 0x00,
  801. 0x10, 0x00, 0x40, 0xa1, 0x02, 0x80, 0x00, 0x12, 0x00, 0x00, 0x00,
  802. 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
  803. 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  804. 0x00, 0x49, 0x13, 0x00, 0x00, 0xc0, 0x00, 0x14,
  805. 0x02, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00,
  806. 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
  807. 0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
  808. 0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
  809. 0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
  810. 0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
  811. 0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
  812. 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
  813. 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
  814. 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
  815. 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
  816. 0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
  817. 0x10, 0x80, 0x1b, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
  818. 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x82,
  819. 0x02, 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40,
  820. 0x01, 0xf0, 0x00,
  821. 0x02, 0x00, 0x11, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
  822. 0x00, 0x78, 0x3f, 0x10, 0x02, 0xf2, 0x8f, 0x78,
  823. 0x40,
  824. 0x10, 0x1a, 0x01, 0x00,
  825. 0x10, 0x00, 0x01, 0xad,
  826. 0x00, 0x00, 0x01, 0x08,
  827. 0x10, 0x85, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
  828. 0x10, 0x1b, 0x02, 0x00, 0x00,
  829. 0x10, 0x11, 0x08, 0x51, 0x00, 0xf0, 0x00, 0x3d, 0x00, 0xb4, 0x00,
  830. 0x10, 0x1d, 0x08, 0x40, 0x06, 0x01, 0x20, 0x02, 0xe8, 0x03, 0x00,
  831. 0x10, 0x0e, 0x01, 0x20,
  832. 0x10, 0x41, 0x11, 0x00, 0x07, 0x1e, 0x38, 0x4d, 0x60, 0x70, 0x7f,
  833. 0x8e, 0x9b, 0xa8, 0xb4, 0xbf, 0xca, 0xd5, 0xdf,
  834. 0xea,
  835. 0x10, 0x03, 0x01, 0x00,
  836. 0x10, 0x0f, 0x02, 0x11, 0x11,
  837. 0x10, 0x03, 0x01, 0x10,
  838. 0x10, 0x41, 0x11, 0x00, 0x07, 0x1e, 0x38, 0x4d, 0x60, 0x70, 0x7f,
  839. 0x8e, 0x9b, 0xa8, 0xb4, 0xbf, 0xca, 0xd5, 0xdf,
  840. 0xea,
  841. 0x10, 0x0b, 0x01, 0x19,
  842. 0x10, 0x0d, 0x01, 0x10,
  843. 0x10, 0x0c, 0x01, 0x1e,
  844. 0x04, 0x06, 0x01, 0x03,
  845. 0x04, 0x04, 0x01, 0x00,
  846. 0, 0, 0
  847. };
  848. /* 06a5:d001 - nw801 - Sony
  849. * Plustek Opticam 500U or ProLink DS3303u (Hitachi HD49322BF) */
  850. /*fixme: 320x240 only*/
  851. static const u8 ds3303_start[] = {
  852. 0x05, 0x06, 0x01, 0x04,
  853. 0x00, 0x00, 0x40, 0x16, 0x00, 0x00, 0xf9, 0x02, 0x11, 0x00, 0x0e,
  854. 0x01, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
  855. 0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
  856. 0x00, 0x01, 0x00, 0x19, 0x00, 0xce, 0x00, 0xf4,
  857. 0x05, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
  858. 0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
  859. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
  860. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
  861. 0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  862. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  863. 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  864. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  865. 0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
  866. 0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
  867. 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
  868. 0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
  869. 0x00, 0x80, 0x22, 0xb4, 0x6f, 0x3f, 0x0f, 0x88, 0x20, 0x08, 0x00,
  870. 0x00, 0x00, 0x00, 0x00, 0xa9, 0xa8, 0x1f, 0x00,
  871. 0x0d, 0x02, 0x07, 0x00, 0x01, 0x00, 0x19, 0x00,
  872. 0xf2, 0x00, 0x18, 0x06, 0x10, 0x06, 0x10, 0x00,
  873. 0x36, 0x00,
  874. 0x02, 0x00, 0x12, 0x03, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
  875. 0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0x50,
  876. 0x40, 0x20,
  877. 0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
  878. 0x05, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0xff, 0x00,
  879. 0x06, 0x00, 0x02, 0x09, 0x99,
  880. 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  881. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  882. 0x00, 0x00, 0x00, 0x00, 0x00,
  883. 0x10, 0x00, 0x40, 0x2f, 0x02, 0x80, 0x00, 0x12, 0x00, 0x00, 0x00,
  884. 0x00, 0x00, 0x00, 0x10, 0x1f, 0x10, 0x08, 0x0a,
  885. 0x0a, 0x51, 0x00, 0xf1, 0x00, 0x3c, 0x00, 0xb4,
  886. 0x00, 0x01, 0x15, 0xfd, 0x07, 0x3d, 0x00, 0x00,
  887. 0x00, 0x00, 0x00, 0x00, 0x8c, 0x04, 0x01, 0x20,
  888. 0x02, 0x00, 0x03, 0x00, 0x20, 0x00, 0x00, 0x00,
  889. 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08, 0x03,
  890. 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06, 0xf7,
  891. 0x10, 0x40, 0x40, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80, 0x80,
  892. 0x00, 0x2d, 0x46, 0x58, 0x67, 0x74, 0x7f, 0x88,
  893. 0x94, 0x9d, 0xa6, 0xae, 0xb5, 0xbd, 0xc4, 0xcb,
  894. 0xd1, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54, 0x64,
  895. 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2, 0xe2,
  896. 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
  897. 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
  898. 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
  899. 0x10, 0x80, 0x22, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
  900. 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x3f, 0x01,
  901. 0x00, 0x00, 0xef, 0x00, 0x02, 0x0a, 0x82, 0x02,
  902. 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40, 0x01,
  903. 0xf0, 0x00,
  904. 0x02, 0x00, 0x11, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
  905. 0x00, 0x78, 0x3f, 0x3f, 0x00, 0xf2, 0x8f, 0x81,
  906. 0x40,
  907. 0x10, 0x1a, 0x01, 0x15,
  908. 0x10, 0x00, 0x01, 0x2f,
  909. 0x10, 0x8c, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
  910. 0x10, 0x1b, 0x02, 0x00, 0x00,
  911. 0x10, 0x11, 0x08, 0x61, 0x00, 0xe0, 0x00, 0x49, 0x00, 0xa8, 0x00,
  912. 0x10, 0x26, 0x06, 0x01, 0x20, 0x02, 0xe8, 0x03, 0x00,
  913. 0x10, 0x24, 0x02, 0x40, 0x06,
  914. 0x10, 0x0e, 0x01, 0x08,
  915. 0x10, 0x48, 0x11, 0x00, 0x15, 0x40, 0x67, 0x84, 0x9d, 0xb2, 0xc6,
  916. 0xd6, 0xe7, 0xf6, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9,
  917. 0xf9,
  918. 0x10, 0x03, 0x01, 0x00,
  919. 0x10, 0x0f, 0x02, 0x16, 0x16,
  920. 0x10, 0x03, 0x01, 0x0c,
  921. 0x10, 0x48, 0x11, 0x00, 0x15, 0x40, 0x67, 0x84, 0x9d, 0xb2, 0xc6,
  922. 0xd6, 0xe7, 0xf6, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9,
  923. 0xf9,
  924. 0x10, 0x0b, 0x01, 0x26,
  925. 0x10, 0x0d, 0x01, 0x10,
  926. 0x10, 0x0c, 0x01, 0x1c,
  927. 0x05, 0x06, 0x01, 0x03,
  928. 0x05, 0x04, 0x01, 0x00,
  929. 0, 0, 0
  930. };
  931. /* 06a5:d001 - nw802 - Panasonic
  932. * GP-KR651US (Philips TDA8786) */
  933. static const u8 kr651_start_1[] = {
  934. 0x04, 0x06, 0x01, 0x04,
  935. 0x00, 0x00, 0x40, 0x44, 0x96, 0x98, 0xf9, 0x02, 0x18, 0x00, 0x48,
  936. 0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
  937. 0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
  938. 0x00, 0x0b, 0x00, 0x1b, 0x00, 0xc8, 0x00, 0xf4,
  939. 0x05, 0xb4, 0x00, 0xcc, 0x00, 0x01, 0x00, 0x01,
  940. 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
  941. 0x00, 0xa2, 0x00, 0xc6, 0x00, 0x60, 0x00, 0xc6,
  942. 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
  943. 0x00, 0x40, 0x40, 0x00, 0xae, 0x00, 0xd2, 0x00, 0xae, 0x00, 0xd2,
  944. 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
  945. 0x00, 0xa8, 0x00, 0xc0, 0x00, 0x66, 0x00, 0xc0,
  946. 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
  947. 0x00, 0x0a, 0x00, 0x54, 0x00, 0x0a, 0x00, 0x54,
  948. 0x00, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
  949. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6,
  950. 0x00, 0x5d, 0x00, 0xc7, 0x00, 0x7e, 0x00, 0x30,
  951. 0x00, 0x80, 0x1f, 0x18, 0x43, 0x3f, 0x0d, 0x88, 0x20, 0x80, 0x3f,
  952. 0x47, 0xaf, 0x00, 0x00, 0xa8, 0x08, 0x00, 0x11,
  953. 0x00, 0x0c, 0x02, 0x0c, 0x00, 0x1c, 0x00, 0x94,
  954. 0x00, 0x10, 0x06, 0x24, 0x00, 0x4a, 0x00,
  955. 0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
  956. 0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
  957. 0x40, 0x20,
  958. 0x03, 0x00, 0x03, 0x02, 0x00, 0x00,
  959. 0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x21, 0x00,
  960. 0x06, 0x00, 0x02, 0x09, 0x99,
  961. 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  962. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  963. 0x00, 0x00, 0x00, 0x00, 0x00,
  964. 0x10, 0x00, 0x40, 0xa0, 0x02, 0x80, 0x00, 0x12, 0x00, 0x00, 0x00,
  965. 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
  966. 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  967. 0x00, 0x49, 0x13, 0x00, 0x00, 0xe0, 0x00, 0x0c,
  968. 0x00, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
  969. 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
  970. 0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
  971. 0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
  972. 0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
  973. 0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
  974. 0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
  975. 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
  976. 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
  977. 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
  978. 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
  979. 0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
  980. 0x10, 0x80, 0x1b, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
  981. 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x05, 0x82,
  982. 0x02, 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40,
  983. 0x01, 0xf0, 0x00,
  984. 0, 0, 0
  985. };
  986. static const u8 kr651_start_qvga[] = {
  987. 0x02, 0x00, 0x11, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
  988. 0x00, 0x78, 0x3f, 0x10, 0x02, 0xf2, 0x8f, 0x78,
  989. 0x40,
  990. 0x10, 0x1a, 0x01, 0x03,
  991. 0x10, 0x00, 0x01, 0xac,
  992. 0x10, 0x85, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
  993. 0x10, 0x1b, 0x02, 0x00, 0x00,
  994. 0x10, 0x11, 0x08, 0x29, 0x00, 0x18, 0x01, 0x1f, 0x00, 0xd2, 0x00,
  995. 0x10, 0x1d, 0x06, 0xe0, 0x00, 0x0c, 0x00, 0x52, 0x00,
  996. 0x10, 0x1d, 0x02, 0x28, 0x01,
  997. 0, 0, 0
  998. };
  999. static const u8 kr651_start_vga[] = {
  1000. 0x02, 0x00, 0x11, 0x78, 0xa0, 0x8c, 0x78, 0xa0, 0x00, 0x00, 0x00,
  1001. 0x00, 0xf0, 0x30, 0x03, 0x01, 0x82, 0x82, 0x98,
  1002. 0x80,
  1003. 0x10, 0x1a, 0x01, 0x03,
  1004. 0x10, 0x00, 0x01, 0xa0,
  1005. 0x10, 0x85, 0x08, 0x00, 0x00, 0x7f, 0x02, 0x00, 0x00, 0xdf, 0x01,
  1006. 0x10, 0x1b, 0x02, 0x00, 0x00,
  1007. 0x10, 0x11, 0x08, 0x51, 0x00, 0x30, 0x02, 0x3d, 0x00, 0xa4, 0x01,
  1008. 0x10, 0x1d, 0x06, 0xe0, 0x00, 0x0c, 0x00, 0x52, 0x00,
  1009. 0x10, 0x1d, 0x02, 0x68, 0x00,
  1010. };
  1011. static const u8 kr651_start_2[] = {
  1012. 0x10, 0x0e, 0x01, 0x08,
  1013. 0x10, 0x41, 0x11, 0x00, 0x11, 0x3c, 0x5c, 0x74, 0x88, 0x99, 0xa8,
  1014. 0xb7, 0xc4, 0xd0, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
  1015. 0xdc,
  1016. 0x10, 0x03, 0x01, 0x00,
  1017. 0x10, 0x0f, 0x02, 0x0c, 0x0c,
  1018. 0x10, 0x03, 0x01, 0x0c,
  1019. 0x10, 0x41, 0x11, 0x00, 0x11, 0x3c, 0x5c, 0x74, 0x88, 0x99, 0xa8,
  1020. 0xb7, 0xc4, 0xd0, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
  1021. 0xdc,
  1022. 0x10, 0x0b, 0x01, 0x10,
  1023. 0x10, 0x0d, 0x01, 0x10,
  1024. 0x10, 0x0c, 0x01, 0x2d,
  1025. 0x04, 0x06, 0x01, 0x03,
  1026. 0x04, 0x04, 0x01, 0x00,
  1027. 0, 0, 0
  1028. };
  1029. /* nw802 - iRez Kritter cam */
  1030. static const u8 kritter_start[] = {
  1031. 0x04, 0x06, 0x01, 0x06,
  1032. 0x00, 0x00, 0x40, 0x44, 0x96, 0x98, 0x94, 0x03, 0x18, 0x00, 0x48,
  1033. 0x0f, 0x1e, 0x00, 0x0c, 0x02, 0x01, 0x00, 0x19,
  1034. 0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
  1035. 0x00, 0x0b, 0x00, 0x1b, 0x00, 0x0a, 0x01, 0x28,
  1036. 0x07, 0xb4, 0x00, 0xcc, 0x00, 0x01, 0x00, 0x01,
  1037. 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
  1038. 0x00, 0xa2, 0x00, 0xc6, 0x00, 0x60, 0x00, 0xc6,
  1039. 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
  1040. 0x00, 0x40, 0x40, 0x00, 0xae, 0x00, 0xd2, 0x00, 0xae, 0x00, 0xd2,
  1041. 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
  1042. 0x00, 0xa8, 0x00, 0xc0, 0x00, 0x66, 0x00, 0xc0,
  1043. 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
  1044. 0x00, 0x0a, 0x00, 0x54, 0x00, 0x0a, 0x00, 0x54,
  1045. 0x00, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
  1046. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6,
  1047. 0x00, 0x5d, 0x00, 0x0e, 0x00, 0x7e, 0x00, 0x30,
  1048. 0x00, 0x80, 0x1f, 0x18, 0x43, 0x3f, 0x0d, 0x88, 0x20, 0x80, 0x3f,
  1049. 0x47, 0xaf, 0x00, 0x00, 0xa8, 0x08, 0x00, 0x11,
  1050. 0x00, 0x0b, 0x02, 0x0c, 0x00, 0x1c, 0x00, 0x94,
  1051. 0x00, 0x10, 0x06, 0x24, 0x00, 0x4a, 0x00,
  1052. 0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
  1053. 0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
  1054. 0x40, 0x20,
  1055. 0x03, 0x00, 0x03, 0x02, 0x00, 0x00,
  1056. 0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0xff, 0x00,
  1057. 0x06, 0x00, 0x02, 0x09, 0x99,
  1058. 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1059. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1060. 0x00, 0x00, 0x00, 0x00, 0x00,
  1061. 0x10, 0x00, 0x40, 0xa0, 0x02, 0x80, 0x00, 0x12, 0x00, 0x00, 0x00,
  1062. 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
  1063. 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1064. 0x00, 0x49, 0x13, 0x00, 0x00, 0xe0, 0x00, 0x0c,
  1065. 0x00, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
  1066. 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
  1067. 0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
  1068. 0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
  1069. 0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
  1070. 0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
  1071. 0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
  1072. 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
  1073. 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
  1074. 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
  1075. 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
  1076. 0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
  1077. 0x10, 0x80, 0x1b, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
  1078. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x82,
  1079. 0x02, 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40,
  1080. 0x01, 0xf0, 0x00,
  1081. 0x02, 0x00, 0x11, 0x3c, 0x50, 0x8c, 0x3c, 0x50, 0x00, 0x00, 0x00,
  1082. 0x00, 0x78, 0x3f, 0x3f, 0x06, 0xf2, 0x8f, 0xf0,
  1083. 0x40,
  1084. 0x10, 0x1a, 0x01, 0x03,
  1085. 0x10, 0x00, 0x01, 0xaf,
  1086. 0x10, 0x85, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
  1087. 0x10, 0x1b, 0x02, 0x3b, 0x01,
  1088. 0x10, 0x11, 0x08, 0x61, 0x00, 0xe0, 0x00, 0x49, 0x00, 0xa8, 0x00,
  1089. 0x10, 0x1d, 0x06, 0xe0, 0x00, 0x0c, 0x00, 0x52, 0x00,
  1090. 0x10, 0x1d, 0x02, 0x00, 0x00,
  1091. 0x10, 0x0e, 0x01, 0x08,
  1092. 0x10, 0x41, 0x11, 0x00, 0x0d, 0x36, 0x4e, 0x60, 0x6f, 0x7b, 0x86,
  1093. 0x90, 0x98, 0xa1, 0xa9, 0xb1, 0xb7, 0xbe, 0xc4,
  1094. 0xcb,
  1095. 0x10, 0x03, 0x01, 0x00,
  1096. 0x10, 0x0f, 0x02, 0x0d, 0x0d,
  1097. 0x10, 0x03, 0x01, 0x02,
  1098. 0x10, 0x41, 0x11, 0x00, 0x0d, 0x36, 0x4e, 0x60, 0x6f, 0x7b, 0x86,
  1099. 0x90, 0x98, 0xa1, 0xa9, 0xb1, 0xb7, 0xbe, 0xc4,
  1100. 0xcb,
  1101. 0x10, 0x0b, 0x01, 0x17,
  1102. 0x10, 0x0d, 0x01, 0x10,
  1103. 0x10, 0x0c, 0x01, 0x1e,
  1104. 0x04, 0x06, 0x01, 0x03,
  1105. 0x04, 0x04, 0x01, 0x00,
  1106. 0, 0, 0
  1107. };
  1108. /* nw802 - Mustek Wcam 300 mini */
  1109. static const u8 mustek_start[] = {
  1110. 0x04, 0x06, 0x01, 0x04,
  1111. 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x92, 0x03, 0x10, 0x00, 0x4d,
  1112. 0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
  1113. 0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
  1114. 0x00, 0x01, 0x00, 0x19, 0x00, 0xce, 0x00, 0xf4,
  1115. 0x05, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
  1116. 0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
  1117. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
  1118. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
  1119. 0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  1120. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  1121. 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  1122. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  1123. 0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
  1124. 0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
  1125. 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
  1126. 0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
  1127. 0x00, 0x80, 0x1f, 0xb4, 0x6f, 0x3f, 0x0f, 0x88, 0x20, 0x68, 0x00,
  1128. 0x00, 0x00, 0x00, 0x00, 0xa8, 0x08, 0x00, 0x11,
  1129. 0x00, 0x0c, 0x02, 0x01, 0x00, 0x16, 0x00, 0x94,
  1130. 0x00, 0x10, 0x06, 0xfc, 0x05, 0x0c, 0x06,
  1131. 0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
  1132. 0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
  1133. 0x40, 0x20,
  1134. 0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
  1135. 0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x21, 0x00,
  1136. 0x06, 0x00, 0x02, 0x09, 0x99,
  1137. 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1138. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1139. 0x00, 0x00, 0x00, 0x00, 0x00,
  1140. 0x10, 0x00, 0x40, 0xa1, 0x02, 0x80, 0x00, 0x13, 0x00, 0x00, 0x00,
  1141. 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
  1142. 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1143. 0x00, 0x49, 0x13, 0x00, 0x00, 0xc0, 0x00, 0x14,
  1144. 0x02, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00,
  1145. 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
  1146. 0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
  1147. 0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
  1148. 0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
  1149. 0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
  1150. 0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
  1151. 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
  1152. 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
  1153. 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
  1154. 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
  1155. 0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
  1156. 0x10, 0x80, 0x1b, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
  1157. 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x01, 0x82,
  1158. 0x02, 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40,
  1159. 0x01, 0xf0, 0x00,
  1160. 0x02, 0x00, 0x11, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
  1161. 0x00, 0x78, 0x3f, 0x10, 0x02, 0xf2, 0x8f, 0x78,
  1162. 0x40,
  1163. 0x10, 0x1a, 0x01, 0x00,
  1164. 0x10, 0x00, 0x01, 0xad,
  1165. 0x00, 0x00, 0x01, 0x08,
  1166. 0x10, 0x85, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
  1167. 0x10, 0x1b, 0x02, 0x00, 0x00,
  1168. 0x10, 0x11, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
  1169. 0x10, 0x1d, 0x08, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20,
  1170. 0x10, 0x0e, 0x01, 0x0f,
  1171. 0x10, 0x41, 0x11, 0x00, 0x0f, 0x29, 0x4a, 0x64, 0x7a, 0x8c, 0x9e,
  1172. 0xad, 0xba, 0xc7, 0xd3, 0xde, 0xe8, 0xf1, 0xf9,
  1173. 0xff,
  1174. 0x10, 0x0f, 0x02, 0x11, 0x11,
  1175. 0x10, 0x03, 0x01, 0x0c,
  1176. 0x10, 0x41, 0x11, 0x00, 0x0f, 0x29, 0x4a, 0x64, 0x7a, 0x8c, 0x9e,
  1177. 0xad, 0xba, 0xc7, 0xd3, 0xde, 0xe8, 0xf1, 0xf9,
  1178. 0xff,
  1179. 0x10, 0x0b, 0x01, 0x1c,
  1180. 0x10, 0x0d, 0x01, 0x1a,
  1181. 0x10, 0x0c, 0x01, 0x34,
  1182. 0x04, 0x05, 0x01, 0x61,
  1183. 0x04, 0x04, 0x01, 0x40,
  1184. 0x04, 0x06, 0x01, 0x03,
  1185. 0, 0, 0
  1186. };
  1187. /* nw802 - Scope USB Microscope M2 (ProScope) (Hitachi HD49322BF) */
  1188. static const u8 proscope_init[] = {
  1189. 0x04, 0x05, 0x01, 0x21,
  1190. 0x04, 0x04, 0x01, 0x01,
  1191. 0, 0, 0
  1192. };
  1193. static const u8 proscope_start_1[] = {
  1194. 0x04, 0x06, 0x01, 0x04,
  1195. 0x00, 0x00, 0x40, 0x10, 0x01, 0x00, 0xf9, 0x02, 0x10, 0x00, 0x04,
  1196. 0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
  1197. 0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
  1198. 0x00, 0x08, 0x00, 0x17, 0x00, 0xce, 0x00, 0xf4,
  1199. 0x05, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
  1200. 0x00, 0xce, 0x00, 0xf8, 0x03, 0x3e, 0x00, 0x86,
  1201. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
  1202. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
  1203. 0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0xb6,
  1204. 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  1205. 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  1206. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  1207. 0x00, 0xf6, 0x03, 0x34, 0x04, 0xf6, 0x03, 0x34,
  1208. 0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
  1209. 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xe8,
  1210. 0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
  1211. 0x00, 0x80, 0x1f, 0xb4, 0x6f, 0x1f, 0x0f, 0x08, 0x20, 0xa8, 0x00,
  1212. 0x00, 0x00, 0x00, 0x00, 0xa8, 0x08, 0x00, 0x11,
  1213. 0x00, 0x0c, 0x02, 0x01, 0x00, 0x19, 0x00, 0x94,
  1214. 0x00, 0x10, 0x06, 0x10, 0x00, 0x36, 0x00,
  1215. 0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
  1216. 0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
  1217. 0x40, 0x20,
  1218. 0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
  1219. 0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x21, 0x00,
  1220. 0x06, 0x00, 0x02, 0x09, 0x99,
  1221. 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1222. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1223. 0x00, 0x00, 0x00, 0x00, 0x00,
  1224. 0x10, 0x00, 0x40, 0xad, 0x02, 0x80, 0x00, 0x12, 0x00, 0x00, 0x00,
  1225. 0x00, 0x00, 0x00, 0x10, 0x1f, 0x10, 0x08, 0x0a,
  1226. 0x0a, 0x51, 0x00, 0xf1, 0x00, 0x3c, 0x00, 0xb4,
  1227. 0x00, 0x49, 0x13, 0x00, 0x00, 0x8c, 0x04, 0x01,
  1228. 0x20, 0x02, 0x00, 0x03, 0x00, 0x20, 0x00, 0x00,
  1229. 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
  1230. 0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
  1231. 0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
  1232. 0x10, 0x40, 0x40, 0x80, 0x00, 0x2d, 0x46, 0x58, 0x67, 0x74, 0x7f,
  1233. 0x88, 0x94, 0x9d, 0xa6, 0xae, 0xb5, 0xbd, 0xc4,
  1234. 0xcb, 0xd1, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
  1235. 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
  1236. 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
  1237. 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
  1238. 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
  1239. 0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
  1240. 0x10, 0x80, 0x1b, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x3f,
  1241. 0x01, 0x00, 0x00, 0xef, 0x00, 0x09, 0x05, 0x82,
  1242. 0x02, 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40,
  1243. 0x01, 0xf0, 0x00,
  1244. 0, 0, 0
  1245. };
  1246. static const u8 proscope_start_qvga[] = {
  1247. 0x02, 0x00, 0x11, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
  1248. 0x00, 0x78, 0x3f, 0x10, 0x02, 0xf2, 0x8f, 0x78,
  1249. 0x40,
  1250. 0x10, 0x1a, 0x01, 0x06,
  1251. 0x00, 0x03, 0x02, 0xf9, 0x02,
  1252. 0x10, 0x85, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
  1253. 0x10, 0x1b, 0x02, 0x00, 0x00,
  1254. 0x10, 0x11, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
  1255. 0x10, 0x1d, 0x08, 0xc0, 0x0d, 0x01, 0x20, 0x02, 0xe8, 0x03, 0x00,
  1256. 0x10, 0x0e, 0x01, 0x10,
  1257. 0, 0, 0
  1258. };
  1259. static const u8 proscope_start_vga[] = {
  1260. 0x00, 0x03, 0x02, 0xf9, 0x02,
  1261. 0x10, 0x85, 0x08, 0x00, 0x00, 0x7f, 0x02, 0x00, 0x00, 0xdf, 0x01,
  1262. 0x02, 0x00, 0x11, 0x78, 0xa0, 0x8c, 0x78, 0xa0, 0x00, 0x00, 0x00,
  1263. 0x00, 0xf0, 0x16, 0x00, 0x00, 0x82, 0x84, 0x00,
  1264. 0x80,
  1265. 0x10, 0x1a, 0x01, 0x06,
  1266. 0x10, 0x00, 0x01, 0xa1,
  1267. 0x10, 0x1b, 0x02, 0x00, 0x00,
  1268. 0x10, 0x1d, 0x08, 0xc0, 0x0d, 0x01, 0x20, 0x02, 0xe8, 0x03, 0x00,
  1269. 0x10, 0x11, 0x08, 0x00, 0x00, 0x7f, 0x02, 0x00, 0x00, 0xdf, 0x01,
  1270. 0x10, 0x0e, 0x01, 0x10,
  1271. 0x10, 0x41, 0x11, 0x00, 0x10, 0x51, 0x6e, 0x83, 0x93, 0xa1, 0xae,
  1272. 0xb9, 0xc3, 0xcc, 0xd4, 0xdd, 0xe4, 0xeb, 0xf2,
  1273. 0xf9,
  1274. 0x10, 0x03, 0x01, 0x00,
  1275. 0, 0, 0
  1276. };
  1277. static const u8 proscope_start_2[] = {
  1278. 0x10, 0x0f, 0x02, 0x0c, 0x0c,
  1279. 0x10, 0x03, 0x01, 0x0c,
  1280. 0x10, 0x41, 0x11, 0x00, 0x10, 0x51, 0x6e, 0x83, 0x93, 0xa1, 0xae,
  1281. 0xb9, 0xc3, 0xcc, 0xd4, 0xdd, 0xe4, 0xeb, 0xf2,
  1282. 0xf9,
  1283. 0x10, 0x0b, 0x01, 0x0b,
  1284. 0x10, 0x0d, 0x01, 0x10,
  1285. 0x10, 0x0c, 0x01, 0x1b,
  1286. 0x04, 0x06, 0x01, 0x03,
  1287. 0x04, 0x05, 0x01, 0x21,
  1288. 0x04, 0x04, 0x01, 0x00,
  1289. 0, 0, 0
  1290. };
  1291. /* nw800 - hv7121b? (seems pas106) - Divio Chicony TwinkleCam */
  1292. static const u8 twinkle_start[] = {
  1293. 0x04, 0x06, 0x01, 0x44,
  1294. 0x04, 0x06, 0x01, 0x00,
  1295. 0x00, 0x00, 0x40, 0x14, 0x83, 0x00, 0xba, 0x01, 0x10, 0x00, 0x4f,
  1296. 0xef, 0x00, 0x00, 0x60, 0x00, 0x01, 0x00, 0x19,
  1297. 0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
  1298. 0x00, 0x01, 0x00, 0x19, 0x00, 0x06, 0x00, 0xfc,
  1299. 0x01, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
  1300. 0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
  1301. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
  1302. 0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
  1303. 0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  1304. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  1305. 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
  1306. 0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
  1307. 0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
  1308. 0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
  1309. 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
  1310. 0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
  1311. 0x00, 0x80, 0x1f, 0xb8, 0x48, 0x0f, 0x04, 0x88, 0x14, 0x68, 0x00,
  1312. 0x00, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x03,
  1313. 0x00, 0x24, 0x01, 0x01, 0x00, 0x16, 0x00, 0x04,
  1314. 0x00, 0x4b, 0x00, 0x76, 0x00, 0x86, 0x00,
  1315. 0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
  1316. 0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
  1317. 0x40, 0x20,
  1318. 0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
  1319. 0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x61, 0x00,
  1320. 0x05, 0x00, 0x06, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00,
  1321. 0x06, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1322. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1323. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1324. 0x00, 0x00, 0x00,
  1325. 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1326. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1327. 0x00, 0x00, 0x00, 0x00, 0x00,
  1328. 0x10, 0x00, 0x40, 0x80, 0x02, 0x20, 0x00, 0x11, 0x00, 0x00, 0x00,
  1329. 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x08,
  1330. 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1331. 0x00, 0x49, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00,
  1332. 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
  1333. 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
  1334. 0x03, 0x00, 0x00, 0x10, 0x00, 0x20, 0x10, 0x06,
  1335. 0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x00, 0x80,
  1336. 0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
  1337. 0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
  1338. 0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
  1339. 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
  1340. 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
  1341. 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
  1342. 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
  1343. 0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
  1344. 0x10, 0x80, 0x1d, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
  1345. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x62,
  1346. 0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01, 0x20,
  1347. 0x01, 0x60, 0x01, 0x00, 0x00,
  1348. 0x10, 0x85, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
  1349. 0x04, 0x04, 0x01, 0x10,
  1350. 0x04, 0x04, 0x01, 0x00,
  1351. 0x04, 0x05, 0x01, 0x61,
  1352. 0x04, 0x04, 0x01, 0x01,
  1353. I2C0, 0x40, 0x0c, 0x02, 0x0c, 0x12, 0x07, 0x00, 0x00, 0x00, 0x00,
  1354. 0x00, 0x00, 0x00, 0x0a,
  1355. I2C0, 0x40, 0x02, 0x11, 0x06,
  1356. I2C0, 0x40, 0x02, 0x14, 0x00,
  1357. I2C0, 0x40, 0x02, 0x13, 0x01, /* i2c end */
  1358. I2C0, 0x40, 0x02, 0x07, 0x01,
  1359. 0x02, 0x00, 0x11, 0x48, 0x58, 0x9e, 0x48, 0x58, 0x00, 0x00, 0x00,
  1360. 0x00, 0x84, 0x36, 0x05, 0x01, 0xf2, 0x86, 0x65,
  1361. 0x40,
  1362. I2C0, 0x40, 0x02, 0x02, 0x0c,
  1363. I2C0, 0x40, 0x02, 0x13, 0x01,
  1364. 0x10, 0x00, 0x01, 0x01,
  1365. 0x10, 0x8f, 0x0c, 0x62, 0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01,
  1366. 0x20, 0x01, 0x60, 0x01,
  1367. I2C0, 0x40, 0x02, 0x05, 0x0f,
  1368. I2C0, 0x40, 0x02, 0x13, 0x01,
  1369. I2C0, 0x40, 0x08, 0x08, 0x04, 0x0b, 0x01, 0x01, 0x02, 0x00, 0x17,
  1370. I2C0, 0x40, 0x03, 0x12, 0x00, 0x01,
  1371. 0x10, 0x11, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
  1372. I2C0, 0x40, 0x02, 0x12, 0x00,
  1373. I2C0, 0x40, 0x02, 0x0e, 0x00,
  1374. I2C0, 0x40, 0x02, 0x11, 0x06,
  1375. 0x10, 0x41, 0x11, 0x00, 0x17, 0x3f, 0x69, 0x7b, 0x8c, 0x9a, 0xa7,
  1376. 0xb3, 0xbf, 0xc9, 0xd3, 0xdd, 0xe6, 0xef, 0xf7,
  1377. 0xf9,
  1378. 0x10, 0x03, 0x01, 0x00,
  1379. 0x10, 0x0f, 0x02, 0x0c, 0x0c,
  1380. 0x10, 0x03, 0x01, 0x06,
  1381. 0x10, 0x41, 0x11, 0x00, 0x17, 0x3f, 0x69, 0x7b, 0x8c, 0x9a, 0xa7,
  1382. 0xb3, 0xbf, 0xc9, 0xd3, 0xdd, 0xe6, 0xef, 0xf7,
  1383. 0xf9,
  1384. 0x10, 0x0b, 0x01, 0x19,
  1385. 0x10, 0x0d, 0x01, 0x10,
  1386. 0x10, 0x0c, 0x01, 0x0d,
  1387. 0x04, 0x06, 0x01, 0x03,
  1388. 0x04, 0x05, 0x01, 0x61,
  1389. 0x04, 0x04, 0x01, 0x41,
  1390. 0, 0, 0
  1391. };
  1392. /* nw802 dvc-v6 */
  1393. static const u8 dvcv6_start[] = {
  1394. 0x04, 0x06, 0x01, 0x06,
  1395. 0x00, 0x00, 0x40, 0x54, 0x96, 0x98, 0xf9, 0x02, 0x18, 0x00, 0x4c,
  1396. 0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
  1397. 0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
  1398. 0x00, 0x0b, 0x00, 0x1b, 0x00, 0xc8, 0x00, 0xf4,
  1399. 0x05, 0xb4, 0x00, 0xcc, 0x00, 0x01, 0x00, 0x01,
  1400. 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
  1401. 0x00, 0xa2, 0x00, 0xc6, 0x00, 0x60, 0x00, 0xc6,
  1402. 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
  1403. 0x00, 0x40, 0x40, 0x00, 0xae, 0x00, 0xd2, 0x00, 0xae, 0x00, 0xd2,
  1404. 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
  1405. 0x00, 0xa8, 0x00, 0xc0, 0x00, 0x66, 0x00, 0xc0,
  1406. 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
  1407. 0x00, 0x0a, 0x00, 0x54, 0x00, 0x0a, 0x00, 0x54,
  1408. 0x00, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
  1409. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6,
  1410. 0x00, 0x5d, 0x00, 0xc7, 0x00, 0x7e, 0x00, 0x30,
  1411. 0x00, 0x80, 0x1f, 0x98, 0x43, 0x3f, 0x0d, 0x88, 0x20, 0x80, 0x3f,
  1412. 0x47, 0xaf, 0x00, 0x00, 0xa8, 0x08, 0x00, 0x11,
  1413. 0x00, 0x0c, 0x02, 0x0c, 0x00, 0x1c, 0x00, 0x94,
  1414. 0x00, 0x10, 0x06, 0x24, 0x00, 0x4a, 0x00,
  1415. 0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
  1416. 0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
  1417. 0x40, 0x20,
  1418. 0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
  1419. 0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0xff, 0x00,
  1420. 0x06, 0x00, 0x02, 0x09, 0x99,
  1421. 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1422. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1423. 0x00, 0x00, 0x00, 0x00, 0x00,
  1424. 0x10, 0x00, 0x40, 0xa0, 0x02, 0x80, 0x00, 0x12, 0x00, 0x00, 0x00,
  1425. 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
  1426. 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1427. 0x00, 0x49, 0x13, 0x00, 0x00, 0xe0, 0x00, 0x0c,
  1428. 0x00, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
  1429. 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
  1430. 0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
  1431. 0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
  1432. 0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
  1433. 0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
  1434. 0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
  1435. 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
  1436. 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
  1437. 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
  1438. 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
  1439. 0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
  1440. 0x10, 0x80, 0x1b, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
  1441. 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x05, 0x82,
  1442. 0x02, 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40,
  1443. 0x01, 0xf0, 0x00,
  1444. 0x00, 0x03, 0x02, 0x94, 0x03,
  1445. 0x00, 0x1d, 0x04, 0x0a, 0x01, 0x28, 0x07,
  1446. 0x00, 0x7b, 0x02, 0xe0, 0x00,
  1447. 0x10, 0x8d, 0x01, 0x00,
  1448. 0x00, 0x09, 0x04, 0x1e, 0x00, 0x0c, 0x02,
  1449. 0x00, 0x91, 0x02, 0x0b, 0x02,
  1450. 0x10, 0x00, 0x01, 0xaf,
  1451. 0x02, 0x00, 0x11, 0x3c, 0x50, 0x8f, 0x3c, 0x50, 0x00, 0x00, 0x00,
  1452. 0x00, 0x78, 0x3f, 0x3f, 0x06, 0xf2, 0x8f, 0xf0,
  1453. 0x40,
  1454. 0x10, 0x1a, 0x01, 0x02,
  1455. 0x10, 0x00, 0x01, 0xaf,
  1456. 0x10, 0x85, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
  1457. 0x10, 0x1b, 0x02, 0x07, 0x01,
  1458. 0x10, 0x11, 0x08, 0x61, 0x00, 0xe0, 0x00, 0x49, 0x00, 0xa8, 0x00,
  1459. 0x10, 0x1f, 0x06, 0x01, 0x20, 0x02, 0xe8, 0x03, 0x00,
  1460. 0x10, 0x1d, 0x02, 0x40, 0x06,
  1461. 0x10, 0x0e, 0x01, 0x08,
  1462. 0x10, 0x41, 0x11, 0x00, 0x0f, 0x54, 0x6f, 0x82, 0x91, 0x9f, 0xaa,
  1463. 0xb4, 0xbd, 0xc5, 0xcd, 0xd5, 0xdb, 0xdc, 0xdc,
  1464. 0xdc,
  1465. 0x10, 0x03, 0x01, 0x00,
  1466. 0x10, 0x0f, 0x02, 0x12, 0x12,
  1467. 0x10, 0x03, 0x01, 0x11,
  1468. 0x10, 0x41, 0x11, 0x00, 0x0f, 0x54, 0x6f, 0x82, 0x91, 0x9f, 0xaa,
  1469. 0xb4, 0xbd, 0xc5, 0xcd, 0xd5, 0xdb, 0xdc, 0xdc,
  1470. 0xdc,
  1471. 0x10, 0x0b, 0x01, 0x16,
  1472. 0x10, 0x0d, 0x01, 0x10,
  1473. 0x10, 0x0c, 0x01, 0x1a,
  1474. 0x04, 0x06, 0x01, 0x03,
  1475. 0x04, 0x04, 0x01, 0x00,
  1476. };
  1477. static const u8 *webcam_start[] = {
  1478. [Generic800] = nw800_start,
  1479. [SpaceCam] = spacecam_start,
  1480. [SpaceCam2] = spacecam2_start,
  1481. [Cvideopro] = cvideopro_start,
  1482. [Dlink350c] = dlink_start,
  1483. [DS3303u] = ds3303_start,
  1484. [Kr651us] = kr651_start_1,
  1485. [Kritter] = kritter_start,
  1486. [Mustek300] = mustek_start,
  1487. [Proscope] = proscope_start_1,
  1488. [Twinkle] = twinkle_start,
  1489. [DvcV6] = dvcv6_start,
  1490. [P35u] = nw801_start_1,
  1491. [Generic802] = nw802_start,
  1492. };
  1493. /* -- write a register -- */
  1494. static void reg_w(struct gspca_dev *gspca_dev,
  1495. u16 index,
  1496. const u8 *data,
  1497. int len)
  1498. {
  1499. struct usb_device *dev = gspca_dev->dev;
  1500. int ret;
  1501. if (gspca_dev->usb_err < 0)
  1502. return;
  1503. if (len == 1)
  1504. PDEBUG(D_USBO, "SET 00 0000 %04x %02x", index, *data);
  1505. else
  1506. PDEBUG(D_USBO, "SET 00 0000 %04x %02x %02x ...",
  1507. index, *data, data[1]);
  1508. memcpy(gspca_dev->usb_buf, data, len);
  1509. ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
  1510. 0x00,
  1511. USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
  1512. 0x00, /* value */
  1513. index,
  1514. gspca_dev->usb_buf,
  1515. len,
  1516. 500);
  1517. if (ret < 0) {
  1518. pr_err("reg_w err %d\n", ret);
  1519. gspca_dev->usb_err = ret;
  1520. }
  1521. }
  1522. /* -- read registers in usb_buf -- */
  1523. static void reg_r(struct gspca_dev *gspca_dev,
  1524. u16 index,
  1525. int len)
  1526. {
  1527. struct usb_device *dev = gspca_dev->dev;
  1528. int ret;
  1529. if (gspca_dev->usb_err < 0)
  1530. return;
  1531. ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
  1532. 0x00,
  1533. USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
  1534. 0x00, index,
  1535. gspca_dev->usb_buf, len, 500);
  1536. if (ret < 0) {
  1537. pr_err("reg_r err %d\n", ret);
  1538. gspca_dev->usb_err = ret;
  1539. return;
  1540. }
  1541. if (len == 1)
  1542. PDEBUG(D_USBI, "GET 00 0000 %04x %02x",
  1543. index, gspca_dev->usb_buf[0]);
  1544. else
  1545. PDEBUG(D_USBI, "GET 00 0000 %04x %02x %02x ..",
  1546. index, gspca_dev->usb_buf[0],
  1547. gspca_dev->usb_buf[1]);
  1548. }
  1549. static void i2c_w(struct gspca_dev *gspca_dev,
  1550. u8 i2c_addr,
  1551. const u8 *data,
  1552. int len)
  1553. {
  1554. u8 val[2];
  1555. int i;
  1556. reg_w(gspca_dev, 0x0600, data + 1, len - 1);
  1557. reg_w(gspca_dev, 0x0600, data, len);
  1558. val[0] = len;
  1559. val[1] = i2c_addr;
  1560. reg_w(gspca_dev, 0x0502, val, 2);
  1561. val[0] = 0x01;
  1562. reg_w(gspca_dev, 0x0501, val, 1);
  1563. for (i = 5; --i >= 0; ) {
  1564. msleep(4);
  1565. reg_r(gspca_dev, 0x0505, 1);
  1566. if (gspca_dev->usb_err < 0)
  1567. return;
  1568. if (gspca_dev->usb_buf[0] == 0)
  1569. return;
  1570. }
  1571. gspca_dev->usb_err = -ETIME;
  1572. }
  1573. static void reg_w_buf(struct gspca_dev *gspca_dev,
  1574. const u8 *cmd)
  1575. {
  1576. u16 reg;
  1577. int len;
  1578. for (;;) {
  1579. reg = *cmd++ << 8;
  1580. reg += *cmd++;
  1581. len = *cmd++;
  1582. if (len == 0)
  1583. break;
  1584. if (cmd[-3] != I2C0)
  1585. reg_w(gspca_dev, reg, cmd, len);
  1586. else
  1587. i2c_w(gspca_dev, reg, cmd, len);
  1588. cmd += len;
  1589. }
  1590. }
  1591. static int swap_bits(int v)
  1592. {
  1593. int r, i;
  1594. r = 0;
  1595. for (i = 0; i < 8; i++) {
  1596. r <<= 1;
  1597. if (v & 1)
  1598. r++;
  1599. v >>= 1;
  1600. }
  1601. return r;
  1602. }
  1603. static void setgain(struct gspca_dev *gspca_dev, u8 val)
  1604. {
  1605. struct sd *sd = (struct sd *) gspca_dev;
  1606. u8 v[2];
  1607. switch (sd->webcam) {
  1608. case P35u:
  1609. reg_w(gspca_dev, 0x1026, &val, 1);
  1610. break;
  1611. case Kr651us:
  1612. /* 0 - 253 */
  1613. val = swap_bits(val);
  1614. v[0] = val << 3;
  1615. v[1] = val >> 5;
  1616. reg_w(gspca_dev, 0x101d, v, 2); /* SIF reg0/1 (AGC) */
  1617. break;
  1618. }
  1619. }
  1620. static void setexposure(struct gspca_dev *gspca_dev, s32 val)
  1621. {
  1622. struct sd *sd = (struct sd *) gspca_dev;
  1623. u8 v[2];
  1624. switch (sd->webcam) {
  1625. case P35u:
  1626. v[0] = ((9 - val) << 3) | 0x01;
  1627. reg_w(gspca_dev, 0x1019, v, 1);
  1628. break;
  1629. case Cvideopro:
  1630. case DvcV6:
  1631. case Kritter:
  1632. case Kr651us:
  1633. v[0] = val;
  1634. v[1] = val >> 8;
  1635. reg_w(gspca_dev, 0x101b, v, 2);
  1636. break;
  1637. }
  1638. }
  1639. static void setautogain(struct gspca_dev *gspca_dev, s32 val)
  1640. {
  1641. struct sd *sd = (struct sd *) gspca_dev;
  1642. int w, h;
  1643. if (!val) {
  1644. sd->ag_cnt = -1;
  1645. return;
  1646. }
  1647. sd->ag_cnt = AG_CNT_START;
  1648. reg_r(gspca_dev, 0x1004, 1);
  1649. if (gspca_dev->usb_buf[0] & 0x04) { /* if AE_FULL_FRM */
  1650. sd->ae_res = gspca_dev->pixfmt.width * gspca_dev->pixfmt.height;
  1651. } else { /* get the AE window size */
  1652. reg_r(gspca_dev, 0x1011, 8);
  1653. w = (gspca_dev->usb_buf[1] << 8) + gspca_dev->usb_buf[0]
  1654. - (gspca_dev->usb_buf[3] << 8) - gspca_dev->usb_buf[2];
  1655. h = (gspca_dev->usb_buf[5] << 8) + gspca_dev->usb_buf[4]
  1656. - (gspca_dev->usb_buf[7] << 8) - gspca_dev->usb_buf[6];
  1657. sd->ae_res = h * w;
  1658. if (sd->ae_res == 0)
  1659. sd->ae_res = gspca_dev->pixfmt.width *
  1660. gspca_dev->pixfmt.height;
  1661. }
  1662. }
  1663. static int nw802_test_reg(struct gspca_dev *gspca_dev,
  1664. u16 index,
  1665. u8 value)
  1666. {
  1667. /* write the value */
  1668. reg_w(gspca_dev, index, &value, 1);
  1669. /* read it */
  1670. reg_r(gspca_dev, index, 1);
  1671. return gspca_dev->usb_buf[0] == value;
  1672. }
  1673. /* this function is called at probe time */
  1674. static int sd_config(struct gspca_dev *gspca_dev,
  1675. const struct usb_device_id *id)
  1676. {
  1677. struct sd *sd = (struct sd *) gspca_dev;
  1678. if ((unsigned) webcam >= NWEBCAMS)
  1679. webcam = 0;
  1680. sd->webcam = webcam;
  1681. gspca_dev->cam.needs_full_bandwidth = 1;
  1682. sd->ag_cnt = -1;
  1683. /*
  1684. * Autodetect sequence inspired from some log.
  1685. * We try to detect what registers exist or not.
  1686. * If 0x0500 does not exist => NW802
  1687. * If it does, test 0x109b. If it doesn't exist,
  1688. * then it's a NW801. Else, a NW800
  1689. * If a et31x110 (nw800 and 06a5:d800)
  1690. * get the sensor ID
  1691. */
  1692. if (!nw802_test_reg(gspca_dev, 0x0500, 0x55)) {
  1693. sd->bridge = BRIDGE_NW802;
  1694. if (sd->webcam == Generic800)
  1695. sd->webcam = Generic802;
  1696. } else if (!nw802_test_reg(gspca_dev, 0x109b, 0xaa)) {
  1697. sd->bridge = BRIDGE_NW801;
  1698. if (sd->webcam == Generic800)
  1699. sd->webcam = P35u;
  1700. } else if (id->idVendor == 0x06a5 && id->idProduct == 0xd800) {
  1701. reg_r(gspca_dev, 0x0403, 1); /* GPIO */
  1702. PDEBUG(D_PROBE, "et31x110 sensor type %02x",
  1703. gspca_dev->usb_buf[0]);
  1704. switch (gspca_dev->usb_buf[0] >> 1) {
  1705. case 0x00: /* ?? */
  1706. if (sd->webcam == Generic800)
  1707. sd->webcam = SpaceCam;
  1708. break;
  1709. case 0x01: /* Hynix? */
  1710. if (sd->webcam == Generic800)
  1711. sd->webcam = Twinkle;
  1712. break;
  1713. case 0x0a: /* Pixart */
  1714. if (sd->webcam == Generic800)
  1715. sd->webcam = SpaceCam2;
  1716. break;
  1717. }
  1718. }
  1719. if (webcam_chip[sd->webcam] != sd->bridge) {
  1720. pr_err("Bad webcam type %d for NW80%d\n",
  1721. sd->webcam, sd->bridge);
  1722. gspca_dev->usb_err = -ENODEV;
  1723. return gspca_dev->usb_err;
  1724. }
  1725. PDEBUG(D_PROBE, "Bridge nw80%d - type: %d", sd->bridge, sd->webcam);
  1726. if (sd->bridge == BRIDGE_NW800) {
  1727. switch (sd->webcam) {
  1728. case DS3303u:
  1729. gspca_dev->cam.cam_mode = cif_mode; /* qvga */
  1730. break;
  1731. default:
  1732. gspca_dev->cam.cam_mode = &cif_mode[1]; /* cif */
  1733. break;
  1734. }
  1735. gspca_dev->cam.nmodes = 1;
  1736. } else {
  1737. gspca_dev->cam.cam_mode = vga_mode;
  1738. switch (sd->webcam) {
  1739. case Kr651us:
  1740. case Proscope:
  1741. case P35u:
  1742. gspca_dev->cam.nmodes = ARRAY_SIZE(vga_mode);
  1743. break;
  1744. default:
  1745. gspca_dev->cam.nmodes = 1; /* qvga only */
  1746. break;
  1747. }
  1748. }
  1749. return gspca_dev->usb_err;
  1750. }
  1751. /* this function is called at probe and resume time */
  1752. static int sd_init(struct gspca_dev *gspca_dev)
  1753. {
  1754. struct sd *sd = (struct sd *) gspca_dev;
  1755. switch (sd->bridge) {
  1756. case BRIDGE_NW800:
  1757. switch (sd->webcam) {
  1758. case SpaceCam:
  1759. reg_w_buf(gspca_dev, spacecam_init);
  1760. break;
  1761. default:
  1762. reg_w_buf(gspca_dev, nw800_init);
  1763. break;
  1764. }
  1765. break;
  1766. default:
  1767. switch (sd->webcam) {
  1768. case Mustek300:
  1769. case P35u:
  1770. case Proscope:
  1771. reg_w_buf(gspca_dev, proscope_init);
  1772. break;
  1773. }
  1774. break;
  1775. }
  1776. return gspca_dev->usb_err;
  1777. }
  1778. /* -- start the camera -- */
  1779. static int sd_start(struct gspca_dev *gspca_dev)
  1780. {
  1781. struct sd *sd = (struct sd *) gspca_dev;
  1782. const u8 *cmd;
  1783. cmd = webcam_start[sd->webcam];
  1784. reg_w_buf(gspca_dev, cmd);
  1785. switch (sd->webcam) {
  1786. case P35u:
  1787. if (gspca_dev->pixfmt.width == 320)
  1788. reg_w_buf(gspca_dev, nw801_start_qvga);
  1789. else
  1790. reg_w_buf(gspca_dev, nw801_start_vga);
  1791. reg_w_buf(gspca_dev, nw801_start_2);
  1792. break;
  1793. case Kr651us:
  1794. if (gspca_dev->pixfmt.width == 320)
  1795. reg_w_buf(gspca_dev, kr651_start_qvga);
  1796. else
  1797. reg_w_buf(gspca_dev, kr651_start_vga);
  1798. reg_w_buf(gspca_dev, kr651_start_2);
  1799. break;
  1800. case Proscope:
  1801. if (gspca_dev->pixfmt.width == 320)
  1802. reg_w_buf(gspca_dev, proscope_start_qvga);
  1803. else
  1804. reg_w_buf(gspca_dev, proscope_start_vga);
  1805. reg_w_buf(gspca_dev, proscope_start_2);
  1806. break;
  1807. }
  1808. sd->exp_too_high_cnt = 0;
  1809. sd->exp_too_low_cnt = 0;
  1810. return gspca_dev->usb_err;
  1811. }
  1812. static void sd_stopN(struct gspca_dev *gspca_dev)
  1813. {
  1814. struct sd *sd = (struct sd *) gspca_dev;
  1815. u8 value;
  1816. /* 'go' off */
  1817. if (sd->bridge != BRIDGE_NW801) {
  1818. value = 0x02;
  1819. reg_w(gspca_dev, 0x0406, &value, 1);
  1820. }
  1821. /* LED off */
  1822. switch (sd->webcam) {
  1823. case Cvideopro:
  1824. case Kr651us:
  1825. case DvcV6:
  1826. case Kritter:
  1827. value = 0xff;
  1828. break;
  1829. case Dlink350c:
  1830. value = 0x21;
  1831. break;
  1832. case SpaceCam:
  1833. case SpaceCam2:
  1834. case Proscope:
  1835. case Twinkle:
  1836. value = 0x01;
  1837. break;
  1838. default:
  1839. return;
  1840. }
  1841. reg_w(gspca_dev, 0x0404, &value, 1);
  1842. }
  1843. static void sd_pkt_scan(struct gspca_dev *gspca_dev,
  1844. u8 *data, /* isoc packet */
  1845. int len) /* iso packet length */
  1846. {
  1847. /*
  1848. * frame header = '00 00 hh ww ss xx ff ff'
  1849. * with:
  1850. * - 'hh': height / 4
  1851. * - 'ww': width / 4
  1852. * - 'ss': frame sequence number c0..dd
  1853. */
  1854. if (data[0] == 0x00 && data[1] == 0x00
  1855. && data[6] == 0xff && data[7] == 0xff) {
  1856. gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
  1857. gspca_frame_add(gspca_dev, FIRST_PACKET, data + 8, len - 8);
  1858. } else {
  1859. gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
  1860. }
  1861. }
  1862. static void do_autogain(struct gspca_dev *gspca_dev)
  1863. {
  1864. struct sd *sd = (struct sd *) gspca_dev;
  1865. int luma;
  1866. if (sd->ag_cnt < 0)
  1867. return;
  1868. if (--sd->ag_cnt >= 0)
  1869. return;
  1870. sd->ag_cnt = AG_CNT_START;
  1871. /* get the average luma */
  1872. reg_r(gspca_dev, sd->bridge == BRIDGE_NW801 ? 0x080d : 0x080c, 4);
  1873. luma = (gspca_dev->usb_buf[3] << 24) + (gspca_dev->usb_buf[2] << 16)
  1874. + (gspca_dev->usb_buf[1] << 8) + gspca_dev->usb_buf[0];
  1875. luma /= sd->ae_res;
  1876. switch (sd->webcam) {
  1877. case P35u:
  1878. gspca_coarse_grained_expo_autogain(gspca_dev, luma, 100, 5);
  1879. break;
  1880. default:
  1881. gspca_expo_autogain(gspca_dev, luma, 100, 5, 230, 0);
  1882. break;
  1883. }
  1884. }
  1885. static int sd_s_ctrl(struct v4l2_ctrl *ctrl)
  1886. {
  1887. struct gspca_dev *gspca_dev =
  1888. container_of(ctrl->handler, struct gspca_dev, ctrl_handler);
  1889. gspca_dev->usb_err = 0;
  1890. if (!gspca_dev->streaming)
  1891. return 0;
  1892. switch (ctrl->id) {
  1893. /* autogain/gain/exposure control cluster */
  1894. case V4L2_CID_AUTOGAIN:
  1895. if (ctrl->is_new)
  1896. setautogain(gspca_dev, ctrl->val);
  1897. if (!ctrl->val) {
  1898. if (gspca_dev->gain->is_new)
  1899. setgain(gspca_dev, gspca_dev->gain->val);
  1900. if (gspca_dev->exposure->is_new)
  1901. setexposure(gspca_dev,
  1902. gspca_dev->exposure->val);
  1903. }
  1904. break;
  1905. /* Some webcams only have exposure, so handle that separately from the
  1906. autogain/gain/exposure cluster in the previous case. */
  1907. case V4L2_CID_EXPOSURE:
  1908. setexposure(gspca_dev, gspca_dev->exposure->val);
  1909. break;
  1910. }
  1911. return gspca_dev->usb_err;
  1912. }
  1913. static const struct v4l2_ctrl_ops sd_ctrl_ops = {
  1914. .s_ctrl = sd_s_ctrl,
  1915. };
  1916. static int sd_init_controls(struct gspca_dev *gspca_dev)
  1917. {
  1918. struct sd *sd = (struct sd *)gspca_dev;
  1919. struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler;
  1920. gspca_dev->vdev.ctrl_handler = hdl;
  1921. v4l2_ctrl_handler_init(hdl, 3);
  1922. switch (sd->webcam) {
  1923. case P35u:
  1924. gspca_dev->autogain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
  1925. V4L2_CID_AUTOGAIN, 0, 1, 1, 1);
  1926. /* For P35u choose coarse expo auto gain function gain minimum,
  1927. * to avoid a large settings jump the first auto adjustment */
  1928. gspca_dev->gain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
  1929. V4L2_CID_GAIN, 0, 127, 1, 127 / 5 * 2);
  1930. gspca_dev->exposure = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
  1931. V4L2_CID_EXPOSURE, 0, 9, 1, 9);
  1932. break;
  1933. case Kr651us:
  1934. gspca_dev->autogain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
  1935. V4L2_CID_AUTOGAIN, 0, 1, 1, 1);
  1936. gspca_dev->gain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
  1937. V4L2_CID_GAIN, 0, 253, 1, 128);
  1938. /* fall through */
  1939. case Cvideopro:
  1940. case DvcV6:
  1941. case Kritter:
  1942. gspca_dev->exposure = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
  1943. V4L2_CID_EXPOSURE, 0, 315, 1, 150);
  1944. break;
  1945. default:
  1946. break;
  1947. }
  1948. if (hdl->error) {
  1949. pr_err("Could not initialize controls\n");
  1950. return hdl->error;
  1951. }
  1952. if (gspca_dev->autogain)
  1953. v4l2_ctrl_auto_cluster(3, &gspca_dev->autogain, 0, false);
  1954. return 0;
  1955. }
  1956. /* sub-driver description */
  1957. static const struct sd_desc sd_desc = {
  1958. .name = MODULE_NAME,
  1959. .config = sd_config,
  1960. .init = sd_init,
  1961. .init_controls = sd_init_controls,
  1962. .start = sd_start,
  1963. .stopN = sd_stopN,
  1964. .pkt_scan = sd_pkt_scan,
  1965. .dq_callback = do_autogain,
  1966. };
  1967. /* -- module initialisation -- */
  1968. static const struct usb_device_id device_table[] = {
  1969. {USB_DEVICE(0x046d, 0xd001)},
  1970. {USB_DEVICE(0x0502, 0xd001)},
  1971. {USB_DEVICE(0x052b, 0xd001)},
  1972. {USB_DEVICE(0x055f, 0xd001)},
  1973. {USB_DEVICE(0x06a5, 0x0000)},
  1974. {USB_DEVICE(0x06a5, 0xd001)},
  1975. {USB_DEVICE(0x06a5, 0xd800)},
  1976. {USB_DEVICE(0x06be, 0xd001)},
  1977. {USB_DEVICE(0x0728, 0xd001)},
  1978. {}
  1979. };
  1980. MODULE_DEVICE_TABLE(usb, device_table);
  1981. /* -- device connect -- */
  1982. static int sd_probe(struct usb_interface *intf,
  1983. const struct usb_device_id *id)
  1984. {
  1985. return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
  1986. THIS_MODULE);
  1987. }
  1988. static struct usb_driver sd_driver = {
  1989. .name = MODULE_NAME,
  1990. .id_table = device_table,
  1991. .probe = sd_probe,
  1992. .disconnect = gspca_disconnect,
  1993. #ifdef CONFIG_PM
  1994. .suspend = gspca_suspend,
  1995. .resume = gspca_resume,
  1996. .reset_resume = gspca_resume,
  1997. #endif
  1998. };
  1999. module_usb_driver(sd_driver);
  2000. module_param(webcam, int, 0644);
  2001. MODULE_PARM_DESC(webcam,
  2002. "Webcam type\n"
  2003. "0: generic\n"
  2004. "1: Trust 120 SpaceCam\n"
  2005. "2: other Trust 120 SpaceCam\n"
  2006. "3: Conceptronic Video Pro\n"
  2007. "4: D-link dru-350c\n"
  2008. "5: Plustek Opticam 500U\n"
  2009. "6: Panasonic GP-KR651US\n"
  2010. "7: iRez Kritter\n"
  2011. "8: Mustek Wcam 300 mini\n"
  2012. "9: Scalar USB Microscope M2 (Proscope)\n"
  2013. "10: Divio Chicony TwinkleCam\n"
  2014. "11: DVC-V6\n");