Skip to content

Commit

Permalink
V4L/DVB: gscpa_zc3xx: Add support for camera button
Browse files Browse the repository at this point in the history
gscpa_zc3xx: 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 32ea3e4 commit 1a35102
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions drivers/media/video/gspca/zc3xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#define MODULE_NAME "zc3xx"

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

Expand Down Expand Up @@ -7170,6 +7171,22 @@ static int sd_get_jcomp(struct gspca_dev *gspca_dev,
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 */
{
if (len == 8 && data[4] == 1) {
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);
}

return 0;
}
#endif

static const struct sd_desc sd_desc = {
.name = MODULE_NAME,
.ctrls = sd_ctrls,
Expand All @@ -7182,6 +7199,9 @@ static const struct sd_desc sd_desc = {
.querymenu = sd_querymenu,
.get_jcomp = sd_get_jcomp,
.set_jcomp = sd_set_jcomp,
#ifdef CONFIG_INPUT
.int_pkt_scan = sd_int_pkt_scan,
#endif
};

static const __devinitdata struct usb_device_id device_table[] = {
Expand Down

0 comments on commit 1a35102

Please sign in to comment.