Blank_now key

Pavel Machek (pavel@bug.ucw.cz)
Tue, 15 Sep 1998 01:43:05 +0200


Hi!

Possibility to blank on request is often usefull: if you are debugging
blanking it is almost mandatory, and you can save some power when
using it in normal cases...

Pavel

Here is the patch:

--- clean//drivers/char/keyboard.c Tue Aug 25 22:00:11 1998
+++ linux/drivers/char/keyboard.c Tue Sep 15 01:33:53 1998
@@ -20,6 +20,9 @@
* parts by Geert Uytterhoeven, May 1997
*
* 27-05-97: Added support for the Magic SysRq Key (Martin Mares)
+ *
+ * 29-07-97: Added blank console key (Pavel Machek)
+ *
* 30-07-98: Dead keys redone, aeb@cwi.nl.
*/

@@ -103,8 +108,9 @@
do_null, enter, show_ptregs, show_mem,
show_state, send_intr, lastcons, caps_toggle,
num, hold, scroll_forw, scroll_back,
boot_it, caps_on, compose, SAK,
- decr_console, incr_console, spawn_console, bare_num
+ decr_console, incr_console, spawn_console, bare_num,
+ blank_now
};

#define SPECIALS_ALLOWED_IN_RAW_MODE (1 << KVAL(K_SAK))
@@ -412,6 +420,26 @@
chg_vc_kbd_led(kbd,VC_NUMLOCK);
}

+static void blank_now_do(void)
+{
+ do_poke_blanked_console = 0;
+ do_blank_screen(0);
+}
+
+static struct timer_list blank_now_timer = {NULL, NULL, 0, 0, blank_now_do};
+
+static void blank_now(void)
+{
+ /* You ask why we have our own timer here? Well, it is because
+ we do not want user's release of keys to unblank
+ immediately. Even if we correctly guessed what is press and
+ what is release, thinkpad's broken bios will turn on
+ backlight for us... <pavel@ucw.cz> */
+ blank_now_timer.expires = jiffies + HZ;
+ blank_now_timer.prev = blank_now_timer.next = NULL;
+ add_timer(&blank_now_timer);
+}
+
static void lastcons(void)
{
/* switch to the last used console, ChN */
@@ -516,6 +552,10 @@
spec_fn_table[value]();
}

+/*
+ * You do not want to clear this procedure and reuse its place...
+ * this is where normal characters reside
+ */
static void do_lowercase(unsigned char value, char up_flag)
{
printk(KERN_ERR "keyboard.c: do_lowercase was called - impossible\n");

-- 
I'm really pavel@atrey.karlin.mff.cuni.cz. 	   Pavel
Look at http://atrey.karlin.mff.cuni.cz/~pavel/ ;-).

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/