Re: [PATCH] Add keyboard blink driver

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andi Kleen
Date: Thursday, April 12, 2007 - 12:28 pm

On Thursday 12 April 2007 21:10:28 Andrew Morton wrote:

Oops sorry -- i must somehow have sent an old patch. I had fixed this of course
Ahh, quilt refresh was missing.

See the new patch.
 
 
Hmm, maybe

-Andi

Add a blink driver for debugging

Simple driver that blinks the keyboard LEDs when loaded. Useful
for checking that the kernel is still alive or for crashdumping

Signed-off-by: Andi Kleen <ak@suse.de>

---
 drivers/misc/Kconfig  |    9 +++++++++
 drivers/misc/Makefile |    1 +
 drivers/misc/blink.c  |   26 ++++++++++++++++++++++++++
 3 files changed, 36 insertions(+)

Index: linux-2.6.21-rc6-test/drivers/misc/Kconfig
===================================================================
--- linux-2.6.21-rc6-test.orig/drivers/misc/Kconfig
+++ linux-2.6.21-rc6-test/drivers/misc/Kconfig
@@ -122,4 +122,13 @@ config SONY_LAPTOP
 
 	  Read <file:Documentation/sony-laptop.txt> for more information.
 
+config BLINK
+	tristate "Keyboard blink driver"
+	help
+	  Driver that when loaded will blink the keyboard LEDs continuously.
+	  This is useful for debugging and for kernels that cannot necessarily
+	  output something to the screen like kexec kernels to give the user
+	  a visual indication that the kernel is doing something.
+
+
 endmenu
Index: linux-2.6.21-rc6-test/drivers/misc/Makefile
===================================================================
--- linux-2.6.21-rc6-test.orig/drivers/misc/Makefile
+++ linux-2.6.21-rc6-test/drivers/misc/Makefile
@@ -12,3 +12,4 @@ obj-$(CONFIG_TIFM_CORE)       	+= tifm_c
 obj-$(CONFIG_TIFM_7XX1)       	+= tifm_7xx1.o
 obj-$(CONFIG_SGI_IOC4)		+= ioc4.o
 obj-$(CONFIG_SONY_LAPTOP)	+= sony-laptop.o
+obj-$(CONFIG_BLINK)		+= blink.o
Index: linux-2.6.21-rc6-test/drivers/misc/blink.c
===================================================================
--- /dev/null
+++ linux-2.6.21-rc6-test/drivers/misc/blink.c
@@ -0,0 +1,27 @@
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/timer.h>
+#include <linux/jiffies.h>
+
+static void do_blink(unsigned long data);
+
+static DEFINE_TIMER(blink_timer, do_blink, 0 ,0);
+
+static void do_blink(unsigned long data)
+{
+	static long count;
+	if (panic_blink)
+		panic_blink(count++);
+	blink_timer.expires = jiffies + msecs_to_jiffies(1);
+	add_timer(&blink_timer);
+}
+
+static int blink_init(void)
+{
+	printk(KERN_INFO "Enabling keyboard blinking\n");
+	do_blink(0);
+	return 0;
+}
+
+module_init(blink_init);
+
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Add keyboard blink driver, Andi Kleen, (Thu Apr 12, 8:27 am)
Re: [PATCH] Add keyboard blink driver, Andrew Morton, (Thu Apr 12, 12:10 pm)
Re: [PATCH] Add keyboard blink driver, Andi Kleen, (Thu Apr 12, 12:28 pm)
Re: [PATCH] Add keyboard blink driver, Andrew Morton, (Thu Apr 12, 12:37 pm)
Re: [PATCH] Add keyboard blink driver, Pavel Machek, (Wed Apr 18, 5:11 am)