Skip to contentSkip to conversation

input: uvc: the button on the camera is KEY_CAMERA

PATCH Applied [email protected] 2 participants 2 messages Jan 9, 2009 – Jan 11, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 12/17 input: uvc: the button on the camera is KEY_CAMERA

From: Bastien Nocera <[email protected]>

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 file changed, 5 insertions(+), 3 deletions(-)
drivers/media/video/uvc/uvc_status.c renamed from drivers/media/video/uvc/uvc_status.c~input-uvc-the-button-on-the-camera-is-key_camera +5 -3
diff -puN drivers/media/video/uvc/uvc_status.c~input-uvc-the-button-on-the-camera-is-key_camera drivers/media/video/uvc/uvc_status.c
@@ -47,7 +47,7 @@ static int uvc_input_init(struct uvc_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;
@@ -70,8 +70,10 @@ static void uvc_input_cleanup(struct uvc
 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 u
 			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 lore raw
Quoted 5 lines · On Fri, Jan 09, 2009 at 12:19:50PM -0800, [email protected] wrote:

From: Bastien Nocera <[email protected]>

Not BTN_0. Also call input_sync() on the device once the button has been pressed.

Applied, thank you Bastien.

Signature · 1 line
Dmitry