[PATCH] input: Add support for Rotronic silver/white handset in cm109driver

From: Georgi Chorbadzhiyski
Date: Sun Aug 30 2009 - 15:10:28 EST


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@xxxxxxxxxxx>

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@xxxxxxxxxxx>
+ *
+ * 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/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/