All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add keyboard blink driver
@ 2007-04-12 15:27 Andi Kleen
  2007-04-12 19:10 ` Andrew Morton
  2007-04-18 12:11 ` Pavel Machek
  0 siblings, 2 replies; 5+ messages in thread
From: Andi Kleen @ 2007-04-12 15:27 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

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.
The kdump kernel currently typically doesn't give any feedback
on the screen because it often cannot reinitialize the graphics
state. This patch allows it to at least show blinking lights
like panic.

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/drivers/misc/Kconfig
===================================================================
--- linux.orig/drivers/misc/Kconfig
+++ linux/drivers/misc/Kconfig
@@ -107,4 +107,13 @@ config MSI_LAPTOP
 
 	  If you have an MSI S270 laptop, say Y or M here.
 
+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/drivers/misc/Makefile
===================================================================
--- linux.orig/drivers/misc/Makefile
+++ linux/drivers/misc/Makefile
@@ -11,3 +11,4 @@ obj-$(CONFIG_LKDTM)		+= lkdtm.o
 obj-$(CONFIG_TIFM_CORE)       	+= tifm_core.o
 obj-$(CONFIG_TIFM_7XX1)       	+= tifm_7xx1.o
 obj-$(CONFIG_SGI_IOC4)		+= ioc4.o
+obj-$(CONFIG_BLINK)		+= blink.o
Index: linux/drivers/misc/blink.c
===================================================================
--- /dev/null
+++ linux/drivers/misc/blink.c
@@ -0,0 +1,26 @@
+#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;
+	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);
+

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

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-12 15:27 [PATCH] Add keyboard blink driver Andi Kleen
2007-04-12 19:10 ` Andrew Morton
2007-04-12 19:28   ` Andi Kleen
2007-04-12 19:37     ` Andrew Morton
2007-04-18 12:11 ` Pavel Machek

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.