diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-05-19 08:04:49 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-05-19 08:04:49 -0400 |
commit | 7426ef52b42ebd54ba85133ffd29132e008a882c (patch) | |
tree | 5232ca850065baf025e8d7384408b48b4b462c96 /drivers/hid/usbhid | |
parent | 537b60d17894b7c19a6060feae40299d7109d6e7 (diff) | |
parent | a8ab5d58b0238b8199cc699b8dff7c5e1da24138 (diff) |
Merge branch 'upstream' into for-linus
Conflicts:
drivers/hid/hid-wacom.c
Diffstat (limited to 'drivers/hid/usbhid')
-rw-r--r-- | drivers/hid/usbhid/hid-core.c | 48 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-quirks.c | 1 | ||||
-rw-r--r-- | drivers/hid/usbhid/usbkbd.c | 1 |
3 files changed, 38 insertions, 12 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 7b85b696fdab..a2ebe1996740 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c | |||
@@ -807,16 +807,36 @@ static int usbhid_output_raw_report(struct hid_device *hid, __u8 *buf, size_t co | |||
807 | struct usb_host_interface *interface = intf->cur_altsetting; | 807 | struct usb_host_interface *interface = intf->cur_altsetting; |
808 | int ret; | 808 | int ret; |
809 | 809 | ||
810 | ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), | 810 | if (usbhid->urbout) { |
811 | HID_REQ_SET_REPORT, | 811 | int actual_length; |
812 | USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, | 812 | int skipped_report_id = 0; |
813 | ((report_type + 1) << 8) | *buf, | 813 | if (buf[0] == 0x0) { |
814 | interface->desc.bInterfaceNumber, buf + 1, count - 1, | 814 | /* Don't send the Report ID */ |
815 | USB_CTRL_SET_TIMEOUT); | 815 | buf++; |
816 | 816 | count--; | |
817 | /* count also the report id */ | 817 | skipped_report_id = 1; |
818 | if (ret > 0) | 818 | } |
819 | ret++; | 819 | ret = usb_interrupt_msg(dev, usbhid->urbout->pipe, |
820 | buf, count, &actual_length, | ||
821 | USB_CTRL_SET_TIMEOUT); | ||
822 | /* return the number of bytes transferred */ | ||
823 | if (ret == 0) { | ||
824 | ret = actual_length; | ||
825 | /* count also the report id */ | ||
826 | if (skipped_report_id) | ||
827 | ret++; | ||
828 | } | ||
829 | } else { | ||
830 | ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), | ||
831 | HID_REQ_SET_REPORT, | ||
832 | USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, | ||
833 | ((report_type + 1) << 8) | *buf, | ||
834 | interface->desc.bInterfaceNumber, buf + 1, count - 1, | ||
835 | USB_CTRL_SET_TIMEOUT); | ||
836 | /* count also the report id */ | ||
837 | if (ret > 0) | ||
838 | ret++; | ||
839 | } | ||
820 | 840 | ||
821 | return ret; | 841 | return ret; |
822 | } | 842 | } |
@@ -1019,12 +1039,15 @@ static int usbhid_start(struct hid_device *hid) | |||
1019 | /* Some keyboards don't work until their LEDs have been set. | 1039 | /* Some keyboards don't work until their LEDs have been set. |
1020 | * Since BIOSes do set the LEDs, it must be safe for any device | 1040 | * Since BIOSes do set the LEDs, it must be safe for any device |
1021 | * that supports the keyboard boot protocol. | 1041 | * that supports the keyboard boot protocol. |
1042 | * In addition, enable remote wakeup by default for all keyboard | ||
1043 | * devices supporting the boot protocol. | ||
1022 | */ | 1044 | */ |
1023 | if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT && | 1045 | if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT && |
1024 | interface->desc.bInterfaceProtocol == | 1046 | interface->desc.bInterfaceProtocol == |
1025 | USB_INTERFACE_PROTOCOL_KEYBOARD) | 1047 | USB_INTERFACE_PROTOCOL_KEYBOARD) { |
1026 | usbhid_set_leds(hid); | 1048 | usbhid_set_leds(hid); |
1027 | 1049 | device_set_wakeup_enable(&dev->dev, 1); | |
1050 | } | ||
1028 | return 0; | 1051 | return 0; |
1029 | 1052 | ||
1030 | fail: | 1053 | fail: |
@@ -1133,6 +1156,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * | |||
1133 | hid->vendor = le16_to_cpu(dev->descriptor.idVendor); | 1156 | hid->vendor = le16_to_cpu(dev->descriptor.idVendor); |
1134 | hid->product = le16_to_cpu(dev->descriptor.idProduct); | 1157 | hid->product = le16_to_cpu(dev->descriptor.idProduct); |
1135 | hid->name[0] = 0; | 1158 | hid->name[0] = 0; |
1159 | hid->quirks = usbhid_lookup_quirk(hid->vendor, hid->product); | ||
1136 | if (intf->cur_altsetting->desc.bInterfaceProtocol == | 1160 | if (intf->cur_altsetting->desc.bInterfaceProtocol == |
1137 | USB_INTERFACE_PROTOCOL_MOUSE) | 1161 | USB_INTERFACE_PROTOCOL_MOUSE) |
1138 | hid->type = HID_TYPE_USBMOUSE; | 1162 | hid->type = HID_TYPE_USBMOUSE; |
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 1152f9b5fd44..7a6bda23283e 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -33,6 +33,7 @@ static const struct hid_blacklist { | |||
33 | { USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_PREDATOR, HID_QUIRK_BADPAD }, | 33 | { USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_PREDATOR, HID_QUIRK_BADPAD }, |
34 | { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD }, | 34 | { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD }, |
35 | { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD }, | 35 | { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD }, |
36 | { USB_VENDOR_ID_EGALAX, USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER, HID_QUIRK_MULTI_INPUT }, | ||
36 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | 37 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, |
37 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | 38 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, |
38 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | 39 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, |
diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c index f843443ba5c3..b2fd0b00de92 100644 --- a/drivers/hid/usbhid/usbkbd.c +++ b/drivers/hid/usbhid/usbkbd.c | |||
@@ -313,6 +313,7 @@ static int usb_kbd_probe(struct usb_interface *iface, | |||
313 | goto fail2; | 313 | goto fail2; |
314 | 314 | ||
315 | usb_set_intfdata(iface, kbd); | 315 | usb_set_intfdata(iface, kbd); |
316 | device_set_wakeup_enable(&dev->dev, 1); | ||
316 | return 0; | 317 | return 0; |
317 | 318 | ||
318 | fail2: | 319 | fail2: |