* HID: expand hid-topseed driver to support BTC "Emprex 3009URF III Vista MCE Remote"
@ 2010-04-24 14:18 Wayne Thomas
2010-04-26 9:48 ` Jiri Kosina
2010-04-27 18:45 ` Wayne Thomas
0 siblings, 2 replies; 8+ messages in thread
From: Wayne Thomas @ 2010-04-24 14:18 UTC (permalink / raw)
To: jkosina, linux-input; +Cc: linux-kernel
HID: expand hid-topseed driver to support BTC "Emprex 3009URF III
Vista MCE Remote"
The Behavior Tech. Computer Corp. (BTC) remote branded as "Emprex 3009URF III
Vista Remote Controller" uses non-standard mappings for all of its 'special
purpose' keys (0xffbc usage page). This patch modifies the existing hid-topseed
quirky driver to support both remotes in order to prevent proliferation of
in-kernel quirky drivers until such a time that udev remapping works
with these devices.
Tested successfully with both the "Emprex" remote and the "CyberLink" remote
originally supported by the hid-topseed driver.
Signed-off-by: Wayne Thomas <waynethomas69@gmail.com>
diff -uprN linux-2.6.33-clean/drivers/hid/hid-core.c
linux/drivers/hid/hid-core.c
--- linux-2.6.33-clean/drivers/hid/hid-core.c 2010-04-22
21:04:17.000000000 +0200
+++ linux/drivers/hid/hid-core.c 2010-04-23 19:55:17.000000000 +0200
@@ -1291,6 +1291,7 @@ static const struct hid_device_id hid_bl
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1) },
diff -uprN linux-2.6.33-clean/drivers/hid/hid-ids.h linux/drivers/hid/hid-ids.h
--- linux-2.6.33-clean/drivers/hid/hid-ids.h 2010-04-22 21:04:17.000000000 +0200
+++ linux/drivers/hid/hid-ids.h 2010-04-23 07:09:59.000000000 +0200
@@ -116,6 +116,9 @@
#define USB_VENDOR_ID_BERKSHIRE 0x0c98
#define USB_DEVICE_ID_BERKSHIRE_PCWD 0x1140
+#define USB_VENDOR_ID_BTC 0x046e
+#define USB_DEVICE_ID_BTC_EMPREX_REMOTE 0x5578
+
#define USB_VENDOR_ID_CH 0x068e
#define USB_DEVICE_ID_CH_PRO_PEDALS 0x00f2
#define USB_DEVICE_ID_CH_COMBATSTICK 0x00f4
diff -uprN linux-2.6.33-clean/drivers/hid/hid-topseed.c
linux/drivers/hid/hid-topseed.c
--- linux-2.6.33-clean/drivers/hid/hid-topseed.c 2010-04-22
20:48:43.000000000 +0200
+++ linux/drivers/hid/hid-topseed.c 2010-04-22 21:29:20.000000000 +0200
@@ -3,6 +3,9 @@
*
* Copyright (c) 2008 Lev Babiev
* based on hid-cherry driver
+ *
+ * Modified to also support BTC "Emprex 3009URF III Vista MCE Remote"
+ *
*/
/*
@@ -24,23 +27,29 @@ static int ts_input_mapping(struct hid_d
struct hid_field *field, struct hid_usage *usage,
unsigned long **bit, int *max)
{
- if ((usage->hid & HID_USAGE_PAGE) != 0x0ffbc0000)
+ if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR)
return 0;
switch (usage->hid & HID_USAGE) {
- case 0x00d: ts_map_key_clear(KEY_HOME); break;
- case 0x024: ts_map_key_clear(KEY_MENU); break;
- case 0x025: ts_map_key_clear(KEY_TV); break;
- case 0x048: ts_map_key_clear(KEY_RED); break;
- case 0x047: ts_map_key_clear(KEY_GREEN); break;
- case 0x049: ts_map_key_clear(KEY_YELLOW); break;
- case 0x04a: ts_map_key_clear(KEY_BLUE); break;
- case 0x04b: ts_map_key_clear(KEY_ANGLE); break;
- case 0x04c: ts_map_key_clear(KEY_LANGUAGE); break;
- case 0x04d: ts_map_key_clear(KEY_SUBTITLE); break;
- case 0x031: ts_map_key_clear(KEY_AUDIO); break;
- case 0x032: ts_map_key_clear(KEY_TEXT); break;
- case 0x033: ts_map_key_clear(KEY_CHANNEL); break;
+ case 0x00d: ts_map_key_clear(KEY_HOME); break;
+ case 0x024: ts_map_key_clear(KEY_MENU); break;
+ case 0x025: ts_map_key_clear(KEY_TV); break;
+ case 0x031: ts_map_key_clear(KEY_AUDIO); break;
+ case 0x032: ts_map_key_clear(KEY_TEXT); break;
+ case 0x033: ts_map_key_clear(KEY_CHANNEL); break;
+ case 0x047: ts_map_key_clear(KEY_MP3); break;
+ case 0x048: ts_map_key_clear(KEY_DVD); break;
+ case 0x049: ts_map_key_clear(KEY_CAMERA); break;
+ case 0x04a: ts_map_key_clear(KEY_VIDEO); break;
+ case 0x04b: ts_map_key_clear(KEY_ANGLE); break;
+ case 0x04c: ts_map_key_clear(KEY_LANGUAGE); break;
+ case 0x04d: ts_map_key_clear(KEY_SUBTITLE); break;
+ case 0x050: ts_map_key_clear(KEY_RADIO); break;
+ case 0x05b: ts_map_key_clear(KEY_RED); break;
+ case 0x05c: ts_map_key_clear(KEY_GREEN); break;
+ case 0x05d: ts_map_key_clear(KEY_YELLOW); break;
+ case 0x05e: ts_map_key_clear(KEY_BLUE); break;
+ case 0x05a: ts_map_key_clear(KEY_TEXT); break;
default:
return 0;
}
@@ -50,6 +59,7 @@ static int ts_input_mapping(struct hid_d
static const struct hid_device_id ts_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE) },
{ }
};
MODULE_DEVICE_TABLE(hid, ts_devices);
diff -uprN linux-2.6.33-clean/drivers/hid/Kconfig linux/drivers/hid/Kconfig
--- linux-2.6.33-clean/drivers/hid/Kconfig 2010-04-22 20:48:43.000000000 +0200
+++ linux/drivers/hid/Kconfig 2010-04-22 21:29:20.000000000 +0200
@@ -80,6 +80,13 @@ config HID_BELKIN
---help---
Support for Belkin Flip KVM and Wireless keyboard.
+config HID_BTC
+ tristate "BTC Emprex remote control support" if EMBEDDED
+ depends on USB_HID
+ default y
+ ---help---
+ Say Y if you have a BTC Emprex remote control.
+
config HID_CHERRY
tristate "Cherry" if EMBEDDED
depends on USB_HID
diff -uprN linux-2.6.33-clean/drivers/hid/Makefile linux/drivers/hid/Makefile
--- linux-2.6.33-clean/drivers/hid/Makefile 2010-04-22 20:48:43.000000000 +0200
+++ linux/drivers/hid/Makefile 2010-04-22 21:29:20.000000000 +0200
@@ -22,6 +22,7 @@ endif
obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o
obj-$(CONFIG_HID_APPLE) += hid-apple.o
obj-$(CONFIG_HID_BELKIN) += hid-belkin.o
+obj-$(CONFIG_HID_BTC) += hid-topseed.o
obj-$(CONFIG_HID_CHERRY) += hid-cherry.o
obj-$(CONFIG_HID_CHICONY) += hid-chicony.o
obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: HID: expand hid-topseed driver to support BTC "Emprex 3009URF III Vista MCE Remote"
2010-04-24 14:18 HID: expand hid-topseed driver to support BTC "Emprex 3009URF III Vista MCE Remote" Wayne Thomas
@ 2010-04-26 9:48 ` Jiri Kosina
2010-04-27 18:45 ` Wayne Thomas
1 sibling, 0 replies; 8+ messages in thread
From: Jiri Kosina @ 2010-04-26 9:48 UTC (permalink / raw)
To: Wayne Thomas; +Cc: linux-input, linux-kernel
On Sat, 24 Apr 2010, Wayne Thomas wrote:
> +config HID_BTC
> + tristate "BTC Emprex remote control support" if EMBEDDED
> + depends on USB_HID
> + default y
> + ---help---
> + Say Y if you have a BTC Emprex remote control.
> +
> config HID_CHERRY
> tristate "Cherry" if EMBEDDED
> depends on USB_HID
> diff -uprN linux-2.6.33-clean/drivers/hid/Makefile linux/drivers/hid/Makefile
> --- linux-2.6.33-clean/drivers/hid/Makefile 2010-04-22 20:48:43.000000000 +0200
> +++ linux/drivers/hid/Makefile 2010-04-22 21:29:20.000000000 +0200
> @@ -22,6 +22,7 @@ endif
> obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o
> obj-$(CONFIG_HID_APPLE) += hid-apple.o
> obj-$(CONFIG_HID_BELKIN) += hid-belkin.o
> +obj-$(CONFIG_HID_BTC) += hid-topseed.o
> obj-$(CONFIG_HID_CHERRY) += hid-cherry.o
> obj-$(CONFIG_HID_CHICONY) += hid-chicony.o
> obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o
The separate config option for this is just overhead, I think. I'd suggest
just to update the Kconfig help text for CONFIG_TOPSPEED to mention that
it supports also this particular device.
Thanks,
--
Jiri Kosina
SUSE Labs, Novell Inc.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: HID: expand hid-topseed driver to support BTC "Emprex 3009URF III Vista MCE Remote"
2010-04-24 14:18 HID: expand hid-topseed driver to support BTC "Emprex 3009URF III Vista MCE Remote" Wayne Thomas
2010-04-26 9:48 ` Jiri Kosina
@ 2010-04-27 18:45 ` Wayne Thomas
2010-04-27 20:43 ` Jiri Kosina
1 sibling, 1 reply; 8+ messages in thread
From: Wayne Thomas @ 2010-04-27 18:45 UTC (permalink / raw)
To: jkosina, linux-input; +Cc: linux-kernel
OK, next attempt...
HID: expand hid-topseed driver to support BTC "Emprex 3009URF III
Vista MCE Remote"
The Behavior Tech. Computer Corp. (BTC) remote branded as "Emprex
3009URF III Vista
Remote Controller" uses non-standard mappings for all of its 'special
purpose' keys
(0xffbc usage page). This patch modifies the existing hid-topseed
quirky driver to
support both remotes in order to prevent proliferation of in-kernel
quirky drivers
until such a time that udev remapping works with these devices.
Tested successfully with both the "Emprex" remote and the "CyberLink" remote
originally supported by the hid-topseed driver.
Signed-off-by: Wayne Thomas <waynethomas69@gmail.com>
diff -uprN linux-2.6.33-clean/drivers/hid/hid-core.c
linux/drivers/hid/hid-core.c
--- linux-2.6.33-clean/drivers/hid/hid-core.c 2010-04-22
21:04:17.000000000 +0200
+++ linux/drivers/hid/hid-core.c 2010-04-23 19:55:17.000000000 +0200
@@ -1291,6 +1291,7 @@ static const struct hid_device_id hid_bl
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1) },
diff -uprN linux-2.6.33-clean/drivers/hid/hid-ids.h linux/drivers/hid/hid-ids.h
--- linux-2.6.33-clean/drivers/hid/hid-ids.h 2010-04-22 21:04:17.000000000 +0200
+++ linux/drivers/hid/hid-ids.h 2010-04-23 07:09:59.000000000 +0200
@@ -116,6 +116,9 @@
#define USB_VENDOR_ID_BERKSHIRE 0x0c98
#define USB_DEVICE_ID_BERKSHIRE_PCWD 0x1140
+#define USB_VENDOR_ID_BTC 0x046e
+#define USB_DEVICE_ID_BTC_EMPREX_REMOTE 0x5578
+
#define USB_VENDOR_ID_CH 0x068e
#define USB_DEVICE_ID_CH_PRO_PEDALS 0x00f2
#define USB_DEVICE_ID_CH_COMBATSTICK 0x00f4
diff -uprN linux-2.6.33-clean/drivers/hid/hid-topseed.c
linux/drivers/hid/hid-topseed.c
--- linux-2.6.33-clean/drivers/hid/hid-topseed.c 2010-04-22
20:48:43.000000000 +0200
+++ linux/drivers/hid/hid-topseed.c 2010-04-22 21:29:20.000000000 +0200
@@ -3,6 +3,9 @@
*
* Copyright (c) 2008 Lev Babiev
* based on hid-cherry driver
+ *
+ * Modified to also support BTC "Emprex 3009URF III Vista MCE Remote" by
+ * Wayne Thomas 2010.
*/
/*
@@ -24,23 +27,29 @@ static int ts_input_mapping(struct hid_d
struct hid_field *field, struct hid_usage *usage,
unsigned long **bit, int *max)
{
- if ((usage->hid & HID_USAGE_PAGE) != 0x0ffbc0000)
+ if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR)
return 0;
switch (usage->hid & HID_USAGE) {
- case 0x00d: ts_map_key_clear(KEY_HOME); break;
- case 0x024: ts_map_key_clear(KEY_MENU); break;
- case 0x025: ts_map_key_clear(KEY_TV); break;
- case 0x048: ts_map_key_clear(KEY_RED); break;
- case 0x047: ts_map_key_clear(KEY_GREEN); break;
- case 0x049: ts_map_key_clear(KEY_YELLOW); break;
- case 0x04a: ts_map_key_clear(KEY_BLUE); break;
- case 0x04b: ts_map_key_clear(KEY_ANGLE); break;
- case 0x04c: ts_map_key_clear(KEY_LANGUAGE); break;
- case 0x04d: ts_map_key_clear(KEY_SUBTITLE); break;
- case 0x031: ts_map_key_clear(KEY_AUDIO); break;
- case 0x032: ts_map_key_clear(KEY_TEXT); break;
- case 0x033: ts_map_key_clear(KEY_CHANNEL); break;
+ case 0x00d: ts_map_key_clear(KEY_MEDIA); break;
+ case 0x024: ts_map_key_clear(KEY_MENU); break;
+ case 0x025: ts_map_key_clear(KEY_TV); break;
+ case 0x031: ts_map_key_clear(KEY_AUDIO); break;
+ case 0x032: ts_map_key_clear(KEY_TEXT); break;
+ case 0x033: ts_map_key_clear(KEY_CHANNEL); break;
+ case 0x047: ts_map_key_clear(KEY_MP3); break;
+ case 0x048: ts_map_key_clear(KEY_TV2); break;
+ case 0x049: ts_map_key_clear(KEY_CAMERA); break;
+ case 0x04a: ts_map_key_clear(KEY_VIDEO); break;
+ case 0x04b: ts_map_key_clear(KEY_ANGLE); break;
+ case 0x04c: ts_map_key_clear(KEY_LANGUAGE); break;
+ case 0x04d: ts_map_key_clear(KEY_SUBTITLE); break;
+ case 0x050: ts_map_key_clear(KEY_RADIO); break;
+ case 0x05a: ts_map_key_clear(KEY_TEXT); break;
+ case 0x05b: ts_map_key_clear(KEY_RED); break;
+ case 0x05c: ts_map_key_clear(KEY_GREEN); break;
+ case 0x05d: ts_map_key_clear(KEY_YELLOW); break;
+ case 0x05e: ts_map_key_clear(KEY_BLUE); break;
default:
return 0;
}
@@ -50,6 +59,7 @@ static int ts_input_mapping(struct hid_d
static const struct hid_device_id ts_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE) },
{ }
};
MODULE_DEVICE_TABLE(hid, ts_devices);
diff -uprN linux-2.6.33-clean/drivers/hid/Kconfig linux/drivers/hid/Kconfig
--- linux-2.6.33-clean/drivers/hid/Kconfig 2010-04-22 20:48:43.000000000 +0200
+++ linux/drivers/hid/Kconfig 2010-04-26 21:06:46.000000000 +0200
@@ -285,7 +285,7 @@ config HID_TOPSEED
depends on USB_HID
default !EMBEDDED
---help---
- Say Y if you have a TopSeed Cyberlink remote control.
+ Say Y if you have a TopSeed Cyberlink or BTC Emprex remote control.
config HID_THRUSTMASTER
tristate "ThrustMaster devices support" if EMBEDDED
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: HID: expand hid-topseed driver to support BTC "Emprex 3009URF III Vista MCE Remote"
2010-04-27 18:45 ` Wayne Thomas
@ 2010-04-27 20:43 ` Jiri Kosina
2010-04-28 5:06 ` Wayne Thomas
0 siblings, 1 reply; 8+ messages in thread
From: Jiri Kosina @ 2010-04-27 20:43 UTC (permalink / raw)
To: Wayne Thomas; +Cc: linux-input, linux-kernel
On Tue, 27 Apr 2010, Wayne Thomas wrote:
> OK, next attempt...
The patch is OK, but your mail client whitespace-damaged it. Could you
please fix up your client and resend? (or attach it separately as an
attachment, if your client can't be fixed).
Thanks,
--
Jiri Kosina
SUSE Labs, Novell Inc.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: HID: expand hid-topseed driver to support BTC "Emprex 3009URF III Vista MCE Remote"
2010-04-27 20:43 ` Jiri Kosina
@ 2010-04-28 5:06 ` Wayne Thomas
2010-04-28 11:51 ` Jiri Kosina
0 siblings, 1 reply; 8+ messages in thread
From: Wayne Thomas @ 2010-04-28 5:06 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-input, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 503 bytes --]
On Tue, Apr 27, 2010 at 10:43 PM, Jiri Kosina <jkosina@suse.cz> wrote:
> On Tue, 27 Apr 2010, Wayne Thomas wrote:
>
>> OK, next attempt...
>
> The patch is OK, but your mail client whitespace-damaged it. Could you
> please fix up your client and resend? (or attach it separately as an
> attachment, if your client can't be fixed).
>
> Thanks,
>
> --
> Jiri Kosina
> SUSE Labs, Novell Inc.
>
I thought it might have; sorry about that.
Have attached patch as separate file as a precaution.
Cheers
Wayne
[-- Attachment #2: btc_patch2 --]
[-- Type: application/octet-stream, Size: 5478 bytes --]
HID: expand hid-topseed driver to support BTC "Emprex 3009URF III Vista MCE Remote"
The Behavior Tech. Computer Corp. (BTC) remote branded as "Emprex 3009URF III Vista
Remote Controller" uses non-standard mappings for all of its 'special purpose' keys
(0xffbc usage page). This patch modifies the existing hid-topseed quirky driver to
support both remotes in order to prevent proliferation of in-kernel quirky drivers
until such a time that udev remapping works with these devices.
Tested successfully with both the "Emprex" remote and the "CyberLink" remote
originally supported by the hid-topseed driver.
Signed-off-by: Wayne Thomas <waynethomas69@gmail.com>
diff -uprN linux-2.6.33-clean/drivers/hid/hid-core.c linux/drivers/hid/hid-core.c
--- linux-2.6.33-clean/drivers/hid/hid-core.c 2010-04-22 21:04:17.000000000 +0200
+++ linux/drivers/hid/hid-core.c 2010-04-23 19:55:17.000000000 +0200
@@ -1291,6 +1291,7 @@ static const struct hid_device_id hid_bl
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1) },
diff -uprN linux-2.6.33-clean/drivers/hid/hid-ids.h linux/drivers/hid/hid-ids.h
--- linux-2.6.33-clean/drivers/hid/hid-ids.h 2010-04-22 21:04:17.000000000 +0200
+++ linux/drivers/hid/hid-ids.h 2010-04-23 07:09:59.000000000 +0200
@@ -116,6 +116,9 @@
#define USB_VENDOR_ID_BERKSHIRE 0x0c98
#define USB_DEVICE_ID_BERKSHIRE_PCWD 0x1140
+#define USB_VENDOR_ID_BTC 0x046e
+#define USB_DEVICE_ID_BTC_EMPREX_REMOTE 0x5578
+
#define USB_VENDOR_ID_CH 0x068e
#define USB_DEVICE_ID_CH_PRO_PEDALS 0x00f2
#define USB_DEVICE_ID_CH_COMBATSTICK 0x00f4
diff -uprN linux-2.6.33-clean/drivers/hid/hid-topseed.c linux/drivers/hid/hid-topseed.c
--- linux-2.6.33-clean/drivers/hid/hid-topseed.c 2010-04-22 20:48:43.000000000 +0200
+++ linux/drivers/hid/hid-topseed.c 2010-04-22 21:29:20.000000000 +0200
@@ -3,6 +3,9 @@
*
* Copyright (c) 2008 Lev Babiev
* based on hid-cherry driver
+ *
+ * Modified to also support BTC "Emprex 3009URF III Vista MCE Remote" by
+ * Wayne Thomas 2010.
*/
/*
@@ -24,23 +27,29 @@ static int ts_input_mapping(struct hid_d
struct hid_field *field, struct hid_usage *usage,
unsigned long **bit, int *max)
{
- if ((usage->hid & HID_USAGE_PAGE) != 0x0ffbc0000)
+ if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR)
return 0;
switch (usage->hid & HID_USAGE) {
- case 0x00d: ts_map_key_clear(KEY_HOME); break;
- case 0x024: ts_map_key_clear(KEY_MENU); break;
- case 0x025: ts_map_key_clear(KEY_TV); break;
- case 0x048: ts_map_key_clear(KEY_RED); break;
- case 0x047: ts_map_key_clear(KEY_GREEN); break;
- case 0x049: ts_map_key_clear(KEY_YELLOW); break;
- case 0x04a: ts_map_key_clear(KEY_BLUE); break;
- case 0x04b: ts_map_key_clear(KEY_ANGLE); break;
- case 0x04c: ts_map_key_clear(KEY_LANGUAGE); break;
- case 0x04d: ts_map_key_clear(KEY_SUBTITLE); break;
- case 0x031: ts_map_key_clear(KEY_AUDIO); break;
- case 0x032: ts_map_key_clear(KEY_TEXT); break;
- case 0x033: ts_map_key_clear(KEY_CHANNEL); break;
+ case 0x00d: ts_map_key_clear(KEY_MEDIA); break;
+ case 0x024: ts_map_key_clear(KEY_MENU); break;
+ case 0x025: ts_map_key_clear(KEY_TV); break;
+ case 0x031: ts_map_key_clear(KEY_AUDIO); break;
+ case 0x032: ts_map_key_clear(KEY_TEXT); break;
+ case 0x033: ts_map_key_clear(KEY_CHANNEL); break;
+ case 0x047: ts_map_key_clear(KEY_MP3); break;
+ case 0x048: ts_map_key_clear(KEY_TV2); break;
+ case 0x049: ts_map_key_clear(KEY_CAMERA); break;
+ case 0x04a: ts_map_key_clear(KEY_VIDEO); break;
+ case 0x04b: ts_map_key_clear(KEY_ANGLE); break;
+ case 0x04c: ts_map_key_clear(KEY_LANGUAGE); break;
+ case 0x04d: ts_map_key_clear(KEY_SUBTITLE); break;
+ case 0x050: ts_map_key_clear(KEY_RADIO); break;
+ case 0x05a: ts_map_key_clear(KEY_TEXT); break;
+ case 0x05b: ts_map_key_clear(KEY_RED); break;
+ case 0x05c: ts_map_key_clear(KEY_GREEN); break;
+ case 0x05d: ts_map_key_clear(KEY_YELLOW); break;
+ case 0x05e: ts_map_key_clear(KEY_BLUE); break;
default:
return 0;
}
@@ -50,6 +59,7 @@ static int ts_input_mapping(struct hid_d
static const struct hid_device_id ts_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE) },
{ }
};
MODULE_DEVICE_TABLE(hid, ts_devices);
diff -uprN linux-2.6.33-clean/drivers/hid/Kconfig linux/drivers/hid/Kconfig
--- linux-2.6.33-clean/drivers/hid/Kconfig 2010-04-22 20:48:43.000000000 +0200
+++ linux/drivers/hid/Kconfig 2010-04-26 21:06:46.000000000 +0200
@@ -285,7 +285,7 @@ config HID_TOPSEED
depends on USB_HID
default !EMBEDDED
---help---
- Say Y if you have a TopSeed Cyberlink remote control.
+ Say Y if you have a TopSeed Cyberlink or BTC Emprex remote control.
config HID_THRUSTMASTER
tristate "ThrustMaster devices support" if EMBEDDED
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: HID: expand hid-topseed driver to support BTC "Emprex 3009URF III Vista MCE Remote"
2010-04-28 5:06 ` Wayne Thomas
@ 2010-04-28 11:51 ` Jiri Kosina
2010-04-28 14:54 ` Wayne Thomas
0 siblings, 1 reply; 8+ messages in thread
From: Jiri Kosina @ 2010-04-28 11:51 UTC (permalink / raw)
To: Wayne Thomas; +Cc: linux-input, linux-kernel
On Wed, 28 Apr 2010, Wayne Thomas wrote:
> >> OK, next attempt...
> >
> > The patch is OK, but your mail client whitespace-damaged it. Could you
> > please fix up your client and resend? (or attach it separately as an
> > attachment, if your client can't be fixed).
> >
> > Thanks,
>
> I thought it might have; sorry about that.
> Have attached patch as separate file as a precaution.
Thanks for the patch.
What is the reason for it being backwards-compatible with the older
topspeed device?
Changes such as
- case 0x048: ts_map_key_clear(KEY_RED); break;
+ case 0x05b: ts_map_key_clear(KEY_RED); break;
(and no other handling of neither 0x048 nor KEY_RED) make me wonder ...
Thanks,
--
Jiri Kosina
SUSE Labs, Novell Inc.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: HID: expand hid-topseed driver to support BTC "Emprex 3009URF III Vista MCE Remote"
2010-04-28 11:51 ` Jiri Kosina
@ 2010-04-28 14:54 ` Wayne Thomas
2010-04-28 22:46 ` Jiri Kosina
0 siblings, 1 reply; 8+ messages in thread
From: Wayne Thomas @ 2010-04-28 14:54 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-input, linux-kernel
On Wed, Apr 28, 2010 at 1:51 PM, Jiri Kosina <jkosina@suse.cz> wrote:
> On Wed, 28 Apr 2010, Wayne Thomas wrote:
>
>> >> OK, next attempt...
>> >
>> > The patch is OK, but your mail client whitespace-damaged it. Could you
>> > please fix up your client and resend? (or attach it separately as an
>> > attachment, if your client can't be fixed).
>> >
>> > Thanks,
>>
>> I thought it might have; sorry about that.
>> Have attached patch as separate file as a precaution.
>
> Thanks for the patch.
>
> What is the reason for it being backwards-compatible with the older
> topspeed device?
>
> Changes such as
>
> - case 0x048: ts_map_key_clear(KEY_RED); break;
> + case 0x05b: ts_map_key_clear(KEY_RED); break;
>
> (and no other handling of neither 0x048 nor KEY_RED) make me wonder ...
>
> Thanks,
>
> --
> Jiri Kosina
> SUSE Labs, Novell Inc.
>
The TopSeed remote has four keys in particular with two labels on each
of them (but only a single output for each key):
- the button with output 0x047 is coloured Green and has the label 'MUSIC'
- the button with output 0x048 is coloured Red and has the label 'DVD/VCD'
- the button with output 0x049 is coloured Yellow and has the label 'PICTURE'
- the button with output 0x04a is coloured Blue and has the label 'VIDEO'
The BTC remote has four buttons with identical outputs and the same
labels but they are not coloured. The BTC has seperate coloured
buttons with completely different outputs.
The original writer of hid-topseed chose to use the colour of the
TopSeed buttons for his key maps rather than the labels. If I did not
change this the BTC would effectively loose four buttons as each
coloured button would have the same keymap as the seperate labelled
button (i.e. Music, DVD/VCD, PICTURE, VIDEO). To prevent this I
altered the original keymaps of the TopSeed to use the appropriate
label, and added the BTC's coloured keymap as seperate buttons. (I
hope I made sense).
Every original TopSeed button has been represented in the driver (i.e.
I changed case 0x048 to KEY_CAMERA) and I tidied up the order that
they have appeared. Below I have re-jigged the relevant part of the
patch to help explain (sorry for the whitespace damage that will no
doubt occur). There are obviously some unneccessary deletions and
re-insertions, this occured due to me starting from scratch.
Ultimately there are four changes and six new entries.
- case 0x00d: ts_map_key_clear(KEY_HOME); break;
+ case 0x00d: ts_map_key_clear(KEY_HOME); break;
- case 0x024: ts_map_key_clear(KEY_MENU); break;
+ case 0x024: ts_map_key_clear(KEY_MENU); break;
- case 0x025: ts_map_key_clear(KEY_TV); break;
+ case 0x025: ts_map_key_clear(KEY_TV); break;
- case 0x048: ts_map_key_clear(KEY_RED); break;
+ case 0x048: ts_map_key_clear(KEY_DVD); break;
- case 0x047: ts_map_key_clear(KEY_GREEN); break;
+ case 0x047: ts_map_key_clear(KEY_MP3); break;
- case 0x049: ts_map_key_clear(KEY_YELLOW); break;
+ case 0x049: ts_map_key_clear(KEY_CAMERA); break;
- case 0x04a: ts_map_key_clear(KEY_BLUE); break;
+ case 0x04a: ts_map_key_clear(KEY_VIDEO); break;
- case 0x04b: ts_map_key_clear(KEY_ANGLE); break;
+ case 0x04b: ts_map_key_clear(KEY_ANGLE); break;
- case 0x04c: ts_map_key_clear(KEY_LANGUAGE); break;
+ case 0x04c: ts_map_key_clear(KEY_LANGUAGE); break;
- case 0x04d: ts_map_key_clear(KEY_SUBTITLE); break;
+ case 0x04d: ts_map_key_clear(KEY_SUBTITLE); break;
- case 0x031: ts_map_key_clear(KEY_AUDIO); break;
+ case 0x031: ts_map_key_clear(KEY_AUDIO); break;
- case 0x032: ts_map_key_clear(KEY_TEXT); break;
+ case 0x032: ts_map_key_clear(KEY_TEXT); break;
- case 0x033: ts_map_key_clear(KEY_CHANNEL); break;
+ case 0x033: ts_map_key_clear(KEY_CHANNEL); break;
+ case 0x050: ts_map_key_clear(KEY_RADIO); break;
+ case 0x05b: ts_map_key_clear(KEY_RED); break;
+ case 0x05c: ts_map_key_clear(KEY_GREEN); break;
+ case 0x05d: ts_map_key_clear(KEY_YELLOW); break;
+ case 0x05e: ts_map_key_clear(KEY_BLUE); break;
+ case 0x05a: ts_map_key_clear(KEY_TEXT); break;
I hope this has answered your question sufficiently.
Cheers
Wayne
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-04-28 22:46 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-24 14:18 HID: expand hid-topseed driver to support BTC "Emprex 3009URF III Vista MCE Remote" Wayne Thomas
2010-04-26 9:48 ` Jiri Kosina
2010-04-27 18:45 ` Wayne Thomas
2010-04-27 20:43 ` Jiri Kosina
2010-04-28 5:06 ` Wayne Thomas
2010-04-28 11:51 ` Jiri Kosina
2010-04-28 14:54 ` Wayne Thomas
2010-04-28 22:46 ` Jiri Kosina
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).