diff options
author | Brian Johnson <brijohn@gmail.com> | 2010-04-18 20:42:40 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 11:59:00 -0400 |
commit | 33ddc16f1003fc13d57ebe5061b29e16e6f84848 (patch) | |
tree | c892df38e7f581365932051a3281f03311a61e93 /drivers/media | |
parent | 5d26ed9102404dec1b9ae3ea3ad3832fe6330f0f (diff) |
V4L/DVB: gspca - sn9c20x: HAS_BUTTON flag -> HAS_NO_BUTTON flag
Reverse HAS_BUTTON logic since most webcams either have a button or if
they don't don't bother to send any interrupts. However I have at least
one model that appears to leave the button GPIO floating and can send
a bogus interrupt.
Signed-off-by: Brian Johnson <brijohn@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/gspca/sn9c20x.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c index ccc34fd76196..dad5ddeb7ff3 100644 --- a/drivers/media/video/gspca/sn9c20x.c +++ b/drivers/media/video/gspca/sn9c20x.c | |||
@@ -55,7 +55,7 @@ MODULE_LICENSE("GPL"); | |||
55 | #define SENSOR_MT9VPRB 20 | 55 | #define SENSOR_MT9VPRB 20 |
56 | 56 | ||
57 | /* camera flags */ | 57 | /* camera flags */ |
58 | #define HAS_BUTTON 0x1 | 58 | #define HAS_NO_BUTTON 0x1 |
59 | #define LED_REVERSE 0x2 /* some cameras unset gpio to turn on leds */ | 59 | #define LED_REVERSE 0x2 /* some cameras unset gpio to turn on leds */ |
60 | #define FLIP_DETECT 0x4 | 60 | #define FLIP_DETECT 0x4 |
61 | 61 | ||
@@ -2340,7 +2340,7 @@ static int sd_int_pkt_scan(struct gspca_dev *gspca_dev, | |||
2340 | { | 2340 | { |
2341 | struct sd *sd = (struct sd *) gspca_dev; | 2341 | struct sd *sd = (struct sd *) gspca_dev; |
2342 | int ret = -EINVAL; | 2342 | int ret = -EINVAL; |
2343 | if (sd->flags & HAS_BUTTON && len == 1) { | 2343 | if (!(sd->flags & HAS_NO_BUTTON) && len == 1) { |
2344 | input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1); | 2344 | input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1); |
2345 | input_sync(gspca_dev->input_dev); | 2345 | input_sync(gspca_dev->input_dev); |
2346 | input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0); | 2346 | input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0); |
@@ -2438,9 +2438,9 @@ static const __devinitdata struct usb_device_id device_table[] = { | |||
2438 | {USB_DEVICE(0x0c45, 0x6242), SN9C20X(MT9M111, 0x5d, 0)}, | 2438 | {USB_DEVICE(0x0c45, 0x6242), SN9C20X(MT9M111, 0x5d, 0)}, |
2439 | {USB_DEVICE(0x0c45, 0x6248), SN9C20X(OV9655, 0x30, 0)}, | 2439 | {USB_DEVICE(0x0c45, 0x6248), SN9C20X(OV9655, 0x30, 0)}, |
2440 | {USB_DEVICE(0x0c45, 0x624c), SN9C20X(MT9M112, 0x5d, 0)}, | 2440 | {USB_DEVICE(0x0c45, 0x624c), SN9C20X(MT9M112, 0x5d, 0)}, |
2441 | {USB_DEVICE(0x0c45, 0x624e), SN9C20X(SOI968, 0x30, | 2441 | {USB_DEVICE(0x0c45, 0x624e), SN9C20X(SOI968, 0x30, LED_REVERSE)}, |
2442 | (HAS_BUTTON | LED_REVERSE))}, | 2442 | {USB_DEVICE(0x0c45, 0x624f), SN9C20X(OV9650, 0x30, |
2443 | {USB_DEVICE(0x0c45, 0x624f), SN9C20X(OV9650, 0x30, FLIP_DETECT)}, | 2443 | (FLIP_DETECT | HAS_NO_BUTTON))}, |
2444 | {USB_DEVICE(0x0c45, 0x6251), SN9C20X(OV9650, 0x30, 0)}, | 2444 | {USB_DEVICE(0x0c45, 0x6251), SN9C20X(OV9650, 0x30, 0)}, |
2445 | {USB_DEVICE(0x0c45, 0x6253), SN9C20X(OV9650, 0x30, 0)}, | 2445 | {USB_DEVICE(0x0c45, 0x6253), SN9C20X(OV9650, 0x30, 0)}, |
2446 | {USB_DEVICE(0x0c45, 0x6260), SN9C20X(OV7670, 0x21, 0)}, | 2446 | {USB_DEVICE(0x0c45, 0x6260), SN9C20X(OV7670, 0x21, 0)}, |
@@ -2450,14 +2450,14 @@ static const __devinitdata struct usb_device_id device_table[] = { | |||
2450 | {USB_DEVICE(0x0c45, 0x627f), SN9C20X(OV9650, 0x30, 0)}, | 2450 | {USB_DEVICE(0x0c45, 0x627f), SN9C20X(OV9650, 0x30, 0)}, |
2451 | {USB_DEVICE(0x0c45, 0x6280), SN9C20X(MT9M001, 0x5d, 0)}, | 2451 | {USB_DEVICE(0x0c45, 0x6280), SN9C20X(MT9M001, 0x5d, 0)}, |
2452 | {USB_DEVICE(0x0c45, 0x6282), SN9C20X(MT9M111, 0x5d, 0)}, | 2452 | {USB_DEVICE(0x0c45, 0x6282), SN9C20X(MT9M111, 0x5d, 0)}, |
2453 | {USB_DEVICE(0x0c45, 0x6288), SN9C20X(OV9655, 0x30, HAS_BUTTON)}, | 2453 | {USB_DEVICE(0x0c45, 0x6288), SN9C20X(OV9655, 0x30, 0)}, |
2454 | {USB_DEVICE(0x0c45, 0x628c), SN9C20X(MT9M112, 0x5d, 0)}, | 2454 | {USB_DEVICE(0x0c45, 0x628c), SN9C20X(MT9M112, 0x5d, 0)}, |
2455 | {USB_DEVICE(0x0c45, 0x628e), SN9C20X(SOI968, 0x30, 0)}, | 2455 | {USB_DEVICE(0x0c45, 0x628e), SN9C20X(SOI968, 0x30, 0)}, |
2456 | {USB_DEVICE(0x0c45, 0x628f), SN9C20X(OV9650, 0x30, 0)}, | 2456 | {USB_DEVICE(0x0c45, 0x628f), SN9C20X(OV9650, 0x30, 0)}, |
2457 | {USB_DEVICE(0x0c45, 0x62a0), SN9C20X(OV7670, 0x21, 0)}, | 2457 | {USB_DEVICE(0x0c45, 0x62a0), SN9C20X(OV7670, 0x21, 0)}, |
2458 | {USB_DEVICE(0x0c45, 0x62b0), SN9C20X(MT9VPRB, 0x00, 0)}, | 2458 | {USB_DEVICE(0x0c45, 0x62b0), SN9C20X(MT9VPRB, 0x00, 0)}, |
2459 | {USB_DEVICE(0x0c45, 0x62b3), SN9C20X(OV9655, 0x30, 0)}, | 2459 | {USB_DEVICE(0x0c45, 0x62b3), SN9C20X(OV9655, 0x30, 0)}, |
2460 | {USB_DEVICE(0x0c45, 0x62bb), SN9C20X(OV7660, 0x21, HAS_BUTTON)}, | 2460 | {USB_DEVICE(0x0c45, 0x62bb), SN9C20X(OV7660, 0x21, 0)}, |
2461 | {USB_DEVICE(0x0c45, 0x62bc), SN9C20X(HV7131R, 0x11, 0)}, | 2461 | {USB_DEVICE(0x0c45, 0x62bc), SN9C20X(HV7131R, 0x11, 0)}, |
2462 | {USB_DEVICE(0x045e, 0x00f4), SN9C20X(OV9650, 0x30, 0)}, | 2462 | {USB_DEVICE(0x045e, 0x00f4), SN9C20X(OV9650, 0x30, 0)}, |
2463 | {USB_DEVICE(0x145f, 0x013d), SN9C20X(OV7660, 0x21, 0)}, | 2463 | {USB_DEVICE(0x145f, 0x013d), SN9C20X(OV7660, 0x21, 0)}, |
@@ -2468,7 +2468,7 @@ static const __devinitdata struct usb_device_id device_table[] = { | |||
2468 | {USB_DEVICE(0xa168, 0x0611), SN9C20X(HV7131R, 0x11, 0)}, | 2468 | {USB_DEVICE(0xa168, 0x0611), SN9C20X(HV7131R, 0x11, 0)}, |
2469 | {USB_DEVICE(0xa168, 0x0613), SN9C20X(HV7131R, 0x11, 0)}, | 2469 | {USB_DEVICE(0xa168, 0x0613), SN9C20X(HV7131R, 0x11, 0)}, |
2470 | {USB_DEVICE(0xa168, 0x0618), SN9C20X(HV7131R, 0x11, 0)}, | 2470 | {USB_DEVICE(0xa168, 0x0618), SN9C20X(HV7131R, 0x11, 0)}, |
2471 | {USB_DEVICE(0xa168, 0x0614), SN9C20X(MT9M111, 0x5d, HAS_BUTTON)}, | 2471 | {USB_DEVICE(0xa168, 0x0614), SN9C20X(MT9M111, 0x5d, 0)}, |
2472 | {USB_DEVICE(0xa168, 0x0615), SN9C20X(MT9M111, 0x5d, 0)}, | 2472 | {USB_DEVICE(0xa168, 0x0615), SN9C20X(MT9M111, 0x5d, 0)}, |
2473 | {USB_DEVICE(0xa168, 0x0617), SN9C20X(MT9M111, 0x5d, 0)}, | 2473 | {USB_DEVICE(0xa168, 0x0617), SN9C20X(MT9M111, 0x5d, 0)}, |
2474 | {} | 2474 | {} |