diff options
author | Hans de Goede <hdegoede@redhat.com> | 2010-01-31 08:35:15 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:11:08 -0500 |
commit | f65e93d60050ae4cf281b55b59864e7e7a08eb58 (patch) | |
tree | cf1ec6373d57f034ab3f34243cc15b33afec2837 /drivers/media | |
parent | 1a3510265b45e2d7f55879c7ff576b947e0b1bd7 (diff) |
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.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/sonixb.c b/drivers/media/video/gspca/sonixb.c index cfefdfefaf62..28843a6a6fea 100644 --- a/drivers/media/video/gspca/sonixb.c +++ b/drivers/media/video/gspca/sonixb.c | |||
@@ -42,6 +42,7 @@ Reg Use | |||
42 | 42 | ||
43 | #define MODULE_NAME "sonixb" | 43 | #define MODULE_NAME "sonixb" |
44 | 44 | ||
45 | #include <linux/input.h> | ||
45 | #include "gspca.h" | 46 | #include "gspca.h" |
46 | 47 | ||
47 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 48 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
@@ -1220,6 +1221,25 @@ static int sd_querymenu(struct gspca_dev *gspca_dev, | |||
1220 | return -EINVAL; | 1221 | return -EINVAL; |
1221 | } | 1222 | } |
1222 | 1223 | ||
1224 | #ifdef CONFIG_INPUT | ||
1225 | static int sd_int_pkt_scan(struct gspca_dev *gspca_dev, | ||
1226 | u8 *data, /* interrupt packet data */ | ||
1227 | int len) /* interrupt packet length */ | ||
1228 | { | ||
1229 | int ret = -EINVAL; | ||
1230 | |||
1231 | if (len == 1 && data[0] == 1) { | ||
1232 | input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1); | ||
1233 | input_sync(gspca_dev->input_dev); | ||
1234 | input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0); | ||
1235 | input_sync(gspca_dev->input_dev); | ||
1236 | ret = 0; | ||
1237 | } | ||
1238 | |||
1239 | return ret; | ||
1240 | } | ||
1241 | #endif | ||
1242 | |||
1223 | /* sub-driver description */ | 1243 | /* sub-driver description */ |
1224 | static const struct sd_desc sd_desc = { | 1244 | static const struct sd_desc sd_desc = { |
1225 | .name = MODULE_NAME, | 1245 | .name = MODULE_NAME, |
@@ -1232,6 +1252,9 @@ static const struct sd_desc sd_desc = { | |||
1232 | .pkt_scan = sd_pkt_scan, | 1252 | .pkt_scan = sd_pkt_scan, |
1233 | .querymenu = sd_querymenu, | 1253 | .querymenu = sd_querymenu, |
1234 | .dq_callback = do_autogain, | 1254 | .dq_callback = do_autogain, |
1255 | #ifdef CONFIG_INPUT | ||
1256 | .int_pkt_scan = sd_int_pkt_scan, | ||
1257 | #endif | ||
1235 | }; | 1258 | }; |
1236 | 1259 | ||
1237 | /* -- module initialisation -- */ | 1260 | /* -- module initialisation -- */ |