All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hid: add two led codes to hid input mapping
@ 2007-04-01  2:56 Dan Engel
  2007-04-01  9:01 ` Jiri Kosina
  0 siblings, 1 reply; 10+ messages in thread
From: Dan Engel @ 2007-04-01  2:56 UTC (permalink / raw)
  To: jkosina; +Cc: linux-kernel

From: Daniel P. Engel <dengel@sourceharvest.com>

Add the "Off-hook" and "Speaker" LED codes 0xb and 0xc to the hid-input configuration,
mapping them to the 0x17 and 0x1e usages in the HID usage table.

Signed-off-by: Daniel P. Engel <dengel@sourceharvest.com>
---
This patch is really being offered because it's what's needed to make the operation
of the Belkin Flip USB KVM switch avaiable to user-space programs through the HID input
event interface. The Belkin Flip KVM overloads LED usages to give software control
over the device, providing options to flip either audio, video or both. However,
without an input mapping to the Off-hook and Speaker LED usages, this functionality
isn't available.

It's a minor patch, adding two led codes to the EV_LED type, and mapping them to
corresponding HID usages.

This patch was created against kernel version 2.6.20.4.

diff -uprN -X linux-2.6.20.4-vanilla/Documentation/dontdiff linux-2.6.20.4-vanilla/drivers/hid/hid-input.c linux-2.6/drivers/hid/hid-input.c
--- linux-2.6.20.4-vanilla/drivers/hid/hid-input.c	2007-03-23 15:52:51.000000000 -0400
+++ linux-2.6/drivers/hid/hid-input.c	2007-03-31 13:43:46.000000000 -0400
@@ -381,6 +381,8 @@ static void hidinput_configure_usage(str
 				case 0x4b:  map_led (LED_MISC);     break;    /*   "Generic Indicator"        */
 				case 0x19:  map_led (LED_MAIL);     break;    /*   "Message Waiting"          */
 				case 0x4d:  map_led (LED_CHARGING); break;    /*   "External Power Connected" */
+				case 0x17:  map_led (LED_OFFHOOK);  break;    /*   "Off Hook"                 */
+				case 0x1e:  map_led (LED_SPEAKER);  break;    /*   "Speaker"                  */
 
 				default: goto ignore;
 			}
diff -uprN -X linux-2.6.20.4-vanilla/Documentation/dontdiff linux-2.6.20.4-vanilla/include/linux/input.h linux-2.6/include/linux/input.h
--- linux-2.6.20.4-vanilla/include/linux/input.h	2007-03-23 15:52:51.000000000 -0400
+++ linux-2.6/include/linux/input.h	2007-03-31 13:42:22.000000000 -0400
@@ -630,6 +630,8 @@ struct input_absinfo {
 #define LED_MISC		0x08
 #define LED_MAIL		0x09
 #define LED_CHARGING		0x0a
+#define LED_OFFHOOK		0x0b
+#define LED_SPEAKER		0x0c
 #define LED_MAX			0x0f
 
 /*



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-04-02 13:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-01  2:56 [PATCH] hid: add two led codes to hid input mapping Dan Engel
2007-04-01  9:01 ` Jiri Kosina
2007-04-01 14:57   ` Dmitry Torokhov
2007-04-01 17:43     ` Jiri Kosina
2007-04-02  3:28       ` Dan Engel
2007-04-02  4:04         ` Dmitry Torokhov
2007-04-02 10:14           ` Dan Engel
2007-04-02 13:06             ` Dmitry Torokhov
2007-04-02 13:33               ` Dan Engel
2007-04-02 13:46                 ` Dmitry Torokhov

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.