All of lore.kernel.org
 help / color / mirror / Atom feed
From: Georgi Chorbadzhiyski <gf@unixsol.org>
To: Dmitry Torokhov <dtor@mail.ru>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] input: Add support for Rotronic silver/white handset in cm109 driver
Date: Sun, 30 Aug 2009 22:05:13 +0300	[thread overview]
Message-ID: <4A9ACD69.5030501@unixsol.org> (raw)

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/


WARNING: multiple messages have this Message-ID
From: Georgi Chorbadzhiyski <gf@unixsol.org>
To: Dmitry Torokhov <dtor@mail.ru>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	lin
Subject: [PATCH] input: Add support for Rotronic silver/white handset in cm109 driver
Date: Sun, 30 Aug 2009 22:05:13 +0300	[thread overview]
Message-ID: <4A9ACD69.5030501@unixsol.org> (raw)

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/


             reply	other threads:[~2009-08-30 19:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-30 19:05 Georgi Chorbadzhiyski [this message]
2009-08-30 19:05 ` Georgi Chorbadzhiyski
2009-09-01  1:37 ` Dmitry Torokhov
2009-09-01  8:32   ` Georgi Chorbadzhiyski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A9ACD69.5030501@unixsol.org \
    --to=gf@unixsol.org \
    --cc=daniel@gimpelevich.san-francisco.ca.us \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dtor@mail.ru \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --subject='Re: [PATCH] input: Add support for Rotronic silver/white handset in cm109 driver' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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.