aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-06-14 05:25:06 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-23 02:11:49 -0400
commit9e4d82588174e68abe8e3568202f0b530415661f (patch)
tree191dc3d223ea2a0a3d538ef402fcee0cf0d7c12e /drivers/media
parent92918a53ee74bb326430aaa958caa0cf111b54b1 (diff)
V4L/DVB (12076): gspca_ov519: Fix led inversion with some cams
My ov519 cam has it led inverted, the same has been reported on the ov51x-jpeg list for another creative cam. This patch fixes this without changing the behaviour for other cams. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/gspca/ov519.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c
index c2982137dc21..c2c087222f17 100644
--- a/drivers/media/video/gspca/ov519.c
+++ b/drivers/media/video/gspca/ov519.c
@@ -58,6 +58,10 @@ struct sd {
58#define BRIDGE_OV518 2 58#define BRIDGE_OV518 2
59#define BRIDGE_OV518PLUS 3 59#define BRIDGE_OV518PLUS 3
60#define BRIDGE_OV519 4 60#define BRIDGE_OV519 4
61#define BRIDGE_MASK 7
62
63 char invert_led;
64#define BRIDGE_INVERT_LED 8
61 65
62 /* Determined by sensor type */ 66 /* Determined by sensor type */
63 __u8 sif; 67 __u8 sif;
@@ -1468,6 +1472,9 @@ static int ov6xx0_configure(struct sd *sd)
1468/* Turns on or off the LED. Only has an effect with OV511+/OV518(+)/OV519 */ 1472/* Turns on or off the LED. Only has an effect with OV511+/OV518(+)/OV519 */
1469static void ov51x_led_control(struct sd *sd, int on) 1473static void ov51x_led_control(struct sd *sd, int on)
1470{ 1474{
1475 if (sd->invert_led)
1476 on = !on;
1477
1471 switch (sd->bridge) { 1478 switch (sd->bridge) {
1472 /* OV511 has no LED control */ 1479 /* OV511 has no LED control */
1473 case BRIDGE_OV511PLUS: 1480 case BRIDGE_OV511PLUS:
@@ -1650,7 +1657,8 @@ static int sd_config(struct gspca_dev *gspca_dev,
1650 struct cam *cam; 1657 struct cam *cam;
1651 int ret = 0; 1658 int ret = 0;
1652 1659
1653 sd->bridge = id->driver_info; 1660 sd->bridge = id->driver_info & BRIDGE_MASK;
1661 sd->invert_led = id->driver_info & BRIDGE_INVERT_LED;
1654 1662
1655 switch (sd->bridge) { 1663 switch (sd->bridge) {
1656 case BRIDGE_OV518: 1664 case BRIDGE_OV518:
@@ -2840,8 +2848,10 @@ static const __devinitdata struct usb_device_id device_table[] = {
2840 {USB_DEVICE(0x041e, 0x405f), .driver_info = BRIDGE_OV519 }, 2848 {USB_DEVICE(0x041e, 0x405f), .driver_info = BRIDGE_OV519 },
2841 {USB_DEVICE(0x041e, 0x4060), .driver_info = BRIDGE_OV519 }, 2849 {USB_DEVICE(0x041e, 0x4060), .driver_info = BRIDGE_OV519 },
2842 {USB_DEVICE(0x041e, 0x4061), .driver_info = BRIDGE_OV519 }, 2850 {USB_DEVICE(0x041e, 0x4061), .driver_info = BRIDGE_OV519 },
2843 {USB_DEVICE(0x041e, 0x4064), .driver_info = BRIDGE_OV519 }, 2851 {USB_DEVICE(0x041e, 0x4064),
2844 {USB_DEVICE(0x041e, 0x4068), .driver_info = BRIDGE_OV519 }, 2852 .driver_info = BRIDGE_OV519 | BRIDGE_INVERT_LED },
2853 {USB_DEVICE(0x041e, 0x4068),
2854 .driver_info = BRIDGE_OV519 | BRIDGE_INVERT_LED },
2845 {USB_DEVICE(0x045e, 0x028c), .driver_info = BRIDGE_OV519 }, 2855 {USB_DEVICE(0x045e, 0x028c), .driver_info = BRIDGE_OV519 },
2846 {USB_DEVICE(0x054c, 0x0154), .driver_info = BRIDGE_OV519 }, 2856 {USB_DEVICE(0x054c, 0x0154), .driver_info = BRIDGE_OV519 },
2847 {USB_DEVICE(0x054c, 0x0155), .driver_info = BRIDGE_OV519 }, 2857 {USB_DEVICE(0x054c, 0x0155), .driver_info = BRIDGE_OV519 },