aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/pac207.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/gspca/pac207.c')
-rw-r--r--drivers/media/video/gspca/pac207.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/pac207.c b/drivers/media/video/gspca/pac207.c
index 4706a823add..0c87c3490b1 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
30MODULE_AUTHOR("Hans de Goede <hdgoede@redhat.com>"); 31MODULE_AUTHOR("Hans de Goede <hdgoede@redhat.com>");
@@ -77,7 +78,7 @@ static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val);
77static int sd_setgain(struct gspca_dev *gspca_dev, __s32 val); 78static int sd_setgain(struct gspca_dev *gspca_dev, __s32 val);
78static int sd_getgain(struct gspca_dev *gspca_dev, __s32 *val); 79static int sd_getgain(struct gspca_dev *gspca_dev, __s32 *val);
79 80
80static struct ctrl sd_ctrls[] = { 81static const struct ctrl sd_ctrls[] = {
81#define SD_BRIGHTNESS 0 82#define SD_BRIGHTNESS 0
82 { 83 {
83 { 84 {
@@ -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
500static 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 */
499static const struct sd_desc sd_desc = { 519static 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 -- */