mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] [uvc] The button on the camera is KEY_CAMERA
Date: Tue, 02 Dec 2008 19:11:40 +0000	[thread overview]
Message-ID: <1228245100.8307.1463.camel@cookie.hadess.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 117 bytes --]

2 small bug fixes for the input part of the UVC driver.

Please keep me CC:ed as I'm not subscribed to LKML.

Cheers

[-- Attachment #2: 0001--uvc-The-button-on-the-camera-is-KEY_CAMERA.patch --]
[-- Type: text/x-patch, Size: 1640 bytes --]

>From df4dfe7370c71647e89acd2db22c46c10ca8faea Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Tue, 2 Dec 2008 19:08:59 +0000
Subject: [PATCH] [uvc] The button on the camera is KEY_CAMERA

Not BTN_0. Also call input_sync() on the device once the button
has been pressed.
---
 drivers/media/video/uvc/uvc_status.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/uvc/uvc_status.c b/drivers/media/video/uvc/uvc_status.c
index 5d60b26..ca93245 100644
--- a/drivers/media/video/uvc/uvc_status.c
+++ b/drivers/media/video/uvc/uvc_status.c
@@ -48,7 +48,7 @@ static int uvc_input_init(struct uvc_device *dev)
 	input->dev.parent = &dev->intf->dev;
 
 	set_bit(EV_KEY, input->evbit);
-	set_bit(BTN_0, input->keybit);
+	set_bit(KEY_CAMERA, input->keybit);
 
 	if ((ret = input_register_device(input)) < 0)
 		goto error;
@@ -71,8 +71,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
@@ -97,7 +99,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);
-- 
1.6.0.4


                 reply	other threads:[~2008-12-02 19:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1228245100.8307.1463.camel@cookie.hadess.net \
    --to=hadess@hadess.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®