From 7d30d1df118d5b27a559e590475897e1b09f0ebe Mon Sep 17 00:00:00 2001 From: Vojtech Pavlik Date: Thu, 25 Jul 2002 02:57:12 +0200 Subject: This patch by Brad Hards replaces the four id* fields of the input struct by a single struct to simplify passing it around and to userspace. --- include/linux/gameport.h | 5 +---- include/linux/input.h | 19 ++++++++++--------- include/linux/uinput.h | 5 +---- 3 files changed, 12 insertions(+), 17 deletions(-) (limited to 'include/linux') diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 0cb1a3b46f77..7bf3bccf0fda 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h @@ -39,10 +39,7 @@ struct gameport { char *name; char *phys; - unsigned short idbus; - unsigned short idvendor; - unsigned short idproduct; - unsigned short idversion; + struct input_devinfo id; int io; int speed; diff --git a/include/linux/input.h b/include/linux/input.h index 28cc98e91037..ca8d8fa55a77 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -56,8 +56,15 @@ struct input_event { * IOCTLs (0x00 - 0x7f) */ +struct input_devinfo { + uint16_t bustype; + uint16_t vendor; + uint16_t product; + uint16_t version; +}; + #define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ -#define EVIOCGID _IOR('E', 0x02, short[4]) /* get device ID */ +#define EVIOCGID _IOR('E', 0x02, struct input_devinfo) /* get device ID */ #define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */ #define EVIOCSREP _IOW('E', 0x03, int[2]) /* get repeat settings */ #define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */ @@ -742,10 +749,7 @@ struct input_dev { char *name; char *phys; char *uniq; - unsigned short idbus; - unsigned short idvendor; - unsigned short idproduct; - unsigned short idversion; + struct input_devinfo id; unsigned long evbit[NBITS(EV_MAX)]; unsigned long keybit[NBITS(KEY_MAX)]; @@ -818,10 +822,7 @@ struct input_device_id { unsigned long flags; - unsigned short idbus; - unsigned short idvendor; - unsigned short idproduct; - unsigned short idversion; + struct input_devinfo id; unsigned long evbit[NBITS(EV_MAX)]; unsigned long keybit[NBITS(KEY_MAX)]; diff --git a/include/linux/uinput.h b/include/linux/uinput.h index 6754ab4e0952..528b27a21d78 100644 --- a/include/linux/uinput.h +++ b/include/linux/uinput.h @@ -64,10 +64,7 @@ struct uinput_device { #define UINPUT_MAX_NAME_SIZE 80 struct uinput_user_dev { char name[UINPUT_MAX_NAME_SIZE]; - unsigned short idbus; - unsigned short idvendor; - unsigned short idproduct; - unsigned short idversion; + struct input_devinfo id; int ff_effects_max; int absmax[ABS_MAX + 1]; int absmin[ABS_MAX + 1]; -- cgit v1.2.3 From 90ced6f7baf3c19792d2e6d81ec81eb431eb0a24 Mon Sep 17 00:00:00 2001 From: Vojtech Pavlik Date: Thu, 25 Jul 2002 03:05:23 +0200 Subject: Remove duplicately defined keys in input.h that got there as a part of a PVR support patch. --- include/linux/input.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'include/linux') diff --git a/include/linux/input.h b/include/linux/input.h index ca8d8fa55a77..7d413abc26b3 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -461,17 +461,15 @@ struct input_devinfo { #define KEY_FIRST 0x194 #define KEY_LAST 0x195 #define KEY_AB 0x196 -#define KEY_PLAY 0x197 +#define KEY_NEXT 0x197 #define KEY_RESTART 0x198 #define KEY_SLOW 0x199 #define KEY_SHUFFLE 0x19a -#define KEY_FASTFORWARD 0x19b +#define KEY_BREAK 0x1ab #define KEY_PREVIOUS 0x19c -#define KEY_NEXT 0x19d -#define KEY_DIGITS 0x19e -#define KEY_TEEN 0x19f -#define KEY_TWEN 0x1a0 -#define KEY_BREAK 0x1a1 +#define KEY_DIGITS 0x19d +#define KEY_TEEN 0x19e +#define KEY_TWEN 0x1af #define KEY_MAX 0x1ff -- cgit v1.2.3 From db82e8212151e4ce67253bc067ac162615615ca5 Mon Sep 17 00:00:00 2001 From: Vojtech Pavlik Date: Thu, 25 Jul 2002 03:14:48 +0200 Subject: The following patch adds the "resend" capability to the keyboard driver; when the host driver detects a parity or framing error, we can ask the keyboard to resend the data, instead of treating random garbage as valid data. We also export serio_interrupt() - serio modules are using it, yet you can't use them as modules without this symbol exported. -- Russell King --- drivers/input/keyboard/atkbd.c | 10 +++++++++- drivers/input/serio/serio.c | 1 + include/linux/serio.h | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'include/linux') diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 998edbf7ff7f..c64b1934dc7a 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -98,6 +98,7 @@ static unsigned char atkbd_set3_keycode[512] = { #define ATKBD_CMD_ENABLE 0x00f4 #define ATKBD_CMD_RESET_DIS 0x00f5 #define ATKBD_CMD_SETALL_MB 0x00f8 +#define ATKBD_CMD_RESEND 0x00fe #define ATKBD_CMD_EX_ENABLE 0x10ea #define ATKBD_CMD_EX_SETLEDS 0x20eb @@ -141,9 +142,16 @@ static void atkbd_interrupt(struct serio *serio, unsigned char data, unsigned in int code = data; #ifdef ATKBD_DEBUG - printk(KERN_DEBUG "atkbd.c: Received %02x\n", data); + printk(KERN_DEBUG "atkbd.c: Received %02x flags %02x\n", data, flags); #endif + /* Interface error. Request that the keyboard resend. */ + if (flags & (SERIO_FRAME | SERIO_PARITY)) { + printk("atkbd.c: frame/parity error: %02x\n", flags); + serio_write(serio, ATKBD_CMD_RESEND); + return; + } + switch (code) { case ATKBD_RET_ACK: atkbd->ack = 1; diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index 415adb665568..b6e6c0f71384 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c @@ -42,6 +42,7 @@ MODULE_AUTHOR("Vojtech Pavlik "); MODULE_DESCRIPTION("Serio abstraction core"); MODULE_LICENSE("GPL"); +EXPORT_SYMBOL(serio_interrupt); EXPORT_SYMBOL(serio_register_port); EXPORT_SYMBOL(serio_unregister_port); EXPORT_SYMBOL(serio_register_device); diff --git a/include/linux/serio.h b/include/linux/serio.h index 37deb0ca7836..ce0359b25fb7 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h @@ -94,8 +94,12 @@ static __inline__ void serio_dev_write_wakeup(struct serio *serio) serio->dev->write_wakeup(serio); } +/* + * bit masks for use in "interrupt" flags (3rd argument) + */ #define SERIO_TIMEOUT 1 #define SERIO_PARITY 2 +#define SERIO_FRAME 4 #define SERIO_TYPE 0xff000000UL #define SERIO_XT 0x00000000UL -- cgit v1.2.3