From 937a6f54e31f3899c93cbe975d2ea7599dadd666 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Fri, 29 Jan 2010 11:02:10 -0300 Subject: V4L/DVB: gscpa_pac207: Add support for camera button gscpa_pac207: Add support for camera button Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/gspca/pac207.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'drivers/media') diff --git a/drivers/media/video/gspca/pac207.c b/drivers/media/video/gspca/pac207.c index 5ad4c730b342..0c87c3490b1e 100644 --- a/drivers/media/video/gspca/pac207.c +++ b/drivers/media/video/gspca/pac207.c @@ -25,6 +25,7 @@ #define MODULE_NAME "pac207" +#include #include "gspca.h" MODULE_AUTHOR("Hans de Goede "); @@ -495,6 +496,25 @@ static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val) return 0; } +#ifdef CONFIG_INPUT +static int sd_int_pkt_scan(struct gspca_dev *gspca_dev, + u8 *data, /* interrupt packet data */ + int len) /* interrput packet length */ +{ + int ret = -EINVAL; + + if (len == 2 && data[0] == 0x5a && data[1] == 0x5a) { + input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1); + input_sync(gspca_dev->input_dev); + input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0); + input_sync(gspca_dev->input_dev); + ret = 0; + } + + return ret; +} +#endif + /* sub-driver description */ static const struct sd_desc sd_desc = { .name = MODULE_NAME, @@ -506,6 +526,9 @@ static const struct sd_desc sd_desc = { .stopN = sd_stopN, .dq_callback = pac207_do_auto_gain, .pkt_scan = sd_pkt_scan, +#ifdef CONFIG_INPUT + .int_pkt_scan = sd_int_pkt_scan, +#endif }; /* -- module initialisation -- */ -- cgit v1.2.3