aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca
diff options
context:
space:
mode:
authorTheodore Kilgore <kilgota@banach.math.auburn.edu>2009-10-30 03:43:39 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:41:06 -0500
commit64f4d9a367b4fe329ba78e3171d1abb1338a951f (patch)
tree1ea9775ea1fb99dc4188e3d9cb00abf178a6bf6c /drivers/media/video/gspca
parent1160a3818ec387ddadfd173b3bceea654a474b74 (diff)
V4L/DVB (13245): gspca_mr97310a: Change blue gain setting for Sakar Digital VGA camera
gspca_mr97310a: Change blue gain setting for Sakar Digital VGA camera Signed-off-by: Theodore Kilgore <kilgota@banach.math.auburn.edu> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca')
-rw-r--r--drivers/media/video/gspca/mr97310a.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/drivers/media/video/gspca/mr97310a.c b/drivers/media/video/gspca/mr97310a.c
index b66169256dc4..a97061a9e44a 100644
--- a/drivers/media/video/gspca/mr97310a.c
+++ b/drivers/media/video/gspca/mr97310a.c
@@ -78,6 +78,7 @@ struct sd {
78 u8 cam_type; /* 0 is CIF and 1 is VGA */ 78 u8 cam_type; /* 0 is CIF and 1 is VGA */
79 u8 sensor_type; /* We use 0 and 1 here, too. */ 79 u8 sensor_type; /* We use 0 and 1 here, too. */
80 u8 do_lcd_stop; 80 u8 do_lcd_stop;
81 u8 adj_colors;
81 82
82 int brightness; 83 int brightness;
83 u16 exposure; 84 u16 exposure;
@@ -525,6 +526,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
525 526
526 sd->sensor_type = 1; 527 sd->sensor_type = 1;
527 sd->do_lcd_stop = 0; 528 sd->do_lcd_stop = 0;
529 sd->adj_colors = 0;
528 if ((gspca_dev->usb_buf[0] != 0x03) && 530 if ((gspca_dev->usb_buf[0] != 0x03) &&
529 (gspca_dev->usb_buf[0] != 0x04)) { 531 (gspca_dev->usb_buf[0] != 0x04)) {
530 PDEBUG(D_ERR, "Unknown VGA Sensor id Byte 0: %02x", 532 PDEBUG(D_ERR, "Unknown VGA Sensor id Byte 0: %02x",
@@ -532,6 +534,10 @@ static int sd_config(struct gspca_dev *gspca_dev,
532 PDEBUG(D_ERR, "Defaults assumed, may not work"); 534 PDEBUG(D_ERR, "Defaults assumed, may not work");
533 PDEBUG(D_ERR, "Please report this"); 535 PDEBUG(D_ERR, "Please report this");
534 } 536 }
537 /* Sakar Digital color needs to be adjusted. */
538 if ((gspca_dev->usb_buf[0] == 0x03) &&
539 (gspca_dev->usb_buf[1] == 0x50))
540 sd->adj_colors = 1;
535 if (gspca_dev->usb_buf[0] == 0x04) { 541 if (gspca_dev->usb_buf[0] == 0x04) {
536 sd->do_lcd_stop = 1; 542 sd->do_lcd_stop = 1;
537 switch (gspca_dev->usb_buf[1]) { 543 switch (gspca_dev->usb_buf[1]) {
@@ -759,9 +765,20 @@ static int start_vga_cam(struct gspca_dev *gspca_dev)
759 err_code = sensor_write_regs(gspca_dev, vga_sensor0_init_data, 765 err_code = sensor_write_regs(gspca_dev, vga_sensor0_init_data,
760 ARRAY_SIZE(vga_sensor0_init_data)); 766 ARRAY_SIZE(vga_sensor0_init_data));
761 } else { /* sd->sensor_type = 1 */ 767 } else { /* sd->sensor_type = 1 */
762 const struct sensor_w_data vga_sensor1_init_data[] = { 768 const struct sensor_w_data color_adj[] = {
769 {0x02, 0x00, {0x06, 0x59, 0x0c, 0x16, 0x00,
770 /* adjusted blue, green, red gain correct
771 too much blue from the Sakar Digital */
772 0x05, 0x01, 0x05}, 8}
773 };
774
775 const struct sensor_w_data color_no_adj[] = {
763 {0x02, 0x00, {0x06, 0x59, 0x0c, 0x16, 0x00, 776 {0x02, 0x00, {0x06, 0x59, 0x0c, 0x16, 0x00,
764 0x07, 0x00, 0x01}, 8}, 777 /* default blue, green, red gain settings */
778 0x07, 0x00, 0x01}, 8}
779 };
780
781 const struct sensor_w_data vga_sensor1_init_data[] = {
765 {0x11, 0x04, {0x01}, 1}, 782 {0x11, 0x04, {0x01}, 1},
766 /*{0x0a, 0x00, {0x00, 0x01, 0x00, 0x00, 0x01, */ 783 /*{0x0a, 0x00, {0x00, 0x01, 0x00, 0x00, 0x01, */
767 {0x0a, 0x00, {0x01, 0x06, 0x00, 0x00, 0x01, 784 {0x0a, 0x00, {0x01, 0x06, 0x00, 0x00, 0x01,
@@ -771,6 +788,17 @@ static int start_vga_cam(struct gspca_dev *gspca_dev)
771 {0x11, 0x04, {0x01}, 1}, 788 {0x11, 0x04, {0x01}, 1},
772 {0, 0, {0}, 0} 789 {0, 0, {0}, 0}
773 }; 790 };
791
792 if (sd->adj_colors)
793 err_code = sensor_write_regs(gspca_dev, color_adj,
794 ARRAY_SIZE(color_adj));
795 else
796 err_code = sensor_write_regs(gspca_dev, color_no_adj,
797 ARRAY_SIZE(color_no_adj));
798
799 if (err_code < 0)
800 return err_code;
801
774 err_code = sensor_write_regs(gspca_dev, vga_sensor1_init_data, 802 err_code = sensor_write_regs(gspca_dev, vga_sensor1_init_data,
775 ARRAY_SIZE(vga_sensor1_init_data)); 803 ARRAY_SIZE(vga_sensor1_init_data));
776 } 804 }