diff options
author | Bastien Nocera <hadess@hadess.net> | 2009-01-11 02:44:22 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-01-11 02:46:14 -0500 |
commit | 74ca11c2056d01d9ebb3615cd781a148450c3c82 (patch) | |
tree | d09bcb1ca0896c5bbc9ec3224ddc3008e55378c7 /drivers | |
parent | 3c0340b774916caa4149892504169d290c8a720a (diff) |
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.
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/uvc/uvc_status.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/video/uvc/uvc_status.c b/drivers/media/video/uvc/uvc_status.c index 5d60b264d59a..fdf7b4187ee1 100644 --- a/drivers/media/video/uvc/uvc_status.c +++ b/drivers/media/video/uvc/uvc_status.c | |||
@@ -47,8 +47,8 @@ static int uvc_input_init(struct uvc_device *dev) | |||
47 | usb_to_input_id(udev, &input->id); | 47 | usb_to_input_id(udev, &input->id); |
48 | input->dev.parent = &dev->intf->dev; | 48 | input->dev.parent = &dev->intf->dev; |
49 | 49 | ||
50 | set_bit(EV_KEY, input->evbit); | 50 | __set_bit(EV_KEY, input->evbit); |
51 | set_bit(BTN_0, input->keybit); | 51 | __set_bit(KEY_CAMERA, input->keybit); |
52 | 52 | ||
53 | if ((ret = input_register_device(input)) < 0) | 53 | if ((ret = input_register_device(input)) < 0) |
54 | goto error; | 54 | goto error; |
@@ -71,8 +71,10 @@ static void uvc_input_cleanup(struct uvc_device *dev) | |||
71 | static void uvc_input_report_key(struct uvc_device *dev, unsigned int code, | 71 | static void uvc_input_report_key(struct uvc_device *dev, unsigned int code, |
72 | int value) | 72 | int value) |
73 | { | 73 | { |
74 | if (dev->input) | 74 | if (dev->input) { |
75 | input_report_key(dev->input, code, value); | 75 | input_report_key(dev->input, code, value); |
76 | input_sync(dev->input); | ||
77 | } | ||
76 | } | 78 | } |
77 | 79 | ||
78 | #else | 80 | #else |
@@ -97,7 +99,7 @@ static void uvc_event_streaming(struct uvc_device *dev, __u8 *data, int len) | |||
97 | return; | 99 | return; |
98 | uvc_trace(UVC_TRACE_STATUS, "Button (intf %u) %s len %d\n", | 100 | uvc_trace(UVC_TRACE_STATUS, "Button (intf %u) %s len %d\n", |
99 | data[1], data[3] ? "pressed" : "released", len); | 101 | data[1], data[3] ? "pressed" : "released", len); |
100 | uvc_input_report_key(dev, BTN_0, data[3]); | 102 | uvc_input_report_key(dev, KEY_CAMERA, data[3]); |
101 | } else { | 103 | } else { |
102 | uvc_trace(UVC_TRACE_STATUS, "Stream %u error event %02x %02x " | 104 | uvc_trace(UVC_TRACE_STATUS, "Stream %u error event %02x %02x " |
103 | "len %d.\n", data[1], data[2], data[3], len); | 105 | "len %d.\n", data[1], data[2], data[3], len); |