aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-02-20 09:26:07 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 13:11:10 -0500
commit0158e98fa15f6980568d7c3f67f035d3783319cd (patch)
tree79dc7ccd7001a7539bb34cf1bb6ed03c92931c61 /drivers/media
parent88e8d20a8c7c84533e1aa89dd45354cb5edded37 (diff)
V4L/DVB: gspca_stv06xx: Add support for camera button
Only tested with an stv6422 based cam, as that is the only stv06xx cam I have with a button. 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/stv06xx/stv06xx.c29
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
32MODULE_AUTHOR("Erik Andrén"); 33MODULE_AUTHOR("Erik Andrén");
@@ -427,6 +428,29 @@ frame_data:
427 } 428 }
428} 429}
429 430
431#ifdef CONFIG_INPUT
432static 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
430static int stv06xx_config(struct gspca_dev *gspca_dev, 454static 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 */