14 #include <linux/kernel.h>
15 #include <linux/input.h>
16 #include <linux/slab.h>
25 #ifdef CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV
28 struct input_dev *
input;
31 input = input_allocate_device();
38 input->name = dev->
name;
40 usb_to_input_id(dev->
udev, &input->id);
41 input->dev.parent = &dev->
intf->dev;
46 if ((ret = input_register_device(input)) < 0)
53 input_free_device(input);
60 input_unregister_device(dev->
input);
67 input_report_key(dev->
input, code, value);
68 input_sync(dev->
input);
73 #define uvc_input_init(dev)
74 #define uvc_input_cleanup(dev)
75 #define uvc_input_report_key(dev, code, value)
93 data[1], data[3] ?
"pressed" :
"released", len);
97 "len %d.\n", data[1], data[2], data[3], len);
103 char *attrs[3] = {
"value",
"info",
"failure" };
105 if (len < 6 || data[2] != 0 || data[4] > 2) {
112 data[1], data[3], attrs[data[4]], len);
115 static void uvc_status_complete(
struct urb *
urb)
120 switch (urb->status) {
133 "completion handler.\n", urb->status);
137 len = urb->actual_length;
139 switch (dev->
status[0] & 0x0f) {
141 uvc_event_control(dev, dev->
status, len);
145 uvc_event_streaming(dev, dev->
status, len);
150 "type %u.\n", dev->
status[0]);
156 urb->interval = dev->
int_ep->desc.bInterval;
165 struct usb_host_endpoint *ep = dev->
int_ep;
184 pipe = usb_rcvintpipe(dev->
udev, ep->desc.bEndpointAddress);
189 interval = ep->desc.bInterval;
192 interval = fls(interval) - 1;