Skip to content

Commit

Permalink
V4L/DVB: gscpa_pac207: Add support for camera button
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Feb 26, 2010
1 parent 4f3a89e commit 937a6f5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions drivers/media/video/gspca/pac207.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#define MODULE_NAME "pac207"

#include <linux/input.h>
#include "gspca.h"

MODULE_AUTHOR("Hans de Goede <hdgoede@redhat.com>");
Expand Down Expand Up @@ -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,
Expand All @@ -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 -- */
Expand Down

0 comments on commit 937a6f5

Please sign in to comment.