diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2009-01-26 03:29:06 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:34 -0400 |
commit | c675e79c917c02a54f54fcac3776ccf0b428bd37 (patch) | |
tree | 71839f008efa80987d8b49afde8e012a4a334083 | |
parent | db91235ee8350149213435c4cf178a7627c968b9 (diff) |
V4L/DVB (10389): gspca - zc3xx: Do work the sensor adcm2700.
The lack of the green color is fixed by sensor sequences closer to the
ms-win traces.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/gspca/zc3xx.c | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c index fff95e69cd14..e6a6cb946a21 100644 --- a/drivers/media/video/gspca/zc3xx.c +++ b/drivers/media/video/gspca/zc3xx.c | |||
@@ -210,7 +210,7 @@ struct usb_action { | |||
210 | static const struct usb_action adcm2700_Initial[] = { | 210 | static const struct usb_action adcm2700_Initial[] = { |
211 | {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */ | 211 | {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */ |
212 | {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT}, /* 00,02,04,cc */ | 212 | {0xa0, 0x04, ZC3XX_R002_CLOCKSELECT}, /* 00,02,04,cc */ |
213 | {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */ | 213 | {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */ |
214 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | 214 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ |
215 | {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */ | 215 | {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */ |
216 | {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */ | 216 | {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */ |
@@ -230,7 +230,7 @@ static const struct usb_action adcm2700_Initial[] = { | |||
230 | {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */ | 230 | {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */ |
231 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | 231 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ |
232 | {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */ | 232 | {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */ |
233 | {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */ | 233 | {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */ |
234 | {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */ | 234 | {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */ |
235 | {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */ | 235 | {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */ |
236 | {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */ | 236 | {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */ |
@@ -269,6 +269,15 @@ static const struct usb_action adcm2700_Initial[] = { | |||
269 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | 269 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ |
270 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | 270 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ |
271 | {0xaa, 0xfe, 0x0020}, /* 00,fe,20,aa */ | 271 | {0xaa, 0xfe, 0x0020}, /* 00,fe,20,aa */ |
272 | /*mswin+*/ | ||
273 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, | ||
274 | {0xaa, 0xfe, 0x0002}, | ||
275 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, | ||
276 | {0xaa, 0xb4, 0xcd37}, | ||
277 | {0xaa, 0xa4, 0x0004}, | ||
278 | {0xaa, 0xa8, 0x0007}, | ||
279 | {0xaa, 0xac, 0x0004}, | ||
280 | /*mswin-*/ | ||
272 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | 281 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ |
273 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | 282 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ |
274 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | 283 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ |
@@ -290,7 +299,7 @@ static const struct usb_action adcm2700_Initial[] = { | |||
290 | static const struct usb_action adcm2700_InitialScale[] = { | 299 | static const struct usb_action adcm2700_InitialScale[] = { |
291 | {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */ | 300 | {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, /* 00,00,01,cc */ |
292 | {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */ | 301 | {0xa0, 0x10, ZC3XX_R002_CLOCKSELECT}, /* 00,02,10,cc */ |
293 | {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */ | 302 | {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, /* 00,08,03,cc */ |
294 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ | 303 | {0xa0, 0x0a, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,0a,cc */ |
295 | {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */ | 304 | {0xa0, 0xd3, ZC3XX_R08B_I2CDEVICEADDR}, /* 00,8b,d3,cc */ |
296 | {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */ | 305 | {0xa0, 0x02, ZC3XX_R003_FRAMEWIDTHHIGH}, /* 00,03,02,cc */ |
@@ -310,7 +319,7 @@ static const struct usb_action adcm2700_InitialScale[] = { | |||
310 | {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */ | 319 | {0xbb, 0x00, 0x0400}, /* 04,00,00,bb */ |
311 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | 320 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ |
312 | {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */ | 321 | {0xbb, 0x0f, 0x140f}, /* 14,0f,0f,bb */ |
313 | {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */ | 322 | {0xa0, 0xb7, ZC3XX_R101_SENSORCORRECTION}, /* 01,01,37,cc */ |
314 | {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */ | 323 | {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* 01,00,0d,cc */ |
315 | {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */ | 324 | {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* 01,89,06,cc */ |
316 | {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */ | 325 | {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* 01,c5,03,cc */ |
@@ -338,9 +347,9 @@ static const struct usb_action adcm2700_InitialScale[] = { | |||
338 | {0xbb, 0x5f, 0x2090}, /* 20,5f,90,bb */ | 347 | {0xbb, 0x5f, 0x2090}, /* 20,5f,90,bb */ |
339 | {0xbb, 0x01, 0x8000}, /* 80,01,00,bb */ | 348 | {0xbb, 0x01, 0x8000}, /* 80,01,00,bb */ |
340 | {0xbb, 0x09, 0x8400}, /* 84,09,00,bb */ | 349 | {0xbb, 0x09, 0x8400}, /* 84,09,00,bb */ |
341 | {0xbb, 0x88, 0x0002}, /* 00,88,02,bb */ | 350 | {0xbb, 0x86, 0x0002}, /* 00,88,02,bb */ |
342 | {0xbb, 0xe6, 0x0401}, /* 04,e6,01,bb */ | 351 | {0xbb, 0xe6, 0x0401}, /* 04,e6,01,bb */ |
343 | {0xbb, 0x88, 0x0802}, /* 08,88,02,bb */ | 352 | {0xbb, 0x86, 0x0802}, /* 08,88,02,bb */ |
344 | {0xbb, 0xe6, 0x0c01}, /* 0c,e6,01,bb */ | 353 | {0xbb, 0xe6, 0x0c01}, /* 0c,e6,01,bb */ |
345 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ | 354 | {0xa0, 0x01, ZC3XX_R010_CMOSSENSORSELECT}, /* 00,10,01,cc */ |
346 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ | 355 | {0xdd, 0x00, 0x0010}, /* 00,00,10,dd */ |
@@ -6354,7 +6363,9 @@ static void setmatrix(struct gspca_dev *gspca_dev) | |||
6354 | int i; | 6363 | int i; |
6355 | const __u8 *matrix; | 6364 | const __u8 *matrix; |
6356 | static const u8 adcm2700_matrix[9] = | 6365 | static const u8 adcm2700_matrix[9] = |
6357 | {0x66, 0xed, 0xed, 0xed, 0x66, 0xed, 0xed, 0xed, 0x66}; | 6366 | /* {0x66, 0xed, 0xed, 0xed, 0x66, 0xed, 0xed, 0xed, 0x66}; */ |
6367 | /*ms-win*/ | ||
6368 | {0x74, 0xed, 0xed, 0xed, 0x74, 0xed, 0xed, 0xed, 0x74}; | ||
6358 | static const __u8 gc0305_matrix[9] = | 6369 | static const __u8 gc0305_matrix[9] = |
6359 | {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50}; | 6370 | {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50}; |
6360 | static const __u8 ov7620_matrix[9] = | 6371 | static const __u8 ov7620_matrix[9] = |
@@ -6399,7 +6410,6 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
6399 | __u8 brightness; | 6410 | __u8 brightness; |
6400 | 6411 | ||
6401 | switch (sd->sensor) { | 6412 | switch (sd->sensor) { |
6402 | case SENSOR_ADCM2700: | ||
6403 | case SENSOR_GC0305: | 6413 | case SENSOR_GC0305: |
6404 | case SENSOR_OV7620: | 6414 | case SENSOR_OV7620: |
6405 | case SENSOR_PO2030: | 6415 | case SENSOR_PO2030: |
@@ -6408,8 +6418,11 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
6408 | /*fixme: is it really write to 011d and 018d for all other sensors? */ | 6418 | /*fixme: is it really write to 011d and 018d for all other sensors? */ |
6409 | brightness = sd->brightness; | 6419 | brightness = sd->brightness; |
6410 | reg_w(gspca_dev->dev, brightness, 0x011d); | 6420 | reg_w(gspca_dev->dev, brightness, 0x011d); |
6411 | if (sd->sensor == SENSOR_HV7131B) | 6421 | switch (sd->sensor) { |
6422 | case SENSOR_ADCM2700: | ||
6423 | case SENSOR_HV7131B: | ||
6412 | return; | 6424 | return; |
6425 | } | ||
6413 | if (brightness < 0x70) | 6426 | if (brightness < 0x70) |
6414 | brightness += 0x10; | 6427 | brightness += 0x10; |
6415 | else | 6428 | else |
@@ -6549,6 +6562,7 @@ static void setquality(struct gspca_dev *gspca_dev) | |||
6549 | __u8 frxt; | 6562 | __u8 frxt; |
6550 | 6563 | ||
6551 | switch (sd->sensor) { | 6564 | switch (sd->sensor) { |
6565 | case SENSOR_ADCM2700: | ||
6552 | case SENSOR_GC0305: | 6566 | case SENSOR_GC0305: |
6553 | case SENSOR_HV7131B: | 6567 | case SENSOR_HV7131B: |
6554 | case SENSOR_OV7620: | 6568 | case SENSOR_OV7620: |
@@ -7295,8 +7309,6 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
7295 | } | 7309 | } |
7296 | setmatrix(gspca_dev); /* one more time? */ | 7310 | setmatrix(gspca_dev); /* one more time? */ |
7297 | switch (sd->sensor) { | 7311 | switch (sd->sensor) { |
7298 | case SENSOR_ADCM2700: | ||
7299 | break; | ||
7300 | case SENSOR_OV7620: | 7312 | case SENSOR_OV7620: |
7301 | case SENSOR_PAS202B: | 7313 | case SENSOR_PAS202B: |
7302 | reg_r(gspca_dev, 0x0180); /* from win */ | 7314 | reg_r(gspca_dev, 0x0180); /* from win */ |
@@ -7338,19 +7350,16 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
7338 | 7350 | ||
7339 | setautogain(gspca_dev); | 7351 | setautogain(gspca_dev); |
7340 | switch (sd->sensor) { | 7352 | switch (sd->sensor) { |
7341 | case SENSOR_PAS202B: | ||
7342 | reg_w(dev, 0x00, 0x0007); /* (from win traces) */ | ||
7343 | break; | ||
7344 | case SENSOR_PO2030: | 7353 | case SENSOR_PO2030: |
7345 | msleep(500); | 7354 | msleep(500); |
7346 | reg_r(gspca_dev, 0x0008); | 7355 | reg_r(gspca_dev, 0x0008); |
7347 | reg_r(gspca_dev, 0x0007); | 7356 | reg_r(gspca_dev, 0x0007); |
7357 | /*fall thru*/ | ||
7358 | case SENSOR_PAS202B: | ||
7348 | reg_w(dev, 0x00, 0x0007); /* (from win traces) */ | 7359 | reg_w(dev, 0x00, 0x0007); /* (from win traces) */ |
7349 | reg_w(dev, 0x02, 0x0008); | 7360 | reg_w(dev, 0x02, ZC3XX_R008_CLOCKSETTING); |
7350 | break; | 7361 | break; |
7351 | } | 7362 | } |
7352 | if (sd->sensor == SENSOR_PAS202B) | ||
7353 | reg_w(dev, 0x02, ZC3XX_R008_CLOCKSETTING); | ||
7354 | return 0; | 7363 | return 0; |
7355 | } | 7364 | } |
7356 | 7365 | ||