hid: support for bluetooth tivo slide remote and usb dongle
PATCH 1/1 hid: support for bluetooth tivo slide remote and usb dongle
This patch adds full support for the TiVo Slide Remote, primarily by way of extending the existing generic HID support. Only four keys are not usages within a standard usage page, but they're easily handled by the addition of a HID_UP_TIVOVENDOR usage page. Note that the UP is 0xffff, which matches the mask, but its also a valid vendor-specific UP, according to the spec.
What's actually connected to the computer is a Broadcom-made usb dongle, which has an embedded hub, bluetooth adapter, mouse and keyboard devices. You pair with the dongle, then the remote sends data that its converted into HID on the keyboard interface (the mouse interface doesn't do anything interesting right now, so far as I can tell).
lsusb for this device:
Bus 004 Device 005: ID 0a5c:2190 Broadcom Corp.
Bus 004 Device 004: ID 0a5c:4503 Broadcom Corp.
Bus 004 Device 003: ID 150a:1201
Bus 004 Device 002: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth)
Speaking of the keyboard interface, the remote actually does contain a keyboard as well. The top slides away, revealing a reasonably functional qwerty keyboard (not unlike many slide cell phones), thus the product name.
Now for some caveats... This device seems to report 0xc (consumer usage page) 0x20 ("+10") after most key presses. At the moment, this will simply be ignored, but if a mapping for that usage is added, the remote behaves very badly (we end up w/a repeating/stuck key until another key is pressed). Not quite sure what to do about that one, if that usage does get mapped. I guess a device-specific quirk to just ignore it would work.
Anyway, the thing is working 100% as expected with this patch right now.
Three more things to note... This patch fixes an incorrect mapping of 0xc 0x45, which was mapped to KEY_RADIO, which is definitely wrong, but may cause some existing device to now report KEY_RIGHT there. Second, there's also an unrelated fix for a redundant KERN_DEBUG in a dbg_hid call. Third, the additions to HID_UP_GENDESK aren't strictly needed by the remote, but the dongle does try to register those, and they're all technically correct, so I've included them for the benefit of a device that comes along and actually does try to use them.
Applies cleanly to hid master, tested w/a 2.6.35.4-based Fedora kernel.
--- drivers/hid/hid-input.c | 45 ++++++++++++++++++++++++++++++++++++++++----- include/linux/hid.h | 1 + 2 files changed, 41 insertions(+), 5 deletions(-)
drivers/hid/hid-input.c +40 -5
@@ -44,11 +44,11 @@ static const unsigned char hid_keyboard[256] = {72 ,73 ,82 ,83 ,86 ,127 ,116 ,117 ,183 ,184 ,185 ,186 ,187 ,188 ,189 ,190 ,191 ,192 ,193 ,194 ,134 ,138 ,130 ,132 ,128 ,129 ,131 ,137 ,133 ,135 ,136 ,113 ,115 ,114 ,unk,unk,unk,121 ,unk,89 ,93 ,124 ,92 ,94 ,95 ,unk,unk,unk, -122 ,123 ,90 ,91 ,85 ,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, +122 ,123 ,90 ,91 ,85 ,unk,unk,unk,unk,unk,unk,unk,111 ,unk,unk,unk, unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, unk,unk,unk,unk,unk,unk,179 ,180 ,unk,unk,unk,unk,unk,unk,unk,unk, unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, - unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, + unk,unk,unk,unk,unk,unk,unk,unk,111 ,unk,unk,unk,unk,unk,unk,unk,29 ,42 ,56 ,125 ,97 ,54 ,100 ,126 ,164 ,166 ,165 ,163 ,161 ,115 ,114 ,113 ,150 ,158 ,159 ,128 ,136 ,177 ,178 ,176 ,142 ,152 ,173 ,140 ,unk,unk,unk,unk };
@@ -136,7 +136,7 @@ static int hidinput_setkeycode(struct input_dev *dev,clear_bit (old_keycode, dev->keybit);set_bit (usage->code, dev->keybit); -dbg_hid (KERN_DEBUG "Assigned keycode %d to HID usage code %x\n" , keycode, scancode); +dbg_hid ("Assigned keycode %d to HID usage code %x\n" , keycode, scancode);/* Set the keybit for the old keycode if the old keycode is used * by another key */ if (hidinput_find_key (hid,0 , old_keycode))
@@ -235,6 +235,18 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x1 :map_key_clear (KEY_POWER );break ;case 0x2 :map_key_clear (KEY_SLEEP );break ;case 0x3 :map_key_clear (KEY_WAKEUP );break ; +case 0x4 :map_key_clear (KEY_CONTEXT_MENU );break ; +case 0x5 :map_key_clear (KEY_MENU );break ; +case 0x6 :map_key_clear (KEY_PROG1 );break ; +case 0x7 :map_key_clear (KEY_HELP );break ; +case 0x8 :map_key_clear (KEY_EXIT );break ; +case 0x9 :map_key_clear (KEY_SELECT );break ; +case 0xa :map_key_clear (KEY_RIGHT );break ; +case 0xb :map_key_clear (KEY_LEFT );break ; +case 0xc :map_key_clear (KEY_UP );break ; +case 0xd :map_key_clear (KEY_DOWN );break ; +case 0xe :map_key_clear (KEY_POWER2 );break ; +case 0xf :map_key_clear (KEY_RESTART );break ;default : goto unknown; }break ;
@@ -343,12 +355,24 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase HID_UP_CONSUMER :/* USB HUT v1.1, pages 56-62 */ switch (usage->hid &HID_USAGE ) {case 0x000 : goto ignore; +case 0x030 :map_key_clear (KEY_POWER );break ;case 0x034 :map_key_clear (KEY_SLEEP );break ;case 0x036 :map_key_clear (BTN_MISC );break ;case 0x040 :map_key_clear (KEY_MENU );break ; -case 0x045 :map_key_clear (KEY_RADIO );break ; - +case 0x041 :map_key_clear (KEY_SELECT );break ; +case 0x042 :map_key_clear (KEY_UP );break ; +case 0x043 :map_key_clear (KEY_DOWN );break ; +case 0x044 :map_key_clear (KEY_LEFT );break ; +case 0x045 :map_key_clear (KEY_RIGHT );break ; + +case 0x069 :map_key_clear (KEY_RED );break ; +case 0x06a :map_key_clear (KEY_GREEN );break ; +case 0x06b :map_key_clear (KEY_BLUE );break ; +case 0x06c :map_key_clear (KEY_YELLOW );break ; +case 0x06d :map_key_clear (KEY_ZOOM );break ; + +case 0x082 :map_key_clear (KEY_VIDEO_NEXT );break ;case 0x083 :map_key_clear (KEY_LAST );break ;case 0x088 :map_key_clear (KEY_PC );break ;case 0x089 :map_key_clear (KEY_TV );break ;
@@ -390,6 +414,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x0e5 :map_key_clear (KEY_BASSBOOST );break ;case 0x0e9 :map_key_clear (KEY_VOLUMEUP );break ;case 0x0ea :map_key_clear (KEY_VOLUMEDOWN );break ; +case 0x0f5 :map_key_clear (KEY_SLOW );break ;case 0x182 :map_key_clear (KEY_BOOKMARKS );break ;case 0x183 :map_key_clear (KEY_CONFIG );break ;
@@ -491,6 +516,16 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel }break ; +case HID_UP_TIVOVENDOR : +switch (usage->hid &HID_USAGE ) { +case 0x3d :map_key_clear (KEY_PROG1 );break ; +case 0x3e :map_key_clear (KEY_TV );break ; +case 0x41 :map_key_clear (KEY_PAGEDOWN );break ; +case 0x42 :map_key_clear (KEY_PAGEUP );break ; +default : goto unknown; + } +break ; +default : unknown:if (field->report_size ==1 ) {
include/linux/hid.h +1 -0
@@ -200,6 +200,7 @@ struct hid_item {#define HID_UP_MSVENDOR 0xff000000#define HID_UP_CUSTOM 0x00ff0000#define HID_UP_LOGIVENDOR 0xffbc0000 +#define HID_UP_TIVOVENDOR 0xffff0000#define HID_USAGE 0x0000ffff
Signature · 2 lines
Jarod Wilson [email protected]
PATCH 1/1 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.
---
Nb: This is being submitted for 2.6.40, but I'd certainly have no objections to it going into 2.6.39. :)
drivers/hid/hid-input.c | 60 ++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 52 insertions(+), 8 deletions(-)
drivers/hid/hid-input.c +52 -8
@@ -44,11 +44,11 @@ static const unsigned char hid_keyboard[256] = {72 ,73 ,82 ,83 ,86 ,127 ,116 ,117 ,183 ,184 ,185 ,186 ,187 ,188 ,189 ,190 ,191 ,192 ,193 ,194 ,134 ,138 ,130 ,132 ,128 ,129 ,131 ,137 ,133 ,135 ,136 ,113 ,115 ,114 ,unk,unk,unk,121 ,unk,89 ,93 ,124 ,92 ,94 ,95 ,unk,unk,unk, -122 ,123 ,90 ,91 ,85 ,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, +122 ,123 ,90 ,91 ,85 ,unk,unk,unk,unk,unk,unk,unk,111 ,unk,unk,unk, unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, unk,unk,unk,unk,unk,unk,179 ,180 ,unk,unk,unk,unk,unk,unk,unk,unk, unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, - unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, + unk,unk,unk,unk,unk,unk,unk,unk,111 ,unk,unk,unk,unk,unk,unk,unk,29 ,42 ,56 ,125 ,97 ,54 ,100 ,126 ,164 ,166 ,165 ,163 ,161 ,115 ,114 ,113 ,150 ,158 ,159 ,128 ,136 ,177 ,178 ,176 ,142 ,152 ,173 ,140 ,unk,unk,unk,unk };
@@ -365,6 +365,18 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x1 :map_key_clear (KEY_POWER );break ;case 0x2 :map_key_clear (KEY_SLEEP );break ;case 0x3 :map_key_clear (KEY_WAKEUP );break ; +case 0x4 :map_key_clear (KEY_CONTEXT_MENU );break ; +case 0x5 :map_key_clear (KEY_MENU );break ; +case 0x6 :map_key_clear (KEY_PROG1 );break ; +case 0x7 :map_key_clear (KEY_HELP );break ; +case 0x8 :map_key_clear (KEY_EXIT );break ; +case 0x9 :map_key_clear (KEY_SELECT );break ; +case 0xa :map_key_clear (KEY_RIGHT );break ; +case 0xb :map_key_clear (KEY_LEFT );break ; +case 0xc :map_key_clear (KEY_UP );break ; +case 0xd :map_key_clear (KEY_DOWN );break ; +case 0xe :map_key_clear (KEY_POWER2 );break ; +case 0xf :map_key_clear (KEY_RESTART );break ;default : goto unknown; }break ;
@@ -474,16 +486,39 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel }break ; -case HID_UP_CONSUMER :/* USB HUT v1.1, pages 56-62 */ +case HID_UP_CONSUMER :/* USB HUT v1.12, pages 75-84 */ switch (usage->hid &HID_USAGE ) {case 0x000 : goto ignore; +case 0x030 :map_key_clear (KEY_POWER );break ; +case 0x031 :map_key_clear (KEY_RESTART );break ; +case 0x032 :map_key_clear (KEY_SLEEP );break ;case 0x034 :map_key_clear (KEY_SLEEP );break ; +case 0x035 :map_key_clear (KEY_KBDILLUMTOGGLE );break ;case 0x036 :map_key_clear (BTN_MISC );break ; -case 0x040 :map_key_clear (KEY_MENU );break ; -case 0x045 :map_key_clear (KEY_RADIO );break ; - +case 0x040 :map_key_clear (KEY_MENU );break ;/* Menu */ +case 0x041 :map_key_clear (KEY_SELECT );break ;/* Menu Pick */ +case 0x042 :map_key_clear (KEY_UP );break ;/* Menu Up */ +case 0x043 :map_key_clear (KEY_DOWN );break ;/* Menu Down */ +case 0x044 :map_key_clear (KEY_LEFT );break ;/* Menu Left */ +case 0x045 :map_key_clear (KEY_RIGHT );break ;/* Menu Right */ +case 0x046 :map_key_clear (KEY_ESC );break ;/* Menu Escape */ +case 0x047 :map_key_clear (KEY_KPPLUS );break ;/* Menu Value Increase */ +case 0x048 :map_key_clear (KEY_KPMINUS );break ;/* Menu Value Decrease */ + +case 0x060 :map_key_clear (KEY_INFO );break ;/* Data On Screen */ +case 0x061 :map_key_clear (KEY_SUBTITLE );break ;/* Closed Caption */ +case 0x063 :map_key_clear (KEY_VCR );break ;/* VCR/TV */ +case 0x065 :map_key_clear (KEY_CAMERA );break ;/* Snapshot */ +case 0x069 :map_key_clear (KEY_RED );break ; +case 0x06a :map_key_clear (KEY_GREEN );break ; +case 0x06b :map_key_clear (KEY_BLUE );break ; +case 0x06c :map_key_clear (KEY_YELLOW );break ; +case 0x06d :map_key_clear (KEY_ZOOM );break ; + +case 0x082 :map_key_clear (KEY_VIDEO_NEXT );break ;case 0x083 :map_key_clear (KEY_LAST );break ; +case 0x084 :map_key_clear (KEY_ENTER );break ;case 0x088 :map_key_clear (KEY_PC );break ;case 0x089 :map_key_clear (KEY_TV );break ;case 0x08a :map_key_clear (KEY_WWW );break ;
@@ -517,6 +552,8 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x0b7 :map_key_clear (KEY_STOPCD );break ;case 0x0b8 :map_key_clear (KEY_EJECTCD );break ;case 0x0bc :map_key_clear (KEY_MEDIA_REPEAT );break ; +case 0x0b9 :map_key_clear (KEY_SHUFFLE );break ; +case 0x0bf :map_key_clear (KEY_SLOW );break ;case 0x0cd :map_key_clear (KEY_PLAYPAUSE );break ;case 0x0e0 :map_abs_clear (ABS_VOLUME );break ;
@@ -524,6 +561,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x0e5 :map_key_clear (KEY_BASSBOOST );break ;case 0x0e9 :map_key_clear (KEY_VOLUMEUP );break ;case 0x0ea :map_key_clear (KEY_VOLUMEDOWN );break ; +case 0x0f5 :map_key_clear (KEY_SLOW );break ;case 0x182 :map_key_clear (KEY_BOOKMARKS );break ;case 0x183 :map_key_clear (KEY_CONFIG );break ;
@@ -540,6 +578,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x18e :map_key_clear (KEY_CALENDAR );break ;case 0x191 :map_key_clear (KEY_FINANCE );break ;case 0x192 :map_key_clear (KEY_CALC );break ; +case 0x192 :map_key_clear (KEY_PLAYER );break ;case 0x194 :map_key_clear (KEY_FILE );break ;case 0x196 :map_key_clear (KEY_WWW );break ;case 0x199 :map_key_clear (KEY_CHAT );break ;
@@ -548,8 +587,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x1a6 :map_key_clear (KEY_HELP );break ;case 0x1a7 :map_key_clear (KEY_DOCUMENTS );break ;case 0x1ab :map_key_clear (KEY_SPELLCHECK );break ; -case 0x1b6 :map_key_clear (KEY_MEDIA );break ; -case 0x1b7 :map_key_clear (KEY_SOUND );break ; +case 0x1ae :map_key_clear (KEY_KEYBOARD );break ; +case 0x1b6 :map_key_clear (KEY_IMAGES );break ; +case 0x1b7 :map_key_clear (KEY_AUDIO );break ; +case 0x1b8 :map_key_clear (KEY_VIDEO );break ;case 0x1bc :map_key_clear (KEY_MESSENGER );break ;case 0x1bd :map_key_clear (KEY_INFO );break ;case 0x201 :map_key_clear (KEY_NEW );break ;
@@ -578,7 +619,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x233 :map_key_clear (KEY_SCROLLUP );break ;case 0x234 :map_key_clear (KEY_SCROLLDOWN );break ;case 0x238 :map_rel (REL_HWHEEL );break ; +case 0x23d :map_key_clear (KEY_EDIT );break ;case 0x25f :map_key_clear (KEY_CANCEL );break ; +case 0x269 :map_key_clear (KEY_INSERT );break ; +case 0x26a :map_key_clear (KEY_DELETE );break ;case 0x279 :map_key_clear (KEY_REDO );break ;case 0x289 :map_key_clear (KEY_REPLY );break ;
Signature · 1 line
1.7.1
Re: [PATCH] hid: assorted usage updates from hut 1.12
Quoted 32 lines · Jarod Wilson
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 tohid-input.cwith 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
0xc0x45fromKEY_RADIOtoKEY_RIGHT, and making use of the newKEY_IMAGES(just added in 2.6.39-rc4) for AL Image Browser instead ofKEY_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.cfollow-up.CC Dmitry Torokhov<[email protected]>CC Jiri Kosina<[email protected]>Signed-off-by Jarod Wilson<[email protected]>---
Nb: This is being submitted for 2.6.40, but I'd certainly have no objections to it going into 2.6.39. :)drivers/hid/hid-input.c | 60 ++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 52 insertions(+), 8 deletions(-)drivers/hid/hid-input.c +0
-0
...
drivers/hid/hid-input.c static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel · line 581
Quoted 5 lines
drivers/hid/hid-input.c +1
-0@@ -540,6 +578,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x18e :map_key_clear (KEY_CALENDAR );break ;case 0x191 :map_key_clear (KEY_FINANCE );break ;case 0x192 :map_key_clear (KEY_CALC );break ; +case 0x192 :map_key_clear (KEY_PLAYER );break ;
Sigh. I thought I'd re-tested after my last round of additions, but obviously not, since this will fail to build, because KEY_PLAYER should be case 0x193, rather than a duplicate... Will resubmit once I'm 100% positive things actually build and function. :\
Signature · 2 lines
Jarod Wilson [email protected]
PATCH v2 1/1 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.
---
v2: fix incorrect duplicate case value for KEY_PLAYER mapping
drivers/hid/hid-input.c | 60 ++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 52 insertions(+), 8 deletions(-)
drivers/hid/hid-input.c +52 -8
@@ -44,11 +44,11 @@ static const unsigned char hid_keyboard[256] = {72 ,73 ,82 ,83 ,86 ,127 ,116 ,117 ,183 ,184 ,185 ,186 ,187 ,188 ,189 ,190 ,191 ,192 ,193 ,194 ,134 ,138 ,130 ,132 ,128 ,129 ,131 ,137 ,133 ,135 ,136 ,113 ,115 ,114 ,unk,unk,unk,121 ,unk,89 ,93 ,124 ,92 ,94 ,95 ,unk,unk,unk, -122 ,123 ,90 ,91 ,85 ,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, +122 ,123 ,90 ,91 ,85 ,unk,unk,unk,unk,unk,unk,unk,111 ,unk,unk,unk, unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, unk,unk,unk,unk,unk,unk,179 ,180 ,unk,unk,unk,unk,unk,unk,unk,unk, unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, - unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, + unk,unk,unk,unk,unk,unk,unk,unk,111 ,unk,unk,unk,unk,unk,unk,unk,29 ,42 ,56 ,125 ,97 ,54 ,100 ,126 ,164 ,166 ,165 ,163 ,161 ,115 ,114 ,113 ,150 ,158 ,159 ,128 ,136 ,177 ,178 ,176 ,142 ,152 ,173 ,140 ,unk,unk,unk,unk };
@@ -365,6 +365,18 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x1 :map_key_clear (KEY_POWER );break ;case 0x2 :map_key_clear (KEY_SLEEP );break ;case 0x3 :map_key_clear (KEY_WAKEUP );break ; +case 0x4 :map_key_clear (KEY_CONTEXT_MENU );break ; +case 0x5 :map_key_clear (KEY_MENU );break ; +case 0x6 :map_key_clear (KEY_PROG1 );break ; +case 0x7 :map_key_clear (KEY_HELP );break ; +case 0x8 :map_key_clear (KEY_EXIT );break ; +case 0x9 :map_key_clear (KEY_SELECT );break ; +case 0xa :map_key_clear (KEY_RIGHT );break ; +case 0xb :map_key_clear (KEY_LEFT );break ; +case 0xc :map_key_clear (KEY_UP );break ; +case 0xd :map_key_clear (KEY_DOWN );break ; +case 0xe :map_key_clear (KEY_POWER2 );break ; +case 0xf :map_key_clear (KEY_RESTART );break ;default : goto unknown; }break ;
@@ -474,16 +486,39 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel }break ; -case HID_UP_CONSUMER :/* USB HUT v1.1, pages 56-62 */ +case HID_UP_CONSUMER :/* USB HUT v1.12, pages 75-84 */ switch (usage->hid &HID_USAGE ) {case 0x000 : goto ignore; +case 0x030 :map_key_clear (KEY_POWER );break ; +case 0x031 :map_key_clear (KEY_RESTART );break ; +case 0x032 :map_key_clear (KEY_SLEEP );break ;case 0x034 :map_key_clear (KEY_SLEEP );break ; +case 0x035 :map_key_clear (KEY_KBDILLUMTOGGLE );break ;case 0x036 :map_key_clear (BTN_MISC );break ; -case 0x040 :map_key_clear (KEY_MENU );break ; -case 0x045 :map_key_clear (KEY_RADIO );break ; - +case 0x040 :map_key_clear (KEY_MENU );break ;/* Menu */ +case 0x041 :map_key_clear (KEY_SELECT );break ;/* Menu Pick */ +case 0x042 :map_key_clear (KEY_UP );break ;/* Menu Up */ +case 0x043 :map_key_clear (KEY_DOWN );break ;/* Menu Down */ +case 0x044 :map_key_clear (KEY_LEFT );break ;/* Menu Left */ +case 0x045 :map_key_clear (KEY_RIGHT );break ;/* Menu Right */ +case 0x046 :map_key_clear (KEY_ESC );break ;/* Menu Escape */ +case 0x047 :map_key_clear (KEY_KPPLUS );break ;/* Menu Value Increase */ +case 0x048 :map_key_clear (KEY_KPMINUS );break ;/* Menu Value Decrease */ + +case 0x060 :map_key_clear (KEY_INFO );break ;/* Data On Screen */ +case 0x061 :map_key_clear (KEY_SUBTITLE );break ;/* Closed Caption */ +case 0x063 :map_key_clear (KEY_VCR );break ;/* VCR/TV */ +case 0x065 :map_key_clear (KEY_CAMERA );break ;/* Snapshot */ +case 0x069 :map_key_clear (KEY_RED );break ; +case 0x06a :map_key_clear (KEY_GREEN );break ; +case 0x06b :map_key_clear (KEY_BLUE );break ; +case 0x06c :map_key_clear (KEY_YELLOW );break ; +case 0x06d :map_key_clear (KEY_ZOOM );break ; + +case 0x082 :map_key_clear (KEY_VIDEO_NEXT );break ;case 0x083 :map_key_clear (KEY_LAST );break ; +case 0x084 :map_key_clear (KEY_ENTER );break ;case 0x088 :map_key_clear (KEY_PC );break ;case 0x089 :map_key_clear (KEY_TV );break ;case 0x08a :map_key_clear (KEY_WWW );break ;
@@ -517,6 +552,8 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x0b7 :map_key_clear (KEY_STOPCD );break ;case 0x0b8 :map_key_clear (KEY_EJECTCD );break ;case 0x0bc :map_key_clear (KEY_MEDIA_REPEAT );break ; +case 0x0b9 :map_key_clear (KEY_SHUFFLE );break ; +case 0x0bf :map_key_clear (KEY_SLOW );break ;case 0x0cd :map_key_clear (KEY_PLAYPAUSE );break ;case 0x0e0 :map_abs_clear (ABS_VOLUME );break ;
@@ -524,6 +561,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x0e5 :map_key_clear (KEY_BASSBOOST );break ;case 0x0e9 :map_key_clear (KEY_VOLUMEUP );break ;case 0x0ea :map_key_clear (KEY_VOLUMEDOWN );break ; +case 0x0f5 :map_key_clear (KEY_SLOW );break ;case 0x182 :map_key_clear (KEY_BOOKMARKS );break ;case 0x183 :map_key_clear (KEY_CONFIG );break ;
@@ -540,6 +578,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x18e :map_key_clear (KEY_CALENDAR );break ;case 0x191 :map_key_clear (KEY_FINANCE );break ;case 0x192 :map_key_clear (KEY_CALC );break ; +case 0x193 :map_key_clear (KEY_PLAYER );break ;case 0x194 :map_key_clear (KEY_FILE );break ;case 0x196 :map_key_clear (KEY_WWW );break ;case 0x199 :map_key_clear (KEY_CHAT );break ;
@@ -548,8 +587,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x1a6 :map_key_clear (KEY_HELP );break ;case 0x1a7 :map_key_clear (KEY_DOCUMENTS );break ;case 0x1ab :map_key_clear (KEY_SPELLCHECK );break ; -case 0x1b6 :map_key_clear (KEY_MEDIA );break ; -case 0x1b7 :map_key_clear (KEY_SOUND );break ; +case 0x1ae :map_key_clear (KEY_KEYBOARD );break ; +case 0x1b6 :map_key_clear (KEY_IMAGES );break ; +case 0x1b7 :map_key_clear (KEY_AUDIO );break ; +case 0x1b8 :map_key_clear (KEY_VIDEO );break ;case 0x1bc :map_key_clear (KEY_MESSENGER );break ;case 0x1bd :map_key_clear (KEY_INFO );break ;case 0x201 :map_key_clear (KEY_NEW );break ;
@@ -578,7 +619,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x233 :map_key_clear (KEY_SCROLLUP );break ;case 0x234 :map_key_clear (KEY_SCROLLDOWN );break ;case 0x238 :map_rel (REL_HWHEEL );break ; +case 0x23d :map_key_clear (KEY_EDIT );break ;case 0x25f :map_key_clear (KEY_CANCEL );break ; +case 0x269 :map_key_clear (KEY_INSERT );break ; +case 0x26a :map_key_clear (KEY_DELETE );break ;case 0x279 :map_key_clear (KEY_REDO );break ;case 0x289 :map_key_clear (KEY_REPLY );break ;
Signature · 1 line
1.7.1
Re: [PATCH v2] hid: assorted usage updates from hut 1.12
Quoted 8 lines · Jarod Wilson
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 tohid-input.cwith 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[*].
Quoted 7 lines
Outside of fixing the obviously incorrect mapping of
0xc0x45fromKEY_RADIOtoKEY_RIGHT, and making use of the newKEY_IMAGES(just added in 2.6.39-rc4) for AL Image Browser instead ofKEY_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.
It took me quite some time to go over the individual changes, sorry for the delay. I have applied the patch.
Thanks,
Signature · 2 lines
Jiri Kosina SUSE Labs
Re: [PATCH v2] hid: assorted usage updates from hut 1.12
Quoted 18 lines · Jiri Kosina
Quoted 8 lines · Jarod Wilson
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 tohid-input.cwith 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[*].Quoted 7 lines
Outside of fixing the obviously incorrect mapping of
0xc0x45fromKEY_RADIOtoKEY_RIGHT, and making use of the newKEY_IMAGES(just added in 2.6.39-rc4) for AL Image Browser instead ofKEY_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.
Quoted 2 lines
It took me quite some time to go over the individual changes, sorry for the delay. I have applied the patch.
Cool, thanks much. Any word on the follow-on TiVo Slide patch?
Signature · 2 lines
Jarod Wilson [email protected]
Re: [PATCH v2] hid: assorted usage updates from hut 1.12
Quoted 8 lines · Jarod Wilson
Quoted 8 lines
Quoted 7 lines
Outside of fixing the obviously incorrect mapping of
0xc0x45fromKEY_RADIOtoKEY_RIGHT, and making use of the newKEY_IMAGES(just added in 2.6.39-rc4) for AL Image Browser instead ofKEY_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.
Quoted 4 lines
Quoted 2 lines
It took me quite some time to go over the individual changes, sorry for the delay. I have applied the patch.
Cool, thanks much. Any word on the follow-on TiVo Slide patch?
Hmm, it might have escaped my attention, I don't seem to have it in my queue. Could you please resend it?
Thanks,
Signature · 2 lines
Jiri Kosina SUSE Labs
Re: [PATCH v2] hid: assorted usage updates from hut 1.12
Quoted 9 lines · Jiri Kosina
Quoted 7 lines · Jarod Wilson
Quoted 7 lines
Quoted 7 lines
Outside of fixing the obviously incorrect mapping of
0xc0x45fromKEY_RADIOtoKEY_RIGHT, and making use of the newKEY_IMAGES(just added in 2.6.39-rc4) for AL Image Browser instead ofKEY_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.
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines
It took me quite some time to go over the individual changes, sorry for the delay. I have applied the patch.
Cool, thanks much. Any word on the follow-on TiVo Slide patch?
Hmm, it might have escaped my attention, I don't seem to have it in my queue. Could you please resend it?
Gah. Seems I should send it, period. I now have vague recollections that I decided to refrain from sending the follow-on patch until this patch was accepted. I'll get the TiVo Slide one sent along shortly.
Sorry for the confusion,
Signature · 2 lines
Jarod Wilson [email protected]