From: Hans de Goede Date: Fri, 29 Jan 2010 14:02:10 +0000 (-0300) Subject: V4L/DVB: gscpa_pac207: Add support for camera button X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=937a6f54e31f3899c93cbe975d2ea7599dadd666;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 --- 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 -- */