* [PATCH] input: Add support for Rotronic silver/white handset in cm109 driver
@ 2009-08-30 19:05 ` Georgi Chorbadzhiyski
0 siblings, 0 replies; 4+ messages in thread
From: Georgi Chorbadzhiyski @ 2009-08-30 19:05 UTC (permalink / raw)
To: Dmitry Torokhov, Dmitry Torokhov, Daniel Gimpelevich,
Stephen Rothwell, linux-input, linux-kernel
The following patch adds support for yet another keymap in
cm109 driver. Rotronic silver/white is USB "Skype" handset
sold in Bulgaria and Serbia (according to Google). With this
cheap stuff a picture is the only way to identify what you've
got, so here is one:
http://www.reset.bg/catalog/images/skyphoneusbbelihcek.jpg
Signed-off-by: Georgi Chorbadzhiyski <georgi@unixsol.org>
diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c
index 86457fe..161899e 100644
--- a/drivers/input/misc/cm109.c
+++ b/drivers/input/misc/cm109.c
@@ -13,6 +13,7 @@
* - Komunikate KIP1000
* - Genius G-talk
* - Allied-Telesis Corega USBPH01
+ * - Rotronic Skype USB silver/white
* - ...
*
* This driver is based on the yealink.c driver
@@ -42,7 +43,7 @@
static char *phone = "kip1000";
module_param(phone, charp, S_IRUSR);
-MODULE_PARM_DESC(phone, "Phone name {kip1000, gtalk, usbph01, atcom}");
+MODULE_PARM_DESC(phone, "Phone name {kip1000, gtalk, usbph01, atcom, rotronic}");
enum {
/* HID Registers */
@@ -289,6 +290,43 @@ static unsigned short keymap_atcom(int scancode)
}
}
+/*
+ * Keymap for Rotronic Skype USB silver/white
+ * Contributed by Georgi Chorbadzhiyski <georgi@unixsol.org>
+ *
+ * Keypad looks like this:
+ * Up
+ * Green Red
+ * Down
+ * Vol+ Mute Vol-
+ * 1 2 3
+ * 4 5 6
+ * 7 8 9
+ * * 0 #
+ */
+static unsigned short keymap_rotronic(int scancode)
+{
+ switch (scancode) {
+ case 0x48: return KEY_UP;
+ case 0x18: return KEY_ENTER; /* pickup */
+ case 0x28: return KEY_ESC; /* hangup */
+ case 0x88: return KEY_DOWN;
+ case 0x21: return KEY_NUMERIC_1;
+ case 0x41: return KEY_NUMERIC_2;
+ case 0x81: return KEY_NUMERIC_3;
+ case 0x12: return KEY_NUMERIC_4;
+ case 0x22: return KEY_NUMERIC_5;
+ case 0x42: return KEY_NUMERIC_6;
+ case 0x82: return KEY_NUMERIC_7;
+ case 0x14: return KEY_NUMERIC_8;
+ case 0x24: return KEY_NUMERIC_9;
+ case 0x84: return KEY_NUMERIC_STAR;
+ case 0x11: return KEY_NUMERIC_0;
+ case 0x44: return KEY_NUMERIC_POUND;
+ default: return special_keymap(scancode);
+ }
+}
+
static unsigned short (*keymap)(int) = keymap_kip1000;
/*
@@ -875,6 +913,10 @@ static int __init cm109_select_keymap(void)
keymap = keymap_atcom;
printk(KERN_INFO KBUILD_MODNAME ": "
"Keymap for ATCom AU-100 phone loaded\n");
+ } else if (!strcasecmp(phone, "rotronic")) {
+ keymap = keymap_rotronic;
+ printk(KERN_INFO KBUILD_MODNAME ": "
+ "Keymap for Rotronic silver/white phone loaded\n");
} else {
printk(KERN_ERR KBUILD_MODNAME ": "
"Unsupported phone: %s\n", phone);
--
Georgi Chorbadzhiyski
http://georgi.unixsol.org/
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] input: Add support for Rotronic silver/white handset in cm109 driver
@ 2009-08-30 19:05 ` Georgi Chorbadzhiyski
0 siblings, 0 replies; 4+ messages in thread
From: Georgi Chorbadzhiyski @ 2009-08-30 19:05 UTC (permalink / raw)
To: Dmitry Torokhov, Dmitry Torokhov, Daniel Gimpelevich,
Stephen Rothwell, lin
The following patch adds support for yet another keymap in
cm109 driver. Rotronic silver/white is USB "Skype" handset
sold in Bulgaria and Serbia (according to Google). With this
cheap stuff a picture is the only way to identify what you've
got, so here is one:
http://www.reset.bg/catalog/images/skyphoneusbbelihcek.jpg
Signed-off-by: Georgi Chorbadzhiyski <georgi@unixsol.org>
diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c
index 86457fe..161899e 100644
--- a/drivers/input/misc/cm109.c
+++ b/drivers/input/misc/cm109.c
@@ -13,6 +13,7 @@
* - Komunikate KIP1000
* - Genius G-talk
* - Allied-Telesis Corega USBPH01
+ * - Rotronic Skype USB silver/white
* - ...
*
* This driver is based on the yealink.c driver
@@ -42,7 +43,7 @@
static char *phone = "kip1000";
module_param(phone, charp, S_IRUSR);
-MODULE_PARM_DESC(phone, "Phone name {kip1000, gtalk, usbph01, atcom}");
+MODULE_PARM_DESC(phone, "Phone name {kip1000, gtalk, usbph01, atcom, rotronic}");
enum {
/* HID Registers */
@@ -289,6 +290,43 @@ static unsigned short keymap_atcom(int scancode)
}
}
+/*
+ * Keymap for Rotronic Skype USB silver/white
+ * Contributed by Georgi Chorbadzhiyski <georgi@unixsol.org>
+ *
+ * Keypad looks like this:
+ * Up
+ * Green Red
+ * Down
+ * Vol+ Mute Vol-
+ * 1 2 3
+ * 4 5 6
+ * 7 8 9
+ * * 0 #
+ */
+static unsigned short keymap_rotronic(int scancode)
+{
+ switch (scancode) {
+ case 0x48: return KEY_UP;
+ case 0x18: return KEY_ENTER; /* pickup */
+ case 0x28: return KEY_ESC; /* hangup */
+ case 0x88: return KEY_DOWN;
+ case 0x21: return KEY_NUMERIC_1;
+ case 0x41: return KEY_NUMERIC_2;
+ case 0x81: return KEY_NUMERIC_3;
+ case 0x12: return KEY_NUMERIC_4;
+ case 0x22: return KEY_NUMERIC_5;
+ case 0x42: return KEY_NUMERIC_6;
+ case 0x82: return KEY_NUMERIC_7;
+ case 0x14: return KEY_NUMERIC_8;
+ case 0x24: return KEY_NUMERIC_9;
+ case 0x84: return KEY_NUMERIC_STAR;
+ case 0x11: return KEY_NUMERIC_0;
+ case 0x44: return KEY_NUMERIC_POUND;
+ default: return special_keymap(scancode);
+ }
+}
+
static unsigned short (*keymap)(int) = keymap_kip1000;
/*
@@ -875,6 +913,10 @@ static int __init cm109_select_keymap(void)
keymap = keymap_atcom;
printk(KERN_INFO KBUILD_MODNAME ": "
"Keymap for ATCom AU-100 phone loaded\n");
+ } else if (!strcasecmp(phone, "rotronic")) {
+ keymap = keymap_rotronic;
+ printk(KERN_INFO KBUILD_MODNAME ": "
+ "Keymap for Rotronic silver/white phone loaded\n");
} else {
printk(KERN_ERR KBUILD_MODNAME ": "
"Unsupported phone: %s\n", phone);
--
Georgi Chorbadzhiyski
http://georgi.unixsol.org/
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] input: Add support for Rotronic silver/white handset in cm109 driver
2009-08-30 19:05 ` Georgi Chorbadzhiyski
(?)
@ 2009-09-01 1:37 ` Dmitry Torokhov
2009-09-01 8:32 ` Georgi Chorbadzhiyski
-1 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2009-09-01 1:37 UTC (permalink / raw)
To: Georgi Chorbadzhiyski
Cc: Daniel Gimpelevich, Stephen Rothwell, linux-input, linux-kernel
Hi Georgi,
On Sun, Aug 30, 2009 at 10:05:13PM +0300, Georgi Chorbadzhiyski wrote:
> The following patch adds support for yet another keymap in
> cm109 driver. Rotronic silver/white is USB "Skype" handset
> sold in Bulgaria and Serbia (according to Google). With this
> cheap stuff a picture is the only way to identify what you've
> got, so here is one:
> http://www.reset.bg/catalog/images/skyphoneusbbelihcek.jpg
>
While there is nothing wrong with the patch I am hesitant to apply it.
Any chance we could push it onto HAL or maybe have your application to
load appropriate keymap? I know we can't do it automatically because
vendor and product IDs are the same for all these devices... It's just
putting every keymap into the kernel is not sustainable.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] input: Add support for Rotronic silver/white handset in cm109 driver
2009-09-01 1:37 ` Dmitry Torokhov
@ 2009-09-01 8:32 ` Georgi Chorbadzhiyski
0 siblings, 0 replies; 4+ messages in thread
From: Georgi Chorbadzhiyski @ 2009-09-01 8:32 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Daniel Gimpelevich, Stephen Rothwell, linux-input, linux-kernel
Dmitry Torokhov scribbled:
> Hi Georgi,
>
> On Sun, Aug 30, 2009 at 10:05:13PM +0300, Georgi Chorbadzhiyski wrote:
>> The following patch adds support for yet another keymap in
>> cm109 driver. Rotronic silver/white is USB "Skype" handset
>> sold in Bulgaria and Serbia (according to Google). With this
>> cheap stuff a picture is the only way to identify what you've
>> got, so here is one:
>> http://www.reset.bg/catalog/images/skyphoneusbbelihcek.jpg
>>
>
> While there is nothing wrong with the patch I am hesitant to apply it.
> Any chance we could push it onto HAL or maybe have your application to
> load appropriate keymap? I know we can't do it automatically because
> vendor and product IDs are the same for all these devices... It's just
> putting every keymap into the kernel is not sustainable.
Sure, no problem.
--
Georgi Chorbadzhiyski
http://georgi.unixsol.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-09-01 8:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-30 19:05 [PATCH] input: Add support for Rotronic silver/white handset in cm109 driver Georgi Chorbadzhiyski
2009-08-30 19:05 ` Georgi Chorbadzhiyski
2009-09-01 1:37 ` Dmitry Torokhov
2009-09-01 8:32 ` Georgi Chorbadzhiyski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.