diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2009-01-19 13:18:44 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:33 -0400 |
commit | 3d22118360cdf603ebce1a3b927139e23aa3b9b1 (patch) | |
tree | e02d786aadda43e83fc1214ed31039de3f2041b0 /drivers/media/video/gspca | |
parent | 9881918756be1cf0a33ae7454ca767682cbfadc3 (diff) |
V4L/DVB (10373): gspca - zc3xx: Sensor adcm2700 added.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca')
-rw-r--r-- | drivers/media/video/gspca/zc3xx.c | 454 |
1 files changed, 362 insertions, 92 deletions
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c index 74eabce7b4ae..b986362bdd17 100644 --- a/drivers/media/video/gspca/zc3xx.c +++ b/drivers/media/video/gspca/zc3xx.c | |||
@@ -48,25 +48,26 @@ struct sd { | |||
48 | 48 | ||
49 | signed char sensor; /* Type of image sensor chip */ | 49 | signed char sensor; /* Type of image sensor chip */ |
50 | /* !! values used in different tables */ | 50 | /* !! values used in different tables */ |
51 | #define SENSOR_CS2102 0 | 51 | #define SENSOR_ADCM2700 0 |
52 | #define SENSOR_CS2102K 1 | 52 | #define SENSOR_CS2102 1 |
53 | #define SENSOR_GC0305 2 | 53 | #define SENSOR_CS2102K 2 |
54 | #define SENSOR_HDCS2020b 3 | 54 | #define SENSOR_GC0305 3 |
55 | #define SENSOR_HV7131B 4 | 55 | #define SENSOR_HDCS2020b 4 |
56 | #define SENSOR_HV7131C 5 | 56 | #define SENSOR_HV7131B 5 |
57 | #define SENSOR_ICM105A 6 | 57 | #define SENSOR_HV7131C 6 |
58 | #define SENSOR_MC501CB 7 | 58 | #define SENSOR_ICM105A 7 |
59 | #define SENSOR_OV7620 8 | 59 | #define SENSOR_MC501CB 8 |
60 | /*#define SENSOR_OV7648 8 - same values */ | 60 | #define SENSOR_OV7620 9 |
61 | #define SENSOR_OV7630C 9 | 61 | /*#define SENSOR_OV7648 9 - same values */ |
62 | #define SENSOR_PAS106 10 | 62 | #define SENSOR_OV7630C 10 |
63 | #define SENSOR_PAS202B 11 | 63 | #define SENSOR_PAS106 11 |
64 | #define SENSOR_PB0330 12 | 64 | #define SENSOR_PAS202B 12 |
65 | #define SENSOR_PO2030 13 | 65 | #define SENSOR_PB0330 13 |
66 | #define SENSOR_TAS5130CK 14 | 66 | #define SENSOR_PO2030 14 |
67 | #define SENSOR_TAS5130CXX 15 | 67 | #define SENSOR_TAS5130CK 15 |
68 | #define SENSOR_TAS5130C_VF0250 16 | 68 | #define SENSOR_TAS5130CXX 16 |
69 | #define SENSOR_MAX 17 | 69 | #define SENSOR_TAS5130C_VF0250 17 |
70 | #define SENSOR_MAX 18 | ||
70 | unsigned short chip_revision; | 71 | unsigned short chip_revision; |
71 | }; | 72 | }; |
72 | 73 | ||
@@ -206,6 +207,241 @@ struct usb_action { | |||
206 | __u16 idx; | 207 | __u16 idx; |
207 | }; | 208 | }; |
208 | 209 | ||
210 | static const struct usb_action adcm2700_Initial[] = { | ||
211 | {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */ | ||
212 | {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT}, /* 00,02,04,cc */ | ||
213 | {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */ | ||
214 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
215 | {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */ | ||
216 | {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */ | ||
217 | {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */ | ||
218 | {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */ | ||
219 | {0xa0, 0xd8, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d8,cc */ | ||
220 | {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */ | ||
221 | {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */ | ||
222 | {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */ | ||
223 | {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */ | ||
224 | {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */ | ||
225 | {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */ | ||
226 | {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */ | ||
227 | {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */ | ||
228 | {0xa0, 0xde, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,de,cc */ | ||
229 | {0xa0, 0x86, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,86,cc */ | ||
230 | {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */ | ||
231 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | ||
232 | {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */ | ||
233 | {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */ | ||
234 | {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */ | ||
235 | {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */ | ||
236 | {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */ | ||
237 | {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */ | ||
238 | {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */ | ||
239 | {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */ | ||
240 | {0xa0, 0x58, ZC3XX_R116_RGAIN}, /* 01,16,58,cc */ | ||
241 | {0xa0, 0x5a, ZC3XX_R118_BGAIN}, /* 01,18,5a,cc */ | ||
242 | {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */ | ||
243 | {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */ | ||
244 | {0xbb, 0x00, 0x0408}, /* 04,00,08,bb */ | ||
245 | {0xdd, 0x00, 0x0200}, /* 00,02,00,dd */ | ||
246 | {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */ | ||
247 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | ||
248 | {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */ | ||
249 | {0xbb, 0xe0, 0x0c2e}, /* 0c,e0,2e,bb */ | ||
250 | {0xbb, 0x01, 0x2000}, /* 20,01,00,bb */ | ||
251 | {0xbb, 0x96, 0x2400}, /* 24,96,00,bb */ | ||
252 | {0xbb, 0x06, 0x1006}, /* 10,06,06,bb */ | ||
253 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
254 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | ||
255 | {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */ | ||
256 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
257 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | ||
258 | {0xbb, 0x5f, 0x2090}, /* 20,5f,90,bb */ | ||
259 | {0xbb, 0x01, 0x8000}, /* 80,01,00,bb */ | ||
260 | {0xbb, 0x09, 0x8400}, /* 84,09,00,bb */ | ||
261 | {0xbb, 0x86, 0x0002}, /* 00,86,02,bb */ | ||
262 | {0xbb, 0xe6, 0x0401}, /* 04,e6,01,bb */ | ||
263 | {0xbb, 0x86, 0x0802}, /* 08,86,02,bb */ | ||
264 | {0xbb, 0xe6, 0x0c01}, /* 0c,e6,01,bb */ | ||
265 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
266 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | ||
267 | {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */ | ||
268 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
269 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | ||
270 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
271 | {0xaa, 0xfe, 0x0020}, /* 00,fe,20,aa */ | ||
272 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
273 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
274 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | ||
275 | {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */ | ||
276 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
277 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | ||
278 | {0xbb, 0x04, 0x0400}, /* 04,04,00,bb */ | ||
279 | {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */ | ||
280 | {0xbb, 0x01, 0x0400}, /* 04,01,00,bb */ | ||
281 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
282 | {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */ | ||
283 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
284 | {0xbb, 0x41, 0x2803}, /* 28,41,03,bb */ | ||
285 | {0xbb, 0x40, 0x2c03}, /* 2c,40,03,bb */ | ||
286 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
287 | {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */ | ||
288 | {} | ||
289 | }; | ||
290 | static const struct usb_action adcm2700_InitialScale[] = { | ||
291 | {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */ | ||
292 | {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */ | ||
293 | {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */ | ||
294 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
295 | {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */ | ||
296 | {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */ | ||
297 | {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, /* 00,04,80,cc */ | ||
298 | {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* 00,05,01,cc */ | ||
299 | {0xa0, 0xd0, ZC3XX_R006_FRAMEHEIGHTLOW}, /* 00,06,d0,cc */ | ||
300 | {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* 00,01,01,cc */ | ||
301 | {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,03,cc */ | ||
302 | {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,01,cc */ | ||
303 | {0xa0, 0x05, ZC3XX_R012_VIDEOCONTROLFUNC}, /* 00,12,05,cc */ | ||
304 | {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, /* 00,98,00,cc */ | ||
305 | {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, /* 00,9a,00,cc */ | ||
306 | {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* 01,1a,00,cc */ | ||
307 | {0xa0, 0x00, ZC3XX_R11C_FIRSTXLOW}, /* 01,1c,00,cc */ | ||
308 | {0xa0, 0xd8, ZC3XX_R09C_WINHEIGHTLOW}, /* 00,9c,d8,cc */ | ||
309 | {0xa0, 0x88, ZC3XX_R09E_WINWIDTHLOW}, /* 00,9e,88,cc */ | ||
310 | {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */ | ||
311 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | ||
312 | {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */ | ||
313 | {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */ | ||
314 | {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */ | ||
315 | {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */ | ||
316 | {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */ | ||
317 | {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* 01,cb,13,cc */ | ||
318 | {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* 02,50,08,cc */ | ||
319 | {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* 03,01,08,cc */ | ||
320 | {0xa0, 0x58, ZC3XX_R116_RGAIN}, /* 01,16,58,cc */ | ||
321 | {0xa0, 0x5a, ZC3XX_R118_BGAIN}, /* 01,18,5a,cc */ | ||
322 | {0xa0, 0x02, ZC3XX_R180_AUTOCORRECTENABLE}, /* 01,80,02,cc */ | ||
323 | {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */ | ||
324 | {0xbb, 0x00, 0x0408}, /* 04,00,08,bb */ | ||
325 | {0xdd, 0x00, 0x0200}, /* 00,02,00,dd */ | ||
326 | {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */ | ||
327 | {0xdd, 0x00, 0x0050}, /* 00,00,50,dd */ | ||
328 | {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */ | ||
329 | {0xbb, 0xe0, 0x0c2e}, /* 0c,e0,2e,bb */ | ||
330 | {0xbb, 0x01, 0x2000}, /* 20,01,00,bb */ | ||
331 | {0xbb, 0x96, 0x2400}, /* 24,96,00,bb */ | ||
332 | {0xbb, 0x06, 0x1006}, /* 10,06,06,bb */ | ||
333 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
334 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | ||
335 | {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */ | ||
336 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
337 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | ||
338 | {0xbb, 0x5f, 0x2090}, /* 20,5f,90,bb */ | ||
339 | {0xbb, 0x01, 0x8000}, /* 80,01,00,bb */ | ||
340 | {0xbb, 0x09, 0x8400}, /* 84,09,00,bb */ | ||
341 | {0xbb, 0x88, 0x0002}, /* 00,88,02,bb */ | ||
342 | {0xbb, 0xe6, 0x0401}, /* 04,e6,01,bb */ | ||
343 | {0xbb, 0x88, 0x0802}, /* 08,88,02,bb */ | ||
344 | {0xbb, 0xe6, 0x0c01}, /* 0c,e6,01,bb */ | ||
345 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
346 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | ||
347 | {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */ | ||
348 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
349 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | ||
350 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
351 | {0xaa, 0xfe, 0x0020}, /* 00,fe,20,aa */ | ||
352 | /*******/ | ||
353 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
354 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
355 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | ||
356 | {0xaa, 0xfe, 0x0000}, /* 00,fe,00,aa */ | ||
357 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
358 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | ||
359 | {0xbb, 0x04, 0x0400}, /* 04,04,00,bb */ | ||
360 | {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */ | ||
361 | {0xbb, 0x01, 0x0400}, /* 04,01,00,bb */ | ||
362 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
363 | {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */ | ||
364 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
365 | {0xbb, 0x41, 0x2803}, /* 28,41,03,bb */ | ||
366 | {0xbb, 0x40, 0x2c03}, /* 2c,40,03,bb */ | ||
367 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
368 | {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */ | ||
369 | {} | ||
370 | }; | ||
371 | static const struct usb_action adcm2700_50HZ[] = { | ||
372 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
373 | {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */ | ||
374 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
375 | {0xbb, 0x05, 0x8400}, /* 84,05,00,bb */ | ||
376 | {0xbb, 0xd0, 0xb007}, /* b0,d0,07,bb */ | ||
377 | {0xbb, 0xa0, 0xb80f}, /* b8,a0,0f,bb */ | ||
378 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
379 | {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */ | ||
380 | {0xaa, 0x26, 0x00d0}, /* 00,26,d0,aa */ | ||
381 | {0xaa, 0x28, 0x0002}, /* 00,28,02,aa */ | ||
382 | {} | ||
383 | }; | ||
384 | static const struct usb_action adcm2700_50HZScale[] = { | ||
385 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
386 | {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */ | ||
387 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
388 | {0xbb, 0x05, 0x8400}, /* 84,05,00,bb */ | ||
389 | {0xbb, 0xd0, 0xb007}, /* b0,d0,07,bb */ | ||
390 | {0xbb, 0xa0, 0xb80f}, /* b8,a0,0f,bb */ | ||
391 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
392 | {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */ | ||
393 | {0xaa, 0x26, 0x00d0}, /* 00,26,d0,aa */ | ||
394 | {0xaa, 0x28, 0x0002}, /* 00,28,02,aa */ | ||
395 | {} | ||
396 | }; | ||
397 | static const struct usb_action adcm2700_60HZ[] = { | ||
398 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
399 | {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */ | ||
400 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
401 | {0xbb, 0x07, 0x8400}, /* 84,07,00,bb */ | ||
402 | {0xbb, 0x82, 0xb006}, /* b0,82,06,bb */ | ||
403 | {0xbb, 0x04, 0xb80d}, /* b8,04,0d,bb */ | ||
404 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
405 | {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */ | ||
406 | {0xaa, 0x26, 0x0057}, /* 00,26,57,aa */ | ||
407 | {0xaa, 0x28, 0x0002}, /* 00,28,02,aa */ | ||
408 | {} | ||
409 | }; | ||
410 | static const struct usb_action adcm2700_60HZScale[] = { | ||
411 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
412 | {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */ | ||
413 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
414 | {0xbb, 0x07, 0x8400}, /* 84,07,00,bb */ | ||
415 | {0xbb, 0x82, 0xb006}, /* b0,82,06,bb */ | ||
416 | {0xbb, 0x04, 0xb80d}, /* b8,04,0d,bb */ | ||
417 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
418 | {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */ | ||
419 | {0xaa, 0x26, 0x0057}, /* 00,26,57,aa */ | ||
420 | {0xaa, 0x28, 0x0002}, /* 00,28,02,aa */ | ||
421 | {} | ||
422 | }; | ||
423 | static const struct usb_action adcm2700_NoFliker[] = { | ||
424 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
425 | {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */ | ||
426 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
427 | {0xbb, 0x07, 0x8400}, /* 84,07,00,bb */ | ||
428 | {0xbb, 0x05, 0xb000}, /* b0,05,00,bb */ | ||
429 | {0xbb, 0xa0, 0xb801}, /* b8,a0,01,bb */ | ||
430 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
431 | {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */ | ||
432 | {} | ||
433 | }; | ||
434 | static const struct usb_action adcm2700_NoFlikerScale[] = { | ||
435 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
436 | {0xaa, 0xfe, 0x0002}, /* 00,fe,02,aa */ | ||
437 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | ||
438 | {0xbb, 0x07, 0x8400}, /* 84,07,00,bb */ | ||
439 | {0xbb, 0x05, 0xb000}, /* b0,05,00,bb */ | ||
440 | {0xbb, 0xa0, 0xb801}, /* b8,a0,01,bb */ | ||
441 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | ||
442 | {0xaa, 0xfe, 0x0010}, /* 00,fe,10,aa */ | ||
443 | {} | ||
444 | }; | ||
209 | static const struct usb_action cs2102_Initial[] = { | 445 | static const struct usb_action cs2102_Initial[] = { |
210 | {0xa1, 0x01, 0x0008}, | 446 | {0xa1, 0x01, 0x0008}, |
211 | {0xa1, 0x01, 0x0008}, | 447 | {0xa1, 0x01, 0x0008}, |
@@ -6286,8 +6522,8 @@ static __u16 i2c_read(struct gspca_dev *gspca_dev, | |||
6286 | __u8 retbyte; | 6522 | __u8 retbyte; |
6287 | __u16 retval; | 6523 | __u16 retval; |
6288 | 6524 | ||
6289 | reg_w_i(gspca_dev->dev, reg, 0x92); | 6525 | reg_w_i(gspca_dev->dev, reg, 0x0092); |
6290 | reg_w_i(gspca_dev->dev, 0x02, 0x90); /* <- read command */ | 6526 | reg_w_i(gspca_dev->dev, 0x02, 0x0090); /* <- read command */ |
6291 | msleep(25); | 6527 | msleep(25); |
6292 | retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */ | 6528 | retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */ |
6293 | retval = reg_r_i(gspca_dev, 0x0095); /* read Lowbyte */ | 6529 | retval = reg_r_i(gspca_dev, 0x0095); /* read Lowbyte */ |
@@ -6332,6 +6568,12 @@ static void usb_exchange(struct gspca_dev *gspca_dev, | |||
6332 | action->idx & 0xff, /* valL */ | 6568 | action->idx & 0xff, /* valL */ |
6333 | action->idx >> 8); /* valH */ | 6569 | action->idx >> 8); /* valH */ |
6334 | break; | 6570 | break; |
6571 | case 0xbb: | ||
6572 | i2c_write(gspca_dev, | ||
6573 | action->idx >> 8, /* reg */ | ||
6574 | action->idx & 0xff, /* valL */ | ||
6575 | action->val); /* valH */ | ||
6576 | break; | ||
6335 | default: | 6577 | default: |
6336 | /* case 0xdd: * delay */ | 6578 | /* case 0xdd: * delay */ |
6337 | msleep(action->val / 64 + 10); | 6579 | msleep(action->val / 64 + 10); |
@@ -6347,6 +6589,8 @@ static void setmatrix(struct gspca_dev *gspca_dev) | |||
6347 | struct sd *sd = (struct sd *) gspca_dev; | 6589 | struct sd *sd = (struct sd *) gspca_dev; |
6348 | int i; | 6590 | int i; |
6349 | const __u8 *matrix; | 6591 | const __u8 *matrix; |
6592 | static const u8 adcm2700_matrix[9] = | ||
6593 | {0x66, 0xed, 0xed, 0xed, 0x66, 0xed, 0xed, 0xed, 0x66}; | ||
6350 | static const __u8 gc0305_matrix[9] = | 6594 | static const __u8 gc0305_matrix[9] = |
6351 | {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50}; | 6595 | {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50}; |
6352 | static const __u8 ov7620_matrix[9] = | 6596 | static const __u8 ov7620_matrix[9] = |
@@ -6358,23 +6602,24 @@ static void setmatrix(struct gspca_dev *gspca_dev) | |||
6358 | static const __u8 vf0250_matrix[9] = | 6602 | static const __u8 vf0250_matrix[9] = |
6359 | {0x7b, 0xea, 0xea, 0xea, 0x7b, 0xea, 0xea, 0xea, 0x7b}; | 6603 | {0x7b, 0xea, 0xea, 0xea, 0x7b, 0xea, 0xea, 0xea, 0x7b}; |
6360 | static const __u8 *matrix_tb[SENSOR_MAX] = { | 6604 | static const __u8 *matrix_tb[SENSOR_MAX] = { |
6361 | NULL, /* SENSOR_CS2102 0 */ | 6605 | adcm2700_matrix, /* SENSOR_ADCM2700 0 */ |
6362 | NULL, /* SENSOR_CS2102K 1 */ | 6606 | NULL, /* SENSOR_CS2102 1 */ |
6363 | gc0305_matrix, /* SENSOR_GC0305 2 */ | 6607 | NULL, /* SENSOR_CS2102K 2 */ |
6364 | NULL, /* SENSOR_HDCS2020b 3 */ | 6608 | gc0305_matrix, /* SENSOR_GC0305 3 */ |
6365 | NULL, /* SENSOR_HV7131B 4 */ | 6609 | NULL, /* SENSOR_HDCS2020b 4 */ |
6366 | NULL, /* SENSOR_HV7131C 5 */ | 6610 | NULL, /* SENSOR_HV7131B 5 */ |
6367 | NULL, /* SENSOR_ICM105A 6 */ | 6611 | NULL, /* SENSOR_HV7131C 6 */ |
6368 | NULL, /* SENSOR_MC501CB 7 */ | 6612 | NULL, /* SENSOR_ICM105A 7 */ |
6369 | ov7620_matrix, /* SENSOR_OV7620 8 */ | 6613 | NULL, /* SENSOR_MC501CB 8 */ |
6370 | NULL, /* SENSOR_OV7630C 9 */ | 6614 | ov7620_matrix, /* SENSOR_OV7620 9 */ |
6371 | NULL, /* SENSOR_PAS106 10 */ | 6615 | NULL, /* SENSOR_OV7630C 10 */ |
6372 | pas202b_matrix, /* SENSOR_PAS202B 11 */ | 6616 | NULL, /* SENSOR_PAS106 11 */ |
6373 | NULL, /* SENSOR_PB0330 12 */ | 6617 | pas202b_matrix, /* SENSOR_PAS202B 12 */ |
6374 | po2030_matrix, /* SENSOR_PO2030 13 */ | 6618 | NULL, /* SENSOR_PB0330 13 */ |
6375 | NULL, /* SENSOR_TAS5130CK 14 */ | 6619 | po2030_matrix, /* SENSOR_PO2030 14 */ |
6376 | NULL, /* SENSOR_TAS5130CXX 15 */ | 6620 | NULL, /* SENSOR_TAS5130CK 15 */ |
6377 | vf0250_matrix, /* SENSOR_TAS5130C_VF0250 16 */ | 6621 | NULL, /* SENSOR_TAS5130CXX 16 */ |
6622 | vf0250_matrix, /* SENSOR_TAS5130C_VF0250 17 */ | ||
6378 | }; | 6623 | }; |
6379 | 6624 | ||
6380 | matrix = matrix_tb[sd->sensor]; | 6625 | matrix = matrix_tb[sd->sensor]; |
@@ -6390,6 +6635,7 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
6390 | __u8 brightness; | 6635 | __u8 brightness; |
6391 | 6636 | ||
6392 | switch (sd->sensor) { | 6637 | switch (sd->sensor) { |
6638 | case SENSOR_ADCM2700: | ||
6393 | case SENSOR_GC0305: | 6639 | case SENSOR_GC0305: |
6394 | case SENSOR_OV7620: | 6640 | case SENSOR_OV7620: |
6395 | case SENSOR_PO2030: | 6641 | case SENSOR_PO2030: |
@@ -6574,71 +6820,75 @@ static int setlightfreq(struct gspca_dev *gspca_dev) | |||
6574 | int i, mode; | 6820 | int i, mode; |
6575 | const struct usb_action *zc3_freq; | 6821 | const struct usb_action *zc3_freq; |
6576 | static const struct usb_action *freq_tb[SENSOR_MAX][6] = { | 6822 | static const struct usb_action *freq_tb[SENSOR_MAX][6] = { |
6577 | /* SENSOR_CS2102 0 */ | 6823 | /* SENSOR_ADCM2700 0 */ |
6824 | {adcm2700_NoFlikerScale, adcm2700_NoFliker, | ||
6825 | adcm2700_50HZScale, adcm2700_50HZ, | ||
6826 | adcm2700_60HZScale, adcm2700_60HZ}, | ||
6827 | /* SENSOR_CS2102 1 */ | ||
6578 | {cs2102_NoFliker, cs2102_NoFlikerScale, | 6828 | {cs2102_NoFliker, cs2102_NoFlikerScale, |
6579 | cs2102_50HZ, cs2102_50HZScale, | 6829 | cs2102_50HZ, cs2102_50HZScale, |
6580 | cs2102_60HZ, cs2102_60HZScale}, | 6830 | cs2102_60HZ, cs2102_60HZScale}, |
6581 | /* SENSOR_CS2102K 1 */ | 6831 | /* SENSOR_CS2102K 2 */ |
6582 | {cs2102_NoFliker, cs2102_NoFlikerScale, | 6832 | {cs2102_NoFliker, cs2102_NoFlikerScale, |
6583 | NULL, NULL, /* currently disabled */ | 6833 | NULL, NULL, /* currently disabled */ |
6584 | NULL, NULL}, | 6834 | NULL, NULL}, |
6585 | /* SENSOR_GC0305 2 */ | 6835 | /* SENSOR_GC0305 3 */ |
6586 | {gc0305_NoFliker, gc0305_NoFliker, | 6836 | {gc0305_NoFliker, gc0305_NoFliker, |
6587 | gc0305_50HZ, gc0305_50HZ, | 6837 | gc0305_50HZ, gc0305_50HZ, |
6588 | gc0305_60HZ, gc0305_60HZ}, | 6838 | gc0305_60HZ, gc0305_60HZ}, |
6589 | /* SENSOR_HDCS2020b 3 */ | 6839 | /* SENSOR_HDCS2020b 4 */ |
6590 | {hdcs2020b_NoFliker, hdcs2020b_NoFliker, | 6840 | {hdcs2020b_NoFliker, hdcs2020b_NoFliker, |
6591 | hdcs2020b_50HZ, hdcs2020b_50HZ, | 6841 | hdcs2020b_50HZ, hdcs2020b_50HZ, |
6592 | hdcs2020b_60HZ, hdcs2020b_60HZ}, | 6842 | hdcs2020b_60HZ, hdcs2020b_60HZ}, |
6593 | /* SENSOR_HV7131B 4 */ | 6843 | /* SENSOR_HV7131B 5 */ |
6594 | {hv7131b_NoFlikerScale, hv7131b_NoFliker, | 6844 | {hv7131b_NoFlikerScale, hv7131b_NoFliker, |
6595 | hv7131b_50HZScale, hv7131b_50HZ, | 6845 | hv7131b_50HZScale, hv7131b_50HZ, |
6596 | hv7131b_60HZScale, hv7131b_60HZ}, | 6846 | hv7131b_60HZScale, hv7131b_60HZ}, |
6597 | /* SENSOR_HV7131C 5 */ | 6847 | /* SENSOR_HV7131C 6 */ |
6598 | {NULL, NULL, | 6848 | {NULL, NULL, |
6599 | NULL, NULL, | 6849 | NULL, NULL, |
6600 | NULL, NULL}, | 6850 | NULL, NULL}, |
6601 | /* SENSOR_ICM105A 6 */ | 6851 | /* SENSOR_ICM105A 7 */ |
6602 | {icm105a_NoFliker, icm105a_NoFlikerScale, | 6852 | {icm105a_NoFliker, icm105a_NoFlikerScale, |
6603 | icm105a_50HZ, icm105a_50HZScale, | 6853 | icm105a_50HZ, icm105a_50HZScale, |
6604 | icm105a_60HZ, icm105a_60HZScale}, | 6854 | icm105a_60HZ, icm105a_60HZScale}, |
6605 | /* SENSOR_MC501CB 7 */ | 6855 | /* SENSOR_MC501CB 8 */ |
6606 | {MC501CB_NoFliker, MC501CB_NoFlikerScale, | 6856 | {MC501CB_NoFliker, MC501CB_NoFlikerScale, |
6607 | MC501CB_50HZ, MC501CB_50HZScale, | 6857 | MC501CB_50HZ, MC501CB_50HZScale, |
6608 | MC501CB_60HZ, MC501CB_60HZScale}, | 6858 | MC501CB_60HZ, MC501CB_60HZScale}, |
6609 | /* SENSOR_OV7620 8 */ | 6859 | /* SENSOR_OV7620 9 */ |
6610 | {OV7620_NoFliker, OV7620_NoFliker, | 6860 | {OV7620_NoFliker, OV7620_NoFliker, |
6611 | OV7620_50HZ, OV7620_50HZ, | 6861 | OV7620_50HZ, OV7620_50HZ, |
6612 | OV7620_60HZ, OV7620_60HZ}, | 6862 | OV7620_60HZ, OV7620_60HZ}, |
6613 | /* SENSOR_OV7630C 9 */ | 6863 | /* SENSOR_OV7630C 10 */ |
6614 | {NULL, NULL, | 6864 | {NULL, NULL, |
6615 | NULL, NULL, | 6865 | NULL, NULL, |
6616 | NULL, NULL}, | 6866 | NULL, NULL}, |
6617 | /* SENSOR_PAS106 10 */ | 6867 | /* SENSOR_PAS106 11 */ |
6618 | {pas106b_NoFliker, pas106b_NoFliker, | 6868 | {pas106b_NoFliker, pas106b_NoFliker, |
6619 | pas106b_50HZ, pas106b_50HZ, | 6869 | pas106b_50HZ, pas106b_50HZ, |
6620 | pas106b_60HZ, pas106b_60HZ}, | 6870 | pas106b_60HZ, pas106b_60HZ}, |
6621 | /* SENSOR_PAS202B 11 */ | 6871 | /* SENSOR_PAS202B 12 */ |
6622 | {pas202b_NoFlikerScale, pas202b_NoFliker, | 6872 | {pas202b_NoFlikerScale, pas202b_NoFliker, |
6623 | pas202b_50HZScale, pas202b_50HZ, | 6873 | pas202b_50HZScale, pas202b_50HZ, |
6624 | pas202b_60HZScale, pas202b_60HZ}, | 6874 | pas202b_60HZScale, pas202b_60HZ}, |
6625 | /* SENSOR_PB0330 12 */ | 6875 | /* SENSOR_PB0330 13 */ |
6626 | {pb0330_NoFliker, pb0330_NoFlikerScale, | 6876 | {pb0330_NoFliker, pb0330_NoFlikerScale, |
6627 | pb0330_50HZ, pb0330_50HZScale, | 6877 | pb0330_50HZ, pb0330_50HZScale, |
6628 | pb0330_60HZ, pb0330_60HZScale}, | 6878 | pb0330_60HZ, pb0330_60HZScale}, |
6629 | /* SENSOR_PO2030 13 */ | 6879 | /* SENSOR_PO2030 14 */ |
6630 | {PO2030_NoFliker, PO2030_NoFliker, | 6880 | {PO2030_NoFliker, PO2030_NoFliker, |
6631 | PO2030_50HZ, PO2030_50HZ, | 6881 | PO2030_50HZ, PO2030_50HZ, |
6632 | PO2030_60HZ, PO2030_60HZ}, | 6882 | PO2030_60HZ, PO2030_60HZ}, |
6633 | /* SENSOR_TAS5130CK 14 */ | 6883 | /* SENSOR_TAS5130CK 15 */ |
6634 | {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale, | 6884 | {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale, |
6635 | tas5130cxx_50HZ, tas5130cxx_50HZScale, | 6885 | tas5130cxx_50HZ, tas5130cxx_50HZScale, |
6636 | tas5130cxx_60HZ, tas5130cxx_60HZScale}, | 6886 | tas5130cxx_60HZ, tas5130cxx_60HZScale}, |
6637 | /* SENSOR_TAS5130CXX 15 */ | 6887 | /* SENSOR_TAS5130CXX 16 */ |
6638 | {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale, | 6888 | {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale, |
6639 | tas5130cxx_50HZ, tas5130cxx_50HZScale, | 6889 | tas5130cxx_50HZ, tas5130cxx_50HZScale, |
6640 | tas5130cxx_60HZ, tas5130cxx_60HZScale}, | 6890 | tas5130cxx_60HZ, tas5130cxx_60HZScale}, |
6641 | /* SENSOR_TAS5130C_VF0250 16 */ | 6891 | /* SENSOR_TAS5130C_VF0250 17 */ |
6642 | {tas5130c_vf0250_NoFliker, tas5130c_vf0250_NoFlikerScale, | 6892 | {tas5130c_vf0250_NoFliker, tas5130c_vf0250_NoFlikerScale, |
6643 | tas5130c_vf0250_50HZ, tas5130c_vf0250_50HZScale, | 6893 | tas5130c_vf0250_50HZ, tas5130c_vf0250_50HZScale, |
6644 | tas5130c_vf0250_60HZ, tas5130c_vf0250_60HZScale}, | 6894 | tas5130c_vf0250_60HZ, tas5130c_vf0250_60HZScale}, |
@@ -6692,6 +6942,7 @@ static void send_unknown(struct usb_device *dev, int sensor) | |||
6692 | reg_w(dev, 0x0c, 0x003b); | 6942 | reg_w(dev, 0x0c, 0x003b); |
6693 | reg_w(dev, 0x08, 0x0038); | 6943 | reg_w(dev, 0x08, 0x0038); |
6694 | break; | 6944 | break; |
6945 | case SENSOR_ADCM2700: | ||
6695 | case SENSOR_GC0305: | 6946 | case SENSOR_GC0305: |
6696 | case SENSOR_OV7620: | 6947 | case SENSOR_OV7620: |
6697 | case SENSOR_PB0330: | 6948 | case SENSOR_PB0330: |
@@ -6949,7 +7200,7 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev) | |||
6949 | retword = i2c_read(gspca_dev, 0x01); | 7200 | retword = i2c_read(gspca_dev, 0x01); |
6950 | if (retword != 0) { | 7201 | if (retword != 0) { |
6951 | PDEBUG(D_PROBE, "probe 3wr vga type 0a ? ret: %04x", retword); | 7202 | PDEBUG(D_PROBE, "probe 3wr vga type 0a ? ret: %04x", retword); |
6952 | return 0x0a; /* ?? */ | 7203 | return retword; /* 0x6200/0x6100?? */ |
6953 | } | 7204 | } |
6954 | return -1; | 7205 | return -1; |
6955 | } | 7206 | } |
@@ -6993,23 +7244,24 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
6993 | int sensor; | 7244 | int sensor; |
6994 | int vga = 1; /* 1: vga, 0: sif */ | 7245 | int vga = 1; /* 1: vga, 0: sif */ |
6995 | static const __u8 gamma[SENSOR_MAX] = { | 7246 | static const __u8 gamma[SENSOR_MAX] = { |
6996 | 5, /* SENSOR_CS2102 0 */ | 7247 | 4, /* SENSOR_ADCM2700 0 */ |
6997 | 5, /* SENSOR_CS2102K 1 */ | 7248 | 5, /* SENSOR_CS2102 1 */ |
6998 | 4, /* SENSOR_GC0305 2 */ | 7249 | 5, /* SENSOR_CS2102K 2 */ |
6999 | 4, /* SENSOR_HDCS2020b 3 */ | 7250 | 4, /* SENSOR_GC0305 3 */ |
7000 | 4, /* SENSOR_HV7131B 4 */ | 7251 | 4, /* SENSOR_HDCS2020b 4 */ |
7001 | 4, /* SENSOR_HV7131C 5 */ | 7252 | 4, /* SENSOR_HV7131B 5 */ |
7002 | 4, /* SENSOR_ICM105A 6 */ | 7253 | 4, /* SENSOR_HV7131C 6 */ |
7003 | 4, /* SENSOR_MC501CB 7 */ | 7254 | 4, /* SENSOR_ICM105A 7 */ |
7004 | 3, /* SENSOR_OV7620 8 */ | 7255 | 4, /* SENSOR_MC501CB 8 */ |
7005 | 4, /* SENSOR_OV7630C 9 */ | 7256 | 3, /* SENSOR_OV7620 9 */ |
7006 | 4, /* SENSOR_PAS106 10 */ | 7257 | 4, /* SENSOR_OV7630C 10 */ |
7007 | 4, /* SENSOR_PAS202B 11 */ | 7258 | 4, /* SENSOR_PAS106 11 */ |
7008 | 4, /* SENSOR_PB0330 12 */ | 7259 | 4, /* SENSOR_PAS202B 12 */ |
7009 | 4, /* SENSOR_PO2030 13 */ | 7260 | 4, /* SENSOR_PB0330 13 */ |
7010 | 4, /* SENSOR_TAS5130CK 14 */ | 7261 | 4, /* SENSOR_PO2030 14 */ |
7011 | 4, /* SENSOR_TAS5130CXX 15 */ | 7262 | 4, /* SENSOR_TAS5130CK 15 */ |
7012 | 3, /* SENSOR_TAS5130C_VF0250 16 */ | 7263 | 4, /* SENSOR_TAS5130CXX 16 */ |
7264 | 3, /* SENSOR_TAS5130C_VF0250 17 */ | ||
7013 | }; | 7265 | }; |
7014 | 7266 | ||
7015 | /* define some sensors from the vendor/product */ | 7267 | /* define some sensors from the vendor/product */ |
@@ -7017,7 +7269,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
7017 | sd->sensor = id->driver_info; | 7269 | sd->sensor = id->driver_info; |
7018 | sensor = zcxx_probeSensor(gspca_dev); | 7270 | sensor = zcxx_probeSensor(gspca_dev); |
7019 | if (sensor >= 0) | 7271 | if (sensor >= 0) |
7020 | PDEBUG(D_PROBE, "probe sensor -> %02x", sensor); | 7272 | PDEBUG(D_PROBE, "probe sensor -> %04x", sensor); |
7021 | if ((unsigned) force_sensor < SENSOR_MAX) { | 7273 | if ((unsigned) force_sensor < SENSOR_MAX) { |
7022 | sd->sensor = force_sensor; | 7274 | sd->sensor = force_sensor; |
7023 | PDEBUG(D_PROBE, "sensor forced to %d", force_sensor); | 7275 | PDEBUG(D_PROBE, "sensor forced to %d", force_sensor); |
@@ -7109,6 +7361,12 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
7109 | sd->sensor = SENSOR_PO2030; | 7361 | sd->sensor = SENSOR_PO2030; |
7110 | sd->sharpness = 0; /* from win traces */ | 7362 | sd->sharpness = 0; /* from win traces */ |
7111 | break; | 7363 | break; |
7364 | case 0x6100: | ||
7365 | case 0x6200: | ||
7366 | PDEBUG(D_PROBE, "Find Sensor ADCM2700"); | ||
7367 | sd->sensor = SENSOR_ADCM2700; | ||
7368 | send_unknown(gspca_dev->dev, sd->sensor); | ||
7369 | break; | ||
7112 | case 0x7620: | 7370 | case 0x7620: |
7113 | PDEBUG(D_PROBE, "Find Sensor OV7620"); | 7371 | PDEBUG(D_PROBE, "Find Sensor OV7620"); |
7114 | sd->sensor = SENSOR_OV7620; | 7372 | sd->sensor = SENSOR_OV7620; |
@@ -7178,25 +7436,26 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
7178 | const struct usb_action *zc3_init; | 7436 | const struct usb_action *zc3_init; |
7179 | int mode; | 7437 | int mode; |
7180 | static const struct usb_action *init_tb[SENSOR_MAX][2] = { | 7438 | static const struct usb_action *init_tb[SENSOR_MAX][2] = { |
7181 | {cs2102_InitialScale, cs2102_Initial}, /* 0 */ | 7439 | {adcm2700_Initial, adcm2700_InitialScale}, /* 0 */ |
7182 | {cs2102K_InitialScale, cs2102K_Initial}, /* 1 */ | 7440 | {cs2102_InitialScale, cs2102_Initial}, /* 1 */ |
7183 | {gc0305_Initial, gc0305_InitialScale}, /* 2 */ | 7441 | {cs2102K_InitialScale, cs2102K_Initial}, /* 2 */ |
7184 | {hdcs2020xb_InitialScale, hdcs2020xb_Initial}, /* 3 */ | 7442 | {gc0305_Initial, gc0305_InitialScale}, /* 3 */ |
7185 | {hv7131bxx_InitialScale, hv7131bxx_Initial}, /* 4 */ | 7443 | {hdcs2020xb_InitialScale, hdcs2020xb_Initial}, /* 4 */ |
7186 | {hv7131cxx_InitialScale, hv7131cxx_Initial}, /* 5 */ | 7444 | {hv7131bxx_InitialScale, hv7131bxx_Initial}, /* 5 */ |
7187 | {icm105axx_InitialScale, icm105axx_Initial}, /* 6 */ | 7445 | {hv7131cxx_InitialScale, hv7131cxx_Initial}, /* 6 */ |
7188 | {MC501CB_InitialScale, MC501CB_Initial}, /* 7 */ | 7446 | {icm105axx_InitialScale, icm105axx_Initial}, /* 7 */ |
7189 | {OV7620_mode0, OV7620_mode1}, /* 8 */ | 7447 | {MC501CB_InitialScale, MC501CB_Initial}, /* 8 */ |
7190 | {ov7630c_InitialScale, ov7630c_Initial}, /* 9 */ | 7448 | {OV7620_mode0, OV7620_mode1}, /* 9 */ |
7191 | {pas106b_InitialScale, pas106b_Initial}, /* 10 */ | 7449 | {ov7630c_InitialScale, ov7630c_Initial}, /* 10 */ |
7192 | {pas202b_Initial, pas202b_InitialScale}, /* 11 */ | 7450 | {pas106b_InitialScale, pas106b_Initial}, /* 11 */ |
7193 | {pb0330xx_InitialScale, pb0330xx_Initial}, /* 12 */ | 7451 | {pas202b_Initial, pas202b_InitialScale}, /* 12 */ |
7452 | {pb0330xx_InitialScale, pb0330xx_Initial}, /* 13 */ | ||
7194 | /* or {pb03303x_InitialScale, pb03303x_Initial}, */ | 7453 | /* or {pb03303x_InitialScale, pb03303x_Initial}, */ |
7195 | {PO2030_mode0, PO2030_mode1}, /* 13 */ | 7454 | {PO2030_mode0, PO2030_mode1}, /* 14 */ |
7196 | {tas5130CK_InitialScale, tas5130CK_Initial}, /* 14 */ | 7455 | {tas5130CK_InitialScale, tas5130CK_Initial}, /* 15 */ |
7197 | {tas5130cxx_InitialScale, tas5130cxx_Initial}, /* 15 */ | 7456 | {tas5130cxx_InitialScale, tas5130cxx_Initial}, /* 16 */ |
7198 | {tas5130c_vf0250_InitialScale, tas5130c_vf0250_Initial}, | 7457 | {tas5130c_vf0250_InitialScale, tas5130c_vf0250_Initial}, |
7199 | /* 16 */ | 7458 | /* 17 */ |
7200 | }; | 7459 | }; |
7201 | 7460 | ||
7202 | mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; | 7461 | mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; |
@@ -7225,11 +7484,12 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
7225 | usb_exchange(gspca_dev, zc3_init); | 7484 | usb_exchange(gspca_dev, zc3_init); |
7226 | 7485 | ||
7227 | switch (sd->sensor) { | 7486 | switch (sd->sensor) { |
7487 | case SENSOR_ADCM2700: | ||
7228 | case SENSOR_GC0305: | 7488 | case SENSOR_GC0305: |
7229 | case SENSOR_OV7620: | 7489 | case SENSOR_OV7620: |
7230 | case SENSOR_PO2030: | 7490 | case SENSOR_PO2030: |
7231 | case SENSOR_TAS5130C_VF0250: | 7491 | case SENSOR_TAS5130C_VF0250: |
7232 | msleep(100); /* ?? */ | 7492 | /* msleep(100); * ?? */ |
7233 | reg_r(gspca_dev, 0x0002); /* --> 0x40 */ | 7493 | reg_r(gspca_dev, 0x0002); /* --> 0x40 */ |
7234 | reg_w(dev, 0x09, 0x01ad); /* (from win traces) */ | 7494 | reg_w(dev, 0x09, 0x01ad); /* (from win traces) */ |
7235 | reg_w(dev, 0x15, 0x01ae); | 7495 | reg_w(dev, 0x15, 0x01ae); |
@@ -7242,6 +7502,7 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
7242 | setmatrix(gspca_dev); | 7502 | setmatrix(gspca_dev); |
7243 | setbrightness(gspca_dev); | 7503 | setbrightness(gspca_dev); |
7244 | switch (sd->sensor) { | 7504 | switch (sd->sensor) { |
7505 | case SENSOR_ADCM2700: | ||
7245 | case SENSOR_OV7620: | 7506 | case SENSOR_OV7620: |
7246 | reg_r(gspca_dev, 0x0008); | 7507 | reg_r(gspca_dev, 0x0008); |
7247 | reg_w(dev, 0x00, 0x0008); | 7508 | reg_w(dev, 0x00, 0x0008); |
@@ -7271,6 +7532,8 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
7271 | } | 7532 | } |
7272 | setmatrix(gspca_dev); /* one more time? */ | 7533 | setmatrix(gspca_dev); /* one more time? */ |
7273 | switch (sd->sensor) { | 7534 | switch (sd->sensor) { |
7535 | case SENSOR_ADCM2700: | ||
7536 | break; | ||
7274 | case SENSOR_OV7620: | 7537 | case SENSOR_OV7620: |
7275 | case SENSOR_PAS202B: | 7538 | case SENSOR_PAS202B: |
7276 | reg_r(gspca_dev, 0x0180); /* from win */ | 7539 | reg_r(gspca_dev, 0x0180); /* from win */ |
@@ -7283,6 +7546,13 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
7283 | setlightfreq(gspca_dev); | 7546 | setlightfreq(gspca_dev); |
7284 | 7547 | ||
7285 | switch (sd->sensor) { | 7548 | switch (sd->sensor) { |
7549 | case SENSOR_ADCM2700: | ||
7550 | reg_w(dev, 0x09, 0x01ad); /* (from win traces) */ | ||
7551 | reg_w(dev, 0x15, 0x01ae); | ||
7552 | reg_w(dev, 0x02, 0x0180); | ||
7553 | /* ms-win + */ | ||
7554 | reg_w(dev, 0x40, 0x0117); | ||
7555 | break; | ||
7286 | case SENSOR_GC0305: | 7556 | case SENSOR_GC0305: |
7287 | reg_w(dev, 0x09, 0x01ad); /* (from win traces) */ | 7557 | reg_w(dev, 0x09, 0x01ad); /* (from win traces) */ |
7288 | reg_w(dev, 0x15, 0x01ae); | 7558 | reg_w(dev, 0x15, 0x01ae); |