summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-01-31 10:35:15 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 15:11:08 -0300
commitf65e93d60050ae4cf281b55b59864e7e7a08eb58 (patch)
treecf1ec6373d57f034ab3f34243cc15b33afec2837 /drivers/media
parent1a3510265b45e2d7f55879c7ff576b947e0b1bd7 (diff)
downloadop-kernel-dev-f65e93d60050ae4cf281b55b59864e7e7a08eb58.zip
op-kernel-dev-f65e93d60050ae4cf281b55b59864e7e7a08eb58.tar.gz
V4L/DVB: gspca_sonixb: Add support for camera button
gspca_sonixb: 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/sonixb.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/sonixb.c b/drivers/media/video/gspca/sonixb.c
index cfefdfe..28843a6 100644
--- a/drivers/media/video/gspca/sonixb.c
+++ b/drivers/media/video/gspca/sonixb.c
@@ -42,6 +42,7 @@ Reg Use
#define MODULE_NAME "sonixb"
+#include <linux/input.h>
#include "gspca.h"
MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
@@ -1220,6 +1221,25 @@ static int sd_querymenu(struct gspca_dev *gspca_dev,
return -EINVAL;
}
+#ifdef CONFIG_INPUT
+static int sd_int_pkt_scan(struct gspca_dev *gspca_dev,
+ u8 *data, /* interrupt packet data */
+ int len) /* interrupt packet length */
+{
+ int ret = -EINVAL;
+
+ if (len == 1 && data[0] == 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);
+ ret = 0;
+ }
+
+ return ret;
+}
+#endif
+
/* sub-driver description */
static const struct sd_desc sd_desc = {
.name = MODULE_NAME,
@@ -1232,6 +1252,9 @@ static const struct sd_desc sd_desc = {
.pkt_scan = sd_pkt_scan,
.querymenu = sd_querymenu,
.dq_callback = do_autogain,
+#ifdef CONFIG_INPUT
+ .int_pkt_scan = sd_int_pkt_scan,
+#endif
};
/* -- module initialisation -- */
OpenPOWER on IntegriCloud