Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103933
b: refs/heads/master
c: 6833c91
h: refs/heads/master
i:
  103931: ef4e4b7
v: v3
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed Jul 20, 2008
1 parent 0e566f7 commit 66e7f54
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ac0d6df69bc72eabda944fd14a958074dc08ca0c
refs/heads/master: 6833c917b4de1757febdbf946d709ece6dc7a86f
17 changes: 17 additions & 0 deletions trunk/drivers/media/video/uvc/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
config USB_VIDEO_CLASS
tristate "USB Video Class (UVC)"
---help---
Support for the USB Video Class (UVC). Currently only video
input devices, such as webcams, are supported.

For more information see: <http://linux-uvc.berlios.de/>

config USB_VIDEO_CLASS_INPUT_EVDEV
bool "UVC input events device support"
default y
depends on USB_VIDEO_CLASS && INPUT
---help---
This option makes USB Video Class devices register an input device
to report button events.

If you are in doubt, say Y.
17 changes: 15 additions & 2 deletions trunk/drivers/media/video/uvc/uvc_status.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
/* --------------------------------------------------------------------------
* Input device
*/
#ifdef CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV
static int uvc_input_init(struct uvc_device *dev)
{
struct usb_device *udev = dev->udev;
Expand Down Expand Up @@ -67,6 +68,19 @@ static void uvc_input_cleanup(struct uvc_device *dev)
input_unregister_device(dev->input);
}

static void uvc_input_report_key(struct uvc_device *dev, unsigned int code,
int value)
{
if (dev->input)
input_report_key(dev->input, code, value);
}

#else
#define uvc_input_init(dev)
#define uvc_input_cleanup(dev)
#define uvc_input_report_key(dev, code, value)
#endif /* CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV */

/* --------------------------------------------------------------------------
* Status interrupt endpoint
*/
Expand All @@ -83,8 +97,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);
if (dev->input)
input_report_key(dev->input, BTN_0, data[3]);
uvc_input_report_key(dev, BTN_0, data[3]);
} else {
uvc_trace(UVC_TRACE_STATUS, "Stream %u error event %02x %02x "
"len %d.\n", data[1], data[2], data[3], len);
Expand Down

0 comments on commit 66e7f54

Please sign in to comment.