aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJean-François Moine <moinejf@free.fr>2012-03-24 08:33:42 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-03 14:29:56 -0400
commita1ac5dc28d2b4ca78e183229f7c595ffd725241c (patch)
treeb8e450fe325c688b36fb0e226972c10a0af0e7f9 /drivers
parent4fb8137c43ebc0f5bc0dde6b64faa9dd1b1d7970 (diff)
[media] gspca - sn9c20x: Change the exposure setting of Omnivision sensors
The exposure of Omnivision sensors is defined by the registers 07, 10 and 04. This patch updates the registers 10 and 04 before using the registers 2d and 2e (dummy lines). Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/gspca/sn9c20x.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c
index da2904a891aa..5285a519c1f3 100644
--- a/drivers/media/video/gspca/sn9c20x.c
+++ b/drivers/media/video/gspca/sn9c20x.c
@@ -874,8 +874,8 @@ static const struct i2c_reg_u8 ov7660_init[] = {
874 0x10, 0x61 and sd->hstart, vstart = 3, fixes ugly colored borders */ 874 0x10, 0x61 and sd->hstart, vstart = 3, fixes ugly colored borders */
875 {0x17, 0x10}, {0x18, 0x61}, 875 {0x17, 0x10}, {0x18, 0x61},
876 {0x37, 0x0f}, {0x38, 0x02}, {0x39, 0x43}, 876 {0x37, 0x0f}, {0x38, 0x02}, {0x39, 0x43},
877 {0x3a, 0x00}, {0x69, 0x90}, {0x2d, 0xf6}, 877 {0x3a, 0x00}, {0x69, 0x90}, {0x2d, 0x00},
878 {0x2e, 0x0b}, {0x01, 0x78}, {0x02, 0x50}, 878 {0x2e, 0x00}, {0x01, 0x78}, {0x02, 0x50},
879}; 879};
880 880
881static const struct i2c_reg_u8 ov7670_init[] = { 881static const struct i2c_reg_u8 ov7670_init[] = {
@@ -1645,7 +1645,7 @@ static void set_exposure(struct gspca_dev *gspca_dev)
1645 struct sd *sd = (struct sd *) gspca_dev; 1645 struct sd *sd = (struct sd *) gspca_dev;
1646 u8 exp[8] = {sd->i2c_intf, sd->i2c_addr, 1646 u8 exp[8] = {sd->i2c_intf, sd->i2c_addr,
1647 0x00, 0x00, 0x00, 0x00, 0x00, 0x10}; 1647 0x00, 0x00, 0x00, 0x00, 0x00, 0x10};
1648 int expo; 1648 int expo, expo2;
1649 1649
1650 if (gspca_dev->streaming) 1650 if (gspca_dev->streaming)
1651 exp[7] = 0x1e; 1651 exp[7] = 0x1e;
@@ -1656,8 +1656,23 @@ static void set_exposure(struct gspca_dev *gspca_dev)
1656 case SENSOR_OV7670: 1656 case SENSOR_OV7670:
1657 case SENSOR_OV9655: 1657 case SENSOR_OV9655:
1658 case SENSOR_OV9650: 1658 case SENSOR_OV9650:
1659 if (expo > 547)
1660 expo2 = 547;
1661 else
1662 expo2 = expo;
1663 exp[0] |= (2 << 4);
1664 exp[2] = 0x10; /* AECH */
1665 exp[3] = expo2 >> 2;
1666 exp[7] = 0x10;
1667 i2c_w(gspca_dev, exp);
1668 exp[2] = 0x04; /* COM1 */
1669 exp[3] = expo2 & 0x0003;
1670 exp[7] = 0x10;
1671 i2c_w(gspca_dev, exp);
1672 expo -= expo2;
1673 exp[7] = 0x1e;
1659 exp[0] |= (3 << 4); 1674 exp[0] |= (3 << 4);
1660 exp[2] = 0x2d; 1675 exp[2] = 0x2d; /* ADVFL & ADVFH */
1661 exp[3] = expo; 1676 exp[3] = expo;
1662 exp[4] = expo >> 8; 1677 exp[4] = expo >> 8;
1663 break; 1678 break;