From: Vojtech Pavlik <vojtech@suse.cz>
To: Vojtech Pavlik <vojtech@suse.cz>
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: [patch] input: joydev/mousedev update [8/14]
Date: Wed, 12 Feb 2003 12:04:27 +0100 [thread overview]
Message-ID: <20030212120427.G1563@ucw.cz> (raw)
In-Reply-To: <20030212120359.F1563@ucw.cz>; from vojtech@suse.cz on Wed, Feb 12, 2003 at 12:03:59PM +0100
You can pull this changeset from:
bk://kernel.bkbits.net/vojtech/input
===================================================================
ChangeSet@1.1011, 2003-02-12 11:02:12+01:00, vojtech@suse.cz
input.c: joydev/mousedev update
- relax requirements on devices, joydev now allows joysticks
without buttons to work with throttles and pedals, mousedev
allows a separate mouse wheel
- remove a stray semicolon in joydev
joydev.c | 17 +++++++++--------
mousedev.c | 6 +++++-
2 files changed, 14 insertions(+), 9 deletions(-)
===================================================================
diff -Nru a/drivers/input/joydev.c b/drivers/input/joydev.c
--- a/drivers/input/joydev.c Wed Feb 12 11:56:52 2003
+++ b/drivers/input/joydev.c Wed Feb 12 11:56:52 2003
@@ -340,7 +340,7 @@
case JSIOCSBTNMAP:
if (copy_from_user(joydev->keypam, (__u16 *) arg, sizeof(__u16) * (KEY_MAX - BTN_MISC)))
return -EFAULT;
- for (i = 0; i < joydev->nkey; i++); {
+ for (i = 0; i < joydev->nkey; i++) {
if (joydev->keypam[i] > KEY_MAX || joydev->keypam[i] < BTN_MISC) return -EINVAL;
joydev->keymap[joydev->keypam[i] - BTN_MISC] = i;
}
@@ -377,7 +377,8 @@
struct joydev *joydev;
int i, j, t, minor;
- if (test_bit(BTN_TOUCH, dev->keybit))
+ /* Avoid tablets */
+ if (test_bit(EV_KEY, dev->evbit) && test_bit(BTN_TOUCH, dev->keybit))
return NULL;
for (minor = 0; minor < JOYDEV_MINORS && joydev_table[minor]; minor++);
@@ -463,18 +464,18 @@
static struct input_device_id joydev_ids[] = {
{
- .flags = INPUT_DEVICE_ID_MATCH_EVBIT,
- .evbit = { BIT(EV_KEY) | BIT(EV_ABS) },
+ .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_ABSBIT,
+ .evbit = { BIT(EV_ABS) },
.absbit = { BIT(ABS_X) },
},
{
- .flags = INPUT_DEVICE_ID_MATCH_EVBIT,
- .evbit = { BIT(EV_KEY) | BIT(EV_ABS) },
+ .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_ABSBIT,
+ .evbit = { BIT(EV_ABS) },
.absbit = { BIT(ABS_WHEEL) },
},
{
- .flags = INPUT_DEVICE_ID_MATCH_EVBIT,
- .evbit = { BIT(EV_KEY) | BIT(EV_ABS) },
+ .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_ABSBIT,
+ .evbit = { BIT(EV_ABS) },
.absbit = { BIT(ABS_THROTTLE) },
},
{ }, /* Terminating entry */
diff -Nru a/drivers/input/mousedev.c b/drivers/input/mousedev.c
--- a/drivers/input/mousedev.c Wed Feb 12 11:56:52 2003
+++ b/drivers/input/mousedev.c Wed Feb 12 11:56:52 2003
@@ -454,7 +454,11 @@
.keybit = { [LONG(BTN_LEFT)] = BIT(BTN_LEFT) },
.relbit = { BIT(REL_X) | BIT(REL_Y) },
}, /* A mouse like device, at least one button, two relative axes */
-
+ {
+ .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_RELBIT,
+ .evbit = { BIT(EV_KEY) | BIT(EV_REL) },
+ .relbit = { BIT(REL_WHEEL) },
+ }, /* A separate scrollwheel */
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT | INPUT_DEVICE_ID_MATCH_ABSBIT,
.evbit = { BIT(EV_KEY) | BIT(EV_ABS) },
next prev parent reply other threads:[~2003-02-12 10:57 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-12 10:59 [patch] input: Update AT+PS/2 mouse and keyboard drivers [1/14] Vojtech Pavlik
2003-02-12 11:00 ` [patch] input: Remove include/linux/pc_keyb.h and old PS/2 code [2/14] Vojtech Pavlik
2003-02-12 11:01 ` [patch] input: Only generate rawmode warnings for keys [3/14] Vojtech Pavlik
2003-02-12 11:01 ` [patch] input: Let newly connected keyboards pickup the LED state. [4/14] Vojtech Pavlik
2003-02-12 11:02 ` [patch] input: Get rid of kbd_pt_regs [5/14] Vojtech Pavlik
2003-02-12 11:03 ` [patch] input: Support for NEC PC-9800 beeper and support for Kana Lock [6/14] Vojtech Pavlik
2003-02-12 11:03 ` [patch] input: HID update [7/14] Vojtech Pavlik
2003-02-12 11:04 ` Vojtech Pavlik [this message]
2003-02-12 11:04 ` [patch] input: Give preferential treatment to gameport at 0x201 [9/14] Vojtech Pavlik
2003-02-12 11:05 ` [patch] input: Add support for ThrustMaster ForceFeedback [10/14] Vojtech Pavlik
2003-02-12 11:06 ` [patch] input: PowerMate driver update [11/14] Vojtech Pavlik
2003-02-12 11:06 ` [patch] input: Resurrect usb_set_report for Aiptek and Wacom tablets [12/14] Vojtech Pavlik
2003-02-12 11:07 ` [patch] input: Add two new serio type #defines [13/14] Vojtech Pavlik
2003-02-12 11:07 ` [patch] input: sunkbd.c - fix reading beyond end of keycode array [14/14] Vojtech Pavlik
2003-02-12 16:38 ` Randy.Dunlap
2003-02-13 1:06 ` Vojtech Pavlik
2003-02-12 16:13 ` [patch] input: Get rid of kbd_pt_regs [5/14] James Simmons
2003-02-13 1:13 ` Vojtech Pavlik
2003-02-13 16:39 ` James Simmons
2003-02-13 16:40 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030212120427.G1563@ucw.cz \
--to=vojtech@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox