spca508.c 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794
  1. /*
  2. * SPCA508 chip based cameras subdriver
  3. *
  4. * V4L2 by 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 MODULE_NAME "spca508"
  21. #include "gspca.h"
  22. #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 5)
  23. static const char version[] = "2.1.5";
  24. MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
  25. MODULE_DESCRIPTION("GSPCA/SPCA508 USB Camera Driver");
  26. MODULE_LICENSE("GPL");
  27. /* specific webcam descriptor */
  28. struct sd {
  29. struct gspca_dev gspca_dev; /* !! must be the first item */
  30. int buflen;
  31. unsigned char tmpbuf[352 * 288 * 3 / 2]; /* YUVY per line */
  32. unsigned char tmpbuf2[352 * 288 * 2]; /* YUYV */
  33. unsigned char brightness;
  34. char subtype;
  35. #define CreativeVista 0
  36. #define HamaUSBSightcam 1
  37. #define HamaUSBSightcam2 2
  38. #define IntelEasyPCCamera 3
  39. #define MicroInnovationIC200 4
  40. #define ViewQuestVQ110 5
  41. };
  42. /* V4L2 controls supported by the driver */
  43. static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val);
  44. static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val);
  45. static struct ctrl sd_ctrls[] = {
  46. #define SD_BRIGHTNESS 0
  47. {
  48. {
  49. .id = V4L2_CID_BRIGHTNESS,
  50. .type = V4L2_CTRL_TYPE_INTEGER,
  51. .name = "Brightness",
  52. .minimum = 0,
  53. .maximum = 0xff,
  54. .step = 1,
  55. .default_value = 0x80,
  56. },
  57. .set = sd_setbrightness,
  58. .get = sd_getbrightness,
  59. },
  60. };
  61. static struct v4l2_pix_format sif_mode[] = {
  62. {160, 120, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
  63. .bytesperline = 160 * 2,
  64. .sizeimage = 160 * 120 * 2,
  65. .colorspace = V4L2_COLORSPACE_SRGB,
  66. .priv = 3},
  67. {176, 144, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
  68. .bytesperline = 176 * 2,
  69. .sizeimage = 176 * 144 * 2,
  70. .colorspace = V4L2_COLORSPACE_SRGB,
  71. .priv = 2},
  72. {320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
  73. .bytesperline = 320 * 2,
  74. .sizeimage = 320 * 240 * 2,
  75. .colorspace = V4L2_COLORSPACE_SRGB,
  76. .priv = 1},
  77. {352, 288, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
  78. .bytesperline = 352 * 2,
  79. .sizeimage = 352 * 288 * 2,
  80. .colorspace = V4L2_COLORSPACE_SRGB,
  81. .priv = 0},
  82. };
  83. /* Frame packet header offsets for the spca508 */
  84. #define SPCA508_OFFSET_TYPE 1
  85. #define SPCA508_OFFSET_COMPRESS 2
  86. #define SPCA508_OFFSET_FRAMSEQ 8
  87. #define SPCA508_OFFSET_WIN1LUM 11
  88. #define SPCA508_OFFSET_DATA 37
  89. #define SPCA508_SNAPBIT 0x20
  90. #define SPCA508_SNAPCTRL 0x40
  91. /*************** I2c ****************/
  92. #define SPCA508_INDEX_I2C_BASE 0x8800
  93. /*
  94. * Initialization data: this is the first set-up data written to the
  95. * device (before the open data).
  96. */
  97. static const __u16 spca508_init_data[][3] =
  98. #define IGN(x) /* nothing */
  99. {
  100. /* line URB value, index */
  101. /* 44274 1804 */ {0x0000, 0x870b},
  102. /* 44299 1805 */ {0x0020, 0x8112},
  103. /* Video drop enable, ISO streaming disable */
  104. /* 44324 1806 */ {0x0003, 0x8111},
  105. /* Reset compression & memory */
  106. /* 44349 1807 */ {0x0000, 0x8110},
  107. /* Disable all outputs */
  108. /* 44372 1808 */ /* READ {0x0000, 0x8114} -> 0000: 00 */
  109. /* 44398 1809 */ {0x0000, 0x8114},
  110. /* SW GPIO data */
  111. /* 44423 1810 */ {0x0008, 0x8110},
  112. /* Enable charge pump output */
  113. /* 44527 1811 */ {0x0002, 0x8116},
  114. /* 200 kHz pump clock */
  115. /* 44555 1812 */
  116. /* UNKNOWN DIRECTION (URB_FUNCTION_SELECT_INTERFACE:) */
  117. /* 44590 1813 */ {0x0003, 0x8111},
  118. /* Reset compression & memory */
  119. /* 44615 1814 */ {0x0000, 0x8111},
  120. /* Normal mode (not reset) */
  121. /* 44640 1815 */ {0x0098, 0x8110},
  122. /* Enable charge pump output, sync.serial,external 2x clock */
  123. /* 44665 1816 */ {0x000d, 0x8114},
  124. /* SW GPIO data */
  125. /* 44690 1817 */ {0x0002, 0x8116},
  126. /* 200 kHz pump clock */
  127. /* 44715 1818 */ {0x0020, 0x8112},
  128. /* Video drop enable, ISO streaming disable */
  129. /* --------------------------------------- */
  130. /* 44740 1819 */ {0x000f, 0x8402},
  131. /* memory bank */
  132. /* 44765 1820 */ {0x0000, 0x8403},
  133. /* ... address */
  134. /* --------------------------------------- */
  135. /* 0x88__ is Synchronous Serial Interface. */
  136. /* TBD: This table could be expressed more compactly */
  137. /* using spca508_write_i2c_vector(). */
  138. /* TBD: Should see if the values in spca50x_i2c_data */
  139. /* would work with the VQ110 instead of the values */
  140. /* below. */
  141. /* 44790 1821 */ {0x00c0, 0x8804},
  142. /* SSI slave addr */
  143. /* 44815 1822 */ {0x0008, 0x8802},
  144. /* 375 Khz SSI clock */
  145. /* 44838 1823 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  146. /* 44862 1824 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  147. /* 44888 1825 */ {0x0008, 0x8802},
  148. /* 375 Khz SSI clock */
  149. /* 44913 1826 */ {0x0012, 0x8801},
  150. /* SSI reg addr */
  151. /* 44938 1827 */ {0x0080, 0x8800},
  152. /* SSI data to write */
  153. /* 44961 1828 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  154. /* 44985 1829 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  155. /* 45009 1830 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  156. /* 45035 1831 */ {0x0008, 0x8802},
  157. /* 375 Khz SSI clock */
  158. /* 45060 1832 */ {0x0012, 0x8801},
  159. /* SSI reg addr */
  160. /* 45085 1833 */ {0x0000, 0x8800},
  161. /* SSI data to write */
  162. /* 45108 1834 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  163. /* 45132 1835 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  164. /* 45156 1836 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  165. /* 45182 1837 */ {0x0008, 0x8802},
  166. /* 375 Khz SSI clock */
  167. /* 45207 1838 */ {0x0011, 0x8801},
  168. /* SSI reg addr */
  169. /* 45232 1839 */ {0x0040, 0x8800},
  170. /* SSI data to write */
  171. /* 45255 1840 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  172. /* 45279 1841 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  173. /* 45303 1842 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  174. /* 45329 1843 */ {0x0008, 0x8802},
  175. /* 45354 1844 */ {0x0013, 0x8801},
  176. /* 45379 1845 */ {0x0000, 0x8800},
  177. /* 45402 1846 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  178. /* 45426 1847 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  179. /* 45450 1848 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  180. /* 45476 1849 */ {0x0008, 0x8802},
  181. /* 45501 1850 */ {0x0014, 0x8801},
  182. /* 45526 1851 */ {0x0000, 0x8800},
  183. /* 45549 1852 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  184. /* 45573 1853 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  185. /* 45597 1854 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  186. /* 45623 1855 */ {0x0008, 0x8802},
  187. /* 45648 1856 */ {0x0015, 0x8801},
  188. /* 45673 1857 */ {0x0001, 0x8800},
  189. /* 45696 1858 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  190. /* 45720 1859 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  191. /* 45744 1860 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  192. /* 45770 1861 */ {0x0008, 0x8802},
  193. /* 45795 1862 */ {0x0016, 0x8801},
  194. /* 45820 1863 */ {0x0003, 0x8800},
  195. /* 45843 1864 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  196. /* 45867 1865 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  197. /* 45891 1866 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  198. /* 45917 1867 */ {0x0008, 0x8802},
  199. /* 45942 1868 */ {0x0017, 0x8801},
  200. /* 45967 1869 */ {0x0036, 0x8800},
  201. /* 45990 1870 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  202. /* 46014 1871 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  203. /* 46038 1872 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  204. /* 46064 1873 */ {0x0008, 0x8802},
  205. /* 46089 1874 */ {0x0018, 0x8801},
  206. /* 46114 1875 */ {0x00ec, 0x8800},
  207. /* 46137 1876 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  208. /* 46161 1877 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  209. /* 46185 1878 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  210. /* 46211 1879 */ {0x0008, 0x8802},
  211. /* 46236 1880 */ {0x001a, 0x8801},
  212. /* 46261 1881 */ {0x0094, 0x8800},
  213. /* 46284 1882 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  214. /* 46308 1883 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  215. /* 46332 1884 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  216. /* 46358 1885 */ {0x0008, 0x8802},
  217. /* 46383 1886 */ {0x001b, 0x8801},
  218. /* 46408 1887 */ {0x0000, 0x8800},
  219. /* 46431 1888 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  220. /* 46455 1889 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  221. /* 46479 1890 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  222. /* 46505 1891 */ {0x0008, 0x8802},
  223. /* 46530 1892 */ {0x0027, 0x8801},
  224. /* 46555 1893 */ {0x00a2, 0x8800},
  225. /* 46578 1894 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  226. /* 46602 1895 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  227. /* 46626 1896 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  228. /* 46652 1897 */ {0x0008, 0x8802},
  229. /* 46677 1898 */ {0x0028, 0x8801},
  230. /* 46702 1899 */ {0x0040, 0x8800},
  231. /* 46725 1900 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  232. /* 46749 1901 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  233. /* 46773 1902 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  234. /* 46799 1903 */ {0x0008, 0x8802},
  235. /* 46824 1904 */ {0x002a, 0x8801},
  236. /* 46849 1905 */ {0x0084, 0x8800},
  237. /* 46872 1906 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  238. /* 46896 1907 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  239. /* 46920 1908 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  240. /* 46946 1909 */ {0x0008, 0x8802},
  241. /* 46971 1910 */ {0x002b, 0x8801},
  242. /* 46996 1911 */ {0x00a8, 0x8800},
  243. /* 47019 1912 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  244. /* 47043 1913 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  245. /* 47067 1914 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  246. /* 47093 1915 */ {0x0008, 0x8802},
  247. /* 47118 1916 */ {0x002c, 0x8801},
  248. /* 47143 1917 */ {0x00fe, 0x8800},
  249. /* 47166 1918 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  250. /* 47190 1919 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  251. /* 47214 1920 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  252. /* 47240 1921 */ {0x0008, 0x8802},
  253. /* 47265 1922 */ {0x002d, 0x8801},
  254. /* 47290 1923 */ {0x0003, 0x8800},
  255. /* 47313 1924 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  256. /* 47337 1925 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  257. /* 47361 1926 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  258. /* 47387 1927 */ {0x0008, 0x8802},
  259. /* 47412 1928 */ {0x0038, 0x8801},
  260. /* 47437 1929 */ {0x0083, 0x8800},
  261. /* 47460 1930 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  262. /* 47484 1931 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  263. /* 47508 1932 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  264. /* 47534 1933 */ {0x0008, 0x8802},
  265. /* 47559 1934 */ {0x0033, 0x8801},
  266. /* 47584 1935 */ {0x0081, 0x8800},
  267. /* 47607 1936 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  268. /* 47631 1937 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  269. /* 47655 1938 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  270. /* 47681 1939 */ {0x0008, 0x8802},
  271. /* 47706 1940 */ {0x0034, 0x8801},
  272. /* 47731 1941 */ {0x004a, 0x8800},
  273. /* 47754 1942 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  274. /* 47778 1943 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  275. /* 47802 1944 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  276. /* 47828 1945 */ {0x0008, 0x8802},
  277. /* 47853 1946 */ {0x0039, 0x8801},
  278. /* 47878 1947 */ {0x0000, 0x8800},
  279. /* 47901 1948 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  280. /* 47925 1949 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  281. /* 47949 1950 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  282. /* 47975 1951 */ {0x0008, 0x8802},
  283. /* 48000 1952 */ {0x0010, 0x8801},
  284. /* 48025 1953 */ {0x00a8, 0x8800},
  285. /* 48048 1954 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  286. /* 48072 1955 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  287. /* 48096 1956 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  288. /* 48122 1957 */ {0x0008, 0x8802},
  289. /* 48147 1958 */ {0x0006, 0x8801},
  290. /* 48172 1959 */ {0x0058, 0x8800},
  291. /* 48195 1960 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  292. /* 48219 1961 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  293. /* 48243 1962 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  294. /* 48269 1963 */ {0x0008, 0x8802},
  295. /* 48294 1964 */ {0x0000, 0x8801},
  296. /* 48319 1965 */ {0x0004, 0x8800},
  297. /* 48342 1966 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  298. /* 48366 1967 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  299. /* 48390 1968 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  300. /* 48416 1969 */ {0x0008, 0x8802},
  301. /* 48441 1970 */ {0x0040, 0x8801},
  302. /* 48466 1971 */ {0x0080, 0x8800},
  303. /* 48489 1972 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  304. /* 48513 1973 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  305. /* 48537 1974 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  306. /* 48563 1975 */ {0x0008, 0x8802},
  307. /* 48588 1976 */ {0x0041, 0x8801},
  308. /* 48613 1977 */ {0x000c, 0x8800},
  309. /* 48636 1978 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  310. /* 48660 1979 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  311. /* 48684 1980 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  312. /* 48710 1981 */ {0x0008, 0x8802},
  313. /* 48735 1982 */ {0x0042, 0x8801},
  314. /* 48760 1983 */ {0x000c, 0x8800},
  315. /* 48783 1984 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  316. /* 48807 1985 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  317. /* 48831 1986 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  318. /* 48857 1987 */ {0x0008, 0x8802},
  319. /* 48882 1988 */ {0x0043, 0x8801},
  320. /* 48907 1989 */ {0x0028, 0x8800},
  321. /* 48930 1990 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  322. /* 48954 1991 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  323. /* 48978 1992 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  324. /* 49004 1993 */ {0x0008, 0x8802},
  325. /* 49029 1994 */ {0x0044, 0x8801},
  326. /* 49054 1995 */ {0x0080, 0x8800},
  327. /* 49077 1996 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  328. /* 49101 1997 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  329. /* 49125 1998 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  330. /* 49151 1999 */ {0x0008, 0x8802},
  331. /* 49176 2000 */ {0x0045, 0x8801},
  332. /* 49201 2001 */ {0x0020, 0x8800},
  333. /* 49224 2002 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  334. /* 49248 2003 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  335. /* 49272 2004 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  336. /* 49298 2005 */ {0x0008, 0x8802},
  337. /* 49323 2006 */ {0x0046, 0x8801},
  338. /* 49348 2007 */ {0x0020, 0x8800},
  339. /* 49371 2008 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  340. /* 49395 2009 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  341. /* 49419 2010 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  342. /* 49445 2011 */ {0x0008, 0x8802},
  343. /* 49470 2012 */ {0x0047, 0x8801},
  344. /* 49495 2013 */ {0x0080, 0x8800},
  345. /* 49518 2014 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  346. /* 49542 2015 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  347. /* 49566 2016 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  348. /* 49592 2017 */ {0x0008, 0x8802},
  349. /* 49617 2018 */ {0x0048, 0x8801},
  350. /* 49642 2019 */ {0x004c, 0x8800},
  351. /* 49665 2020 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  352. /* 49689 2021 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  353. /* 49713 2022 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  354. /* 49739 2023 */ {0x0008, 0x8802},
  355. /* 49764 2024 */ {0x0049, 0x8801},
  356. /* 49789 2025 */ {0x0084, 0x8800},
  357. /* 49812 2026 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  358. /* 49836 2027 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  359. /* 49860 2028 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  360. /* 49886 2029 */ {0x0008, 0x8802},
  361. /* 49911 2030 */ {0x004a, 0x8801},
  362. /* 49936 2031 */ {0x0084, 0x8800},
  363. /* 49959 2032 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  364. /* 49983 2033 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  365. /* 50007 2034 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  366. /* 50033 2035 */ {0x0008, 0x8802},
  367. /* 50058 2036 */ {0x004b, 0x8801},
  368. /* 50083 2037 */ {0x0084, 0x8800},
  369. /* 50106 2038 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  370. /* --------------------------------------- */
  371. /* 50132 2039 */ {0x0012, 0x8700},
  372. /* Clock speed 48Mhz/(2+2)/2= 6 Mhz */
  373. /* 50157 2040 */ {0x0000, 0x8701},
  374. /* CKx1 clock delay adj */
  375. /* 50182 2041 */ {0x0000, 0x8701},
  376. /* CKx1 clock delay adj */
  377. /* 50207 2042 */ {0x0001, 0x870c},
  378. /* CKOx2 output */
  379. /* --------------------------------------- */
  380. /* 50232 2043 */ {0x0080, 0x8600},
  381. /* Line memory read counter (L) */
  382. /* 50257 2044 */ {0x0001, 0x8606},
  383. /* reserved */
  384. /* 50282 2045 */ {0x0064, 0x8607},
  385. /* Line memory read counter (H) 0x6480=25,728 */
  386. /* 50307 2046 */ {0x002a, 0x8601},
  387. /* CDSP sharp interpolation mode,
  388. * line sel for color sep, edge enhance enab */
  389. /* 50332 2047 */ {0x0000, 0x8602},
  390. /* optical black level for user settng = 0 */
  391. /* 50357 2048 */ {0x0080, 0x8600},
  392. /* Line memory read counter (L) */
  393. /* 50382 2049 */ {0x000a, 0x8603},
  394. /* optical black level calc mode: auto; optical black offset = 10 */
  395. /* 50407 2050 */ {0x00df, 0x865b},
  396. /* Horiz offset for valid pixels (L)=0xdf */
  397. /* 50432 2051 */ {0x0012, 0x865c},
  398. /* Vert offset for valid lines (L)=0x12 */
  399. /* The following two lines seem to be the "wrong" resolution. */
  400. /* But perhaps these indicate the actual size of the sensor */
  401. /* rather than the size of the current video mode. */
  402. /* 50457 2052 */ {0x0058, 0x865d},
  403. /* Horiz valid pixels (*4) (L) = 352 */
  404. /* 50482 2053 */ {0x0048, 0x865e},
  405. /* Vert valid lines (*4) (L) = 288 */
  406. /* 50507 2054 */ {0x0015, 0x8608},
  407. /* A11 Coef ... */
  408. /* 50532 2055 */ {0x0030, 0x8609},
  409. /* 50557 2056 */ {0x00fb, 0x860a},
  410. /* 50582 2057 */ {0x003e, 0x860b},
  411. /* 50607 2058 */ {0x00ce, 0x860c},
  412. /* 50632 2059 */ {0x00f4, 0x860d},
  413. /* 50657 2060 */ {0x00eb, 0x860e},
  414. /* 50682 2061 */ {0x00dc, 0x860f},
  415. /* 50707 2062 */ {0x0039, 0x8610},
  416. /* 50732 2063 */ {0x0001, 0x8611},
  417. /* R offset for white balance ... */
  418. /* 50757 2064 */ {0x0000, 0x8612},
  419. /* 50782 2065 */ {0x0001, 0x8613},
  420. /* 50807 2066 */ {0x0000, 0x8614},
  421. /* 50832 2067 */ {0x005b, 0x8651},
  422. /* R gain for white balance ... */
  423. /* 50857 2068 */ {0x0040, 0x8652},
  424. /* 50882 2069 */ {0x0060, 0x8653},
  425. /* 50907 2070 */ {0x0040, 0x8654},
  426. /* 50932 2071 */ {0x0000, 0x8655},
  427. /* 50957 2072 */ {0x0001, 0x863f},
  428. /* Fixed gamma correction enable, USB control,
  429. * lum filter disable, lum noise clip disable */
  430. /* 50982 2073 */ {0x00a1, 0x8656},
  431. /* Window1 size 256x256, Windows2 size 64x64,
  432. * gamma look-up disable, new edge enhancement enable */
  433. /* 51007 2074 */ {0x0018, 0x8657},
  434. /* Edge gain high thresh */
  435. /* 51032 2075 */ {0x0020, 0x8658},
  436. /* Edge gain low thresh */
  437. /* 51057 2076 */ {0x000a, 0x8659},
  438. /* Edge bandwidth high threshold */
  439. /* 51082 2077 */ {0x0005, 0x865a},
  440. /* Edge bandwidth low threshold */
  441. /* -------------------------------- */
  442. /* 51107 2078 */ {0x0030, 0x8112},
  443. /* Video drop enable, ISO streaming enable */
  444. /* 51130 2079 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  445. /* 51154 2080 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  446. /* 51180 2081 */ {0xa908, 0x8802},
  447. /* 51205 2082 */ {0x0034, 0x8801},
  448. /* SSI reg addr */
  449. /* 51230 2083 */ {0x00ca, 0x8800},
  450. /* SSI data to write */
  451. /* 51253 2084 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  452. /* 51277 2085 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  453. /* 51301 2086 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  454. /* 51327 2087 */ {0x1f08, 0x8802},
  455. /* 51352 2088 */ {0x0006, 0x8801},
  456. /* 51377 2089 */ {0x0080, 0x8800},
  457. /* 51400 2090 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  458. /* ----- Read back coefs we wrote earlier. */
  459. /* 51424 2091 */ /* READ { 0, 0x0000, 0x8608 } -> 0000: 15 */
  460. /* 51448 2092 */ /* READ { 0, 0x0000, 0x8609 } -> 0000: 30 */
  461. /* 51472 2093 */ /* READ { 0, 0x0000, 0x860a } -> 0000: fb */
  462. /* 51496 2094 */ /* READ { 0, 0x0000, 0x860b } -> 0000: 3e */
  463. /* 51520 2095 */ /* READ { 0, 0x0000, 0x860c } -> 0000: ce */
  464. /* 51544 2096 */ /* READ { 0, 0x0000, 0x860d } -> 0000: f4 */
  465. /* 51568 2097 */ /* READ { 0, 0x0000, 0x860e } -> 0000: eb */
  466. /* 51592 2098 */ /* READ { 0, 0x0000, 0x860f } -> 0000: dc */
  467. /* 51616 2099 */ /* READ { 0, 0x0000, 0x8610 } -> 0000: 39 */
  468. /* 51640 2100 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  469. /* 51664 2101 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 08 */
  470. /* 51690 2102 */ {0xb008, 0x8802},
  471. /* 51715 2103 */ {0x0006, 0x8801},
  472. /* 51740 2104 */ {0x007d, 0x8800},
  473. /* 51763 2105 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  474. /* This chunk is seemingly redundant with */
  475. /* earlier commands (A11 Coef...), but if I disable it, */
  476. /* the image appears too dark. Maybe there was some kind of */
  477. /* reset since the earlier commands, so this is necessary again. */
  478. /* 51789 2106 */ {0x0015, 0x8608},
  479. /* 51814 2107 */ {0x0030, 0x8609},
  480. /* 51839 2108 */ {0xfffb, 0x860a},
  481. /* 51864 2109 */ {0x003e, 0x860b},
  482. /* 51889 2110 */ {0xffce, 0x860c},
  483. /* 51914 2111 */ {0xfff4, 0x860d},
  484. /* 51939 2112 */ {0xffeb, 0x860e},
  485. /* 51964 2113 */ {0xffdc, 0x860f},
  486. /* 51989 2114 */ {0x0039, 0x8610},
  487. /* 52014 2115 */ {0x0018, 0x8657},
  488. /* 52039 2116 */ {0x0000, 0x8508},
  489. /* Disable compression. */
  490. /* Previous line was:
  491. * 52039 2116 * { 0, 0x0021, 0x8508 }, * Enable compression. */
  492. /* 52064 2117 */ {0x0032, 0x850b},
  493. /* compression stuff */
  494. /* 52089 2118 */ {0x0003, 0x8509},
  495. /* compression stuff */
  496. /* 52114 2119 */ {0x0011, 0x850a},
  497. /* compression stuff */
  498. /* 52139 2120 */ {0x0021, 0x850d},
  499. /* compression stuff */
  500. /* 52164 2121 */ {0x0010, 0x850c},
  501. /* compression stuff */
  502. /* 52189 2122 */ {0x0003, 0x8500},
  503. /* *** Video mode: 160x120 */
  504. /* 52214 2123 */ {0x0001, 0x8501},
  505. /* Hardware-dominated snap control */
  506. /* 52239 2124 */ {0x0061, 0x8656},
  507. /* Window1 size 128x128, Windows2 size 128x128,
  508. * gamma look-up disable, new edge enhancement enable */
  509. /* 52264 2125 */ {0x0018, 0x8617},
  510. /* Window1 start X (*2) */
  511. /* 52289 2126 */ {0x0008, 0x8618},
  512. /* Window1 start Y (*2) */
  513. /* 52314 2127 */ {0x0061, 0x8656},
  514. /* Window1 size 128x128, Windows2 size 128x128,
  515. * gamma look-up disable, new edge enhancement enable */
  516. /* 52339 2128 */ {0x0058, 0x8619},
  517. /* Window2 start X (*2) */
  518. /* 52364 2129 */ {0x0008, 0x861a},
  519. /* Window2 start Y (*2) */
  520. /* 52389 2130 */ {0x00ff, 0x8615},
  521. /* High lum thresh for white balance */
  522. /* 52414 2131 */ {0x0000, 0x8616},
  523. /* Low lum thresh for white balance */
  524. /* 52439 2132 */ {0x0012, 0x8700},
  525. /* Clock speed 48Mhz/(2+2)/2= 6 Mhz */
  526. /* 52464 2133 */ {0x0012, 0x8700},
  527. /* Clock speed 48Mhz/(2+2)/2= 6 Mhz */
  528. /* 52487 2134 */ /* READ { 0, 0x0000, 0x8656 } -> 0000: 61 */
  529. /* 52513 2135 */ {0x0028, 0x8802},
  530. /* 375 Khz SSI clock, SSI r/w sync with VSYNC */
  531. /* 52536 2136 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  532. /* 52560 2137 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 28 */
  533. /* 52586 2138 */ {0x1f28, 0x8802},
  534. /* 375 Khz SSI clock, SSI r/w sync with VSYNC */
  535. /* 52611 2139 */ {0x0010, 0x8801},
  536. /* SSI reg addr */
  537. /* 52636 2140 */ {0x003e, 0x8800},
  538. /* SSI data to write */
  539. /* 52659 2141 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  540. /* 52685 2142 */ {0x0028, 0x8802},
  541. /* 52708 2143 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  542. /* 52732 2144 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 28 */
  543. /* 52758 2145 */ {0x1f28, 0x8802},
  544. /* 52783 2146 */ {0x0000, 0x8801},
  545. /* 52808 2147 */ {0x001f, 0x8800},
  546. /* 52831 2148 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  547. /* 52857 2149 */ {0x0001, 0x8602},
  548. /* optical black level for user settning = 1 */
  549. /* Original: */
  550. /* 52882 2150 */ {0x0023, 0x8700},
  551. /* Clock speed 48Mhz/(3+2)/4= 2.4 Mhz */
  552. /* 52907 2151 */ {0x000f, 0x8602},
  553. /* optical black level for user settning = 15 */
  554. /* 52932 2152 */ {0x0028, 0x8802},
  555. /* 52955 2153 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  556. /* 52979 2154 */ /* READ { 0, 0x0001, 0x8802 } -> 0000: 28 */
  557. /* 53005 2155 */ {0x1f28, 0x8802},
  558. /* 53030 2156 */ {0x0010, 0x8801},
  559. /* 53055 2157 */ {0x007b, 0x8800},
  560. /* 53078 2158 */ /* READ { 0, 0x0001, 0x8803 } -> 0000: 00 */
  561. /* 53104 2159 */ {0x002f, 0x8651},
  562. /* R gain for white balance ... */
  563. /* 53129 2160 */ {0x0080, 0x8653},
  564. /* 53152 2161 */ /* READ { 0, 0x0000, 0x8655 } -> 0000: 00 */
  565. /* 53178 2162 */ {0x0000, 0x8655},
  566. /* 53203 2163 */ {0x0030, 0x8112},
  567. /* Video drop enable, ISO streaming enable */
  568. /* 53228 2164 */ {0x0020, 0x8112},
  569. /* Video drop enable, ISO streaming disable */
  570. /* 53252 2165 */
  571. /* UNKNOWN DIRECTION (URB_FUNCTION_SELECT_INTERFACE: (ALT=0) ) */
  572. {0, 0}
  573. };
  574. /*
  575. * Initialization data for Intel EasyPC Camera CS110
  576. */
  577. static const __u16 spca508cs110_init_data[][3] = {
  578. {0x0000, 0x870b}, /* Reset CTL3 */
  579. {0x0003, 0x8111}, /* Soft Reset compression, memory, TG & CDSP */
  580. {0x0000, 0x8111}, /* Normal operation on reset */
  581. {0x0090, 0x8110},
  582. /* External Clock 2x & Synchronous Serial Interface Output */
  583. {0x0020, 0x8112}, /* Video Drop packet enable */
  584. {0x0000, 0x8114}, /* Software GPIO output data */
  585. {0x0001, 0x8114},
  586. {0x0001, 0x8114},
  587. {0x0001, 0x8114},
  588. {0x0003, 0x8114},
  589. /* Initial sequence Synchronous Serial Interface */
  590. {0x000f, 0x8402}, /* Memory bank Address */
  591. {0x0000, 0x8403}, /* Memory bank Address */
  592. {0x00ba, 0x8804}, /* SSI Slave address */
  593. {0x0010, 0x8802}, /* 93.75kHz SSI Clock Two DataByte */
  594. {0x0010, 0x8802}, /* 93.75kHz SSI Clock two DataByte */
  595. {0x0001, 0x8801},
  596. {0x000a, 0x8805},/* a - NWG: Dunno what this is about */
  597. {0x0000, 0x8800},
  598. {0x0010, 0x8802},
  599. {0x0002, 0x8801},
  600. {0x0000, 0x8805},
  601. {0x0000, 0x8800},
  602. {0x0010, 0x8802},
  603. {0x0003, 0x8801},
  604. {0x0027, 0x8805},
  605. {0x0001, 0x8800},
  606. {0x0010, 0x8802},
  607. {0x0004, 0x8801},
  608. {0x0065, 0x8805},
  609. {0x0001, 0x8800},
  610. {0x0010, 0x8802},
  611. {0x0005, 0x8801},
  612. {0x0003, 0x8805},
  613. {0x0000, 0x8800},
  614. {0x0010, 0x8802},
  615. {0x0006, 0x8801},
  616. {0x001c, 0x8805},
  617. {0x0000, 0x8800},
  618. {0x0010, 0x8802},
  619. {0x0007, 0x8801},
  620. {0x002a, 0x8805},
  621. {0x0000, 0x8800},
  622. {0x0010, 0x8802},
  623. {0x0002, 0x8704}, /* External input CKIx1 */
  624. {0x0001, 0x8606}, /* 1 Line memory Read Counter (H) Result: (d)410 */
  625. {0x009a, 0x8600}, /* Line memory Read Counter (L) */
  626. {0x0001, 0x865b}, /* 1 Horizontal Offset for Valid Pixel(L) */
  627. {0x0003, 0x865c}, /* 3 Vertical Offset for Valid Lines(L) */
  628. {0x0058, 0x865d}, /* 58 Horizontal Valid Pixel Window(L) */
  629. {0x0006, 0x8660}, /* Nibble data + input order */
  630. {0x000a, 0x8602}, /* Optical black level set to 0x0a */
  631. /* 1945 */ {0x0000, 0x8603}, /* Optical black level Offset */
  632. /* 1962 * {0, 0x0000, 0x8611}, * 0 R Offset for white Balance */
  633. /* 1963 * {0, 0x0000, 0x8612}, * 1 Gr Offset for white Balance */
  634. /* 1964 * {0, 0x0000, 0x8613}, * 1f B Offset for white Balance */
  635. /* 1965 * {0, 0x0000, 0x8614}, * f0 Gb Offset for white Balance */
  636. {0x0040, 0x8651}, /* 2b BLUE gain for white balance good at all 60 */
  637. {0x0030, 0x8652}, /* 41 Gr Gain for white Balance (L) */
  638. {0x0035, 0x8653}, /* 26 RED gain for white balance */
  639. {0x0035, 0x8654}, /* 40Gb Gain for white Balance (L) */
  640. {0x0041, 0x863f},
  641. /* Fixed Gamma correction enabled (makes colours look better) */
  642. /* 2422 */ {0x0000, 0x8655},
  643. /* High bits for white balance*****brightness control*** */
  644. {}
  645. };
  646. static const __u16 spca508_sightcam_init_data[][3] = {
  647. /* This line seems to setup the frame/canvas */
  648. /*368 */ {0x000f, 0x8402},
  649. /* Theese 6 lines are needed to startup the webcam */
  650. /*398 */ {0x0090, 0x8110},
  651. /*399 */ {0x0001, 0x8114},
  652. /*400 */ {0x0001, 0x8114},
  653. /*401 */ {0x0001, 0x8114},
  654. /*402 */ {0x0003, 0x8114},
  655. /*403 */ {0x0080, 0x8804},
  656. /* This part seems to make the pictures darker? (autobrightness?) */
  657. /*436 */ {0x0001, 0x8801},
  658. /*437 */ {0x0004, 0x8800},
  659. /*439 */ {0x0003, 0x8801},
  660. /*440 */ {0x00e0, 0x8800},
  661. /*442 */ {0x0004, 0x8801},
  662. /*443 */ {0x00b4, 0x8800},
  663. /*445 */ {0x0005, 0x8801},
  664. /*446 */ {0x0000, 0x8800},
  665. /*448 */ {0x0006, 0x8801},
  666. /*449 */ {0x00e0, 0x8800},
  667. /*451 */ {0x0007, 0x8801},
  668. /*452 */ {0x000c, 0x8800},
  669. /* This section is just needed, it probably
  670. * does something like the previous section,
  671. * but the cam won't start if it's not included.
  672. */
  673. /*484 */ {0x0014, 0x8801},
  674. /*485 */ {0x0008, 0x8800},
  675. /*487 */ {0x0015, 0x8801},
  676. /*488 */ {0x0067, 0x8800},
  677. /*490 */ {0x0016, 0x8801},
  678. /*491 */ {0x0000, 0x8800},
  679. /*493 */ {0x0017, 0x8801},
  680. /*494 */ {0x0020, 0x8800},
  681. /*496 */ {0x0018, 0x8801},
  682. /*497 */ {0x0044, 0x8800},
  683. /* Makes the picture darker - and the
  684. * cam won't start if not included
  685. */
  686. /*505 */ {0x001e, 0x8801},
  687. /*506 */ {0x00ea, 0x8800},
  688. /*508 */ {0x001f, 0x8801},
  689. /*509 */ {0x0001, 0x8800},
  690. /*511 */ {0x0003, 0x8801},
  691. /*512 */ {0x00e0, 0x8800},
  692. /* seems to place the colors ontop of each other #1 */
  693. /*517 */ {0x0006, 0x8704},
  694. /*518 */ {0x0001, 0x870c},
  695. /*519 */ {0x0016, 0x8600},
  696. /*520 */ {0x0002, 0x8606},
  697. /* if not included the pictures becomes _very_ dark */
  698. /*521 */ {0x0064, 0x8607},
  699. /*522 */ {0x003a, 0x8601},
  700. /*523 */ {0x0000, 0x8602},
  701. /* seems to place the colors ontop of each other #2 */
  702. /*524 */ {0x0016, 0x8600},
  703. /*525 */ {0x0018, 0x8617},
  704. /*526 */ {0x0008, 0x8618},
  705. /*527 */ {0x00a1, 0x8656},
  706. /* webcam won't start if not included */
  707. /*528 */ {0x0007, 0x865b},
  708. /*529 */ {0x0001, 0x865c},
  709. /*530 */ {0x0058, 0x865d},
  710. /*531 */ {0x0048, 0x865e},
  711. /* adjusts the colors */
  712. /*541 */ {0x0049, 0x8651},
  713. /*542 */ {0x0040, 0x8652},
  714. /*543 */ {0x004c, 0x8653},
  715. /*544 */ {0x0040, 0x8654},
  716. {0, 0}
  717. };
  718. static const __u16 spca508_sightcam2_init_data[][3] = {
  719. /* 35 */ {0x0020, 0x8112},
  720. /* 36 */ {0x000f, 0x8402},
  721. /* 37 */ {0x0000, 0x8403},
  722. /* 38 */ {0x0008, 0x8201},
  723. /* 39 */ {0x0008, 0x8200},
  724. /* 40 */ {0x0001, 0x8200},
  725. /* 43 */ {0x0009, 0x8201},
  726. /* 44 */ {0x0008, 0x8200},
  727. /* 45 */ {0x0001, 0x8200},
  728. /* 48 */ {0x000a, 0x8201},
  729. /* 49 */ {0x0008, 0x8200},
  730. /* 50 */ {0x0001, 0x8200},
  731. /* 53 */ {0x000b, 0x8201},
  732. /* 54 */ {0x0008, 0x8200},
  733. /* 55 */ {0x0001, 0x8200},
  734. /* 58 */ {0x000c, 0x8201},
  735. /* 59 */ {0x0008, 0x8200},
  736. /* 60 */ {0x0001, 0x8200},
  737. /* 63 */ {0x000d, 0x8201},
  738. /* 64 */ {0x0008, 0x8200},
  739. /* 65 */ {0x0001, 0x8200},
  740. /* 68 */ {0x000e, 0x8201},
  741. /* 69 */ {0x0008, 0x8200},
  742. /* 70 */ {0x0001, 0x8200},
  743. /* 73 */ {0x0007, 0x8201},
  744. /* 74 */ {0x0008, 0x8200},
  745. /* 75 */ {0x0001, 0x8200},
  746. /* 78 */ {0x000f, 0x8201},
  747. /* 79 */ {0x0008, 0x8200},
  748. /* 80 */ {0x0001, 0x8200},
  749. /* 84 */ {0x0018, 0x8660},
  750. /* 85 */ {0x0010, 0x8201},
  751. /* 86 */ {0x0008, 0x8200},
  752. /* 87 */ {0x0001, 0x8200},
  753. /* 90 */ {0x0011, 0x8201},
  754. /* 91 */ {0x0008, 0x8200},
  755. /* 92 */ {0x0001, 0x8200},
  756. /* 95 */ {0x0000, 0x86b0},
  757. /* 96 */ {0x0034, 0x86b1},
  758. /* 97 */ {0x0000, 0x86b2},
  759. /* 98 */ {0x0049, 0x86b3},
  760. /* 99 */ {0x0000, 0x86b4},
  761. /* 100 */ {0x0000, 0x86b4},
  762. /* 101 */ {0x0012, 0x8201},
  763. /* 102 */ {0x0008, 0x8200},
  764. /* 103 */ {0x0001, 0x8200},
  765. /* 106 */ {0x0013, 0x8201},
  766. /* 107 */ {0x0008, 0x8200},
  767. /* 108 */ {0x0001, 0x8200},
  768. /* 111 */ {0x0001, 0x86b0},
  769. /* 112 */ {0x00aa, 0x86b1},
  770. /* 113 */ {0x0000, 0x86b2},
  771. /* 114 */ {0x00e4, 0x86b3},
  772. /* 115 */ {0x0000, 0x86b4},
  773. /* 116 */ {0x0000, 0x86b4},
  774. /* 118 */ {0x0018, 0x8660},
  775. /* 119 */ {0x0090, 0x8110},
  776. /* 120 */ {0x0001, 0x8114},
  777. /* 121 */ {0x0001, 0x8114},
  778. /* 122 */ {0x0001, 0x8114},
  779. /* 123 */ {0x0003, 0x8114},
  780. /* 124 */ {0x0080, 0x8804},
  781. /* 157 */ {0x0003, 0x8801},
  782. /* 158 */ {0x0012, 0x8800},
  783. /* 160 */ {0x0004, 0x8801},
  784. /* 161 */ {0x0005, 0x8800},
  785. /* 163 */ {0x0005, 0x8801},
  786. /* 164 */ {0x0000, 0x8800},
  787. /* 166 */ {0x0006, 0x8801},
  788. /* 167 */ {0x0000, 0x8800},
  789. /* 169 */ {0x0007, 0x8801},
  790. /* 170 */ {0x0000, 0x8800},
  791. /* 172 */ {0x0008, 0x8801},
  792. /* 173 */ {0x0005, 0x8800},
  793. /* 175 */ {0x000a, 0x8700},
  794. /* 176 */ {0x000e, 0x8801},
  795. /* 177 */ {0x0004, 0x8800},
  796. /* 179 */ {0x0005, 0x8801},
  797. /* 180 */ {0x0047, 0x8800},
  798. /* 182 */ {0x0006, 0x8801},
  799. /* 183 */ {0x0000, 0x8800},
  800. /* 185 */ {0x0007, 0x8801},
  801. /* 186 */ {0x00c0, 0x8800},
  802. /* 188 */ {0x0008, 0x8801},
  803. /* 189 */ {0x0003, 0x8800},
  804. /* 191 */ {0x0013, 0x8801},
  805. /* 192 */ {0x0001, 0x8800},
  806. /* 194 */ {0x0009, 0x8801},
  807. /* 195 */ {0x0000, 0x8800},
  808. /* 197 */ {0x000a, 0x8801},
  809. /* 198 */ {0x0000, 0x8800},
  810. /* 200 */ {0x000b, 0x8801},
  811. /* 201 */ {0x0000, 0x8800},
  812. /* 203 */ {0x000c, 0x8801},
  813. /* 204 */ {0x0000, 0x8800},
  814. /* 206 */ {0x000e, 0x8801},
  815. /* 207 */ {0x0004, 0x8800},
  816. /* 209 */ {0x000f, 0x8801},
  817. /* 210 */ {0x0000, 0x8800},
  818. /* 212 */ {0x0010, 0x8801},
  819. /* 213 */ {0x0006, 0x8800},
  820. /* 215 */ {0x0011, 0x8801},
  821. /* 216 */ {0x0006, 0x8800},
  822. /* 218 */ {0x0012, 0x8801},
  823. /* 219 */ {0x0000, 0x8800},
  824. /* 221 */ {0x0013, 0x8801},
  825. /* 222 */ {0x0001, 0x8800},
  826. /* 224 */ {0x000a, 0x8700},
  827. /* 225 */ {0x0000, 0x8702},
  828. /* 226 */ {0x0000, 0x8703},
  829. /* 227 */ {0x00c2, 0x8704},
  830. /* 228 */ {0x0001, 0x870c},
  831. /* 229 */ {0x0044, 0x8600},
  832. /* 230 */ {0x0002, 0x8606},
  833. /* 231 */ {0x0064, 0x8607},
  834. /* 232 */ {0x003a, 0x8601},
  835. /* 233 */ {0x0008, 0x8602},
  836. /* 234 */ {0x0044, 0x8600},
  837. /* 235 */ {0x0018, 0x8617},
  838. /* 236 */ {0x0008, 0x8618},
  839. /* 237 */ {0x00a1, 0x8656},
  840. /* 238 */ {0x0004, 0x865b},
  841. /* 239 */ {0x0002, 0x865c},
  842. /* 240 */ {0x0058, 0x865d},
  843. /* 241 */ {0x0048, 0x865e},
  844. /* 242 */ {0x0012, 0x8608},
  845. /* 243 */ {0x002c, 0x8609},
  846. /* 244 */ {0x0002, 0x860a},
  847. /* 245 */ {0x002c, 0x860b},
  848. /* 246 */ {0x00db, 0x860c},
  849. /* 247 */ {0x00f9, 0x860d},
  850. /* 248 */ {0x00f1, 0x860e},
  851. /* 249 */ {0x00e3, 0x860f},
  852. /* 250 */ {0x002c, 0x8610},
  853. /* 251 */ {0x006c, 0x8651},
  854. /* 252 */ {0x0041, 0x8652},
  855. /* 253 */ {0x0059, 0x8653},
  856. /* 254 */ {0x0040, 0x8654},
  857. /* 255 */ {0x00fa, 0x8611},
  858. /* 256 */ {0x00ff, 0x8612},
  859. /* 257 */ {0x00f8, 0x8613},
  860. /* 258 */ {0x0000, 0x8614},
  861. /* 259 */ {0x0001, 0x863f},
  862. /* 260 */ {0x0000, 0x8640},
  863. /* 261 */ {0x0026, 0x8641},
  864. /* 262 */ {0x0045, 0x8642},
  865. /* 263 */ {0x0060, 0x8643},
  866. /* 264 */ {0x0075, 0x8644},
  867. /* 265 */ {0x0088, 0x8645},
  868. /* 266 */ {0x009b, 0x8646},
  869. /* 267 */ {0x00b0, 0x8647},
  870. /* 268 */ {0x00c5, 0x8648},
  871. /* 269 */ {0x00d2, 0x8649},
  872. /* 270 */ {0x00dc, 0x864a},
  873. /* 271 */ {0x00e5, 0x864b},
  874. /* 272 */ {0x00eb, 0x864c},
  875. /* 273 */ {0x00f0, 0x864d},
  876. /* 274 */ {0x00f6, 0x864e},
  877. /* 275 */ {0x00fa, 0x864f},
  878. /* 276 */ {0x00ff, 0x8650},
  879. /* 277 */ {0x0060, 0x8657},
  880. /* 278 */ {0x0010, 0x8658},
  881. /* 279 */ {0x0018, 0x8659},
  882. /* 280 */ {0x0005, 0x865a},
  883. /* 281 */ {0x0018, 0x8660},
  884. /* 282 */ {0x0003, 0x8509},
  885. /* 283 */ {0x0011, 0x850a},
  886. /* 284 */ {0x0032, 0x850b},
  887. /* 285 */ {0x0010, 0x850c},
  888. /* 286 */ {0x0021, 0x850d},
  889. /* 287 */ {0x0001, 0x8500},
  890. /* 288 */ {0x0000, 0x8508},
  891. /* 289 */ {0x0012, 0x8608},
  892. /* 290 */ {0x002c, 0x8609},
  893. /* 291 */ {0x0002, 0x860a},
  894. /* 292 */ {0x0039, 0x860b},
  895. /* 293 */ {0x00d0, 0x860c},
  896. /* 294 */ {0x00f7, 0x860d},
  897. /* 295 */ {0x00ed, 0x860e},
  898. /* 296 */ {0x00db, 0x860f},
  899. /* 297 */ {0x0039, 0x8610},
  900. /* 298 */ {0x0012, 0x8657},
  901. /* 299 */ {0x000c, 0x8619},
  902. /* 300 */ {0x0004, 0x861a},
  903. /* 301 */ {0x00a1, 0x8656},
  904. /* 302 */ {0x00c8, 0x8615},
  905. /* 303 */ {0x0032, 0x8616},
  906. /* 306 */ {0x0030, 0x8112},
  907. /* 313 */ {0x0020, 0x8112},
  908. /* 314 */ {0x0020, 0x8112},
  909. /* 315 */ {0x000f, 0x8402},
  910. /* 316 */ {0x0000, 0x8403},
  911. /* 317 */ {0x0090, 0x8110},
  912. /* 318 */ {0x0001, 0x8114},
  913. /* 319 */ {0x0001, 0x8114},
  914. /* 320 */ {0x0001, 0x8114},
  915. /* 321 */ {0x0003, 0x8114},
  916. /* 322 */ {0x0080, 0x8804},
  917. /* 355 */ {0x0003, 0x8801},
  918. /* 356 */ {0x0012, 0x8800},
  919. /* 358 */ {0x0004, 0x8801},
  920. /* 359 */ {0x0005, 0x8800},
  921. /* 361 */ {0x0005, 0x8801},
  922. /* 362 */ {0x0047, 0x8800},
  923. /* 364 */ {0x0006, 0x8801},
  924. /* 365 */ {0x0000, 0x8800},
  925. /* 367 */ {0x0007, 0x8801},
  926. /* 368 */ {0x00c0, 0x8800},
  927. /* 370 */ {0x0008, 0x8801},
  928. /* 371 */ {0x0003, 0x8800},
  929. /* 373 */ {0x000a, 0x8700},
  930. /* 374 */ {0x000e, 0x8801},
  931. /* 375 */ {0x0004, 0x8800},
  932. /* 377 */ {0x0005, 0x8801},
  933. /* 378 */ {0x0047, 0x8800},
  934. /* 380 */ {0x0006, 0x8801},
  935. /* 381 */ {0x0000, 0x8800},
  936. /* 383 */ {0x0007, 0x8801},
  937. /* 384 */ {0x00c0, 0x8800},
  938. /* 386 */ {0x0008, 0x8801},
  939. /* 387 */ {0x0003, 0x8800},
  940. /* 389 */ {0x0013, 0x8801},
  941. /* 390 */ {0x0001, 0x8800},
  942. /* 392 */ {0x0009, 0x8801},
  943. /* 393 */ {0x0000, 0x8800},
  944. /* 395 */ {0x000a, 0x8801},
  945. /* 396 */ {0x0000, 0x8800},
  946. /* 398 */ {0x000b, 0x8801},
  947. /* 399 */ {0x0000, 0x8800},
  948. /* 401 */ {0x000c, 0x8801},
  949. /* 402 */ {0x0000, 0x8800},
  950. /* 404 */ {0x000e, 0x8801},
  951. /* 405 */ {0x0004, 0x8800},
  952. /* 407 */ {0x000f, 0x8801},
  953. /* 408 */ {0x0000, 0x8800},
  954. /* 410 */ {0x0010, 0x8801},
  955. /* 411 */ {0x0006, 0x8800},
  956. /* 413 */ {0x0011, 0x8801},
  957. /* 414 */ {0x0006, 0x8800},
  958. /* 416 */ {0x0012, 0x8801},
  959. /* 417 */ {0x0000, 0x8800},
  960. /* 419 */ {0x0013, 0x8801},
  961. /* 420 */ {0x0001, 0x8800},
  962. /* 422 */ {0x000a, 0x8700},
  963. /* 423 */ {0x0000, 0x8702},
  964. /* 424 */ {0x0000, 0x8703},
  965. /* 425 */ {0x00c2, 0x8704},
  966. /* 426 */ {0x0001, 0x870c},
  967. /* 427 */ {0x0044, 0x8600},
  968. /* 428 */ {0x0002, 0x8606},
  969. /* 429 */ {0x0064, 0x8607},
  970. /* 430 */ {0x003a, 0x8601},
  971. /* 431 */ {0x0008, 0x8602},
  972. /* 432 */ {0x0044, 0x8600},
  973. /* 433 */ {0x0018, 0x8617},
  974. /* 434 */ {0x0008, 0x8618},
  975. /* 435 */ {0x00a1, 0x8656},
  976. /* 436 */ {0x0004, 0x865b},
  977. /* 437 */ {0x0002, 0x865c},
  978. /* 438 */ {0x0058, 0x865d},
  979. /* 439 */ {0x0048, 0x865e},
  980. /* 440 */ {0x0012, 0x8608},
  981. /* 441 */ {0x002c, 0x8609},
  982. /* 442 */ {0x0002, 0x860a},
  983. /* 443 */ {0x002c, 0x860b},
  984. /* 444 */ {0x00db, 0x860c},
  985. /* 445 */ {0x00f9, 0x860d},
  986. /* 446 */ {0x00f1, 0x860e},
  987. /* 447 */ {0x00e3, 0x860f},
  988. /* 448 */ {0x002c, 0x8610},
  989. /* 449 */ {0x006c, 0x8651},
  990. /* 450 */ {0x0041, 0x8652},
  991. /* 451 */ {0x0059, 0x8653},
  992. /* 452 */ {0x0040, 0x8654},
  993. /* 453 */ {0x00fa, 0x8611},
  994. /* 454 */ {0x00ff, 0x8612},
  995. /* 455 */ {0x00f8, 0x8613},
  996. /* 456 */ {0x0000, 0x8614},
  997. /* 457 */ {0x0001, 0x863f},
  998. /* 458 */ {0x0000, 0x8640},
  999. /* 459 */ {0x0026, 0x8641},
  1000. /* 460 */ {0x0045, 0x8642},
  1001. /* 461 */ {0x0060, 0x8643},
  1002. /* 462 */ {0x0075, 0x8644},
  1003. /* 463 */ {0x0088, 0x8645},
  1004. /* 464 */ {0x009b, 0x8646},
  1005. /* 465 */ {0x00b0, 0x8647},
  1006. /* 466 */ {0x00c5, 0x8648},
  1007. /* 467 */ {0x00d2, 0x8649},
  1008. /* 468 */ {0x00dc, 0x864a},
  1009. /* 469 */ {0x00e5, 0x864b},
  1010. /* 470 */ {0x00eb, 0x864c},
  1011. /* 471 */ {0x00f0, 0x864d},
  1012. /* 472 */ {0x00f6, 0x864e},
  1013. /* 473 */ {0x00fa, 0x864f},
  1014. /* 474 */ {0x00ff, 0x8650},
  1015. /* 475 */ {0x0060, 0x8657},
  1016. /* 476 */ {0x0010, 0x8658},
  1017. /* 477 */ {0x0018, 0x8659},
  1018. /* 478 */ {0x0005, 0x865a},
  1019. /* 479 */ {0x0018, 0x8660},
  1020. /* 480 */ {0x0003, 0x8509},
  1021. /* 481 */ {0x0011, 0x850a},
  1022. /* 482 */ {0x0032, 0x850b},
  1023. /* 483 */ {0x0010, 0x850c},
  1024. /* 484 */ {0x0021, 0x850d},
  1025. /* 485 */ {0x0001, 0x8500},
  1026. /* 486 */ {0x0000, 0x8508},
  1027. /* 487 */ {0x0012, 0x8608},
  1028. /* 488 */ {0x002c, 0x8609},
  1029. /* 489 */ {0x0002, 0x860a},
  1030. /* 490 */ {0x0039, 0x860b},
  1031. /* 491 */ {0x00d0, 0x860c},
  1032. /* 492 */ {0x00f7, 0x860d},
  1033. /* 493 */ {0x00ed, 0x860e},
  1034. /* 494 */ {0x00db, 0x860f},
  1035. /* 495 */ {0x0039, 0x8610},
  1036. /* 496 */ {0x0012, 0x8657},
  1037. /* 497 */ {0x0064, 0x8619},
  1038. /* This line starts it all, it is not needed here */
  1039. /* since it has been build into the driver */
  1040. /* jfm: don't start now */
  1041. /* 590 * {0x0030, 0x8112}, */
  1042. {}
  1043. };
  1044. /*
  1045. * Initialization data for Creative Webcam Vista
  1046. */
  1047. static const __u16 spca508_vista_init_data[][3] = {
  1048. {0x0008, 0x8200}, /* Clear register */
  1049. {0x0000, 0x870b}, /* Reset CTL3 */
  1050. {0x0020, 0x8112}, /* Video Drop packet enable */
  1051. {0x0003, 0x8111}, /* Soft Reset compression, memory, TG & CDSP */
  1052. {0x0000, 0x8110}, /* Disable everything */
  1053. {0x0000, 0x8114}, /* Software GPIO output data */
  1054. {0x0000, 0x8114},
  1055. {0x0003, 0x8111},
  1056. {0x0000, 0x8111},
  1057. {0x0090, 0x8110}, /* Enable: SSI output, External 2X clock output */
  1058. {0x0020, 0x8112},
  1059. {0x0000, 0x8114},
  1060. {0x0001, 0x8114},
  1061. {0x0001, 0x8114},
  1062. {0x0001, 0x8114},
  1063. {0x0003, 0x8114},
  1064. {0x000f, 0x8402}, /* Memory bank Address */
  1065. {0x0000, 0x8403}, /* Memory bank Address */
  1066. {0x00ba, 0x8804}, /* SSI Slave address */
  1067. {0x0010, 0x8802}, /* 93.75kHz SSI Clock Two DataByte */
  1068. /* READ { 0, 0x0001, 0x8803 } ->
  1069. 0000: 00 */
  1070. /* READ { 0, 0x0001, 0x8802 } ->
  1071. 0000: 10 */
  1072. {0x0010, 0x8802}, /* Will write 2 bytes (DATA1+DATA2) */
  1073. {0x0020, 0x8801}, /* Register address for SSI read/write */
  1074. {0x0044, 0x8805}, /* DATA2 */
  1075. {0x0004, 0x8800}, /* DATA1 -> write triggered */
  1076. /* READ { 0, 0x0001, 0x8803 } ->
  1077. 0000: 00 */
  1078. /* READ { 0, 0x0001, 0x8803 } ->
  1079. 0000: 00 */
  1080. /* READ { 0, 0x0001, 0x8802 } ->
  1081. 0000: 10 */
  1082. {0x0010, 0x8802},
  1083. {0x0009, 0x8801},
  1084. {0x0042, 0x8805},
  1085. {0x0001, 0x8800},
  1086. /* READ { 0, 0x0001, 0x8803 } ->
  1087. 0000: 00 */
  1088. /* READ { 0, 0x0001, 0x8803 } ->
  1089. 0000: 00 */
  1090. /* READ { 0, 0x0001, 0x8802 } ->
  1091. 0000: 10 */
  1092. {0x0010, 0x8802},
  1093. {0x003c, 0x8801},
  1094. {0x0001, 0x8805},
  1095. {0x0000, 0x8800},
  1096. /* READ { 0, 0x0001, 0x8803 } ->
  1097. 0000: 00 */
  1098. /* READ { 0, 0x0001, 0x8803 } ->
  1099. 0000: 00 */
  1100. /* READ { 0, 0x0001, 0x8802 } ->
  1101. 0000: 10 */
  1102. {0x0010, 0x8802},
  1103. {0x0001, 0x8801},
  1104. {0x000a, 0x8805},
  1105. {0x0000, 0x8800},
  1106. /* READ { 0, 0x0001, 0x8803 } ->
  1107. 0000: 00 */
  1108. /* READ { 0, 0x0001, 0x8803 } ->
  1109. 0000: 00 */
  1110. /* READ { 0, 0x0001, 0x8802 } ->
  1111. 0000: 10 */
  1112. {0x0010, 0x8802},
  1113. {0x0002, 0x8801},
  1114. {0x0000, 0x8805},
  1115. {0x0000, 0x8800},
  1116. /* READ { 0, 0x0001, 0x8803 } ->
  1117. 0000: 00 */
  1118. /* READ { 0, 0x0001, 0x8803 } ->
  1119. 0000: 00 */
  1120. /* READ { 0, 0x0001, 0x8802 } ->
  1121. 0000: 10 */
  1122. {0x0010, 0x8802},
  1123. {0x0003, 0x8801},
  1124. {0x0027, 0x8805},
  1125. {0x0001, 0x8800},
  1126. /* READ { 0, 0x0001, 0x8803 } ->
  1127. 0000: 00 */
  1128. /* READ { 0, 0x0001, 0x8803 } ->
  1129. 0000: 00 */
  1130. /* READ { 0, 0x0001, 0x8802 } ->
  1131. 0000: 10 */
  1132. {0x0010, 0x8802},
  1133. {0x0004, 0x8801},
  1134. {0x0065, 0x8805},
  1135. {0x0001, 0x8800},
  1136. /* READ { 0, 0x0001, 0x8803 } ->
  1137. 0000: 00 */
  1138. /* READ { 0, 0x0001, 0x8803 } ->
  1139. 0000: 00 */
  1140. /* READ { 0, 0x0001, 0x8802 } ->
  1141. 0000: 10 */
  1142. {0x0010, 0x8802},
  1143. {0x0005, 0x8801},
  1144. {0x0003, 0x8805},
  1145. {0x0000, 0x8800},
  1146. /* READ { 0, 0x0001, 0x8803 } ->
  1147. 0000: 00 */
  1148. /* READ { 0, 0x0001, 0x8803 } ->
  1149. 0000: 00 */
  1150. /* READ { 0, 0x0001, 0x8802 } ->
  1151. 0000: 10 */
  1152. {0x0010, 0x8802},
  1153. {0x0006, 0x8801},
  1154. {0x001c, 0x8805},
  1155. {0x0000, 0x8800},
  1156. /* READ { 0, 0x0001, 0x8803 } ->
  1157. 0000: 00 */
  1158. /* READ { 0, 0x0001, 0x8803 } ->
  1159. 0000: 00 */
  1160. /* READ { 0, 0x0001, 0x8802 } ->
  1161. 0000: 10 */
  1162. {0x0010, 0x8802},
  1163. {0x0007, 0x8801},
  1164. {0x002a, 0x8805},
  1165. {0x0000, 0x8800},
  1166. /* READ { 0, 0x0001, 0x8803 } ->
  1167. 0000: 00 */
  1168. /* READ { 0, 0x0001, 0x8803 } ->
  1169. 0000: 00 */
  1170. /* READ { 0, 0x0001, 0x8802 } ->
  1171. 0000: 10 */
  1172. {0x0010, 0x8802},
  1173. {0x000e, 0x8801},
  1174. {0x0000, 0x8805},
  1175. {0x0000, 0x8800},
  1176. /* READ { 0, 0x0001, 0x8803 } ->
  1177. 0000: 00 */
  1178. /* READ { 0, 0x0001, 0x8803 } ->
  1179. 0000: 00 */
  1180. /* READ { 0, 0x0001, 0x8802 } ->
  1181. 0000: 10 */
  1182. {0x0010, 0x8802},
  1183. {0x0028, 0x8801},
  1184. {0x002e, 0x8805},
  1185. {0x0000, 0x8800},
  1186. /* READ { 0, 0x0001, 0x8803 } ->
  1187. 0000: 00 */
  1188. /* READ { 0, 0x0001, 0x8803 } ->
  1189. 0000: 00 */
  1190. /* READ { 0, 0x0001, 0x8802 } ->
  1191. 0000: 10 */
  1192. {0x0010, 0x8802},
  1193. {0x0039, 0x8801},
  1194. {0x0013, 0x8805},
  1195. {0x0000, 0x8800},
  1196. /* READ { 0, 0x0001, 0x8803 } ->
  1197. 0000: 00 */
  1198. /* READ { 0, 0x0001, 0x8803 } ->
  1199. 0000: 00 */
  1200. /* READ { 0, 0x0001, 0x8802 } ->
  1201. 0000: 10 */
  1202. {0x0010, 0x8802},
  1203. {0x003b, 0x8801},
  1204. {0x000c, 0x8805},
  1205. {0x0000, 0x8800},
  1206. /* READ { 0, 0x0001, 0x8803 } ->
  1207. 0000: 00 */
  1208. /* READ { 0, 0x0001, 0x8803 } ->
  1209. 0000: 00 */
  1210. /* READ { 0, 0x0001, 0x8802 } ->
  1211. 0000: 10 */
  1212. {0x0010, 0x8802},
  1213. {0x0035, 0x8801},
  1214. {0x0028, 0x8805},
  1215. {0x0000, 0x8800},
  1216. /* READ { 0, 0x0001, 0x8803 } ->
  1217. 0000: 00 */
  1218. /* READ { 0, 0x0001, 0x8803 } ->
  1219. 0000: 00 */
  1220. /* READ { 0, 0x0001, 0x8802 } ->
  1221. 0000: 10 */
  1222. {0x0010, 0x8802},
  1223. {0x0009, 0x8801},
  1224. {0x0042, 0x8805},
  1225. {0x0001, 0x8800},
  1226. /* READ { 0, 0x0001, 0x8803 } ->
  1227. 0000: 00 */
  1228. {0x0050, 0x8703},
  1229. {0x0002, 0x8704}, /* External input CKIx1 */
  1230. {0x0001, 0x870C}, /* Select CKOx2 output */
  1231. {0x009A, 0x8600}, /* Line memory Read Counter (L) */
  1232. {0x0001, 0x8606}, /* 1 Line memory Read Counter (H) Result: (d)410 */
  1233. {0x0023, 0x8601},
  1234. {0x0010, 0x8602},
  1235. {0x000A, 0x8603},
  1236. {0x009A, 0x8600},
  1237. {0x0001, 0x865B}, /* 1 Horizontal Offset for Valid Pixel(L) */
  1238. {0x0003, 0x865C}, /* Vertical offset for valid lines (L) */
  1239. {0x0058, 0x865D}, /* Horizontal valid pixels window (L) */
  1240. {0x0048, 0x865E}, /* Vertical valid lines window (L) */
  1241. {0x0000, 0x865F},
  1242. {0x0006, 0x8660},
  1243. /* Enable nibble data input, select nibble input order */
  1244. {0x0013, 0x8608}, /* A11 Coeficients for color correction */
  1245. {0x0028, 0x8609},
  1246. /* Note: these values are confirmed at the end of array */
  1247. {0x0005, 0x860A}, /* ... */
  1248. {0x0025, 0x860B},
  1249. {0x00E1, 0x860C},
  1250. {0x00FA, 0x860D},
  1251. {0x00F4, 0x860E},
  1252. {0x00E8, 0x860F},
  1253. {0x0025, 0x8610}, /* A33 Coef. */
  1254. {0x00FC, 0x8611}, /* White balance offset: R */
  1255. {0x0001, 0x8612}, /* White balance offset: Gr */
  1256. {0x00FE, 0x8613}, /* White balance offset: B */
  1257. {0x0000, 0x8614}, /* White balance offset: Gb */
  1258. {0x0064, 0x8651}, /* R gain for white balance (L) */
  1259. {0x0040, 0x8652}, /* Gr gain for white balance (L) */
  1260. {0x0066, 0x8653}, /* B gain for white balance (L) */
  1261. {0x0040, 0x8654}, /* Gb gain for white balance (L) */
  1262. {0x0001, 0x863F}, /* Enable fixed gamma correction */
  1263. {0x00A1, 0x8656}, /* Size - Window1: 256x256, Window2: 128x128 */
  1264. /* UV division: UV no change, Enable New edge enhancement */
  1265. {0x0018, 0x8657}, /* Edge gain high threshold */
  1266. {0x0020, 0x8658}, /* Edge gain low threshold */
  1267. {0x000A, 0x8659}, /* Edge bandwidth high threshold */
  1268. {0x0005, 0x865A}, /* Edge bandwidth low threshold */
  1269. {0x0064, 0x8607}, /* UV filter enable */
  1270. {0x0016, 0x8660},
  1271. {0x0000, 0x86B0}, /* Bad pixels compensation address */
  1272. {0x00DC, 0x86B1}, /* X coord for bad pixels compensation (L) */
  1273. {0x0000, 0x86B2},
  1274. {0x0009, 0x86B3}, /* Y coord for bad pixels compensation (L) */
  1275. {0x0000, 0x86B4},
  1276. {0x0001, 0x86B0},
  1277. {0x00F5, 0x86B1},
  1278. {0x0000, 0x86B2},
  1279. {0x00C6, 0x86B3},
  1280. {0x0000, 0x86B4},
  1281. {0x0002, 0x86B0},
  1282. {0x001C, 0x86B1},
  1283. {0x0001, 0x86B2},
  1284. {0x00D7, 0x86B3},
  1285. {0x0000, 0x86B4},
  1286. {0x0003, 0x86B0},
  1287. {0x001C, 0x86B1},
  1288. {0x0001, 0x86B2},
  1289. {0x00D8, 0x86B3},
  1290. {0x0000, 0x86B4},
  1291. {0x0004, 0x86B0},
  1292. {0x001D, 0x86B1},
  1293. {0x0001, 0x86B2},
  1294. {0x00D8, 0x86B3},
  1295. {0x0000, 0x86B4},
  1296. {0x001E, 0x8660},
  1297. /* READ { 0, 0x0000, 0x8608 } ->
  1298. 0000: 13 */
  1299. /* READ { 0, 0x0000, 0x8609 } ->
  1300. 0000: 28 */
  1301. /* READ { 0, 0x0000, 0x8610 } ->
  1302. 0000: 05 */
  1303. /* READ { 0, 0x0000, 0x8611 } ->
  1304. 0000: 25 */
  1305. /* READ { 0, 0x0000, 0x8612 } ->
  1306. 0000: e1 */
  1307. /* READ { 0, 0x0000, 0x8613 } ->
  1308. 0000: fa */
  1309. /* READ { 0, 0x0000, 0x8614 } ->
  1310. 0000: f4 */
  1311. /* READ { 0, 0x0000, 0x8615 } ->
  1312. 0000: e8 */
  1313. /* READ { 0, 0x0000, 0x8616 } ->
  1314. 0000: 25 */
  1315. {}
  1316. };
  1317. static int reg_write(struct usb_device *dev,
  1318. __u16 index, __u16 value)
  1319. {
  1320. int ret;
  1321. ret = usb_control_msg(dev,
  1322. usb_sndctrlpipe(dev, 0),
  1323. 0, /* request */
  1324. USB_TYPE_VENDOR | USB_RECIP_DEVICE,
  1325. value, index, NULL, 0, 500);
  1326. PDEBUG(D_USBO, "reg write i:0x%04x = 0x%02x",
  1327. index, value);
  1328. if (ret < 0)
  1329. PDEBUG(D_ERR|D_USBO, "reg write: error %d", ret);
  1330. return ret;
  1331. }
  1332. /* read 1 byte */
  1333. /* returns: negative is error, pos or zero is data */
  1334. static int reg_read(struct usb_device *dev,
  1335. __u16 index) /* wIndex */
  1336. {
  1337. int ret;
  1338. __u8 data;
  1339. ret = usb_control_msg(dev,
  1340. usb_rcvctrlpipe(dev, 0),
  1341. 0, /* register */
  1342. USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
  1343. (__u16) 0, /* value */
  1344. index,
  1345. &data, 1,
  1346. 500); /* timeout */
  1347. PDEBUG(D_USBI, "reg read i:%04x --> %02x", index, data);
  1348. if (ret < 0) {
  1349. PDEBUG(D_ERR|D_USBI, "reg_read err %d", ret);
  1350. return ret;
  1351. }
  1352. return data;
  1353. }
  1354. static int write_vector(struct gspca_dev *gspca_dev,
  1355. const __u16 data[][3])
  1356. {
  1357. struct usb_device *dev = gspca_dev->dev;
  1358. int ret, i = 0;
  1359. while (data[i][1] != 0) {
  1360. ret = reg_write(dev, data[i][1], data[i][0]);
  1361. if (ret < 0)
  1362. return ret;
  1363. i++;
  1364. }
  1365. return 0;
  1366. }
  1367. /* this function is called at probe time */
  1368. static int sd_config(struct gspca_dev *gspca_dev,
  1369. const struct usb_device_id *id)
  1370. {
  1371. struct sd *sd = (struct sd *) gspca_dev;
  1372. struct usb_device *dev = gspca_dev->dev;
  1373. struct cam *cam;
  1374. __u16 vendor;
  1375. __u16 product;
  1376. int data1, data2;
  1377. vendor = id->idVendor;
  1378. product = id->idProduct;
  1379. switch (vendor) {
  1380. case 0x041e: /* Creative cameras */
  1381. /* switch (product) { */
  1382. /* case 0x4018: */
  1383. sd->subtype = CreativeVista;
  1384. /* break; */
  1385. /* } */
  1386. break;
  1387. case 0x0461: /* MicroInnovation */
  1388. /* switch (product) { */
  1389. /* case 0x0815: */
  1390. sd->subtype = MicroInnovationIC200;
  1391. /* break; */
  1392. /* } */
  1393. break;
  1394. case 0x0733: /* Rebadged ViewQuest (Intel) and ViewQuest cameras */
  1395. /* switch (product) { */
  1396. /* case 0x110: */
  1397. sd->subtype = ViewQuestVQ110;
  1398. /* break; */
  1399. /* } */
  1400. break;
  1401. case 0x0130: /* Clone webcam */
  1402. case 0x0af9: /* Hama cameras */
  1403. switch (product) {
  1404. case 0x0130:
  1405. case 0x0010:
  1406. sd->subtype = HamaUSBSightcam;
  1407. break;
  1408. case 0x0011:
  1409. sd->subtype = HamaUSBSightcam2;
  1410. break;
  1411. }
  1412. break;
  1413. case 0x8086: /* Intel */
  1414. /* switch (product) { */
  1415. /* case 0x0110: */
  1416. sd->subtype = IntelEasyPCCamera;
  1417. /* break; */
  1418. /* } */
  1419. break;
  1420. }
  1421. /* Read from global register the USB product and vendor IDs, just to */
  1422. /* prove that we can communicate with the device. This works, which */
  1423. /* confirms at we are communicating properly and that the device */
  1424. /* is a 508. */
  1425. data1 = reg_read(dev, 0x8104);
  1426. data2 = reg_read(dev, 0x8105);
  1427. PDEBUG(D_PROBE,
  1428. "Read from GLOBAL: USB Vendor ID 0x%02x%02x", data2, data1);
  1429. data1 = reg_read(dev, 0x8106);
  1430. data2 = reg_read(dev, 0x8107);
  1431. PDEBUG(D_PROBE,
  1432. "Read from GLOBAL: USB Product ID 0x%02x%02x", data2, data1);
  1433. data1 = reg_read(dev, 0x8621);
  1434. PDEBUG(D_PROBE,
  1435. "Read from GLOBAL: Window 1 average luminance %d", data1);
  1436. cam = &gspca_dev->cam;
  1437. cam->dev_name = (char *) id->driver_info;
  1438. cam->epaddr = 0x01;
  1439. cam->cam_mode = sif_mode;
  1440. cam->nmodes = sizeof sif_mode / sizeof sif_mode[0];
  1441. sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value;
  1442. switch (sd->subtype) {
  1443. case ViewQuestVQ110:
  1444. if (write_vector(gspca_dev, spca508_init_data))
  1445. return -1;
  1446. break;
  1447. default:
  1448. /* case MicroInnovationIC200: */
  1449. /* case IntelEasyPCCamera: */
  1450. if (write_vector(gspca_dev, spca508cs110_init_data))
  1451. return -1;
  1452. break;
  1453. case HamaUSBSightcam:
  1454. if (write_vector(gspca_dev, spca508_sightcam_init_data))
  1455. return -1;
  1456. break;
  1457. case HamaUSBSightcam2:
  1458. if (write_vector(gspca_dev, spca508_sightcam2_init_data))
  1459. return -1;
  1460. break;
  1461. case CreativeVista:
  1462. if (write_vector(gspca_dev, spca508_vista_init_data))
  1463. return -1;
  1464. break;
  1465. }
  1466. return 0; /* success */
  1467. }
  1468. /* this function is called at open time */
  1469. static int sd_open(struct gspca_dev *gspca_dev)
  1470. {
  1471. /* write_vector(gspca_dev, spca508_open_data); */
  1472. return 0;
  1473. }
  1474. static void sd_start(struct gspca_dev *gspca_dev)
  1475. {
  1476. int mode;
  1477. mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
  1478. reg_write(gspca_dev->dev, 0x8500, mode);
  1479. switch (mode) {
  1480. case 0:
  1481. case 1:
  1482. reg_write(gspca_dev->dev, 0x8700, 0x28); /* clock */
  1483. break;
  1484. default:
  1485. /* case 2: */
  1486. /* case 3: */
  1487. reg_write(gspca_dev->dev, 0x8700, 0x23); /* clock */
  1488. break;
  1489. }
  1490. reg_write(gspca_dev->dev, 0x8112, 0x10 | 0x20);
  1491. }
  1492. static void sd_stopN(struct gspca_dev *gspca_dev)
  1493. {
  1494. /* Video ISO disable, Video Drop Packet enable: */
  1495. reg_write(gspca_dev->dev, 0x8112, 0x20);
  1496. }
  1497. static void sd_stop0(struct gspca_dev *gspca_dev)
  1498. {
  1499. }
  1500. /* this function is called at close time */
  1501. static void sd_close(struct gspca_dev *gspca_dev)
  1502. {
  1503. }
  1504. /* convert YUVY per line to YUYV (YUV 4:2:2) */
  1505. static void yuvy_decode(unsigned char *out,
  1506. unsigned char *in,
  1507. int width,
  1508. int height)
  1509. {
  1510. unsigned char *Ui, *Vi, *yi, *yi1;
  1511. unsigned char *out1;
  1512. int i, j;
  1513. yi = in;
  1514. for (i = height / 2; --i >= 0; ) {
  1515. out1 = out + width * 2; /* next line */
  1516. Ui = yi + width;
  1517. Vi = Ui + width / 2;
  1518. yi1 = Vi + width / 2;
  1519. for (j = width / 2; --j >= 0; ) {
  1520. *out++ = 128 + *yi++;
  1521. *out++ = 128 + *Ui;
  1522. *out++ = 128 + *yi++;
  1523. *out++ = 128 + *Vi;
  1524. *out1++ = 128 + *yi1++;
  1525. *out1++ = 128 + *Ui++;
  1526. *out1++ = 128 + *yi1++;
  1527. *out1++ = 128 + *Vi++;
  1528. }
  1529. yi += width * 2;
  1530. out = out1;
  1531. }
  1532. }
  1533. static void sd_pkt_scan(struct gspca_dev *gspca_dev,
  1534. struct gspca_frame *frame, /* target */
  1535. __u8 *data, /* isoc packet */
  1536. int len) /* iso packet length */
  1537. {
  1538. struct sd *sd = (struct sd *) gspca_dev;
  1539. switch (data[0]) {
  1540. case 0: /* start of frame */
  1541. if (gspca_dev->last_packet_type == FIRST_PACKET) {
  1542. yuvy_decode(sd->tmpbuf2, sd->tmpbuf,
  1543. gspca_dev->width,
  1544. gspca_dev->height);
  1545. frame = gspca_frame_add(gspca_dev,
  1546. LAST_PACKET,
  1547. frame,
  1548. sd->tmpbuf2,
  1549. gspca_dev->width
  1550. * gspca_dev->height
  1551. * 2);
  1552. }
  1553. gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
  1554. data, 0);
  1555. data += SPCA508_OFFSET_DATA;
  1556. len -= SPCA508_OFFSET_DATA;
  1557. if (len > 0)
  1558. memcpy(sd->tmpbuf, data, len);
  1559. else
  1560. len = 0;
  1561. sd->buflen = len;
  1562. return;
  1563. case 0xff: /* drop */
  1564. /* gspca_dev->last_packet_type = DISCARD_PACKET; */
  1565. return;
  1566. }
  1567. data += 1;
  1568. len -= 1;
  1569. memcpy(&sd->tmpbuf[sd->buflen], data, len);
  1570. sd->buflen += len;
  1571. }
  1572. static void setbrightness(struct gspca_dev *gspca_dev)
  1573. {
  1574. struct sd *sd = (struct sd *) gspca_dev;
  1575. __u8 brightness = sd->brightness;
  1576. /* MX seem contrast */
  1577. reg_write(gspca_dev->dev, 0x8651, brightness);
  1578. reg_write(gspca_dev->dev, 0x8652, brightness);
  1579. reg_write(gspca_dev->dev, 0x8653, brightness);
  1580. reg_write(gspca_dev->dev, 0x8654, brightness);
  1581. }
  1582. static void getbrightness(struct gspca_dev *gspca_dev)
  1583. {
  1584. struct sd *sd = (struct sd *) gspca_dev;
  1585. sd->brightness = reg_read(gspca_dev->dev, 0x8651);
  1586. }
  1587. static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
  1588. {
  1589. struct sd *sd = (struct sd *) gspca_dev;
  1590. sd->brightness = val;
  1591. if (gspca_dev->streaming)
  1592. setbrightness(gspca_dev);
  1593. return 0;
  1594. }
  1595. static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
  1596. {
  1597. struct sd *sd = (struct sd *) gspca_dev;
  1598. getbrightness(gspca_dev);
  1599. *val = sd->brightness;
  1600. return 0;
  1601. }
  1602. /* sub-driver description */
  1603. static const struct sd_desc sd_desc = {
  1604. .name = MODULE_NAME,
  1605. .ctrls = sd_ctrls,
  1606. .nctrls = ARRAY_SIZE(sd_ctrls),
  1607. .config = sd_config,
  1608. .open = sd_open,
  1609. .start = sd_start,
  1610. .stopN = sd_stopN,
  1611. .stop0 = sd_stop0,
  1612. .close = sd_close,
  1613. .pkt_scan = sd_pkt_scan,
  1614. };
  1615. /* -- module initialisation -- */
  1616. #define DVNM(name) .driver_info = (kernel_ulong_t) name
  1617. static const __devinitdata struct usb_device_id device_table[] = {
  1618. {USB_DEVICE(0x041e, 0x4018), DVNM("Creative Webcam Vista (PD1100)")},
  1619. {USB_DEVICE(0x0461, 0x0815), DVNM("Micro Innovation IC200")},
  1620. {USB_DEVICE(0x0733, 0x0110), DVNM("ViewQuest VQ110")},
  1621. {USB_DEVICE(0x0af9, 0x0010), DVNM("Hama USB Sightcam 100")},
  1622. {USB_DEVICE(0x0af9, 0x0011), DVNM("Hama USB Sightcam 100")},
  1623. {USB_DEVICE(0x8086, 0x0110), DVNM("Intel Easy PC Camera")},
  1624. {USB_DEVICE(0x0130, 0x0130),
  1625. DVNM("Clone Digital Webcam 11043 (spca508a)")},
  1626. {}
  1627. };
  1628. MODULE_DEVICE_TABLE(usb, device_table);
  1629. /* -- device connect -- */
  1630. static int sd_probe(struct usb_interface *intf,
  1631. const struct usb_device_id *id)
  1632. {
  1633. return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
  1634. THIS_MODULE);
  1635. }
  1636. static struct usb_driver sd_driver = {
  1637. .name = MODULE_NAME,
  1638. .id_table = device_table,
  1639. .probe = sd_probe,
  1640. .disconnect = gspca_disconnect,
  1641. };
  1642. /* -- module insert / remove -- */
  1643. static int __init sd_mod_init(void)
  1644. {
  1645. if (usb_register(&sd_driver) < 0)
  1646. return -1;
  1647. PDEBUG(D_PROBE, "v%s registered", version);
  1648. return 0;
  1649. }
  1650. static void __exit sd_mod_exit(void)
  1651. {
  1652. usb_deregister(&sd_driver);
  1653. PDEBUG(D_PROBE, "deregistered");
  1654. }
  1655. module_init(sd_mod_init);
  1656. module_exit(sd_mod_exit);