[PATCH 4/4] Fix HID LED mapping.

Vojtech Pavlik
2005-02-02T20:19:06Z

ChangeSet@1.1994, 2005-02-02 17:54:35+01:00, vojtech@silver.ucw.cz
input: Fix HID LED mapping. LEDs were ignored because the usage
value contains the page code in high 16 bits.

Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>

hid-debug.h | 2 +-
hid-input.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

===================================================================

diff -Nru a/drivers/usb/input/hid-debug.h b/drivers/usb/input/hid-debug.h
--- a/drivers/usb/input/hid-debug.h 2005-02-02 20:29:32 +01:00
+++ b/drivers/usb/input/hid-debug.h 2005-02-02 20:29:32 +01:00
@@ -86,12 +86,12 @@
{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" },
diff -Nru a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c
--- a/drivers/usb/input/hid-input.c 2005-02-02 20:29:32 +01:00
+++ b/drivers/usb/input/hid-input.c 2005-02-02 20:29:32 +01:00
@@ -185,9 +185,9 @@
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;