The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH 2.4] Fix LED's for input subsystem keyboards
Date: Sat, 13 Dec 2003 22:28:55 +0100	[thread overview]
Message-ID: <1071350935.16387.8.camel@pegasus> (raw)

[-- 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;
 }
 

                 reply	other threads:[~2003-12-13 21:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1071350935.16387.8.camel@pegasus \
    --to=marcel@holtmann.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox