diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-14 13:38:38 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-14 13:38:38 -0300 |
commit | 34ef7f10c4a258874ea1b35c55c4899cf26bc262 (patch) | |
tree | 1f9a9dd5c92ba77939a94681b8b55f4d3e690ab8 /linux/drivers/media/video/uvc/uvc_status.c | |
parent | 6ded551dac9dcf5b62839a2ed2b37c1ae76a54d3 (diff) | |
download | mediapointer-dvb-s2-34ef7f10c4a258874ea1b35c55c4899cf26bc262.tar.gz mediapointer-dvb-s2-34ef7f10c4a258874ea1b35c55c4899cf26bc262.tar.bz2 |
backport commit 74ca11c2056d01d9ebb3615cd781a148450c3c82
From: Mauro Carvalho Chehab <mchehab@redhat.com>
kernel-sync:
Author: Bastien Nocera <hadess@hadess.net>
Date: Sat Jan 10 23:44:22 2009 -0800
Input: uvc - the button on the camera is KEY_CAMERA
Cameras should generate KEY_CAMERA, not BTN_0. Also call input_sync()
on the device once the button has been pressed.
CC: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/uvc/uvc_status.c')
-rw-r--r-- | linux/drivers/media/video/uvc/uvc_status.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/linux/drivers/media/video/uvc/uvc_status.c b/linux/drivers/media/video/uvc/uvc_status.c index 4f4171fa8..1e1bda413 100644 --- a/linux/drivers/media/video/uvc/uvc_status.c +++ b/linux/drivers/media/video/uvc/uvc_status.c @@ -47,8 +47,8 @@ static int uvc_input_init(struct uvc_device *dev) input->cdev.dev = &dev->intf->dev; #endif - set_bit(EV_KEY, input->evbit); - set_bit(BTN_0, input->keybit); + __set_bit(EV_KEY, input->evbit); + __set_bit(KEY_CAMERA, input->keybit); if ((ret = input_register_device(input)) < 0) goto error; @@ -70,8 +70,10 @@ static void uvc_input_cleanup(struct uvc_device *dev) static void uvc_input_report_key(struct uvc_device *dev, unsigned int code, int value) { - if (dev->input) + if (dev->input) { input_report_key(dev->input, code, value); + input_sync(dev->input); + } } #else @@ -96,7 +98,7 @@ static void uvc_event_streaming(struct uvc_device *dev, __u8 *data, int len) return; uvc_trace(UVC_TRACE_STATUS, "Button (intf %u) %s len %d\n", data[1], data[3] ? "pressed" : "released", len); - uvc_input_report_key(dev, BTN_0, data[3]); + uvc_input_report_key(dev, KEY_CAMERA, data[3]); } else { uvc_trace(UVC_TRACE_STATUS, "Stream %u error event %02x %02x " "len %d.\n", data[1], data[2], data[3], len); |