diff options
author | Hans de Goede <hdegoede@redhat.com> | 2010-01-29 11:02:10 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 15:11:07 -0300 |
commit | 937a6f54e31f3899c93cbe975d2ea7599dadd666 (patch) | |
tree | 1eee22aeeb56af2ba4ecd0175b9e17390cb1cc7c /drivers/media | |
parent | 4f3a89e48a9975ab3f777ea15ac161267e4b8794 (diff) | |
download | blackbird-obmc-linux-937a6f54e31f3899c93cbe975d2ea7599dadd666.tar.gz blackbird-obmc-linux-937a6f54e31f3899c93cbe975d2ea7599dadd666.zip |
V4L/DVB: gscpa_pac207: Add support for camera button
gscpa_pac207: Add support for camera 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/pac207.c | 23 |
1 files changed, 23 insertions, 0 deletions
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 <linux/input.h> #include "gspca.h" MODULE_AUTHOR("Hans de Goede <hdgoede@redhat.com>"); @@ -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 -- */ |