aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2011-04-19 15:28:30 -0400
committerJiri Kosina <jkosina@suse.cz>2011-05-18 11:07:34 -0400
commit437f3b199c437e2a9ac01b9ab733c78e5fc7c720 (patch)
treefdd82f76f1dab5f7b2e0e1009d8cb6a6cf44225d /drivers/hid
parent6b7b8e488bbdedeccabdd001a78ffcbe43bb8a3a (diff)
HID: assorted usage updates from hut 1.12
I've got a Tivo Slide bluetooth remote/dongle, which uses a fair number of hid usages that aren't currently mapped in hid-input.c. I'd initially written additions to hid-input.c with just this device in mind, including some bits that were specific to the device. This go around, I'm looking at adding/correcting as many generic HID usages from the HID Usage Tables, version 1.12, as I can -- which also serves to enable all but four of the buttons on the Tivo Slide remote[*]. Outside of fixing the obviously incorrect mapping of 0xc 0x45 from KEY_RADIO to KEY_RIGHT, and making use of the new KEY_IMAGES (just added in 2.6.39-rc4) for AL Image Browser instead of KEY_MEDIA, these are purely additions, and thus should have no negative impact on any already functional HID devices. Most of the added mappings seemed to be perfectly logical to me, but there were a few that were mapped on more of an "I think this makes the most sense" basis. [*] I'll handle the last four tivo buttons via an hid-tivo.c follow-up. CC: Dmitry Torokhov <dmitry.torokhov@gmail.com> CC: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-input.c60
1 files changed, 52 insertions, 8 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 33dde8724e02..6559e2e3364e 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -44,11 +44,11 @@ static const unsigned char hid_keyboard[256] = {
44 72, 73, 82, 83, 86,127,116,117,183,184,185,186,187,188,189,190, 44 72, 73, 82, 83, 86,127,116,117,183,184,185,186,187,188,189,190,
45 191,192,193,194,134,138,130,132,128,129,131,137,133,135,136,113, 45 191,192,193,194,134,138,130,132,128,129,131,137,133,135,136,113,
46 115,114,unk,unk,unk,121,unk, 89, 93,124, 92, 94, 95,unk,unk,unk, 46 115,114,unk,unk,unk,121,unk, 89, 93,124, 92, 94, 95,unk,unk,unk,
47 122,123, 90, 91, 85,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, 47 122,123, 90, 91, 85,unk,unk,unk,unk,unk,unk,unk,111,unk,unk,unk,
48 unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, 48 unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,
49 unk,unk,unk,unk,unk,unk,179,180,unk,unk,unk,unk,unk,unk,unk,unk, 49 unk,unk,unk,unk,unk,unk,179,180,unk,unk,unk,unk,unk,unk,unk,unk,
50 unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, 50 unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,
51 unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, 51 unk,unk,unk,unk,unk,unk,unk,unk,111,unk,unk,unk,unk,unk,unk,unk,
52 29, 42, 56,125, 97, 54,100,126,164,166,165,163,161,115,114,113, 52 29, 42, 56,125, 97, 54,100,126,164,166,165,163,161,115,114,113,
53 150,158,159,128,136,177,178,176,142,152,173,140,unk,unk,unk,unk 53 150,158,159,128,136,177,178,176,142,152,173,140,unk,unk,unk,unk
54}; 54};
@@ -357,6 +357,18 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
357 case 0x1: map_key_clear(KEY_POWER); break; 357 case 0x1: map_key_clear(KEY_POWER); break;
358 case 0x2: map_key_clear(KEY_SLEEP); break; 358 case 0x2: map_key_clear(KEY_SLEEP); break;
359 case 0x3: map_key_clear(KEY_WAKEUP); break; 359 case 0x3: map_key_clear(KEY_WAKEUP); break;
360 case 0x4: map_key_clear(KEY_CONTEXT_MENU); break;
361 case 0x5: map_key_clear(KEY_MENU); break;
362 case 0x6: map_key_clear(KEY_PROG1); break;
363 case 0x7: map_key_clear(KEY_HELP); break;
364 case 0x8: map_key_clear(KEY_EXIT); break;
365 case 0x9: map_key_clear(KEY_SELECT); break;
366 case 0xa: map_key_clear(KEY_RIGHT); break;
367 case 0xb: map_key_clear(KEY_LEFT); break;
368 case 0xc: map_key_clear(KEY_UP); break;
369 case 0xd: map_key_clear(KEY_DOWN); break;
370 case 0xe: map_key_clear(KEY_POWER2); break;
371 case 0xf: map_key_clear(KEY_RESTART); break;
360 default: goto unknown; 372 default: goto unknown;
361 } 373 }
362 break; 374 break;
@@ -466,16 +478,39 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
466 } 478 }
467 break; 479 break;
468 480
469 case HID_UP_CONSUMER: /* USB HUT v1.1, pages 56-62 */ 481 case HID_UP_CONSUMER: /* USB HUT v1.12, pages 75-84 */
470 switch (usage->hid & HID_USAGE) { 482 switch (usage->hid & HID_USAGE) {
471 case 0x000: goto ignore; 483 case 0x000: goto ignore;
484 case 0x030: map_key_clear(KEY_POWER); break;
485 case 0x031: map_key_clear(KEY_RESTART); break;
486 case 0x032: map_key_clear(KEY_SLEEP); break;
472 case 0x034: map_key_clear(KEY_SLEEP); break; 487 case 0x034: map_key_clear(KEY_SLEEP); break;
488 case 0x035: map_key_clear(KEY_KBDILLUMTOGGLE); break;
473 case 0x036: map_key_clear(BTN_MISC); break; 489 case 0x036: map_key_clear(BTN_MISC); break;
474 490
475 case 0x040: map_key_clear(KEY_MENU); break; 491 case 0x040: map_key_clear(KEY_MENU); break; /* Menu */
476 case 0x045: map_key_clear(KEY_RADIO); break; 492 case 0x041: map_key_clear(KEY_SELECT); break; /* Menu Pick */
477 493 case 0x042: map_key_clear(KEY_UP); break; /* Menu Up */
494 case 0x043: map_key_clear(KEY_DOWN); break; /* Menu Down */
495 case 0x044: map_key_clear(KEY_LEFT); break; /* Menu Left */
496 case 0x045: map_key_clear(KEY_RIGHT); break; /* Menu Right */
497 case 0x046: map_key_clear(KEY_ESC); break; /* Menu Escape */
498 case 0x047: map_key_clear(KEY_KPPLUS); break; /* Menu Value Increase */
499 case 0x048: map_key_clear(KEY_KPMINUS); break; /* Menu Value Decrease */
500
501 case 0x060: map_key_clear(KEY_INFO); break; /* Data On Screen */
502 case 0x061: map_key_clear(KEY_SUBTITLE); break; /* Closed Caption */
503 case 0x063: map_key_clear(KEY_VCR); break; /* VCR/TV */
504 case 0x065: map_key_clear(KEY_CAMERA); break; /* Snapshot */
505 case 0x069: map_key_clear(KEY_RED); break;
506 case 0x06a: map_key_clear(KEY_GREEN); break;
507 case 0x06b: map_key_clear(KEY_BLUE); break;
508 case 0x06c: map_key_clear(KEY_YELLOW); break;
509 case 0x06d: map_key_clear(KEY_ZOOM); break;
510
511 case 0x082: map_key_clear(KEY_VIDEO_NEXT); break;
478 case 0x083: map_key_clear(KEY_LAST); break; 512 case 0x083: map_key_clear(KEY_LAST); break;
513 case 0x084: map_key_clear(KEY_ENTER); break;
479 case 0x088: map_key_clear(KEY_PC); break; 514 case 0x088: map_key_clear(KEY_PC); break;
480 case 0x089: map_key_clear(KEY_TV); break; 515 case 0x089: map_key_clear(KEY_TV); break;
481 case 0x08a: map_key_clear(KEY_WWW); break; 516 case 0x08a: map_key_clear(KEY_WWW); break;
@@ -509,6 +544,8 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
509 case 0x0b7: map_key_clear(KEY_STOPCD); break; 544 case 0x0b7: map_key_clear(KEY_STOPCD); break;
510 case 0x0b8: map_key_clear(KEY_EJECTCD); break; 545 case 0x0b8: map_key_clear(KEY_EJECTCD); break;
511 case 0x0bc: map_key_clear(KEY_MEDIA_REPEAT); break; 546 case 0x0bc: map_key_clear(KEY_MEDIA_REPEAT); break;
547 case 0x0b9: map_key_clear(KEY_SHUFFLE); break;
548 case 0x0bf: map_key_clear(KEY_SLOW); break;
512 549
513 case 0x0cd: map_key_clear(KEY_PLAYPAUSE); break; 550 case 0x0cd: map_key_clear(KEY_PLAYPAUSE); break;
514 case 0x0e0: map_abs_clear(ABS_VOLUME); break; 551 case 0x0e0: map_abs_clear(ABS_VOLUME); break;
@@ -516,6 +553,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
516 case 0x0e5: map_key_clear(KEY_BASSBOOST); break; 553 case 0x0e5: map_key_clear(KEY_BASSBOOST); break;
517 case 0x0e9: map_key_clear(KEY_VOLUMEUP); break; 554 case 0x0e9: map_key_clear(KEY_VOLUMEUP); break;
518 case 0x0ea: map_key_clear(KEY_VOLUMEDOWN); break; 555 case 0x0ea: map_key_clear(KEY_VOLUMEDOWN); break;
556 case 0x0f5: map_key_clear(KEY_SLOW); break;
519 557
520 case 0x182: map_key_clear(KEY_BOOKMARKS); break; 558 case 0x182: map_key_clear(KEY_BOOKMARKS); break;
521 case 0x183: map_key_clear(KEY_CONFIG); break; 559 case 0x183: map_key_clear(KEY_CONFIG); break;
@@ -532,6 +570,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
532 case 0x18e: map_key_clear(KEY_CALENDAR); break; 570 case 0x18e: map_key_clear(KEY_CALENDAR); break;
533 case 0x191: map_key_clear(KEY_FINANCE); break; 571 case 0x191: map_key_clear(KEY_FINANCE); break;
534 case 0x192: map_key_clear(KEY_CALC); break; 572 case 0x192: map_key_clear(KEY_CALC); break;
573 case 0x193: map_key_clear(KEY_PLAYER); break;
535 case 0x194: map_key_clear(KEY_FILE); break; 574 case 0x194: map_key_clear(KEY_FILE); break;
536 case 0x196: map_key_clear(KEY_WWW); break; 575 case 0x196: map_key_clear(KEY_WWW); break;
537 case 0x199: map_key_clear(KEY_CHAT); break; 576 case 0x199: map_key_clear(KEY_CHAT); break;
@@ -540,8 +579,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
540 case 0x1a6: map_key_clear(KEY_HELP); break; 579 case 0x1a6: map_key_clear(KEY_HELP); break;
541 case 0x1a7: map_key_clear(KEY_DOCUMENTS); break; 580 case 0x1a7: map_key_clear(KEY_DOCUMENTS); break;
542 case 0x1ab: map_key_clear(KEY_SPELLCHECK); break; 581 case 0x1ab: map_key_clear(KEY_SPELLCHECK); break;
543 case 0x1b6: map_key_clear(KEY_MEDIA); break; 582 case 0x1ae: map_key_clear(KEY_KEYBOARD); break;
544 case 0x1b7: map_key_clear(KEY_SOUND); break; 583 case 0x1b6: map_key_clear(KEY_IMAGES); break;
584 case 0x1b7: map_key_clear(KEY_AUDIO); break;
585 case 0x1b8: map_key_clear(KEY_VIDEO); break;
545 case 0x1bc: map_key_clear(KEY_MESSENGER); break; 586 case 0x1bc: map_key_clear(KEY_MESSENGER); break;
546 case 0x1bd: map_key_clear(KEY_INFO); break; 587 case 0x1bd: map_key_clear(KEY_INFO); break;
547 case 0x201: map_key_clear(KEY_NEW); break; 588 case 0x201: map_key_clear(KEY_NEW); break;
@@ -570,7 +611,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
570 case 0x233: map_key_clear(KEY_SCROLLUP); break; 611 case 0x233: map_key_clear(KEY_SCROLLUP); break;
571 case 0x234: map_key_clear(KEY_SCROLLDOWN); break; 612 case 0x234: map_key_clear(KEY_SCROLLDOWN); break;
572 case 0x238: map_rel(REL_HWHEEL); break; 613 case 0x238: map_rel(REL_HWHEEL); break;
614 case 0x23d: map_key_clear(KEY_EDIT); break;
573 case 0x25f: map_key_clear(KEY_CANCEL); break; 615 case 0x25f: map_key_clear(KEY_CANCEL); break;
616 case 0x269: map_key_clear(KEY_INSERT); break;
617 case 0x26a: map_key_clear(KEY_DELETE); break;
574 case 0x279: map_key_clear(KEY_REDO); break; 618 case 0x279: map_key_clear(KEY_REDO); break;
575 619
576 case 0x289: map_key_clear(KEY_REPLY); break; 620 case 0x289: map_key_clear(KEY_REPLY); break;