diff options
author | Lennart Poettering <mzxreary@0pointer.de> | 2009-06-11 10:19:33 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 18:07:38 -0400 |
commit | bcd3e4b3190f0cc4e0702785220f0269f8537175 (patch) | |
tree | 2c642ce364251b85832b723967ff49715c948908 /drivers/media/video/usbvideo | |
parent | 6f4d72392d76b8f78f646805ba2be995b3f77992 (diff) |
V4L/DVB (11960): v4l: generate KEY_CAMERA instead of BTN_0 key events on input devices
A bunch of V4L drivers generate BTN_0 instead of KEY_CAMERA key presses.
X11 is able to handle KEY_CAMERA automatically these days while BTN_0 is
not treated at all. Thus it would be of big benefit if the camera drivers
would consistently generate KEY_CAMERA. Some drivers (uvc) already do,
this patch updates the remaining drivers to do the same.
I only possess a limited set of webcams, so this isn't tested with all
cameras. The patch is rather trivial and compile tested, so I'd say it's
still good enough to get merged.
Signed-off-by: Lennart Poettering <mzxreary@0pointer.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/usbvideo')
-rw-r--r-- | drivers/media/video/usbvideo/konicawc.c | 4 | ||||
-rw-r--r-- | drivers/media/video/usbvideo/quickcam_messenger.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/video/usbvideo/konicawc.c b/drivers/media/video/usbvideo/konicawc.c index 900ec2129ca1..31d57f2d09e1 100644 --- a/drivers/media/video/usbvideo/konicawc.c +++ b/drivers/media/video/usbvideo/konicawc.c | |||
@@ -240,7 +240,7 @@ static void konicawc_register_input(struct konicawc *cam, struct usb_device *dev | |||
240 | input_dev->dev.parent = &dev->dev; | 240 | input_dev->dev.parent = &dev->dev; |
241 | 241 | ||
242 | input_dev->evbit[0] = BIT_MASK(EV_KEY); | 242 | input_dev->evbit[0] = BIT_MASK(EV_KEY); |
243 | input_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0); | 243 | input_dev->keybit[BIT_WORD(KEY_CAMERA)] = BIT_MASK(KEY_CAMERA); |
244 | 244 | ||
245 | error = input_register_device(cam->input); | 245 | error = input_register_device(cam->input); |
246 | if (error) { | 246 | if (error) { |
@@ -263,7 +263,7 @@ static void konicawc_unregister_input(struct konicawc *cam) | |||
263 | static void konicawc_report_buttonstat(struct konicawc *cam) | 263 | static void konicawc_report_buttonstat(struct konicawc *cam) |
264 | { | 264 | { |
265 | if (cam->input) { | 265 | if (cam->input) { |
266 | input_report_key(cam->input, BTN_0, cam->buttonsts); | 266 | input_report_key(cam->input, KEY_CAMERA, cam->buttonsts); |
267 | input_sync(cam->input); | 267 | input_sync(cam->input); |
268 | } | 268 | } |
269 | } | 269 | } |
diff --git a/drivers/media/video/usbvideo/quickcam_messenger.c b/drivers/media/video/usbvideo/quickcam_messenger.c index fd112f0b9d35..803d3e4e29a2 100644 --- a/drivers/media/video/usbvideo/quickcam_messenger.c +++ b/drivers/media/video/usbvideo/quickcam_messenger.c | |||
@@ -103,7 +103,7 @@ static void qcm_register_input(struct qcm *cam, struct usb_device *dev) | |||
103 | input_dev->dev.parent = &dev->dev; | 103 | input_dev->dev.parent = &dev->dev; |
104 | 104 | ||
105 | input_dev->evbit[0] = BIT_MASK(EV_KEY); | 105 | input_dev->evbit[0] = BIT_MASK(EV_KEY); |
106 | input_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0); | 106 | input_dev->keybit[BIT_WORD(KEY_CAMERA)] = BIT_MASK(KEY_CAMERA); |
107 | 107 | ||
108 | error = input_register_device(cam->input); | 108 | error = input_register_device(cam->input); |
109 | if (error) { | 109 | if (error) { |
@@ -126,7 +126,7 @@ static void qcm_unregister_input(struct qcm *cam) | |||
126 | static void qcm_report_buttonstat(struct qcm *cam) | 126 | static void qcm_report_buttonstat(struct qcm *cam) |
127 | { | 127 | { |
128 | if (cam->input) { | 128 | if (cam->input) { |
129 | input_report_key(cam->input, BTN_0, cam->button_sts); | 129 | input_report_key(cam->input, KEY_CAMERA, cam->button_sts); |
130 | input_sync(cam->input); | 130 | input_sync(cam->input); |
131 | } | 131 | } |
132 | } | 132 | } |