diff options
| -rw-r--r-- | drivers/media/video/gspca/stv06xx/stv06xx.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx.c b/drivers/media/video/gspca/stv06xx/stv06xx.c index de823edd8ec3..af73da34c83f 100644 --- a/drivers/media/video/gspca/stv06xx/stv06xx.c +++ b/drivers/media/video/gspca/stv06xx/stv06xx.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | * P/N 861040-0000: Sensor ST VV6410 ASIC STV0610 - QuickCam Web | 27 | * P/N 861040-0000: Sensor ST VV6410 ASIC STV0610 - QuickCam Web |
| 28 | */ | 28 | */ |
| 29 | 29 | ||
| 30 | #include <linux/input.h> | ||
| 30 | #include "stv06xx_sensor.h" | 31 | #include "stv06xx_sensor.h" |
| 31 | 32 | ||
| 32 | MODULE_AUTHOR("Erik Andrén"); | 33 | MODULE_AUTHOR("Erik Andrén"); |
| @@ -427,6 +428,29 @@ frame_data: | |||
| 427 | } | 428 | } |
| 428 | } | 429 | } |
| 429 | 430 | ||
| 431 | #ifdef CONFIG_INPUT | ||
| 432 | static int sd_int_pkt_scan(struct gspca_dev *gspca_dev, | ||
| 433 | u8 *data, /* interrupt packet data */ | ||
| 434 | int len) /* interrupt packet length */ | ||
| 435 | { | ||
| 436 | int ret = -EINVAL; | ||
| 437 | |||
| 438 | if (len == 1 && data[0] == 0x80) { | ||
| 439 | input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1); | ||
| 440 | input_sync(gspca_dev->input_dev); | ||
| 441 | ret = 0; | ||
| 442 | } | ||
| 443 | |||
| 444 | if (len == 1 && data[0] == 0x88) { | ||
| 445 | input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0); | ||
| 446 | input_sync(gspca_dev->input_dev); | ||
| 447 | ret = 0; | ||
| 448 | } | ||
| 449 | |||
| 450 | return ret; | ||
| 451 | } | ||
| 452 | #endif | ||
| 453 | |||
| 430 | static int stv06xx_config(struct gspca_dev *gspca_dev, | 454 | static int stv06xx_config(struct gspca_dev *gspca_dev, |
| 431 | const struct usb_device_id *id); | 455 | const struct usb_device_id *id); |
| 432 | 456 | ||
| @@ -437,7 +461,10 @@ static const struct sd_desc sd_desc = { | |||
| 437 | .init = stv06xx_init, | 461 | .init = stv06xx_init, |
| 438 | .start = stv06xx_start, | 462 | .start = stv06xx_start, |
| 439 | .stopN = stv06xx_stopN, | 463 | .stopN = stv06xx_stopN, |
| 440 | .pkt_scan = stv06xx_pkt_scan | 464 | .pkt_scan = stv06xx_pkt_scan, |
| 465 | #ifdef CONFIG_INPUT | ||
| 466 | .int_pkt_scan = sd_int_pkt_scan, | ||
| 467 | #endif | ||
| 441 | }; | 468 | }; |
| 442 | 469 | ||
| 443 | /* This function is called at probe time */ | 470 | /* This function is called at probe time */ |
