diff options
author | Hans de Goede <hdegoede@redhat.com> | 2010-02-01 05:48:17 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:11:08 -0500 |
commit | 4efcfa0af11d75fa6311ef62180eefcd654be3c1 (patch) | |
tree | 26fa32832c89356be9dd669a808777af0db7cc83 /drivers | |
parent | 9712a8be6b842ba9ffbd1b74a8d9b04c785b8ac1 (diff) |
V4L/DVB: gspca_sonixb: leave bridge gain at 1.0 when we have a sensor gain
Leave bridge gain at 1.0 when we have a sensor gain, while at it also
change the bridge gain setting code to write both registers in one go
saving us a usb transaction.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/gspca/sonixb.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/media/video/gspca/sonixb.c b/drivers/media/video/gspca/sonixb.c index 28843a6a6fea..4356423c6f99 100644 --- a/drivers/media/video/gspca/sonixb.c +++ b/drivers/media/video/gspca/sonixb.c | |||
@@ -347,7 +347,7 @@ static const __u8 initOv7630[] = { | |||
347 | }; | 347 | }; |
348 | static const __u8 initOv7630_3[] = { | 348 | static const __u8 initOv7630_3[] = { |
349 | 0x44, 0x44, 0x00, 0x1a, 0x20, 0x20, 0x20, 0x80, /* r01 .. r08 */ | 349 | 0x44, 0x44, 0x00, 0x1a, 0x20, 0x20, 0x20, 0x80, /* r01 .. r08 */ |
350 | 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, /* r09 .. r10 */ | 350 | 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* r09 .. r10 */ |
351 | 0x00, 0x02, 0x01, 0x0a, /* r11 .. r14 */ | 351 | 0x00, 0x02, 0x01, 0x0a, /* r11 .. r14 */ |
352 | 0x28, 0x1e, /* H & V sizes r15 .. r16 */ | 352 | 0x28, 0x1e, /* H & V sizes r15 .. r16 */ |
353 | 0x68, 0x8f, MCK_INIT1, /* r17 .. r19 */ | 353 | 0x68, 0x8f, MCK_INIT1, /* r17 .. r19 */ |
@@ -465,7 +465,7 @@ static const __u8 pas202_sensor_init[][8] = { | |||
465 | static const __u8 initTas5110c[] = { | 465 | static const __u8 initTas5110c[] = { |
466 | 0x44, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x11, 0x00, 0x00, 0x00, | 466 | 0x44, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x11, 0x00, 0x00, 0x00, |
467 | 0x00, 0x00, | 467 | 0x00, 0x00, |
468 | 0x00, 0x01, 0x00, 0x45, 0x09, 0x0a, | 468 | 0x00, 0x00, 0x00, 0x45, 0x09, 0x0a, |
469 | 0x16, 0x12, 0x60, 0x86, 0x2b, | 469 | 0x16, 0x12, 0x60, 0x86, 0x2b, |
470 | 0x14, 0x0a, 0x02, 0x02, 0x09, 0x07 | 470 | 0x14, 0x0a, 0x02, 0x02, 0x09, 0x07 |
471 | }; | 471 | }; |
@@ -473,7 +473,7 @@ static const __u8 initTas5110c[] = { | |||
473 | static const __u8 initTas5110d[] = { | 473 | static const __u8 initTas5110d[] = { |
474 | 0x44, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x11, 0x00, 0x00, 0x00, | 474 | 0x44, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x11, 0x00, 0x00, 0x00, |
475 | 0x00, 0x00, | 475 | 0x00, 0x00, |
476 | 0x00, 0x01, 0x00, 0x41, 0x09, 0x0a, | 476 | 0x00, 0x00, 0x00, 0x41, 0x09, 0x0a, |
477 | 0x16, 0x12, 0x60, 0x86, 0x2b, | 477 | 0x16, 0x12, 0x60, 0x86, 0x2b, |
478 | 0x14, 0x0a, 0x02, 0x02, 0x09, 0x07 | 478 | 0x14, 0x0a, 0x02, 0x02, 0x09, 0x07 |
479 | }; | 479 | }; |
@@ -486,7 +486,7 @@ static const __u8 tas5110_sensor_init[][8] = { | |||
486 | static const __u8 initTas5130[] = { | 486 | static const __u8 initTas5130[] = { |
487 | 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x11, 0x00, 0x00, 0x00, | 487 | 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x11, 0x00, 0x00, 0x00, |
488 | 0x00, 0x00, | 488 | 0x00, 0x00, |
489 | 0x00, 0x01, 0x00, 0x68, 0x0c, 0x0a, | 489 | 0x00, 0x00, 0x00, 0x68, 0x0c, 0x0a, |
490 | 0x28, 0x1e, 0x60, COMP, MCK_INIT, | 490 | 0x28, 0x1e, 0x60, COMP, MCK_INIT, |
491 | 0x18, 0x10, 0x04, 0x03, 0x11, 0x0c | 491 | 0x18, 0x10, 0x04, 0x03, 0x11, 0x0c |
492 | }; | 492 | }; |
@@ -697,19 +697,21 @@ static void setgain(struct gspca_dev *gspca_dev) | |||
697 | { | 697 | { |
698 | struct sd *sd = (struct sd *) gspca_dev; | 698 | struct sd *sd = (struct sd *) gspca_dev; |
699 | __u8 gain; | 699 | __u8 gain; |
700 | __u8 rgb_value; | 700 | __u8 buf[2] = { 0, 0 }; |
701 | |||
702 | if (sensor_data[sd->sensor].flags & F_GAIN) { | ||
703 | /* Use the sensor gain to do the actual gain */ | ||
704 | setsensorgain(gspca_dev); | ||
705 | return; | ||
706 | } | ||
701 | 707 | ||
702 | gain = sd->gain >> 4; | 708 | gain = sd->gain >> 4; |
703 | 709 | ||
704 | /* red and blue gain */ | 710 | /* red and blue gain */ |
705 | rgb_value = gain << 4 | gain; | 711 | buf[0] = gain << 4 | gain; |
706 | reg_w(gspca_dev, 0x10, &rgb_value, 1); | ||
707 | /* green gain */ | 712 | /* green gain */ |
708 | rgb_value = gain; | 713 | buf[1] = gain; |
709 | reg_w(gspca_dev, 0x11, &rgb_value, 1); | 714 | reg_w(gspca_dev, 0x10, buf, 2); |
710 | |||
711 | if (sensor_data[sd->sensor].flags & F_GAIN) | ||
712 | setsensorgain(gspca_dev); | ||
713 | } | 715 | } |
714 | 716 | ||
715 | static void setexposure(struct gspca_dev *gspca_dev) | 717 | static void setexposure(struct gspca_dev *gspca_dev) |