diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2008-10-31 01:58:51 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2009-01-04 03:00:50 +0300 |
commit | 08ef08ee8c5a8d538ca9a3c433d4213c128af863 (patch) | |
tree | 99726465fd5973d748ad7fd1521c512754443f84 /drivers/hid/usbhid | |
parent | efc7ce18d9037aa947c1aad5eb712ecc47520126 (diff) | |
download | linux-08ef08ee8c5a8d538ca9a3c433d4213c128af863.tar.xz |
HID: automatically call usbhid_set_leds in usbhid driver
This patch (as1146c) makes usbhid automatically call usbhid_set_leds()
for any device that supports the keyboard boot protocol.
In theory this should be perfectly safe. BIOSes send the LED output
report as part of their normal device initialization, so any keyboard
device supporting the boot protocol has to be able to handle it.
As a side effect, the hid-dell and hid-bright drivers are no longer
needed, and the Logitech keyboard driver can be removed from hid-lg.
CC: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/usbhid')
-rw-r--r-- | drivers/hid/usbhid/hid-core.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 2afc8617f591..6383145b5840 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -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: |