diff options
author | Vojtech Pavlik <vojtech@suse.cz> | 2005-09-05 01:08:08 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-09-05 01:08:08 -0400 |
commit | 8a409b0118c2d78f84f740f60fe03abda1fe3333 (patch) | |
tree | cfb6e118361c275b4f114d1c843588dee9ad4793 /drivers/usb | |
parent | 0aebfdac042b63d0f2625414062e138a4333181c (diff) |
Input: HID - add more consumer usages
Extend mapping of the consumer usage page in hid-input.c to handle
more cases appearing on new USB keyboards.
Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/input/hid-debug.h | 17 | ||||
-rw-r--r-- | drivers/usb/input/hid-input.c | 19 | ||||
-rw-r--r-- | drivers/usb/input/hid.h | 1 |
3 files changed, 28 insertions, 9 deletions
diff --git a/drivers/usb/input/hid-debug.h b/drivers/usb/input/hid-debug.h index 789df807b113..ceebab99eff2 100644 --- a/drivers/usb/input/hid-debug.h +++ b/drivers/usb/input/hid-debug.h | |||
@@ -109,6 +109,7 @@ static const struct hid_usage_entry hid_usage_table[] = { | |||
109 | {0, 0x03, "ScrollLock"}, | 109 | {0, 0x03, "ScrollLock"}, |
110 | {0, 0x04, "Compose"}, | 110 | {0, 0x04, "Compose"}, |
111 | {0, 0x05, "Kana"}, | 111 | {0, 0x05, "Kana"}, |
112 | {0, 0x4b, "GenericIndicator"}, | ||
112 | { 9, 0, "Button" }, | 113 | { 9, 0, "Button" }, |
113 | { 10, 0, "Ordinal" }, | 114 | { 10, 0, "Ordinal" }, |
114 | { 12, 0, "Consumer" }, | 115 | { 12, 0, "Consumer" }, |
@@ -591,7 +592,8 @@ static char *keys[KEY_MAX + 1] = { | |||
591 | [KEY_EXIT] = "Exit", [KEY_MOVE] = "Move", | 592 | [KEY_EXIT] = "Exit", [KEY_MOVE] = "Move", |
592 | [KEY_EDIT] = "Edit", [KEY_SCROLLUP] = "ScrollUp", | 593 | [KEY_EDIT] = "Edit", [KEY_SCROLLUP] = "ScrollUp", |
593 | [KEY_SCROLLDOWN] = "ScrollDown", [KEY_KPLEFTPAREN] = "KPLeftParenthesis", | 594 | [KEY_SCROLLDOWN] = "ScrollDown", [KEY_KPLEFTPAREN] = "KPLeftParenthesis", |
594 | [KEY_KPRIGHTPAREN] = "KPRightParenthesis", [KEY_F13] = "F13", | 595 | [KEY_KPRIGHTPAREN] = "KPRightParenthesis", [KEY_NEW] = "New", |
596 | [KEY_REDO] = "Redo", [KEY_F13] = "F13", | ||
595 | [KEY_F14] = "F14", [KEY_F15] = "F15", | 597 | [KEY_F14] = "F14", [KEY_F15] = "F15", |
596 | [KEY_F16] = "F16", [KEY_F17] = "F17", | 598 | [KEY_F16] = "F16", [KEY_F17] = "F17", |
597 | [KEY_F18] = "F18", [KEY_F19] = "F19", | 599 | [KEY_F18] = "F18", [KEY_F19] = "F19", |
@@ -601,15 +603,15 @@ static char *keys[KEY_MAX + 1] = { | |||
601 | [KEY_PAUSECD] = "PauseCD", [KEY_PROG3] = "Prog3", | 603 | [KEY_PAUSECD] = "PauseCD", [KEY_PROG3] = "Prog3", |
602 | [KEY_PROG4] = "Prog4", [KEY_SUSPEND] = "Suspend", | 604 | [KEY_PROG4] = "Prog4", [KEY_SUSPEND] = "Suspend", |
603 | [KEY_CLOSE] = "Close", [KEY_PLAY] = "Play", | 605 | [KEY_CLOSE] = "Close", [KEY_PLAY] = "Play", |
604 | [KEY_FASTFORWARD] = "Fast Forward", [KEY_BASSBOOST] = "Bass Boost", | 606 | [KEY_FASTFORWARD] = "FastForward", [KEY_BASSBOOST] = "BassBoost", |
605 | [KEY_PRINT] = "Print", [KEY_HP] = "HP", | 607 | [KEY_PRINT] = "Print", [KEY_HP] = "HP", |
606 | [KEY_CAMERA] = "Camera", [KEY_SOUND] = "Sound", | 608 | [KEY_CAMERA] = "Camera", [KEY_SOUND] = "Sound", |
607 | [KEY_QUESTION] = "Question", [KEY_EMAIL] = "Email", | 609 | [KEY_QUESTION] = "Question", [KEY_EMAIL] = "Email", |
608 | [KEY_CHAT] = "Chat", [KEY_SEARCH] = "Search", | 610 | [KEY_CHAT] = "Chat", [KEY_SEARCH] = "Search", |
609 | [KEY_CONNECT] = "Connect", [KEY_FINANCE] = "Finance", | 611 | [KEY_CONNECT] = "Connect", [KEY_FINANCE] = "Finance", |
610 | [KEY_SPORT] = "Sport", [KEY_SHOP] = "Shop", | 612 | [KEY_SPORT] = "Sport", [KEY_SHOP] = "Shop", |
611 | [KEY_ALTERASE] = "Alternate Erase", [KEY_CANCEL] = "Cancel", | 613 | [KEY_ALTERASE] = "AlternateErase", [KEY_CANCEL] = "Cancel", |
612 | [KEY_BRIGHTNESSDOWN] = "Brightness down", [KEY_BRIGHTNESSUP] = "Brightness up", | 614 | [KEY_BRIGHTNESSDOWN] = "BrightnessDown", [KEY_BRIGHTNESSUP] = "BrightnessUp", |
613 | [KEY_MEDIA] = "Media", [KEY_UNKNOWN] = "Unknown", | 615 | [KEY_MEDIA] = "Media", [KEY_UNKNOWN] = "Unknown", |
614 | [BTN_0] = "Btn0", [BTN_1] = "Btn1", | 616 | [BTN_0] = "Btn0", [BTN_1] = "Btn1", |
615 | [BTN_2] = "Btn2", [BTN_3] = "Btn3", | 617 | [BTN_2] = "Btn2", [BTN_3] = "Btn3", |
@@ -639,8 +641,8 @@ static char *keys[KEY_MAX + 1] = { | |||
639 | [BTN_TOOL_AIRBRUSH] = "ToolAirbrush", [BTN_TOOL_FINGER] = "ToolFinger", | 641 | [BTN_TOOL_AIRBRUSH] = "ToolAirbrush", [BTN_TOOL_FINGER] = "ToolFinger", |
640 | [BTN_TOOL_MOUSE] = "ToolMouse", [BTN_TOOL_LENS] = "ToolLens", | 642 | [BTN_TOOL_MOUSE] = "ToolMouse", [BTN_TOOL_LENS] = "ToolLens", |
641 | [BTN_TOUCH] = "Touch", [BTN_STYLUS] = "Stylus", | 643 | [BTN_TOUCH] = "Touch", [BTN_STYLUS] = "Stylus", |
642 | [BTN_STYLUS2] = "Stylus2", [BTN_TOOL_DOUBLETAP] = "Tool Doubletap", | 644 | [BTN_STYLUS2] = "Stylus2", [BTN_TOOL_DOUBLETAP] = "ToolDoubleTap", |
643 | [BTN_TOOL_TRIPLETAP] = "Tool Tripletap", [BTN_GEAR_DOWN] = "WheelBtn", | 645 | [BTN_TOOL_TRIPLETAP] = "ToolTripleTap", [BTN_GEAR_DOWN] = "WheelBtn", |
644 | [BTN_GEAR_UP] = "Gear up", [KEY_OK] = "Ok", | 646 | [BTN_GEAR_UP] = "Gear up", [KEY_OK] = "Ok", |
645 | [KEY_SELECT] = "Select", [KEY_GOTO] = "Goto", | 647 | [KEY_SELECT] = "Select", [KEY_GOTO] = "Goto", |
646 | [KEY_CLEAR] = "Clear", [KEY_POWER2] = "Power2", | 648 | [KEY_CLEAR] = "Clear", [KEY_POWER2] = "Power2", |
@@ -676,6 +678,9 @@ static char *keys[KEY_MAX + 1] = { | |||
676 | [KEY_TWEN] = "TWEN", [KEY_DEL_EOL] = "DeleteEOL", | 678 | [KEY_TWEN] = "TWEN", [KEY_DEL_EOL] = "DeleteEOL", |
677 | [KEY_DEL_EOS] = "DeleteEOS", [KEY_INS_LINE] = "InsertLine", | 679 | [KEY_DEL_EOS] = "DeleteEOS", [KEY_INS_LINE] = "InsertLine", |
678 | [KEY_DEL_LINE] = "DeleteLine", | 680 | [KEY_DEL_LINE] = "DeleteLine", |
681 | [KEY_SEND] = "Send", [KEY_REPLY] = "Reply", | ||
682 | [KEY_FORWARDMAIL] = "ForwardMail", [KEY_SAVE] = "Save", | ||
683 | [KEY_DOCUMENTS] = "Documents", | ||
679 | }; | 684 | }; |
680 | 685 | ||
681 | static char *relatives[REL_MAX + 1] = { | 686 | static char *relatives[REL_MAX + 1] = { |
diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c index fa4f79d88aa7..b28cf8593b48 100644 --- a/drivers/usb/input/hid-input.c +++ b/drivers/usb/input/hid-input.c | |||
@@ -78,8 +78,8 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
78 | { | 78 | { |
79 | struct input_dev *input = &hidinput->input; | 79 | struct input_dev *input = &hidinput->input; |
80 | struct hid_device *device = hidinput->input.private; | 80 | struct hid_device *device = hidinput->input.private; |
81 | int max, code; | 81 | int max = 0, code; |
82 | unsigned long *bit; | 82 | unsigned long *bit = NULL; |
83 | 83 | ||
84 | field->hidinput = hidinput; | 84 | field->hidinput = hidinput; |
85 | 85 | ||
@@ -248,7 +248,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
248 | case 0x034: map_key_clear(KEY_SLEEP); break; | 248 | case 0x034: map_key_clear(KEY_SLEEP); break; |
249 | case 0x036: map_key_clear(BTN_MISC); break; | 249 | case 0x036: map_key_clear(BTN_MISC); break; |
250 | case 0x08a: map_key_clear(KEY_WWW); break; | 250 | case 0x08a: map_key_clear(KEY_WWW); break; |
251 | case 0x08d: map_key_clear(KEY_PROGRAM); break; | ||
251 | case 0x095: map_key_clear(KEY_HELP); break; | 252 | case 0x095: map_key_clear(KEY_HELP); break; |
253 | case 0x09c: map_key_clear(KEY_CHANNELUP); break; | ||
254 | case 0x09d: map_key_clear(KEY_CHANNELDOWN); break; | ||
252 | case 0x0b0: map_key_clear(KEY_PLAY); break; | 255 | case 0x0b0: map_key_clear(KEY_PLAY); break; |
253 | case 0x0b1: map_key_clear(KEY_PAUSE); break; | 256 | case 0x0b1: map_key_clear(KEY_PAUSE); break; |
254 | case 0x0b2: map_key_clear(KEY_RECORD); break; | 257 | case 0x0b2: map_key_clear(KEY_RECORD); break; |
@@ -268,6 +271,11 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
268 | case 0x18a: map_key_clear(KEY_MAIL); break; | 271 | case 0x18a: map_key_clear(KEY_MAIL); break; |
269 | case 0x192: map_key_clear(KEY_CALC); break; | 272 | case 0x192: map_key_clear(KEY_CALC); break; |
270 | case 0x194: map_key_clear(KEY_FILE); break; | 273 | case 0x194: map_key_clear(KEY_FILE); break; |
274 | case 0x1a7: map_key_clear(KEY_DOCUMENTS); break; | ||
275 | case 0x201: map_key_clear(KEY_NEW); break; | ||
276 | case 0x207: map_key_clear(KEY_SAVE); break; | ||
277 | case 0x208: map_key_clear(KEY_PRINT); break; | ||
278 | case 0x209: map_key_clear(KEY_PROPS); break; | ||
271 | case 0x21a: map_key_clear(KEY_UNDO); break; | 279 | case 0x21a: map_key_clear(KEY_UNDO); break; |
272 | case 0x21b: map_key_clear(KEY_COPY); break; | 280 | case 0x21b: map_key_clear(KEY_COPY); break; |
273 | case 0x21c: map_key_clear(KEY_CUT); break; | 281 | case 0x21c: map_key_clear(KEY_CUT); break; |
@@ -280,7 +288,11 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
280 | case 0x227: map_key_clear(KEY_REFRESH); break; | 288 | case 0x227: map_key_clear(KEY_REFRESH); break; |
281 | case 0x22a: map_key_clear(KEY_BOOKMARKS); break; | 289 | case 0x22a: map_key_clear(KEY_BOOKMARKS); break; |
282 | case 0x238: map_rel(REL_HWHEEL); break; | 290 | case 0x238: map_rel(REL_HWHEEL); break; |
283 | default: goto unknown; | 291 | case 0x279: map_key_clear(KEY_REDO); break; |
292 | case 0x289: map_key_clear(KEY_REPLY); break; | ||
293 | case 0x28b: map_key_clear(KEY_FORWARDMAIL); break; | ||
294 | case 0x28c: map_key_clear(KEY_SEND); break; | ||
295 | default: goto ignore; | ||
284 | } | 296 | } |
285 | break; | 297 | break; |
286 | 298 | ||
@@ -306,6 +318,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
306 | 318 | ||
307 | case HID_UP_MSVENDOR: | 319 | case HID_UP_MSVENDOR: |
308 | case HID_UP_LOGIVENDOR: | 320 | case HID_UP_LOGIVENDOR: |
321 | case HID_UP_LOGIVENDOR2: | ||
309 | 322 | ||
310 | goto ignore; | 323 | goto ignore; |
311 | 324 | ||
diff --git a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h index cea5cf34b5f9..ca3e170ce0b3 100644 --- a/drivers/usb/input/hid.h +++ b/drivers/usb/input/hid.h | |||
@@ -184,6 +184,7 @@ struct hid_item { | |||
184 | #define HID_UP_HPVENDOR 0xff7f0000 | 184 | #define HID_UP_HPVENDOR 0xff7f0000 |
185 | #define HID_UP_MSVENDOR 0xff000000 | 185 | #define HID_UP_MSVENDOR 0xff000000 |
186 | #define HID_UP_LOGIVENDOR 0x00ff0000 | 186 | #define HID_UP_LOGIVENDOR 0x00ff0000 |
187 | #define HID_UP_LOGIVENDOR2 0xffbc0000 | ||
187 | 188 | ||
188 | #define HID_USAGE 0x0000ffff | 189 | #define HID_USAGE 0x0000ffff |
189 | 190 | ||