spca508.c 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548
  1. /*
  2. * SPCA508 chip based cameras subdriver
  3. *
  4. * Copyright (C) 2009 Jean-Francois Moine <http://moinejf.free.fr>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. */
  20. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  21. #define MODULE_NAME "spca508"
  22. #include "gspca.h"
  23. MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
  24. MODULE_DESCRIPTION("GSPCA/SPCA508 USB Camera Driver");
  25. MODULE_LICENSE("GPL");
  26. /* specific webcam descriptor */
  27. struct sd {
  28. struct gspca_dev gspca_dev; /* !! must be the first item */
  29. u8 brightness;
  30. u8 subtype;
  31. #define CreativeVista 0
  32. #define HamaUSBSightcam 1
  33. #define HamaUSBSightcam2 2
  34. #define IntelEasyPCCamera 3
  35. #define MicroInnovationIC200 4
  36. #define ViewQuestVQ110 5
  37. };
  38. /* V4L2 controls supported by the driver */
  39. static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val);
  40. static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val);
  41. static const struct ctrl sd_ctrls[] = {
  42. {
  43. {
  44. .id = V4L2_CID_BRIGHTNESS,
  45. .type = V4L2_CTRL_TYPE_INTEGER,
  46. .name = "Brightness",
  47. .minimum = 0,
  48. .maximum = 255,
  49. .step = 1,
  50. #define BRIGHTNESS_DEF 128
  51. .default_value = BRIGHTNESS_DEF,
  52. },
  53. .set = sd_setbrightness,
  54. .get = sd_getbrightness,
  55. },
  56. };
  57. static const struct v4l2_pix_format sif_mode[] = {
  58. {160, 120, V4L2_PIX_FMT_SPCA508, V4L2_FIELD_NONE,
  59. .bytesperline = 160,
  60. .sizeimage = 160 * 120 * 3 / 2,
  61. .colorspace = V4L2_COLORSPACE_SRGB,
  62. .priv = 3},
  63. {176, 144, V4L2_PIX_FMT_SPCA508, V4L2_FIELD_NONE,
  64. .bytesperline = 176,
  65. .sizeimage = 176 * 144 * 3 / 2,
  66. .colorspace = V4L2_COLORSPACE_SRGB,
  67. .priv = 2},
  68. {320, 240, V4L2_PIX_FMT_SPCA508, V4L2_FIELD_NONE,
  69. .bytesperline = 320,
  70. .sizeimage = 320 * 240 * 3 / 2,
  71. .colorspace = V4L2_COLORSPACE_SRGB,
  72. .priv = 1},
  73. {352, 288, V4L2_PIX_FMT_SPCA508, V4L2_FIELD_NONE,
  74. .bytesperline = 352,
  75. .sizeimage = 352 * 288 * 3 / 2,
  76. .colorspace = V4L2_COLORSPACE_SRGB,
  77. .priv = 0},
  78. };
  79. /* Frame packet header offsets for the spca508 */
  80. #define SPCA508_OFFSET_DATA 37
  81. /*
  82. * Initialization data: this is the first set-up data written to the
  83. * device (before the open data).
  84. */
  85. static const u16 spca508_init_data[][2] = {
  86. {0x0000, 0x870b},
  87. {0x0020, 0x8112}, /* Video drop enable, ISO streaming disable */
  88. {0x0003, 0x8111}, /* Reset compression & memory */
  89. {0x0000, 0x8110}, /* Disable all outputs */
  90. /* READ {0x0000, 0x8114} -> 0000: 00 */
  91. {0x0000, 0x8114}, /* SW GPIO data */
  92. {0x0008, 0x8110}, /* Enable charge pump output */
  93. {0x0002, 0x8116}, /* 200 kHz pump clock */
  94. /* UNKNOWN DIRECTION (URB_FUNCTION_SELECT_INTERFACE:) */
  95. {0x0003, 0x8111}, /* Reset compression & memory */
  96. {0x0000, 0x8111}, /* Normal mode (not reset) */
  97. {0x0098, 0x8110},
  98. /* Enable charge pump output, sync.serial,external 2x clock */
  99. {0x000d, 0x8114}, /* SW GPIO data */
  100. {0x0002, 0x8116}, /* 200 kHz pump clock */
  101. {0x0020, 0x8112}, /* Video drop enable, ISO streaming disable */
  102. /* --------------------------------------- */
  103. {0x000f, 0x8402}, /* memory bank */
  104. {0x0000, 0x8403}, /* ... address */
  105. /* --------------------------------------- */
  106. /* 0x88__ is Synchronous Serial Interface. */
  107. /* TBD: This table could be expressed more compactly */
  108. /* using spca508_write_i2c_vector(). */
  109. /* TBD: Should see if the values in spca50x_i2c_data */
  110. /* would work with the VQ110 instead of the values */
  111. /* below. */
  112. {0x00c0, 0x8804}, /* SSI slave addr */
  113. {0x0008, 0x8802}, /* 375 Khz SSI clock */
  114. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  115. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  116. {0x0008, 0x8802}, /* 375 Khz SSI clock */
  117. {0x0012, 0x8801}, /* SSI reg addr */
  118. {0x0080, 0x8800}, /* SSI data to write */
  119. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  120. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  121. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  122. {0x0008, 0x8802}, /* 375 Khz SSI clock */
  123. {0x0012, 0x8801}, /* SSI reg addr */
  124. {0x0000, 0x8800}, /* SSI data to write */
  125. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  126. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  127. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  128. {0x0008, 0x8802}, /* 375 Khz SSI clock */
  129. {0x0011, 0x8801}, /* SSI reg addr */
  130. {0x0040, 0x8800}, /* SSI data to write */
  131. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  132. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  133. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  134. {0x0008, 0x8802},
  135. {0x0013, 0x8801},
  136. {0x0000, 0x8800},
  137. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  138. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  139. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  140. {0x0008, 0x8802},
  141. {0x0014, 0x8801},
  142. {0x0000, 0x8800},
  143. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  144. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  145. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  146. {0x0008, 0x8802},
  147. {0x0015, 0x8801},
  148. {0x0001, 0x8800},
  149. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  150. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  151. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  152. {0x0008, 0x8802},
  153. {0x0016, 0x8801},
  154. {0x0003, 0x8800},
  155. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  156. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  157. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  158. {0x0008, 0x8802},
  159. {0x0017, 0x8801},
  160. {0x0036, 0x8800},
  161. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  162. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  163. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  164. {0x0008, 0x8802},
  165. {0x0018, 0x8801},
  166. {0x00ec, 0x8800},
  167. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  168. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  169. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  170. {0x0008, 0x8802},
  171. {0x001a, 0x8801},
  172. {0x0094, 0x8800},
  173. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  174. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  175. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  176. {0x0008, 0x8802},
  177. {0x001b, 0x8801},
  178. {0x0000, 0x8800},
  179. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  180. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  181. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  182. {0x0008, 0x8802},
  183. {0x0027, 0x8801},
  184. {0x00a2, 0x8800},
  185. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  186. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  187. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  188. {0x0008, 0x8802},
  189. {0x0028, 0x8801},
  190. {0x0040, 0x8800},
  191. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  192. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  193. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  194. {0x0008, 0x8802},
  195. {0x002a, 0x8801},
  196. {0x0084, 0x8800},
  197. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  198. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  199. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  200. {0x0008, 0x8802},
  201. {0x002b, 0x8801},
  202. {0x00a8, 0x8800},
  203. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  204. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  205. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  206. {0x0008, 0x8802},
  207. {0x002c, 0x8801},
  208. {0x00fe, 0x8800},
  209. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  210. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  211. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  212. {0x0008, 0x8802},
  213. {0x002d, 0x8801},
  214. {0x0003, 0x8800},
  215. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  216. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  217. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  218. {0x0008, 0x8802},
  219. {0x0038, 0x8801},
  220. {0x0083, 0x8800},
  221. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  222. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  223. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  224. {0x0008, 0x8802},
  225. {0x0033, 0x8801},
  226. {0x0081, 0x8800},
  227. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  228. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  229. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  230. {0x0008, 0x8802},
  231. {0x0034, 0x8801},
  232. {0x004a, 0x8800},
  233. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  234. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  235. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  236. {0x0008, 0x8802},
  237. {0x0039, 0x8801},
  238. {0x0000, 0x8800},
  239. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  240. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  241. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  242. {0x0008, 0x8802},
  243. {0x0010, 0x8801},
  244. {0x00a8, 0x8800},
  245. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  246. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  247. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  248. {0x0008, 0x8802},
  249. {0x0006, 0x8801},
  250. {0x0058, 0x8800},
  251. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  252. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  253. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  254. {0x0008, 0x8802},
  255. {0x0000, 0x8801},
  256. {0x0004, 0x8800},
  257. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  258. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  259. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  260. {0x0008, 0x8802},
  261. {0x0040, 0x8801},
  262. {0x0080, 0x8800},
  263. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  264. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  265. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  266. {0x0008, 0x8802},
  267. {0x0041, 0x8801},
  268. {0x000c, 0x8800},
  269. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  270. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  271. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  272. {0x0008, 0x8802},
  273. {0x0042, 0x8801},
  274. {0x000c, 0x8800},
  275. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  276. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  277. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  278. {0x0008, 0x8802},
  279. {0x0043, 0x8801},
  280. {0x0028, 0x8800},
  281. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  282. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  283. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  284. {0x0008, 0x8802},
  285. {0x0044, 0x8801},
  286. {0x0080, 0x8800},
  287. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  288. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  289. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  290. {0x0008, 0x8802},
  291. {0x0045, 0x8801},
  292. {0x0020, 0x8800},
  293. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  294. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  295. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  296. {0x0008, 0x8802},
  297. {0x0046, 0x8801},
  298. {0x0020, 0x8800},
  299. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  300. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  301. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  302. {0x0008, 0x8802},
  303. {0x0047, 0x8801},
  304. {0x0080, 0x8800},
  305. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  306. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  307. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  308. {0x0008, 0x8802},
  309. {0x0048, 0x8801},
  310. {0x004c, 0x8800},
  311. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  312. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  313. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  314. {0x0008, 0x8802},
  315. {0x0049, 0x8801},
  316. {0x0084, 0x8800},
  317. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  318. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  319. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  320. {0x0008, 0x8802},
  321. {0x004a, 0x8801},
  322. {0x0084, 0x8800},
  323. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  324. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  325. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  326. {0x0008, 0x8802},
  327. {0x004b, 0x8801},
  328. {0x0084, 0x8800},
  329. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  330. /* --------------------------------------- */
  331. {0x0012, 0x8700}, /* Clock speed 48Mhz/(2+2)/2= 6 Mhz */
  332. {0x0000, 0x8701}, /* CKx1 clock delay adj */
  333. {0x0000, 0x8701}, /* CKx1 clock delay adj */
  334. {0x0001, 0x870c}, /* CKOx2 output */
  335. /* --------------------------------------- */
  336. {0x0080, 0x8600}, /* Line memory read counter (L) */
  337. {0x0001, 0x8606}, /* reserved */
  338. {0x0064, 0x8607}, /* Line memory read counter (H) 0x6480=25,728 */
  339. {0x002a, 0x8601}, /* CDSP sharp interpolation mode,
  340. * line sel for color sep, edge enhance enab */
  341. {0x0000, 0x8602}, /* optical black level for user settng = 0 */
  342. {0x0080, 0x8600}, /* Line memory read counter (L) */
  343. {0x000a, 0x8603}, /* optical black level calc mode:
  344. * auto; optical black offset = 10 */
  345. {0x00df, 0x865b}, /* Horiz offset for valid pixels (L)=0xdf */
  346. {0x0012, 0x865c}, /* Vert offset for valid lines (L)=0x12 */
  347. /* The following two lines seem to be the "wrong" resolution. */
  348. /* But perhaps these indicate the actual size of the sensor */
  349. /* rather than the size of the current video mode. */
  350. {0x0058, 0x865d}, /* Horiz valid pixels (*4) (L) = 352 */
  351. {0x0048, 0x865e}, /* Vert valid lines (*4) (L) = 288 */
  352. {0x0015, 0x8608}, /* A11 Coef ... */
  353. {0x0030, 0x8609},
  354. {0x00fb, 0x860a},
  355. {0x003e, 0x860b},
  356. {0x00ce, 0x860c},
  357. {0x00f4, 0x860d},
  358. {0x00eb, 0x860e},
  359. {0x00dc, 0x860f},
  360. {0x0039, 0x8610},
  361. {0x0001, 0x8611}, /* R offset for white balance ... */
  362. {0x0000, 0x8612},
  363. {0x0001, 0x8613},
  364. {0x0000, 0x8614},
  365. {0x005b, 0x8651}, /* R gain for white balance ... */
  366. {0x0040, 0x8652},
  367. {0x0060, 0x8653},
  368. {0x0040, 0x8654},
  369. {0x0000, 0x8655},
  370. {0x0001, 0x863f}, /* Fixed gamma correction enable, USB control,
  371. * lum filter disable, lum noise clip disable */
  372. {0x00a1, 0x8656}, /* Window1 size 256x256, Windows2 size 64x64,
  373. * gamma look-up disable,
  374. * new edge enhancement enable */
  375. {0x0018, 0x8657}, /* Edge gain high thresh */
  376. {0x0020, 0x8658}, /* Edge gain low thresh */
  377. {0x000a, 0x8659}, /* Edge bandwidth high threshold */
  378. {0x0005, 0x865a}, /* Edge bandwidth low threshold */
  379. /* -------------------------------- */
  380. {0x0030, 0x8112}, /* Video drop enable, ISO streaming enable */
  381. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  382. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  383. {0xa908, 0x8802},
  384. {0x0034, 0x8801}, /* SSI reg addr */
  385. {0x00ca, 0x8800},
  386. /* SSI data to write */
  387. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  388. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  389. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  390. {0x1f08, 0x8802},
  391. {0x0006, 0x8801},
  392. {0x0080, 0x8800},
  393. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  394. /* ----- Read back coefs we wrote earlier. */
  395. /* READ { 0x0000, 0x8608 } -> 0000: 15 */
  396. /* READ { 0x0000, 0x8609 } -> 0000: 30 */
  397. /* READ { 0x0000, 0x860a } -> 0000: fb */
  398. /* READ { 0x0000, 0x860b } -> 0000: 3e */
  399. /* READ { 0x0000, 0x860c } -> 0000: ce */
  400. /* READ { 0x0000, 0x860d } -> 0000: f4 */
  401. /* READ { 0x0000, 0x860e } -> 0000: eb */
  402. /* READ { 0x0000, 0x860f } -> 0000: dc */
  403. /* READ { 0x0000, 0x8610 } -> 0000: 39 */
  404. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  405. /* READ { 0x0001, 0x8802 } -> 0000: 08 */
  406. {0xb008, 0x8802},
  407. {0x0006, 0x8801},
  408. {0x007d, 0x8800},
  409. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  410. /* This chunk is seemingly redundant with */
  411. /* earlier commands (A11 Coef...), but if I disable it, */
  412. /* the image appears too dark. Maybe there was some kind of */
  413. /* reset since the earlier commands, so this is necessary again. */
  414. {0x0015, 0x8608},
  415. {0x0030, 0x8609},
  416. {0xfffb, 0x860a},
  417. {0x003e, 0x860b},
  418. {0xffce, 0x860c},
  419. {0xfff4, 0x860d},
  420. {0xffeb, 0x860e},
  421. {0xffdc, 0x860f},
  422. {0x0039, 0x8610},
  423. {0x0018, 0x8657},
  424. {0x0000, 0x8508}, /* Disable compression. */
  425. /* Previous line was:
  426. {0x0021, 0x8508}, * Enable compression. */
  427. {0x0032, 0x850b}, /* compression stuff */
  428. {0x0003, 0x8509}, /* compression stuff */
  429. {0x0011, 0x850a}, /* compression stuff */
  430. {0x0021, 0x850d}, /* compression stuff */
  431. {0x0010, 0x850c}, /* compression stuff */
  432. {0x0003, 0x8500}, /* *** Video mode: 160x120 */
  433. {0x0001, 0x8501}, /* Hardware-dominated snap control */
  434. {0x0061, 0x8656}, /* Window1 size 128x128, Windows2 size 128x128,
  435. * gamma look-up disable,
  436. * new edge enhancement enable */
  437. {0x0018, 0x8617}, /* Window1 start X (*2) */
  438. {0x0008, 0x8618}, /* Window1 start Y (*2) */
  439. {0x0061, 0x8656}, /* Window1 size 128x128, Windows2 size 128x128,
  440. * gamma look-up disable,
  441. * new edge enhancement enable */
  442. {0x0058, 0x8619}, /* Window2 start X (*2) */
  443. {0x0008, 0x861a}, /* Window2 start Y (*2) */
  444. {0x00ff, 0x8615}, /* High lum thresh for white balance */
  445. {0x0000, 0x8616}, /* Low lum thresh for white balance */
  446. {0x0012, 0x8700}, /* Clock speed 48Mhz/(2+2)/2= 6 Mhz */
  447. {0x0012, 0x8700}, /* Clock speed 48Mhz/(2+2)/2= 6 Mhz */
  448. /* READ { 0x0000, 0x8656 } -> 0000: 61 */
  449. {0x0028, 0x8802}, /* 375 Khz SSI clock, SSI r/w sync with VSYNC */
  450. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  451. /* READ { 0x0001, 0x8802 } -> 0000: 28 */
  452. {0x1f28, 0x8802}, /* 375 Khz SSI clock, SSI r/w sync with VSYNC */
  453. {0x0010, 0x8801}, /* SSI reg addr */
  454. {0x003e, 0x8800}, /* SSI data to write */
  455. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  456. {0x0028, 0x8802},
  457. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  458. /* READ { 0x0001, 0x8802 } -> 0000: 28 */
  459. {0x1f28, 0x8802},
  460. {0x0000, 0x8801},
  461. {0x001f, 0x8800},
  462. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  463. {0x0001, 0x8602}, /* optical black level for user settning = 1 */
  464. /* Original: */
  465. {0x0023, 0x8700}, /* Clock speed 48Mhz/(3+2)/4= 2.4 Mhz */
  466. {0x000f, 0x8602}, /* optical black level for user settning = 15 */
  467. {0x0028, 0x8802},
  468. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  469. /* READ { 0x0001, 0x8802 } -> 0000: 28 */
  470. {0x1f28, 0x8802},
  471. {0x0010, 0x8801},
  472. {0x007b, 0x8800},
  473. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  474. {0x002f, 0x8651}, /* R gain for white balance ... */
  475. {0x0080, 0x8653},
  476. /* READ { 0x0000, 0x8655 } -> 0000: 00 */
  477. {0x0000, 0x8655},
  478. {0x0030, 0x8112}, /* Video drop enable, ISO streaming enable */
  479. {0x0020, 0x8112}, /* Video drop enable, ISO streaming disable */
  480. /* UNKNOWN DIRECTION (URB_FUNCTION_SELECT_INTERFACE: (ALT=0) ) */
  481. {}
  482. };
  483. /*
  484. * Initialization data for Intel EasyPC Camera CS110
  485. */
  486. static const u16 spca508cs110_init_data[][2] = {
  487. {0x0000, 0x870b}, /* Reset CTL3 */
  488. {0x0003, 0x8111}, /* Soft Reset compression, memory, TG & CDSP */
  489. {0x0000, 0x8111}, /* Normal operation on reset */
  490. {0x0090, 0x8110},
  491. /* External Clock 2x & Synchronous Serial Interface Output */
  492. {0x0020, 0x8112}, /* Video Drop packet enable */
  493. {0x0000, 0x8114}, /* Software GPIO output data */
  494. {0x0001, 0x8114},
  495. {0x0001, 0x8114},
  496. {0x0001, 0x8114},
  497. {0x0003, 0x8114},
  498. /* Initial sequence Synchronous Serial Interface */
  499. {0x000f, 0x8402}, /* Memory bank Address */
  500. {0x0000, 0x8403}, /* Memory bank Address */
  501. {0x00ba, 0x8804}, /* SSI Slave address */
  502. {0x0010, 0x8802}, /* 93.75kHz SSI Clock Two DataByte */
  503. {0x0010, 0x8802}, /* 93.75kHz SSI Clock two DataByte */
  504. {0x0001, 0x8801},
  505. {0x000a, 0x8805}, /* a - NWG: Dunno what this is about */
  506. {0x0000, 0x8800},
  507. {0x0010, 0x8802},
  508. {0x0002, 0x8801},
  509. {0x0000, 0x8805},
  510. {0x0000, 0x8800},
  511. {0x0010, 0x8802},
  512. {0x0003, 0x8801},
  513. {0x0027, 0x8805},
  514. {0x0001, 0x8800},
  515. {0x0010, 0x8802},
  516. {0x0004, 0x8801},
  517. {0x0065, 0x8805},
  518. {0x0001, 0x8800},
  519. {0x0010, 0x8802},
  520. {0x0005, 0x8801},
  521. {0x0003, 0x8805},
  522. {0x0000, 0x8800},
  523. {0x0010, 0x8802},
  524. {0x0006, 0x8801},
  525. {0x001c, 0x8805},
  526. {0x0000, 0x8800},
  527. {0x0010, 0x8802},
  528. {0x0007, 0x8801},
  529. {0x002a, 0x8805},
  530. {0x0000, 0x8800},
  531. {0x0010, 0x8802},
  532. {0x0002, 0x8704}, /* External input CKIx1 */
  533. {0x0001, 0x8606}, /* 1 Line memory Read Counter (H) Result: (d)410 */
  534. {0x009a, 0x8600}, /* Line memory Read Counter (L) */
  535. {0x0001, 0x865b}, /* 1 Horizontal Offset for Valid Pixel(L) */
  536. {0x0003, 0x865c}, /* 3 Vertical Offset for Valid Lines(L) */
  537. {0x0058, 0x865d}, /* 58 Horizontal Valid Pixel Window(L) */
  538. {0x0006, 0x8660}, /* Nibble data + input order */
  539. {0x000a, 0x8602}, /* Optical black level set to 0x0a */
  540. {0x0000, 0x8603}, /* Optical black level Offset */
  541. /* {0x0000, 0x8611}, * 0 R Offset for white Balance */
  542. /* {0x0000, 0x8612}, * 1 Gr Offset for white Balance */
  543. /* {0x0000, 0x8613}, * 1f B Offset for white Balance */
  544. /* {0x0000, 0x8614}, * f0 Gb Offset for white Balance */
  545. {0x0040, 0x8651}, /* 2b BLUE gain for white balance good at all 60 */
  546. {0x0030, 0x8652}, /* 41 Gr Gain for white Balance (L) */
  547. {0x0035, 0x8653}, /* 26 RED gain for white balance */
  548. {0x0035, 0x8654}, /* 40Gb Gain for white Balance (L) */
  549. {0x0041, 0x863f},
  550. /* Fixed Gamma correction enabled (makes colours look better) */
  551. {0x0000, 0x8655},
  552. /* High bits for white balance*****brightness control*** */
  553. {}
  554. };
  555. static const u16 spca508_sightcam_init_data[][2] = {
  556. /* This line seems to setup the frame/canvas */
  557. {0x000f, 0x8402},
  558. /* These 6 lines are needed to startup the webcam */
  559. {0x0090, 0x8110},
  560. {0x0001, 0x8114},
  561. {0x0001, 0x8114},
  562. {0x0001, 0x8114},
  563. {0x0003, 0x8114},
  564. {0x0080, 0x8804},
  565. /* This part seems to make the pictures darker? (autobrightness?) */
  566. {0x0001, 0x8801},
  567. {0x0004, 0x8800},
  568. {0x0003, 0x8801},
  569. {0x00e0, 0x8800},
  570. {0x0004, 0x8801},
  571. {0x00b4, 0x8800},
  572. {0x0005, 0x8801},
  573. {0x0000, 0x8800},
  574. {0x0006, 0x8801},
  575. {0x00e0, 0x8800},
  576. {0x0007, 0x8801},
  577. {0x000c, 0x8800},
  578. /* This section is just needed, it probably
  579. * does something like the previous section,
  580. * but the cam won't start if it's not included.
  581. */
  582. {0x0014, 0x8801},
  583. {0x0008, 0x8800},
  584. {0x0015, 0x8801},
  585. {0x0067, 0x8800},
  586. {0x0016, 0x8801},
  587. {0x0000, 0x8800},
  588. {0x0017, 0x8801},
  589. {0x0020, 0x8800},
  590. {0x0018, 0x8801},
  591. {0x0044, 0x8800},
  592. /* Makes the picture darker - and the
  593. * cam won't start if not included
  594. */
  595. {0x001e, 0x8801},
  596. {0x00ea, 0x8800},
  597. {0x001f, 0x8801},
  598. {0x0001, 0x8800},
  599. {0x0003, 0x8801},
  600. {0x00e0, 0x8800},
  601. /* seems to place the colors ontop of each other #1 */
  602. {0x0006, 0x8704},
  603. {0x0001, 0x870c},
  604. {0x0016, 0x8600},
  605. {0x0002, 0x8606},
  606. /* if not included the pictures becomes _very_ dark */
  607. {0x0064, 0x8607},
  608. {0x003a, 0x8601},
  609. {0x0000, 0x8602},
  610. /* seems to place the colors ontop of each other #2 */
  611. {0x0016, 0x8600},
  612. {0x0018, 0x8617},
  613. {0x0008, 0x8618},
  614. {0x00a1, 0x8656},
  615. /* webcam won't start if not included */
  616. {0x0007, 0x865b},
  617. {0x0001, 0x865c},
  618. {0x0058, 0x865d},
  619. {0x0048, 0x865e},
  620. /* adjusts the colors */
  621. {0x0049, 0x8651},
  622. {0x0040, 0x8652},
  623. {0x004c, 0x8653},
  624. {0x0040, 0x8654},
  625. {}
  626. };
  627. static const u16 spca508_sightcam2_init_data[][2] = {
  628. {0x0020, 0x8112},
  629. {0x000f, 0x8402},
  630. {0x0000, 0x8403},
  631. {0x0008, 0x8201},
  632. {0x0008, 0x8200},
  633. {0x0001, 0x8200},
  634. {0x0009, 0x8201},
  635. {0x0008, 0x8200},
  636. {0x0001, 0x8200},
  637. {0x000a, 0x8201},
  638. {0x0008, 0x8200},
  639. {0x0001, 0x8200},
  640. {0x000b, 0x8201},
  641. {0x0008, 0x8200},
  642. {0x0001, 0x8200},
  643. {0x000c, 0x8201},
  644. {0x0008, 0x8200},
  645. {0x0001, 0x8200},
  646. {0x000d, 0x8201},
  647. {0x0008, 0x8200},
  648. {0x0001, 0x8200},
  649. {0x000e, 0x8201},
  650. {0x0008, 0x8200},
  651. {0x0001, 0x8200},
  652. {0x0007, 0x8201},
  653. {0x0008, 0x8200},
  654. {0x0001, 0x8200},
  655. {0x000f, 0x8201},
  656. {0x0008, 0x8200},
  657. {0x0001, 0x8200},
  658. {0x0018, 0x8660},
  659. {0x0010, 0x8201},
  660. {0x0008, 0x8200},
  661. {0x0001, 0x8200},
  662. {0x0011, 0x8201},
  663. {0x0008, 0x8200},
  664. {0x0001, 0x8200},
  665. {0x0000, 0x86b0},
  666. {0x0034, 0x86b1},
  667. {0x0000, 0x86b2},
  668. {0x0049, 0x86b3},
  669. {0x0000, 0x86b4},
  670. {0x0000, 0x86b4},
  671. {0x0012, 0x8201},
  672. {0x0008, 0x8200},
  673. {0x0001, 0x8200},
  674. {0x0013, 0x8201},
  675. {0x0008, 0x8200},
  676. {0x0001, 0x8200},
  677. {0x0001, 0x86b0},
  678. {0x00aa, 0x86b1},
  679. {0x0000, 0x86b2},
  680. {0x00e4, 0x86b3},
  681. {0x0000, 0x86b4},
  682. {0x0000, 0x86b4},
  683. {0x0018, 0x8660},
  684. {0x0090, 0x8110},
  685. {0x0001, 0x8114},
  686. {0x0001, 0x8114},
  687. {0x0001, 0x8114},
  688. {0x0003, 0x8114},
  689. {0x0080, 0x8804},
  690. {0x0003, 0x8801},
  691. {0x0012, 0x8800},
  692. {0x0004, 0x8801},
  693. {0x0005, 0x8800},
  694. {0x0005, 0x8801},
  695. {0x0000, 0x8800},
  696. {0x0006, 0x8801},
  697. {0x0000, 0x8800},
  698. {0x0007, 0x8801},
  699. {0x0000, 0x8800},
  700. {0x0008, 0x8801},
  701. {0x0005, 0x8800},
  702. {0x000a, 0x8700},
  703. {0x000e, 0x8801},
  704. {0x0004, 0x8800},
  705. {0x0005, 0x8801},
  706. {0x0047, 0x8800},
  707. {0x0006, 0x8801},
  708. {0x0000, 0x8800},
  709. {0x0007, 0x8801},
  710. {0x00c0, 0x8800},
  711. {0x0008, 0x8801},
  712. {0x0003, 0x8800},
  713. {0x0013, 0x8801},
  714. {0x0001, 0x8800},
  715. {0x0009, 0x8801},
  716. {0x0000, 0x8800},
  717. {0x000a, 0x8801},
  718. {0x0000, 0x8800},
  719. {0x000b, 0x8801},
  720. {0x0000, 0x8800},
  721. {0x000c, 0x8801},
  722. {0x0000, 0x8800},
  723. {0x000e, 0x8801},
  724. {0x0004, 0x8800},
  725. {0x000f, 0x8801},
  726. {0x0000, 0x8800},
  727. {0x0010, 0x8801},
  728. {0x0006, 0x8800},
  729. {0x0011, 0x8801},
  730. {0x0006, 0x8800},
  731. {0x0012, 0x8801},
  732. {0x0000, 0x8800},
  733. {0x0013, 0x8801},
  734. {0x0001, 0x8800},
  735. {0x000a, 0x8700},
  736. {0x0000, 0x8702},
  737. {0x0000, 0x8703},
  738. {0x00c2, 0x8704},
  739. {0x0001, 0x870c},
  740. {0x0044, 0x8600},
  741. {0x0002, 0x8606},
  742. {0x0064, 0x8607},
  743. {0x003a, 0x8601},
  744. {0x0008, 0x8602},
  745. {0x0044, 0x8600},
  746. {0x0018, 0x8617},
  747. {0x0008, 0x8618},
  748. {0x00a1, 0x8656},
  749. {0x0004, 0x865b},
  750. {0x0002, 0x865c},
  751. {0x0058, 0x865d},
  752. {0x0048, 0x865e},
  753. {0x0012, 0x8608},
  754. {0x002c, 0x8609},
  755. {0x0002, 0x860a},
  756. {0x002c, 0x860b},
  757. {0x00db, 0x860c},
  758. {0x00f9, 0x860d},
  759. {0x00f1, 0x860e},
  760. {0x00e3, 0x860f},
  761. {0x002c, 0x8610},
  762. {0x006c, 0x8651},
  763. {0x0041, 0x8652},
  764. {0x0059, 0x8653},
  765. {0x0040, 0x8654},
  766. {0x00fa, 0x8611},
  767. {0x00ff, 0x8612},
  768. {0x00f8, 0x8613},
  769. {0x0000, 0x8614},
  770. {0x0001, 0x863f},
  771. {0x0000, 0x8640},
  772. {0x0026, 0x8641},
  773. {0x0045, 0x8642},
  774. {0x0060, 0x8643},
  775. {0x0075, 0x8644},
  776. {0x0088, 0x8645},
  777. {0x009b, 0x8646},
  778. {0x00b0, 0x8647},
  779. {0x00c5, 0x8648},
  780. {0x00d2, 0x8649},
  781. {0x00dc, 0x864a},
  782. {0x00e5, 0x864b},
  783. {0x00eb, 0x864c},
  784. {0x00f0, 0x864d},
  785. {0x00f6, 0x864e},
  786. {0x00fa, 0x864f},
  787. {0x00ff, 0x8650},
  788. {0x0060, 0x8657},
  789. {0x0010, 0x8658},
  790. {0x0018, 0x8659},
  791. {0x0005, 0x865a},
  792. {0x0018, 0x8660},
  793. {0x0003, 0x8509},
  794. {0x0011, 0x850a},
  795. {0x0032, 0x850b},
  796. {0x0010, 0x850c},
  797. {0x0021, 0x850d},
  798. {0x0001, 0x8500},
  799. {0x0000, 0x8508},
  800. {0x0012, 0x8608},
  801. {0x002c, 0x8609},
  802. {0x0002, 0x860a},
  803. {0x0039, 0x860b},
  804. {0x00d0, 0x860c},
  805. {0x00f7, 0x860d},
  806. {0x00ed, 0x860e},
  807. {0x00db, 0x860f},
  808. {0x0039, 0x8610},
  809. {0x0012, 0x8657},
  810. {0x000c, 0x8619},
  811. {0x0004, 0x861a},
  812. {0x00a1, 0x8656},
  813. {0x00c8, 0x8615},
  814. {0x0032, 0x8616},
  815. {0x0030, 0x8112},
  816. {0x0020, 0x8112},
  817. {0x0020, 0x8112},
  818. {0x000f, 0x8402},
  819. {0x0000, 0x8403},
  820. {0x0090, 0x8110},
  821. {0x0001, 0x8114},
  822. {0x0001, 0x8114},
  823. {0x0001, 0x8114},
  824. {0x0003, 0x8114},
  825. {0x0080, 0x8804},
  826. {0x0003, 0x8801},
  827. {0x0012, 0x8800},
  828. {0x0004, 0x8801},
  829. {0x0005, 0x8800},
  830. {0x0005, 0x8801},
  831. {0x0047, 0x8800},
  832. {0x0006, 0x8801},
  833. {0x0000, 0x8800},
  834. {0x0007, 0x8801},
  835. {0x00c0, 0x8800},
  836. {0x0008, 0x8801},
  837. {0x0003, 0x8800},
  838. {0x000a, 0x8700},
  839. {0x000e, 0x8801},
  840. {0x0004, 0x8800},
  841. {0x0005, 0x8801},
  842. {0x0047, 0x8800},
  843. {0x0006, 0x8801},
  844. {0x0000, 0x8800},
  845. {0x0007, 0x8801},
  846. {0x00c0, 0x8800},
  847. {0x0008, 0x8801},
  848. {0x0003, 0x8800},
  849. {0x0013, 0x8801},
  850. {0x0001, 0x8800},
  851. {0x0009, 0x8801},
  852. {0x0000, 0x8800},
  853. {0x000a, 0x8801},
  854. {0x0000, 0x8800},
  855. {0x000b, 0x8801},
  856. {0x0000, 0x8800},
  857. {0x000c, 0x8801},
  858. {0x0000, 0x8800},
  859. {0x000e, 0x8801},
  860. {0x0004, 0x8800},
  861. {0x000f, 0x8801},
  862. {0x0000, 0x8800},
  863. {0x0010, 0x8801},
  864. {0x0006, 0x8800},
  865. {0x0011, 0x8801},
  866. {0x0006, 0x8800},
  867. {0x0012, 0x8801},
  868. {0x0000, 0x8800},
  869. {0x0013, 0x8801},
  870. {0x0001, 0x8800},
  871. {0x000a, 0x8700},
  872. {0x0000, 0x8702},
  873. {0x0000, 0x8703},
  874. {0x00c2, 0x8704},
  875. {0x0001, 0x870c},
  876. {0x0044, 0x8600},
  877. {0x0002, 0x8606},
  878. {0x0064, 0x8607},
  879. {0x003a, 0x8601},
  880. {0x0008, 0x8602},
  881. {0x0044, 0x8600},
  882. {0x0018, 0x8617},
  883. {0x0008, 0x8618},
  884. {0x00a1, 0x8656},
  885. {0x0004, 0x865b},
  886. {0x0002, 0x865c},
  887. {0x0058, 0x865d},
  888. {0x0048, 0x865e},
  889. {0x0012, 0x8608},
  890. {0x002c, 0x8609},
  891. {0x0002, 0x860a},
  892. {0x002c, 0x860b},
  893. {0x00db, 0x860c},
  894. {0x00f9, 0x860d},
  895. {0x00f1, 0x860e},
  896. {0x00e3, 0x860f},
  897. {0x002c, 0x8610},
  898. {0x006c, 0x8651},
  899. {0x0041, 0x8652},
  900. {0x0059, 0x8653},
  901. {0x0040, 0x8654},
  902. {0x00fa, 0x8611},
  903. {0x00ff, 0x8612},
  904. {0x00f8, 0x8613},
  905. {0x0000, 0x8614},
  906. {0x0001, 0x863f},
  907. {0x0000, 0x8640},
  908. {0x0026, 0x8641},
  909. {0x0045, 0x8642},
  910. {0x0060, 0x8643},
  911. {0x0075, 0x8644},
  912. {0x0088, 0x8645},
  913. {0x009b, 0x8646},
  914. {0x00b0, 0x8647},
  915. {0x00c5, 0x8648},
  916. {0x00d2, 0x8649},
  917. {0x00dc, 0x864a},
  918. {0x00e5, 0x864b},
  919. {0x00eb, 0x864c},
  920. {0x00f0, 0x864d},
  921. {0x00f6, 0x864e},
  922. {0x00fa, 0x864f},
  923. {0x00ff, 0x8650},
  924. {0x0060, 0x8657},
  925. {0x0010, 0x8658},
  926. {0x0018, 0x8659},
  927. {0x0005, 0x865a},
  928. {0x0018, 0x8660},
  929. {0x0003, 0x8509},
  930. {0x0011, 0x850a},
  931. {0x0032, 0x850b},
  932. {0x0010, 0x850c},
  933. {0x0021, 0x850d},
  934. {0x0001, 0x8500},
  935. {0x0000, 0x8508},
  936. {0x0012, 0x8608},
  937. {0x002c, 0x8609},
  938. {0x0002, 0x860a},
  939. {0x0039, 0x860b},
  940. {0x00d0, 0x860c},
  941. {0x00f7, 0x860d},
  942. {0x00ed, 0x860e},
  943. {0x00db, 0x860f},
  944. {0x0039, 0x8610},
  945. {0x0012, 0x8657},
  946. {0x0064, 0x8619},
  947. /* This line starts it all, it is not needed here */
  948. /* since it has been build into the driver */
  949. /* jfm: don't start now */
  950. /* {0x0030, 0x8112}, */
  951. {}
  952. };
  953. /*
  954. * Initialization data for Creative Webcam Vista
  955. */
  956. static const u16 spca508_vista_init_data[][2] = {
  957. {0x0008, 0x8200}, /* Clear register */
  958. {0x0000, 0x870b}, /* Reset CTL3 */
  959. {0x0020, 0x8112}, /* Video Drop packet enable */
  960. {0x0003, 0x8111}, /* Soft Reset compression, memory, TG & CDSP */
  961. {0x0000, 0x8110}, /* Disable everything */
  962. {0x0000, 0x8114}, /* Software GPIO output data */
  963. {0x0000, 0x8114},
  964. {0x0003, 0x8111},
  965. {0x0000, 0x8111},
  966. {0x0090, 0x8110}, /* Enable: SSI output, External 2X clock output */
  967. {0x0020, 0x8112},
  968. {0x0000, 0x8114},
  969. {0x0001, 0x8114},
  970. {0x0001, 0x8114},
  971. {0x0001, 0x8114},
  972. {0x0003, 0x8114},
  973. {0x000f, 0x8402}, /* Memory bank Address */
  974. {0x0000, 0x8403}, /* Memory bank Address */
  975. {0x00ba, 0x8804}, /* SSI Slave address */
  976. {0x0010, 0x8802}, /* 93.75kHz SSI Clock Two DataByte */
  977. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  978. /* READ { 0x0001, 0x8802 } -> 0000: 10 */
  979. {0x0010, 0x8802}, /* Will write 2 bytes (DATA1+DATA2) */
  980. {0x0020, 0x8801}, /* Register address for SSI read/write */
  981. {0x0044, 0x8805}, /* DATA2 */
  982. {0x0004, 0x8800}, /* DATA1 -> write triggered */
  983. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  984. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  985. /* READ { 0x0001, 0x8802 } -> 0000: 10 */
  986. {0x0010, 0x8802},
  987. {0x0009, 0x8801},
  988. {0x0042, 0x8805},
  989. {0x0001, 0x8800},
  990. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  991. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  992. /* READ { 0x0001, 0x8802 } -> 0000: 10 */
  993. {0x0010, 0x8802},
  994. {0x003c, 0x8801},
  995. {0x0001, 0x8805},
  996. {0x0000, 0x8800},
  997. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  998. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  999. /* READ { 0x0001, 0x8802 } -> 0000: 10 */
  1000. {0x0010, 0x8802},
  1001. {0x0001, 0x8801},
  1002. {0x000a, 0x8805},
  1003. {0x0000, 0x8800},
  1004. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1005. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1006. /* READ { 0x0001, 0x8802 } -> 0000: 10 */
  1007. {0x0010, 0x8802},
  1008. {0x0002, 0x8801},
  1009. {0x0000, 0x8805},
  1010. {0x0000, 0x8800},
  1011. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1012. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1013. /* READ { 0x0001, 0x8802 } -> 0000: 10 */
  1014. {0x0010, 0x8802},
  1015. {0x0003, 0x8801},
  1016. {0x0027, 0x8805},
  1017. {0x0001, 0x8800},
  1018. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1019. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1020. /* READ { 0x0001, 0x8802 } -> 0000: 10 */
  1021. {0x0010, 0x8802},
  1022. {0x0004, 0x8801},
  1023. {0x0065, 0x8805},
  1024. {0x0001, 0x8800},
  1025. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1026. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1027. /* READ { 0x0001, 0x8802 } -> 0000: 10 */
  1028. {0x0010, 0x8802},
  1029. {0x0005, 0x8801},
  1030. {0x0003, 0x8805},
  1031. {0x0000, 0x8800},
  1032. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1033. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1034. /* READ { 0x0001, 0x8802 } -> 0000: 10 */
  1035. {0x0010, 0x8802},
  1036. {0x0006, 0x8801},
  1037. {0x001c, 0x8805},
  1038. {0x0000, 0x8800},
  1039. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1040. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1041. /* READ { 0x0001, 0x8802 } -> 0000: 10 */
  1042. {0x0010, 0x8802},
  1043. {0x0007, 0x8801},
  1044. {0x002a, 0x8805},
  1045. {0x0000, 0x8800},
  1046. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1047. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1048. /* READ { 0x0001, 0x8802 } -> 0000: 10 */
  1049. {0x0010, 0x8802},
  1050. {0x000e, 0x8801},
  1051. {0x0000, 0x8805},
  1052. {0x0000, 0x8800},
  1053. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1054. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1055. /* READ { 0x0001, 0x8802 } -> 0000: 10 */
  1056. {0x0010, 0x8802},
  1057. {0x0028, 0x8801},
  1058. {0x002e, 0x8805},
  1059. {0x0000, 0x8800},
  1060. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1061. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1062. /* READ { 0x0001, 0x8802 } -> 0000: 10 */
  1063. {0x0010, 0x8802},
  1064. {0x0039, 0x8801},
  1065. {0x0013, 0x8805},
  1066. {0x0000, 0x8800},
  1067. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1068. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1069. /* READ { 0x0001, 0x8802 } -> 0000: 10 */
  1070. {0x0010, 0x8802},
  1071. {0x003b, 0x8801},
  1072. {0x000c, 0x8805},
  1073. {0x0000, 0x8800},
  1074. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1075. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1076. /* READ { 0x0001, 0x8802 } -> 0000: 10 */
  1077. {0x0010, 0x8802},
  1078. {0x0035, 0x8801},
  1079. {0x0028, 0x8805},
  1080. {0x0000, 0x8800},
  1081. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1082. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1083. /* READ { 0x0001, 0x8802 } -> 0000: 10 */
  1084. {0x0010, 0x8802},
  1085. {0x0009, 0x8801},
  1086. {0x0042, 0x8805},
  1087. {0x0001, 0x8800},
  1088. /* READ { 0x0001, 0x8803 } -> 0000: 00 */
  1089. {0x0050, 0x8703},
  1090. {0x0002, 0x8704}, /* External input CKIx1 */
  1091. {0x0001, 0x870c}, /* Select CKOx2 output */
  1092. {0x009a, 0x8600}, /* Line memory Read Counter (L) */
  1093. {0x0001, 0x8606}, /* 1 Line memory Read Counter (H) Result: (d)410 */
  1094. {0x0023, 0x8601},
  1095. {0x0010, 0x8602},
  1096. {0x000a, 0x8603},
  1097. {0x009a, 0x8600},
  1098. {0x0001, 0x865b}, /* 1 Horizontal Offset for Valid Pixel(L) */
  1099. {0x0003, 0x865c}, /* Vertical offset for valid lines (L) */
  1100. {0x0058, 0x865d}, /* Horizontal valid pixels window (L) */
  1101. {0x0048, 0x865e}, /* Vertical valid lines window (L) */
  1102. {0x0000, 0x865f},
  1103. {0x0006, 0x8660},
  1104. /* Enable nibble data input, select nibble input order */
  1105. {0x0013, 0x8608}, /* A11 Coeficients for color correction */
  1106. {0x0028, 0x8609},
  1107. /* Note: these values are confirmed at the end of array */
  1108. {0x0005, 0x860a}, /* ... */
  1109. {0x0025, 0x860b},
  1110. {0x00e1, 0x860c},
  1111. {0x00fa, 0x860d},
  1112. {0x00f4, 0x860e},
  1113. {0x00e8, 0x860f},
  1114. {0x0025, 0x8610}, /* A33 Coef. */
  1115. {0x00fc, 0x8611}, /* White balance offset: R */
  1116. {0x0001, 0x8612}, /* White balance offset: Gr */
  1117. {0x00fe, 0x8613}, /* White balance offset: B */
  1118. {0x0000, 0x8614}, /* White balance offset: Gb */
  1119. {0x0064, 0x8651}, /* R gain for white balance (L) */
  1120. {0x0040, 0x8652}, /* Gr gain for white balance (L) */
  1121. {0x0066, 0x8653}, /* B gain for white balance (L) */
  1122. {0x0040, 0x8654}, /* Gb gain for white balance (L) */
  1123. {0x0001, 0x863f}, /* Enable fixed gamma correction */
  1124. {0x00a1, 0x8656}, /* Size - Window1: 256x256, Window2: 128x128,
  1125. * UV division: UV no change,
  1126. * Enable New edge enhancement */
  1127. {0x0018, 0x8657}, /* Edge gain high threshold */
  1128. {0x0020, 0x8658}, /* Edge gain low threshold */
  1129. {0x000a, 0x8659}, /* Edge bandwidth high threshold */
  1130. {0x0005, 0x865a}, /* Edge bandwidth low threshold */
  1131. {0x0064, 0x8607}, /* UV filter enable */
  1132. {0x0016, 0x8660},
  1133. {0x0000, 0x86b0}, /* Bad pixels compensation address */
  1134. {0x00dc, 0x86b1}, /* X coord for bad pixels compensation (L) */
  1135. {0x0000, 0x86b2},
  1136. {0x0009, 0x86b3}, /* Y coord for bad pixels compensation (L) */
  1137. {0x0000, 0x86b4},
  1138. {0x0001, 0x86b0},
  1139. {0x00f5, 0x86b1},
  1140. {0x0000, 0x86b2},
  1141. {0x00c6, 0x86b3},
  1142. {0x0000, 0x86b4},
  1143. {0x0002, 0x86b0},
  1144. {0x001c, 0x86b1},
  1145. {0x0001, 0x86b2},
  1146. {0x00d7, 0x86b3},
  1147. {0x0000, 0x86b4},
  1148. {0x0003, 0x86b0},
  1149. {0x001c, 0x86b1},
  1150. {0x0001, 0x86b2},
  1151. {0x00d8, 0x86b3},
  1152. {0x0000, 0x86b4},
  1153. {0x0004, 0x86b0},
  1154. {0x001d, 0x86b1},
  1155. {0x0001, 0x86b2},
  1156. {0x00d8, 0x86b3},
  1157. {0x0000, 0x86b4},
  1158. {0x001e, 0x8660},
  1159. /* READ { 0x0000, 0x8608 } -> 0000: 13 */
  1160. /* READ { 0x0000, 0x8609 } -> 0000: 28 */
  1161. /* READ { 0x0000, 0x8610 } -> 0000: 05 */
  1162. /* READ { 0x0000, 0x8611 } -> 0000: 25 */
  1163. /* READ { 0x0000, 0x8612 } -> 0000: e1 */
  1164. /* READ { 0x0000, 0x8613 } -> 0000: fa */
  1165. /* READ { 0x0000, 0x8614 } -> 0000: f4 */
  1166. /* READ { 0x0000, 0x8615 } -> 0000: e8 */
  1167. /* READ { 0x0000, 0x8616 } -> 0000: 25 */
  1168. {}
  1169. };
  1170. static int reg_write(struct usb_device *dev,
  1171. u16 index, u16 value)
  1172. {
  1173. int ret;
  1174. ret = usb_control_msg(dev,
  1175. usb_sndctrlpipe(dev, 0),
  1176. 0, /* request */
  1177. USB_TYPE_VENDOR | USB_RECIP_DEVICE,
  1178. value, index, NULL, 0, 500);
  1179. PDEBUG(D_USBO, "reg write i:0x%04x = 0x%02x",
  1180. index, value);
  1181. if (ret < 0)
  1182. pr_err("reg write: error %d\n", ret);
  1183. return ret;
  1184. }
  1185. /* read 1 byte */
  1186. /* returns: negative is error, pos or zero is data */
  1187. static int reg_read(struct gspca_dev *gspca_dev,
  1188. u16 index) /* wIndex */
  1189. {
  1190. int ret;
  1191. ret = usb_control_msg(gspca_dev->dev,
  1192. usb_rcvctrlpipe(gspca_dev->dev, 0),
  1193. 0, /* register */
  1194. USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
  1195. 0, /* value */
  1196. index,
  1197. gspca_dev->usb_buf, 1,
  1198. 500); /* timeout */
  1199. PDEBUG(D_USBI, "reg read i:%04x --> %02x",
  1200. index, gspca_dev->usb_buf[0]);
  1201. if (ret < 0) {
  1202. pr_err("reg_read err %d\n", ret);
  1203. return ret;
  1204. }
  1205. return gspca_dev->usb_buf[0];
  1206. }
  1207. /* send 1 or 2 bytes to the sensor via the Synchronous Serial Interface */
  1208. static int ssi_w(struct gspca_dev *gspca_dev,
  1209. u16 reg, u16 val)
  1210. {
  1211. struct usb_device *dev = gspca_dev->dev;
  1212. int ret, retry;
  1213. ret = reg_write(dev, 0x8802, reg >> 8);
  1214. if (ret < 0)
  1215. goto out;
  1216. ret = reg_write(dev, 0x8801, reg & 0x00ff);
  1217. if (ret < 0)
  1218. goto out;
  1219. if ((reg & 0xff00) == 0x1000) { /* if 2 bytes */
  1220. ret = reg_write(dev, 0x8805, val & 0x00ff);
  1221. if (ret < 0)
  1222. goto out;
  1223. val >>= 8;
  1224. }
  1225. ret = reg_write(dev, 0x8800, val);
  1226. if (ret < 0)
  1227. goto out;
  1228. /* poll until not busy */
  1229. retry = 10;
  1230. for (;;) {
  1231. ret = reg_read(gspca_dev, 0x8803);
  1232. if (ret < 0)
  1233. break;
  1234. if (gspca_dev->usb_buf[0] == 0)
  1235. break;
  1236. if (--retry <= 0) {
  1237. PDEBUG(D_ERR, "ssi_w busy %02x",
  1238. gspca_dev->usb_buf[0]);
  1239. ret = -1;
  1240. break;
  1241. }
  1242. msleep(8);
  1243. }
  1244. out:
  1245. return ret;
  1246. }
  1247. static int write_vector(struct gspca_dev *gspca_dev,
  1248. const u16 (*data)[2])
  1249. {
  1250. struct usb_device *dev = gspca_dev->dev;
  1251. int ret = 0;
  1252. while ((*data)[1] != 0) {
  1253. if ((*data)[1] & 0x8000) {
  1254. if ((*data)[1] == 0xdd00) /* delay */
  1255. msleep((*data)[0]);
  1256. else
  1257. ret = reg_write(dev, (*data)[1], (*data)[0]);
  1258. } else {
  1259. ret = ssi_w(gspca_dev, (*data)[1], (*data)[0]);
  1260. }
  1261. if (ret < 0)
  1262. break;
  1263. data++;
  1264. }
  1265. return ret;
  1266. }
  1267. /* this function is called at probe time */
  1268. static int sd_config(struct gspca_dev *gspca_dev,
  1269. const struct usb_device_id *id)
  1270. {
  1271. struct sd *sd = (struct sd *) gspca_dev;
  1272. struct cam *cam;
  1273. const u16 (*init_data)[2];
  1274. static const u16 (*(init_data_tb[]))[2] = {
  1275. spca508_vista_init_data, /* CreativeVista 0 */
  1276. spca508_sightcam_init_data, /* HamaUSBSightcam 1 */
  1277. spca508_sightcam2_init_data, /* HamaUSBSightcam2 2 */
  1278. spca508cs110_init_data, /* IntelEasyPCCamera 3 */
  1279. spca508cs110_init_data, /* MicroInnovationIC200 4 */
  1280. spca508_init_data, /* ViewQuestVQ110 5 */
  1281. };
  1282. #ifdef GSPCA_DEBUG
  1283. int data1, data2;
  1284. /* Read from global register the USB product and vendor IDs, just to
  1285. * prove that we can communicate with the device. This works, which
  1286. * confirms at we are communicating properly and that the device
  1287. * is a 508. */
  1288. data1 = reg_read(gspca_dev, 0x8104);
  1289. data2 = reg_read(gspca_dev, 0x8105);
  1290. PDEBUG(D_PROBE, "Webcam Vendor ID: 0x%02x%02x", data2, data1);
  1291. data1 = reg_read(gspca_dev, 0x8106);
  1292. data2 = reg_read(gspca_dev, 0x8107);
  1293. PDEBUG(D_PROBE, "Webcam Product ID: 0x%02x%02x", data2, data1);
  1294. data1 = reg_read(gspca_dev, 0x8621);
  1295. PDEBUG(D_PROBE, "Window 1 average luminance: %d", data1);
  1296. #endif
  1297. cam = &gspca_dev->cam;
  1298. cam->cam_mode = sif_mode;
  1299. cam->nmodes = ARRAY_SIZE(sif_mode);
  1300. sd->subtype = id->driver_info;
  1301. sd->brightness = BRIGHTNESS_DEF;
  1302. init_data = init_data_tb[sd->subtype];
  1303. return write_vector(gspca_dev, init_data);
  1304. }
  1305. /* this function is called at probe and resume time */
  1306. static int sd_init(struct gspca_dev *gspca_dev)
  1307. {
  1308. return 0;
  1309. }
  1310. static int sd_start(struct gspca_dev *gspca_dev)
  1311. {
  1312. int mode;
  1313. mode = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv;
  1314. reg_write(gspca_dev->dev, 0x8500, mode);
  1315. switch (mode) {
  1316. case 0:
  1317. case 1:
  1318. reg_write(gspca_dev->dev, 0x8700, 0x28); /* clock */
  1319. break;
  1320. default:
  1321. /* case 2: */
  1322. /* case 3: */
  1323. reg_write(gspca_dev->dev, 0x8700, 0x23); /* clock */
  1324. break;
  1325. }
  1326. reg_write(gspca_dev->dev, 0x8112, 0x10 | 0x20);
  1327. return 0;
  1328. }
  1329. static void sd_stopN(struct gspca_dev *gspca_dev)
  1330. {
  1331. /* Video ISO disable, Video Drop Packet enable: */
  1332. reg_write(gspca_dev->dev, 0x8112, 0x20);
  1333. }
  1334. static void sd_pkt_scan(struct gspca_dev *gspca_dev,
  1335. u8 *data, /* isoc packet */
  1336. int len) /* iso packet length */
  1337. {
  1338. switch (data[0]) {
  1339. case 0: /* start of frame */
  1340. gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
  1341. data += SPCA508_OFFSET_DATA;
  1342. len -= SPCA508_OFFSET_DATA;
  1343. gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
  1344. break;
  1345. case 0xff: /* drop */
  1346. break;
  1347. default:
  1348. data += 1;
  1349. len -= 1;
  1350. gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
  1351. break;
  1352. }
  1353. }
  1354. static void setbrightness(struct gspca_dev *gspca_dev)
  1355. {
  1356. struct sd *sd = (struct sd *) gspca_dev;
  1357. u8 brightness = sd->brightness;
  1358. /* MX seem contrast */
  1359. reg_write(gspca_dev->dev, 0x8651, brightness);
  1360. reg_write(gspca_dev->dev, 0x8652, brightness);
  1361. reg_write(gspca_dev->dev, 0x8653, brightness);
  1362. reg_write(gspca_dev->dev, 0x8654, brightness);
  1363. }
  1364. static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
  1365. {
  1366. struct sd *sd = (struct sd *) gspca_dev;
  1367. sd->brightness = val;
  1368. if (gspca_dev->streaming)
  1369. setbrightness(gspca_dev);
  1370. return 0;
  1371. }
  1372. static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
  1373. {
  1374. struct sd *sd = (struct sd *) gspca_dev;
  1375. *val = sd->brightness;
  1376. return 0;
  1377. }
  1378. /* sub-driver description */
  1379. static const struct sd_desc sd_desc = {
  1380. .name = MODULE_NAME,
  1381. .ctrls = sd_ctrls,
  1382. .nctrls = ARRAY_SIZE(sd_ctrls),
  1383. .config = sd_config,
  1384. .init = sd_init,
  1385. .start = sd_start,
  1386. .stopN = sd_stopN,
  1387. .pkt_scan = sd_pkt_scan,
  1388. };
  1389. /* -- module initialisation -- */
  1390. static const struct usb_device_id device_table[] = {
  1391. {USB_DEVICE(0x0130, 0x0130), .driver_info = HamaUSBSightcam},
  1392. {USB_DEVICE(0x041e, 0x4018), .driver_info = CreativeVista},
  1393. {USB_DEVICE(0x0733, 0x0110), .driver_info = ViewQuestVQ110},
  1394. {USB_DEVICE(0x0af9, 0x0010), .driver_info = HamaUSBSightcam},
  1395. {USB_DEVICE(0x0af9, 0x0011), .driver_info = HamaUSBSightcam2},
  1396. {USB_DEVICE(0x8086, 0x0110), .driver_info = IntelEasyPCCamera},
  1397. {}
  1398. };
  1399. MODULE_DEVICE_TABLE(usb, device_table);
  1400. /* -- device connect -- */
  1401. static int sd_probe(struct usb_interface *intf,
  1402. const struct usb_device_id *id)
  1403. {
  1404. return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
  1405. THIS_MODULE);
  1406. }
  1407. static struct usb_driver sd_driver = {
  1408. .name = MODULE_NAME,
  1409. .id_table = device_table,
  1410. .probe = sd_probe,
  1411. .disconnect = gspca_disconnect,
  1412. #ifdef CONFIG_PM
  1413. .suspend = gspca_suspend,
  1414. .resume = gspca_resume,
  1415. #endif
  1416. };
  1417. module_usb_driver(sd_driver);