aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-02-16 06:17:36 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-21 19:32:10 -0400
commit779b51f7a5ec0e95dcc3690cd68c2631a971a65e (patch)
tree3e55e2ee5d8ab07c81be6edffb57f66b8e0a232d /drivers
parent8bc50f354047f4afb31fc85f0efb6bfe28ce9e57 (diff)
[media] gspca_sn9c20x: Add hflip and vflip controls for the ov7660 sensor
Tested with a camera with usb-id: 0c45:62bb Also enable dmi based flopped laptop detection for the 0c45:627b ov7660 model. Some of the MSI laptops with upside down camera have this one instead of the 0c45:624f. 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/sn9c20x.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c
index 40e316ac3951..ccc89c113bad 100644
--- a/drivers/media/video/gspca/sn9c20x.c
+++ b/drivers/media/video/gspca/sn9c20x.c
@@ -1335,8 +1335,6 @@ static int ov7660_init_sensor(struct gspca_dev *gspca_dev)
1335 return -ENODEV; 1335 return -ENODEV;
1336 } 1336 }
1337 } 1337 }
1338 /* disable hflip and vflip */
1339 gspca_dev->ctrl_dis = (1 << HFLIP_IDX) | (1 << VFLIP_IDX);
1340 sd->hstart = 3; 1338 sd->hstart = 3;
1341 sd->vstart = 3; 1339 sd->vstart = 3;
1342 return 0; 1340 return 0;
@@ -1611,6 +1609,18 @@ static int set_hvflip(struct gspca_dev *gspca_dev)
1611 } 1609 }
1612 1610
1613 switch (sd->sensor) { 1611 switch (sd->sensor) {
1612 case SENSOR_OV7660:
1613 value = 0x01;
1614 if (hflip)
1615 value |= 0x20;
1616 if (vflip) {
1617 value |= 0x10;
1618 sd->vstart = 2;
1619 } else
1620 sd->vstart = 3;
1621 reg_w1(gspca_dev, 0x1182, sd->vstart);
1622 i2c_w1(gspca_dev, 0x1e, value);
1623 break;
1614 case SENSOR_OV9650: 1624 case SENSOR_OV9650:
1615 i2c_r1(gspca_dev, 0x1e, &value); 1625 i2c_r1(gspca_dev, 0x1e, &value);
1616 value &= ~0x30; 1626 value &= ~0x30;
@@ -2485,7 +2495,7 @@ static const struct usb_device_id device_table[] = {
2485 {USB_DEVICE(0x0c45, 0x6253), SN9C20X(OV9650, 0x30, 0)}, 2495 {USB_DEVICE(0x0c45, 0x6253), SN9C20X(OV9650, 0x30, 0)},
2486 {USB_DEVICE(0x0c45, 0x6260), SN9C20X(OV7670, 0x21, 0)}, 2496 {USB_DEVICE(0x0c45, 0x6260), SN9C20X(OV7670, 0x21, 0)},
2487 {USB_DEVICE(0x0c45, 0x6270), SN9C20X(MT9VPRB, 0x00, 0)}, 2497 {USB_DEVICE(0x0c45, 0x6270), SN9C20X(MT9VPRB, 0x00, 0)},
2488 {USB_DEVICE(0x0c45, 0x627b), SN9C20X(OV7660, 0x21, 0)}, 2498 {USB_DEVICE(0x0c45, 0x627b), SN9C20X(OV7660, 0x21, FLIP_DETECT)},
2489 {USB_DEVICE(0x0c45, 0x627c), SN9C20X(HV7131R, 0x11, 0)}, 2499 {USB_DEVICE(0x0c45, 0x627c), SN9C20X(HV7131R, 0x11, 0)},
2490 {USB_DEVICE(0x0c45, 0x627f), SN9C20X(OV9650, 0x30, 0)}, 2500 {USB_DEVICE(0x0c45, 0x627f), SN9C20X(OV9650, 0x30, 0)},
2491 {USB_DEVICE(0x0c45, 0x6280), SN9C20X(MT9M001, 0x5d, 0)}, 2501 {USB_DEVICE(0x0c45, 0x6280), SN9C20X(MT9M001, 0x5d, 0)},