aboutsummaryrefslogtreecommitdiffstats
path: root/linux/openzaurus-pxa-2.4.18-rmk7-pxa3-embedix20031107/enable-sysrq.patch
blob: ece8fd9a5d58d89deadcd42f1c2508e62cdd9652 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--- linux/drivers/char/corgi_keyb.c~enable-sysrq	2003-09-05 01:18:15.000000000 +0200
+++ linux/drivers/char/corgi_keyb.c	2003-09-05 01:40:17.000000000 +0200
@@ -23,7 +23,7 @@
 #include <linux/init.h>
 #include <linux/poll.h>
 #include <linux/wait.h>
-#include <asm/arch/keyboard.h>
+#include <asm/keyboard.h>
 #include <asm/uaccess.h>
 #include <linux/tqueue.h>
 #include <linux/kbd_ll.h>
@@ -46,6 +46,18 @@
 #endif
 
 /*
+ * This is the KeyCode [not ScanCode!] to ASCII Code mapping table
+ */
+
+#ifdef CONFIG_MAGIC_SYSRQ
+static unsigned char corgi_sysrq_xlate[128] =
+	"\000abcdefghijklmno"						/* 00-0f */
+	"pqrstuvwxyz\000\000\000\000\000"				/* 10-1f */
+	" \000\000\000\000\000\000\000\0001234567"			/* 20-2f */
+	"890\000\000\000\000\000\000\000\000\000\000\000\000\000";	/* 30-3f */
+#endif
+
+/*
  * common logical driver definition
  */
 extern void sharppda_kbd_press(int keycode);
@@ -251,7 +263,13 @@
 	corgi_wakeup_button_init();
 #endif // USE_WAKEUP_BUTTON
 
-	printk("keyboard initilaized.\n");
+	printk("keyboard initialized.\n");
+#ifdef CONFIG_MAGIC_SYSRQ
+	k_sysrq_key = 0x28; // KEY_HOME
+	k_sysrq_xlate = corgi_sysrq_xlate;
+	printk("magic_sysrq initialized.\n");
+#endif
+
 }
 
 int corgi_kbd_translate(unsigned char scancode, unsigned char *keycode_p)