Commit 34151589 authored by Patrick Mochel's avatar Patrick Mochel

Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin

into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-input
parents 541d91b8 0ceeaa7b
......@@ -57,7 +57,7 @@ if [ "$CONFIG_IT8712" = "y" ]; then
bool 'Enable Qtronix 990P Keyboard Support' CONFIG_QTRONIX_KEYBOARD
if [ "$CONFIG_QTRONIX_KEYBOARD" = "y" ]; then
define_bool CONFIG_IT8172_CIR y
else
fi
bool 'Enable Smart Card Reader 0 Support ' CONFIG_IT8172_SCR0
bool 'Enable Smart Card Reader 1 Support ' CONFIG_IT8172_SCR1
fi
......
......@@ -40,7 +40,6 @@
#include <linux/kbd_diacr.h>
#include <linux/vt_kern.h>
#include <linux/sysrq.h>
#include <linux/pm.h>
#include <linux/input.h>
static void kbd_disconnect(struct input_handle *handle);
......@@ -50,6 +49,22 @@ extern void ctrl_alt_del(void);
* Exported functions/variables
*/
#ifndef KBD_DEFMODE
#define KBD_DEFMODE ((1 << VC_REPEAT) | (1 << VC_META))
#endif
#ifndef KBD_DEFLEDS
/*
* Some laptops take the 789uiojklm,. keys as number pad when NumLock is on.
* This seems a good reason to start with NumLock off.
*/
#define KBD_DEFLEDS 0
#endif
#ifndef KBD_DEFLOCK
#define KBD_DEFLOCK 0
#endif
struct pt_regs *kbd_pt_regs;
void compute_shiftstate(void);
......@@ -94,6 +109,7 @@ const int NR_TYPES = ARRAY_SIZE(max_vals);
struct kbd_struct kbd_table[MAX_NR_CONSOLES];
static struct kbd_struct *kbd = kbd_table;
static struct kbd_struct kbd0;
int spawnpid, spawnsig;
......@@ -124,6 +140,21 @@ static struct ledptr {
unsigned char valid:1;
} ledptrs[3];
/* Simple translation table for the SysRq keys */
#ifdef CONFIG_MAGIC_SYSRQ
unsigned char kbd_sysrq_xlate[128] =
"\000\0331234567890-=\177\t" /* 0x00 - 0x0f */
"qwertyuiop[]\r\000as" /* 0x10 - 0x1f */
"dfghjkl;'`\000\\zxcv" /* 0x20 - 0x2f */
"bnm,./\000*\000 \000\201\202\203\204\205" /* 0x30 - 0x3f */
"\206\207\210\211\212\000\000789-456+1" /* 0x40 - 0x4f */
"230\177\000\000\213\214\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */
"\r\000/"; /* 0x60 - 0x6f */
static int sysrq_down;
#endif
static int sysrq_alt;
/*
* Translation of scancodes to keycodes. We set them on only the first attached
* keyboard - for per-keyboard setting, /dev/input/event is more useful.
......@@ -329,7 +360,7 @@ void compute_shiftstate(void)
if (!key_down[i])
continue;
k = i*BITS_PER_LONG;
k = i * BITS_PER_LONG;
for (j = 0; j < BITS_PER_LONG; j++, k++) {
......@@ -877,8 +908,6 @@ DECLARE_TASKLET_DISABLED(keyboard_tasklet, kbd_bh, 0);
#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC)
static int x86_sysrq_alt = 0;
static unsigned short x86_keycodes[256] =
{ 0, 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,
......@@ -918,7 +947,7 @@ static int emulate_raw(struct vc_data *vc, unsigned int keycode,
return 0;
}
if (keycode == KEY_SYSRQ && x86_sysrq_alt) {
if (keycode == KEY_SYSRQ && sysrq_alt) {
put_queue(vc, 0x54 | up_flag);
return 0;
}
......@@ -933,9 +962,6 @@ static int emulate_raw(struct vc_data *vc, unsigned int keycode,
put_queue(vc, 0x37 | up_flag);
}
if (keycode == KEY_LEFTALT || keycode == KEY_RIGHTALT)
x86_sysrq_alt = !up_flag;
return 0;
}
......@@ -973,10 +999,26 @@ void kbd_keycode(unsigned int keycode, int down)
kbd = kbd_table + fg_console;
if (keycode == KEY_LEFTALT || keycode == KEY_RIGHTALT)
sysrq_alt = down;
rep = (down == 2);
if ((raw_mode = (kbd->kbdmode == VC_RAW)))
if (emulate_raw(vc, keycode, !down << 7))
printk(KERN_WARNING "keyboard.c: can't emulate rawmode for keycode %d\n", keycode);
#ifdef CONFIG_MAGIC_SYSRQ /* Handle the SysRq Hack */
if (keycode == KEY_SYSRQ && !rep) {
sysrq_down = sysrq_alt && down;
return;
}
if (sysrq_down && down && !rep) {
handle_sysrq(kbd_sysrq_xlate[keycode], kbd_pt_regs, tty);
return;
}
#endif
if (kbd->kbdmode == VC_MEDIUMRAW) {
/*
* This is extended medium raw mode, with keys above 127
......@@ -997,7 +1039,10 @@ void kbd_keycode(unsigned int keycode, int down)
raw_mode = 1;
}
rep = (down == 2);
if (down)
set_bit(keycode, key_down);
else
clear_bit(keycode, key_down);
if (rep && (!vc_kbd_mode(kbd, VC_REPEAT) || (tty &&
(!L_ECHO(tty) && tty->driver.chars_in_buffer(tty))))) {
......@@ -1053,6 +1098,8 @@ static void kbd_event(struct input_handle *handle, unsigned int event_type,
return;
kbd_keycode(keycode, down);
tasklet_schedule(&keyboard_tasklet);
do_poke_blanked_console = 1;
schedule_console_callback();
}
static char kbd_name[] = "kbd";
......@@ -1121,6 +1168,18 @@ static struct input_handler kbd_handler = {
int __init kbd_init(void)
{
int i;
kbd0.ledflagstate = kbd0.default_ledflagstate = KBD_DEFLEDS;
kbd0.ledmode = LED_SHOW_FLAGS;
kbd0.lockstate = KBD_DEFLOCK;
kbd0.slockstate = 0;
kbd0.modeflags = KBD_DEFMODE;
kbd0.kbdmode = VC_XLATE;
for (i = 0 ; i < MAX_NR_CONSOLES ; i++)
kbd_table[i] = kbd0;
tasklet_enable(&keyboard_tasklet);
tasklet_schedule(&keyboard_tasklet);
input_register_handler(&kbd_handler);
......
......@@ -5,7 +5,7 @@
mainmenu_option next_comment
comment 'Input device support'
tristate 'Input core support' CONFIG_INPUT
define_tristate CONFIG_INPUT y
comment 'Userland interfaces'
dep_tristate ' Mouse interface' CONFIG_INPUT_MOUSEDEV $CONFIG_INPUT
......
......@@ -61,6 +61,8 @@ struct timer_list i8042_timer;
static unsigned long i8042_start;
#endif
extern struct pt_regs *kbd_pt_regs;
static unsigned long i8042_unxlate_seen[128 / BITS_PER_LONG];
static unsigned char i8042_unxlate_table[128] = {
0,118, 22, 30, 38, 37, 46, 54, 61, 62, 70, 69, 78, 85,102, 13,
......@@ -346,6 +348,10 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
unsigned char str, data;
unsigned int dfl;
#ifdef CONFIG_VT
kbd_pt_regs = regs;
#endif
spin_lock_irqsave(&i8042_lock, flags);
while ((str = i8042_read_status()) & I8042_STR_OBF) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment