* [PATCH] hid: support for bluetooth tivo slide remote and usb dongle
@ 2010-09-07 15:49 Jarod Wilson
2011-04-19 17:35 ` [PATCH] hid: assorted usage updates from hut 1.12 Jarod Wilson
0 siblings, 1 reply; 8+ messages in thread
From: Jarod Wilson @ 2010-09-07 15:49 UTC (permalink / raw)
To: linux-input; +Cc: Wayne Thomas, jmk
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.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
drivers/hid/hid-input.c | 45 ++++++++++++++++++++++++++++++++++++++++-----
include/linux/hid.h | 1 +
2 files changed, 41 insertions(+), 5 deletions(-)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 6c03dcc..bd1479e 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -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_fiel
case 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_fiel
case 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_fiel
case 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) {
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 42a0f1d..083cfb2 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -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
--
Jarod Wilson
jarod@redhat.com
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] hid: assorted usage updates from hut 1.12
2010-09-07 15:49 [PATCH] hid: support for bluetooth tivo slide remote and usb dongle Jarod Wilson
@ 2011-04-19 17:35 ` Jarod Wilson
2011-04-19 19:13 ` Jarod Wilson
0 siblings, 1 reply; 8+ messages in thread
From: Jarod Wilson @ 2011-04-19 17:35 UTC (permalink / raw)
To: linux-input; +Cc: Jarod Wilson, Dmitry Torokhov, Jiri Kosina
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>
---
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(-)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 7f552bf..84d50e7 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -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_fiel
case 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_fiel
case 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_fiel
case 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_fiel
case 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_fiel
case 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_fiel
case 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;
--
1.7.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] hid: assorted usage updates from hut 1.12
2011-04-19 17:35 ` [PATCH] hid: assorted usage updates from hut 1.12 Jarod Wilson
@ 2011-04-19 19:13 ` Jarod Wilson
2011-04-19 19:28 ` [PATCH v2] " Jarod Wilson
0 siblings, 1 reply; 8+ messages in thread
From: Jarod Wilson @ 2011-04-19 19:13 UTC (permalink / raw)
To: linux-input; +Cc: Dmitry Torokhov, Jiri Kosina
Jarod Wilson wrote:
> 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>
> ---
> 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(-)
>
> diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> index 7f552bf..84d50e7 100644
> --- a/drivers/hid/hid-input.c
> +++ b/drivers/hid/hid-input.c
...
> @@ -540,6 +578,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
> case 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. :\
--
Jarod Wilson
jarod@redhat.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2] hid: assorted usage updates from hut 1.12
2011-04-19 19:13 ` Jarod Wilson
@ 2011-04-19 19:28 ` Jarod Wilson
2011-05-18 15:08 ` Jiri Kosina
0 siblings, 1 reply; 8+ messages in thread
From: Jarod Wilson @ 2011-04-19 19:28 UTC (permalink / raw)
To: linux-input; +Cc: Jarod Wilson, Dmitry Torokhov, Jiri Kosina
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>
---
v2: fix incorrect duplicate case value for KEY_PLAYER mapping
drivers/hid/hid-input.c | 60 ++++++++++++++++++++++++++++++++++++++++------
1 files changed, 52 insertions(+), 8 deletions(-)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 7f552bf..88d4703 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -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_fiel
case 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_fiel
case 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_fiel
case 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_fiel
case 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_fiel
case 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_fiel
case 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;
--
1.7.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2] hid: assorted usage updates from hut 1.12
2011-04-19 19:28 ` [PATCH v2] " Jarod Wilson
@ 2011-05-18 15:08 ` Jiri Kosina
2011-05-23 21:07 ` Jarod Wilson
0 siblings, 1 reply; 8+ messages in thread
From: Jiri Kosina @ 2011-05-18 15:08 UTC (permalink / raw)
To: Jarod Wilson; +Cc: linux-input, Dmitry Torokhov
On Tue, 19 Apr 2011, Jarod Wilson wrote:
> 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.
It took me quite some time to go over the individual changes, sorry for
the delay. I have applied the patch.
Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] hid: assorted usage updates from hut 1.12
2011-05-18 15:08 ` Jiri Kosina
@ 2011-05-23 21:07 ` Jarod Wilson
2011-05-24 11:57 ` Jiri Kosina
0 siblings, 1 reply; 8+ messages in thread
From: Jarod Wilson @ 2011-05-23 21:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-input, Dmitry Torokhov
Jiri Kosina wrote:
> On Tue, 19 Apr 2011, Jarod Wilson wrote:
>
>> 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.
>
> 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?
--
Jarod Wilson
jarod@redhat.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] hid: assorted usage updates from hut 1.12
2011-05-23 21:07 ` Jarod Wilson
@ 2011-05-24 11:57 ` Jiri Kosina
2011-05-24 17:49 ` Jarod Wilson
0 siblings, 1 reply; 8+ messages in thread
From: Jiri Kosina @ 2011-05-24 11:57 UTC (permalink / raw)
To: Jarod Wilson; +Cc: linux-input, Dmitry Torokhov
On Mon, 23 May 2011, Jarod Wilson wrote:
> > > 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.
> >
> > 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,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] hid: assorted usage updates from hut 1.12
2011-05-24 11:57 ` Jiri Kosina
@ 2011-05-24 17:49 ` Jarod Wilson
0 siblings, 0 replies; 8+ messages in thread
From: Jarod Wilson @ 2011-05-24 17:49 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-input, Dmitry Torokhov
Jiri Kosina wrote:
> On Mon, 23 May 2011, Jarod Wilson wrote:
>
>>>> 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.
>>> 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,
--
Jarod Wilson
jarod@redhat.com
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-05-24 17:48 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-07 15:49 [PATCH] hid: support for bluetooth tivo slide remote and usb dongle Jarod Wilson
2011-04-19 17:35 ` [PATCH] hid: assorted usage updates from hut 1.12 Jarod Wilson
2011-04-19 19:13 ` Jarod Wilson
2011-04-19 19:28 ` [PATCH v2] " Jarod Wilson
2011-05-18 15:08 ` Jiri Kosina
2011-05-23 21:07 ` Jarod Wilson
2011-05-24 11:57 ` Jiri Kosina
2011-05-24 17:49 ` Jarod Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).