From 08ef08ee8c5a8d538ca9a3c433d4213c128af863 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Thu, 30 Oct 2008 23:58:51 +0100 Subject: 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 Signed-off-by: Alan Stern Signed-off-by: Jiri Kosina --- drivers/hid/usbhid/hid-core.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/hid/usbhid') 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: -- cgit v1.2.3