]> git.hungrycats.org Git - linux/commitdiff
input: Fix HID LED mapping. LEDs were ignored because the usage
authorVojtech Pavlik <vojtech@silver.ucw.cz>
Wed, 2 Feb 2005 18:54:35 +0000 (19:54 +0100)
committerVojtech Pavlik <vojtech@silver.ucw.cz>
Wed, 2 Feb 2005 18:54:35 +0000 (19:54 +0100)
       value contains the page code in high 16 bits.

Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>
drivers/usb/input/hid-debug.h
drivers/usb/input/hid-input.c

index b524c9bf21f125d905b30e1edfd8e31a2516091f..5ea2307403b874f1e9370abe2cefb4afc77dd304 100644 (file)
@@ -86,12 +86,12 @@ static const struct hid_usage_entry hid_usage_table[] = {
       {0, 0x92, "D-PadRight"},
       {0, 0x93, "D-PadLeft"},
   {  7, 0, "Keyboard" },
+  {  8, 0, "LED" },
       {0, 0x01, "NumLock"},
       {0, 0x02, "CapsLock"},
       {0, 0x03, "ScrollLock"},
       {0, 0x04, "Compose"},
       {0, 0x05, "Kana"},
-  {  8, 0, "LED" },
   {  9, 0, "Button" },
   { 10, 0, "Ordinal" },
   { 12, 0, "Consumer" },
index 8080e27499263da86717d216bd32d3ebaf3fa3b2..c90ff0f0362f6af3c189c05b6df57c8ef0241168 100644 (file)
@@ -185,9 +185,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
                        break;
 
                case HID_UP_LED:
-                       if (usage->hid - 1 >= LED_MAX)
+                       if (((usage->hid - 1) & 0xffff) >= LED_MAX)
                                goto ignore;
-                       map_led(usage->hid - 1);
+                       map_led((usage->hid - 1) & 0xffff);
                        break;
 
                case HID_UP_DIGITIZER: