diff options
author | Hans de Goede <hdegoede@redhat.com> | 2010-01-29 09:02:10 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:11:07 -0500 |
commit | 937a6f54e31f3899c93cbe975d2ea7599dadd666 (patch) | |
tree | 1eee22aeeb56af2ba4ecd0175b9e17390cb1cc7c | |
parent | 4f3a89e48a9975ab3f777ea15ac161267e4b8794 (diff) |
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>
-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 @@ | |||
25 | 25 | ||
26 | #define MODULE_NAME "pac207" | 26 | #define MODULE_NAME "pac207" |
27 | 27 | ||
28 | #include <linux/input.h> | ||
28 | #include "gspca.h" | 29 | #include "gspca.h" |
29 | 30 | ||
30 | MODULE_AUTHOR("Hans de Goede <hdgoede@redhat.com>"); | 31 | MODULE_AUTHOR("Hans de Goede <hdgoede@redhat.com>"); |
@@ -495,6 +496,25 @@ static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val) | |||
495 | return 0; | 496 | return 0; |
496 | } | 497 | } |
497 | 498 | ||
499 | #ifdef CONFIG_INPUT | ||
500 | static int sd_int_pkt_scan(struct gspca_dev *gspca_dev, | ||
501 | u8 *data, /* interrupt packet data */ | ||
502 | int len) /* interrput packet length */ | ||
503 | { | ||
504 | int ret = -EINVAL; | ||
505 | |||
506 | if (len == 2 && data[0] == 0x5a && data[1] == 0x5a) { | ||
507 | input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1); | ||
508 | input_sync(gspca_dev->input_dev); | ||
509 | input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0); | ||
510 | input_sync(gspca_dev->input_dev); | ||
511 | ret = 0; | ||
512 | } | ||
513 | |||
514 | return ret; | ||
515 | } | ||
516 | #endif | ||
517 | |||
498 | /* sub-driver description */ | 518 | /* sub-driver description */ |
499 | static const struct sd_desc sd_desc = { | 519 | static const struct sd_desc sd_desc = { |
500 | .name = MODULE_NAME, | 520 | .name = MODULE_NAME, |
@@ -506,6 +526,9 @@ static const struct sd_desc sd_desc = { | |||
506 | .stopN = sd_stopN, | 526 | .stopN = sd_stopN, |
507 | .dq_callback = pac207_do_auto_gain, | 527 | .dq_callback = pac207_do_auto_gain, |
508 | .pkt_scan = sd_pkt_scan, | 528 | .pkt_scan = sd_pkt_scan, |
529 | #ifdef CONFIG_INPUT | ||
530 | .int_pkt_scan = sd_int_pkt_scan, | ||
531 | #endif | ||
509 | }; | 532 | }; |
510 | 533 | ||
511 | /* -- module initialisation -- */ | 534 | /* -- module initialisation -- */ |