linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.4] Fix LED's for input subsystem keyboards
@ 2003-12-13 21:28 Marcel Holtmann
  0 siblings, 0 replies; only message in thread
From: Marcel Holtmann @ 2003-12-13 21:28 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 116 bytes --]

This patch propagates the current LED's to every new keyboard device
that is attached through the input subsystem.


[-- Attachment #2: patch-2.4.23-keybdev-led-fix --]
[-- Type: text/plain, Size: 1087 bytes --]

--- linux-2.4.23/drivers/input/keybdev.c	2003-08-25 13:44:42.000000000 +0200
+++ linux-2.4.23-mh/drivers/input/keybdev.c	2003-12-13 21:51:54.000000000 +0100
@@ -154,16 +154,18 @@
 
 static struct input_handler keybdev_handler;
 
+static unsigned int ledstate = 0xff;
+
 void keybdev_ledfunc(unsigned int led)
 {
 	struct input_handle *handle;	
 
-	for (handle = keybdev_handler.handle; handle; handle = handle->hnext) {
+	ledstate = led;
 
+	for (handle = keybdev_handler.handle; handle; handle = handle->hnext) {
 		input_event(handle->dev, EV_LED, LED_SCROLLL, !!(led & 0x01));
 		input_event(handle->dev, EV_LED, LED_NUML,    !!(led & 0x02));
 		input_event(handle->dev, EV_LED, LED_CAPSL,   !!(led & 0x04));
-
 	}
 }
 
@@ -204,6 +206,12 @@
 //	printk(KERN_INFO "keybdev.c: Adding keyboard: input%d\n", dev->number);
 	kbd_refresh_leds();
 
+	if (ledstate != 0xff) {
+		input_event(dev, EV_LED, LED_SCROLLL, !!(ledstate & 0x01));
+		input_event(dev, EV_LED, LED_NUML,    !!(ledstate & 0x02));
+		input_event(dev, EV_LED, LED_CAPSL,   !!(ledstate & 0x04));
+	}
+
 	return handle;
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-12-13 21:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-13 21:28 [PATCH 2.4] Fix LED's for input subsystem keyboards Marcel Holtmann

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).