]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/hid/usbhid/hid-core.c
HID: automatically call usbhid_set_leds in usbhid driver
[linux-2.6-omap-h63xx.git] / drivers / hid / usbhid / hid-core.c
index 2afc8617f5919ec28add338ac3197cd5c7c36998..6383145b58401d8f8940ccdf36d2e5a927a0f207 100644 (file)
@@ -874,6 +874,15 @@ static int usbhid_start(struct hid_device *hid)
 
        set_bit(HID_STARTED, &usbhid->iofl);
 
+       /* Some keyboards don't work until their LEDs have been set.
+        * Since BIOSes do set the LEDs, it must be safe for any device
+        * that supports the keyboard boot protocol.
+        */
+       if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT &&
+                       interface->desc.bInterfaceProtocol ==
+                               USB_INTERFACE_PROTOCOL_KEYBOARD)
+               usbhid_set_leds(hid);
+
        return 0;
 
 fail: