From d8c514cfa12b180f41bae49374a4de7e894287a7 Mon Sep 17 00:00:00 2001 From: Vojtech Pavlik Date: Mon, 31 May 2004 19:49:05 +0200 Subject: input: Add reporting of raw scancodes to atkbd.c Signed-off-by: Vojtech Pavlik --- include/linux/input.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux/input.h') diff --git a/include/linux/input.h b/include/linux/input.h index b7a30bb6412e..2fa58351bd4f 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -527,6 +527,7 @@ struct input_absinfo { #define MSC_SERIAL 0x00 #define MSC_PULSELED 0x01 #define MSC_GESTURE 0x02 +#define MSC_RAW 0x03 #define MSC_MAX 0x07 /* -- cgit v1.2.3 From 7daff91b8710b968dff4fdafe55690ab29f05f6d Mon Sep 17 00:00:00 2001 From: Vojtech Pavlik Date: Sun, 6 Jun 2004 15:08:20 +0200 Subject: input: Make hardware rawmode optional for AT-keyboards, and check for rawmode bits in keyboard.c Signed-off-by: Vojtech Pavlik --- drivers/char/keyboard.c | 3 ++- drivers/input/keyboard/atkbd.c | 16 ++++++++++++++-- include/linux/input.h | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) (limited to 'include/linux/input.h') diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index a815b9760258..52efa77cf2d6 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -942,7 +942,8 @@ void kbd_refresh_leds(struct input_handle *handle) #if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) || defined(CONFIG_PARISC) || defined(CONFIG_SH_MPC1211) -#define HW_RAW(dev) (((dev)->id.bustype == BUS_I8042) && ((dev)->id.vendor == 0x0001) && ((dev)->id.product == 0x0001)) +#define HW_RAW(dev) (test_bit(EV_MSC, dev->evbit) && test_bit(MSC_RAW, dev->mscbit) &&\ + ((dev)->id.bustype == BUS_I8042) && ((dev)->id.vendor == 0x0001) && ((dev)->id.product == 0x0001)) static unsigned short x86_keycodes[256] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index ba7fa98c892d..67dfd159b4f0 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -47,6 +47,10 @@ static int atkbd_softrepeat; module_param_named(softrepeat, atkbd_softrepeat, bool, 0); MODULE_PARM_DESC(softrepeat, "Use software keyboard repeat"); +static int atkbd_softraw = 1; +module_param_named(softraw, atkbd_softraw, bool, 0); +MODULE_PARM_DESC(softraw, "Use software generated rawmode"); + static int atkbd_scroll; module_param_named(scroll, atkbd_scroll, bool, 0); MODULE_PARM_DESC(scroll, "Enable scroll-wheel on MS Office and similar keyboards"); @@ -336,6 +340,9 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, code |= (atkbd->set != 3) ? 0x80 : 0x100; } + if (atkbd->keycode[code] != ATKBD_KEY_NULL) + input_event(&atkbd->dev, EV_MSC, MSC_SCAN, code); + switch (atkbd->keycode[code]) { case ATKBD_KEY_NULL: break; @@ -750,16 +757,21 @@ static void atkbd_connect(struct serio *serio, struct serio_dev *dev) return; } + if (!atkbd->write) + atkbd_softrepeat = 1; + if (atkbd_softrepeat) + atkbd_softraw = 1; + if (atkbd->write) { atkbd->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP) | BIT(EV_MSC); atkbd->dev.ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL); } else atkbd->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_MSC); - atkbd->dev.mscbit[0] = BIT(MSC_RAW); + atkbd->dev.mscbit[0] = atkbd_softraw ? BIT(MSC_SCAN) : BIT(MSC_RAW) | BIT(MSC_SCAN); if (!atkbd_softrepeat) { atkbd->dev.rep[REP_DELAY] = 250; atkbd->dev.rep[REP_PERIOD] = 33; - } + } else atkbd_softraw = 1; atkbd->serio = serio; diff --git a/include/linux/input.h b/include/linux/input.h index 2fa58351bd4f..43cb25e228d5 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -528,6 +528,7 @@ struct input_absinfo { #define MSC_PULSELED 0x01 #define MSC_GESTURE 0x02 #define MSC_RAW 0x03 +#define MSC_SCAN 0x04 #define MSC_MAX 0x07 /* -- cgit v1.2.3