From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: Linus Torvalds <torvalds@osdl.org>
Cc: linux-kernel@vger.kernel.org, Vojtech Pavlik <vojtech@suse.cz>,
Dmitry Torokhov <dtor_core@ameritech.net>
Subject: Re: [PATCH 0/15] New set of input patches
Date: Wed, 21 Apr 2004 14:43:00 +0200 [thread overview]
Message-ID: <20040421124300.GD12700@lug-owl.de> (raw)
In-Reply-To: <200404210049.17139.dtor_core@ameritech.net>
[-- Attachment #1: Type: text/plain, Size: 12000 bytes --]
On Wed, 2004-04-21 00:49:17 -0500, Dmitry Torokhov <dtor_core@ameritech.net>
wrote in message <200404210049.17139.dtor_core@ameritech.net>:
...and while we are at it, here's a patch to bring vsxxxaa.c to current
version. I'm running this for daily use on my Athlon (right, the
hardware was developed some 20 years ago for DECstations and
VAXstations).
It also correctly supports the VSXXX-AB digitizer tablet :)
#
# This patch updates the vsxxx driver to it's current version.
# Even DEC tablet support (VSXXX-AB) is now tested - it works:)
# You can even hotplug between mouse and digitizer...
#
Index: linux-2.6.6-rc2/drivers/input/mouse/vsxxxaa.c
===================================================================
--- linux-2.6.6-rc2.orig/drivers/input/mouse/vsxxxaa.c 2004-04-04 05:38:27.000000000 +0200
+++ linux-2.6.6-rc2/drivers/input/mouse/vsxxxaa.c 2004-04-21 14:27:03.000000000 +0200
@@ -11,14 +11,14 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -45,32 +45,32 @@
*
* DEC socket DB9 DB25 Note
* 1 (GND) 5 7 -
- * 2 (RxD) 3 3 -
- * 3 (TxD) 2 2 -
+ * 2 (RxD) 2 3 -
+ * 3 (TxD) 3 2 -
* 4 (-12V) - - Somewhere from the PSU. At ATX, it's
- * the blue wire at pin 12 of the ATX
- * power connector. Please note that the
- * docs say this should be +12V! However,
- * I measured -12V...
- * 5 (+5V) - - PSU (red wire of ATX power connector
+ * the thin blue wire at pin 12 of the
+ * ATX power connector. Only required for
+ * VSXXX-AA/-GA mice.
+ * 5 (+5V) - - PSU (red wires of ATX power connector
* on pin 4, 6, 19 or 20) or HDD power
- * connector (also red wire)
- * 6 (not conn.) - - -
+ * connector (also red wire).
+ * 6 (+12V) - - HDD power connector, yellow wire. Only
+ * required for VSXXX-AB digitizer.
* 7 (dev. avail.) - - The mouse shorts this one to pin 1.
* This way, the host computer can detect
* the mouse. To use it with the adaptor,
* simply don't connect this pin.
*
* So to get a working adaptor, you need to connect the mouse with three
- * wires to a RS232 port and two additional wires for +5V and -12V to the
- * PSU.
+ * wires to a RS232 port and two or three additional wires for +5V, +12V and
+ * -12V to the PSU.
*
* Flow specification for the link is 4800, 8o1.
- */
-
-/*
- * TODO list:
- * - Automatically attach to a given serial port (no need for inputattach).
+ *
+ * The mice and tablet are described in "VCB02 Video Subsystem - Technical
+ * Manual", DEC EK-104AA-TM-001. You'll find it at MANX, a search engine
+ * specific for DEC documentation. Try
+ * http://www.vt100.net/manx/details?pn=EK-104AA-TM-001;id=21;cp=1
*/
#include <linux/delay.h>
@@ -115,6 +115,7 @@
unsigned char version;
unsigned char country;
unsigned char type;
+ char name[64];
char phys[32];
};
@@ -134,27 +135,34 @@
{
if (mouse->count == BUFLEN) {
printk (KERN_ERR "%s on %s: Dropping a byte of full buffer.\n",
- mouse->dev.name, mouse->dev.phys);
+ mouse->name, mouse->phys);
vsxxxaa_drop_bytes (mouse, 1);
}
+ DBG (KERN_INFO "Queueing byte 0x%02x\n", byte);
mouse->buf[mouse->count++] = byte;
}
static void
-vsxxxaa_report_mouse (struct vsxxxaa *mouse)
+vsxxxaa_detection_done (struct vsxxxaa *mouse)
{
- char *devtype;
-
switch (mouse->type) {
- case 0x02: devtype = "DEC mouse"; break;
- case 0x04: devtype = "DEC tablet"; break;
- default: devtype = "unknown DEC device"; break;
+ case 0x02:
+ sprintf (mouse->name, "DEC VSXXX-AA/GA mouse");
+ break;
+
+ case 0x04:
+ sprintf (mouse->name, "DEC VSXXX-AB digitizer");
+ break;
+
+ default:
+ sprintf (mouse->name, "unknown DEC pointer device");
+ break;
}
- printk (KERN_INFO "Found %s version 0x%x from country 0x%x "
- "on port %s\n", devtype, mouse->version,
- mouse->country, mouse->dev.phys);
+ printk (KERN_INFO "Found %s version 0x%02x from country 0x%02x "
+ "on port %s\n", mouse->name, mouse->version,
+ mouse->country, mouse->phys);
}
/*
@@ -216,7 +224,7 @@
* 0, bit 4 of byte 0 is direction.
*/
dx = buf[1] & 0x7f;
- dx *= ((buf[0] >> 4) & 0x01)? -1: 1;
+ dx *= ((buf[0] >> 4) & 0x01)? 1: -1;
/*
* Low 7 bit of byte 2 are abs(dy), bit 7 is
@@ -236,7 +244,7 @@
vsxxxaa_drop_bytes (mouse, 3);
DBG (KERN_INFO "%s on %s: dx=%d, dy=%d, buttons=%s%s%s\n",
- mouse->dev.name, mouse->dev.phys, dx, dy,
+ mouse->name, mouse->phys, dx, dy,
left? "L": "l", middle? "M": "m", right? "R": "r");
/*
@@ -246,6 +254,7 @@
input_report_key (dev, BTN_LEFT, left);
input_report_key (dev, BTN_MIDDLE, middle);
input_report_key (dev, BTN_RIGHT, right);
+ input_report_key (dev, BTN_TOUCH, 0);
input_report_rel (dev, REL_X, dx);
input_report_rel (dev, REL_Y, dy);
input_sync (dev);
@@ -256,7 +265,7 @@
{
struct input_dev *dev = &mouse->dev;
unsigned char *buf = mouse->buf;
- int left, middle, right, extra;
+ int left, middle, right, touch;
int x, y;
/*
@@ -270,10 +279,12 @@
*/
/*
- * Get X/Y position
+ * Get X/Y position. Y axis needs to be inverted since VSXXX-AB
+ * counts down->top while monitor counts top->bottom.
*/
x = ((buf[2] & 0x3f) << 6) | (buf[1] & 0x3f);
y = ((buf[4] & 0x3f) << 6) | (buf[3] & 0x3f);
+ y = 1023 - y;
/*
* Get button state. It's bits <4..1> of byte 0.
@@ -281,14 +292,14 @@
left = (buf[0] & 0x02)? 1: 0;
middle = (buf[0] & 0x04)? 1: 0;
right = (buf[0] & 0x08)? 1: 0;
- extra = (buf[0] & 0x10)? 1: 0;
+ touch = (buf[0] & 0x10)? 1: 0;
vsxxxaa_drop_bytes (mouse, 5);
DBG (KERN_INFO "%s on %s: x=%d, y=%d, buttons=%s%s%s%s\n",
- mouse->dev.name, mouse->dev.phys, x, y,
+ mouse->name, mouse->phys, x, y,
left? "L": "l", middle? "M": "m",
- right? "R": "r", extra? "E": "e");
+ right? "R": "r", touch? "T": "t");
/*
* Report what we've found so far...
@@ -297,7 +308,7 @@
input_report_key (dev, BTN_LEFT, left);
input_report_key (dev, BTN_MIDDLE, middle);
input_report_key (dev, BTN_RIGHT, right);
- input_report_key (dev, BTN_EXTRA, extra);
+ input_report_key (dev, BTN_TOUCH, touch);
input_report_abs (dev, ABS_X, x);
input_report_abs (dev, ABS_Y, y);
input_sync (dev);
@@ -334,7 +345,7 @@
mouse->version = buf[0] & 0x0f;
mouse->country = (buf[1] >> 4) & 0x07;
- mouse->type = buf[1] & 0x07;
+ mouse->type = buf[1] & 0x0f;
error = buf[2] & 0x7f;
/*
@@ -347,7 +358,7 @@
right = (buf[0] & 0x01)? 1: 0;
vsxxxaa_drop_bytes (mouse, 4);
- vsxxxaa_report_mouse (mouse);
+ vsxxxaa_detection_done (mouse);
if (error <= 0x1f) {
/* No error. Report buttons */
@@ -355,20 +366,22 @@
input_report_key (dev, BTN_LEFT, left);
input_report_key (dev, BTN_MIDDLE, middle);
input_report_key (dev, BTN_RIGHT, right);
+ input_report_key (dev, BTN_TOUCH, 0);
input_sync (dev);
} else {
printk (KERN_ERR "Your %s on %s reports an undefined error, "
- "please check it...\n", mouse->dev.name,
- mouse->dev.phys);
+ "please check it...\n", mouse->name,
+ mouse->phys);
}
/*
- * If the mouse was hot-plugged, we need to
- * force differential mode now...
+ * If the mouse was hot-plugged, we need to force differential mode
+ * now... However, give it a second to recover from it's reset.
*/
printk (KERN_NOTICE "%s on %s: Forceing standard packet format and "
- "streaming mode\n", mouse->dev.name, mouse->dev.phys);
+ "streaming mode\n", mouse->name, mouse->phys);
mouse->serio->write (mouse->serio, 'S');
+ mdelay (50);
mouse->serio->write (mouse->serio, 'R');
}
@@ -392,7 +405,7 @@
while (mouse->count > 0 && !IS_HDR_BYTE(buf[0])) {
printk (KERN_ERR "%s on %s: Dropping a byte to regain "
"sync with mouse data stream...\n",
- mouse->dev.name, mouse->dev.phys);
+ mouse->name, mouse->phys);
vsxxxaa_drop_bytes (mouse, 1);
}
@@ -475,7 +488,6 @@
if ((serio->type & SERIO_TYPE) != SERIO_RS232)
return;
-
if ((serio->type & SERIO_PROTO) != SERIO_VSXXXAA)
return;
@@ -486,14 +498,15 @@
init_input_dev (&mouse->dev);
set_bit (EV_KEY, mouse->dev.evbit); /* We have buttons */
- set_bit (EV_REL, mouse->dev.evbit); /* We can move */
+ set_bit (EV_REL, mouse->dev.evbit);
+ set_bit (EV_ABS, mouse->dev.evbit);
set_bit (BTN_LEFT, mouse->dev.keybit); /* We have 3 buttons */
set_bit (BTN_MIDDLE, mouse->dev.keybit);
set_bit (BTN_RIGHT, mouse->dev.keybit);
- set_bit (BTN_EXTRA, mouse->dev.keybit); /* ...and Tablet */
- set_bit (REL_X, mouse->dev.relbit); /* We can move in */
- set_bit (REL_Y, mouse->dev.relbit); /* two dimensions */
- set_bit (ABS_X, mouse->dev.absbit); /* DEC tablet support */
+ set_bit (BTN_TOUCH, mouse->dev.keybit); /* ...and Tablet */
+ set_bit (REL_X, mouse->dev.relbit);
+ set_bit (REL_Y, mouse->dev.relbit);
+ set_bit (ABS_X, mouse->dev.absbit);
set_bit (ABS_Y, mouse->dev.absbit);
mouse->dev.absmin[ABS_X] = 0;
@@ -504,9 +517,10 @@
mouse->dev.private = mouse;
serio->private = mouse;
+ sprintf (mouse->name, "DEC VSXXX-AA/GA mouse or VSXXX-AB digitizer");
sprintf (mouse->phys, "%s/input0", serio->phys);
+ mouse->dev.name = mouse->name;
mouse->dev.phys = mouse->phys;
- mouse->dev.name = "DEC VSXXX-AA/GA mouse or DEC tablet";
mouse->dev.id.bustype = BUS_RS232;
mouse->serio = serio;
@@ -516,20 +530,20 @@
}
/*
- * Request selftest and differential stream mode.
+ * Request selftest. Standard packet format and differential
+ * mode will be requested after the device ID'ed successfully.
*/
mouse->serio->write (mouse->serio, 'T'); /* Test */
- mouse->serio->write (mouse->serio, 'R'); /* Differential stream */
input_register_device (&mouse->dev);
- printk (KERN_INFO "input: %s on %s\n", mouse->dev.name, serio->phys);
+ printk (KERN_INFO "input: %s on %s\n", mouse->name, mouse->phys);
}
static struct serio_dev vsxxxaa_dev = {
- .interrupt = vsxxxaa_interrupt,
- .connect = vsxxxaa_connect,
- .disconnect = vsxxxaa_disconnect
+ .connect = vsxxxaa_connect,
+ .interrupt = vsxxxaa_interrupt,
+ .disconnect = vsxxxaa_disconnect,
};
int __init
Index: linux-2.6.6-rc2/drivers/input/mouse/Kconfig
===================================================================
--- linux-2.6.6-rc2.orig/drivers/input/mouse/Kconfig 2004-04-04 05:37:45.000000000 +0200
+++ linux-2.6.6-rc2/drivers/input/mouse/Kconfig 2004-04-21 14:27:03.000000000 +0200
@@ -119,7 +119,7 @@
module will be called rpcmouse.
config MOUSE_VSXXXAA
- tristate "DEC VSXXX-AA/GA mouse and tablet"
+ tristate "DEC VSXXX-AA/GA mouse and VSXXX-AB tablet"
depends on INPUT && INPUT_MOUSE
select SERIO
help
MfG, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de . +49-172-7608481
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg
fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak!
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2004-04-21 12:46 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-21 5:49 [PATCH 0/15] New set of input patches Dmitry Torokhov
2004-04-21 5:50 ` [PATCH 1/15] New set of input patches: synaptics cleanup Dmitry Torokhov
2004-04-21 5:51 ` [PATCH 2/15] New set of input patches: synaptics middle button support Dmitry Torokhov
2004-04-21 5:51 ` [PATCH 3/15] New set of input patches: dont change max proto Dmitry Torokhov
2004-04-21 5:52 ` [PATCH 4/15] New set of input patches: lkkbd whitespace Dmitry Torokhov
2004-04-21 11:39 ` Jan-Benedict Glaw
2004-04-21 12:40 ` [New-PATCH] lkkbd: Current version Jan-Benedict Glaw
2004-04-22 7:27 ` [PATCH 4/15] New set of input patches: lkkbd whitespace Vojtech Pavlik
2004-04-21 5:53 ` [PATCH 5/15] New set of input patches: lkkbd simplify checks Dmitry Torokhov
2004-04-21 11:34 ` Jan-Benedict Glaw
2004-04-21 5:54 ` [PATCH 6/15] New set of input patches: atkbd soften accusation Dmitry Torokhov
2004-04-21 14:13 ` Giuseppe Bilotta
2004-04-21 5:56 ` [PATCH 7/15] New set of input patches: atkbd trailing whitespace Dmitry Torokhov
2004-04-21 5:57 ` [PATCH 8/15] New set of input patches: atkbd - use bitfields Dmitry Torokhov
2004-04-22 7:31 ` Vojtech Pavlik
2004-04-22 7:41 ` Dmitry Torokhov
2004-04-22 7:58 ` Vojtech Pavlik
2004-04-25 6:25 ` Pavel Machek
2004-04-21 5:58 ` [PATCH 9/15] New set of input patches: atkbd timeout complaints Dmitry Torokhov
2004-04-22 7:32 ` Vojtech Pavlik
2004-04-22 7:43 ` Dmitry Torokhov
2004-04-21 6:00 ` [PATCH 10/15] New set of input patches: psmouse rescan on hotplug Dmitry Torokhov
2004-04-21 6:01 ` [PATCH 11/15] New set of input patches: psmouse reconnect after error Dmitry Torokhov
2004-04-21 6:01 ` [PATCH 12/15] New set of input patches: psmouse add protocol_handler Dmitry Torokhov
2004-04-21 6:02 ` [PATCH 13/15] New set of input patches: psmouse sliced commands Dmitry Torokhov
2004-04-21 6:04 ` [PATCH 14/15] New set of input patches: atkbd reconnect probe Dmitry Torokhov
2004-04-21 6:05 ` [PATCH 15/15] New set of input patches: allow disabling psaux Dmitry Torokhov
2004-04-21 12:43 ` Jan-Benedict Glaw [this message]
2004-04-22 6:43 ` [PATCH 16/15] New set of input patches: serio whitespace Dmitry Torokhov
2004-04-22 6:56 ` [PATCH 17/15] New set of input patches: serio open/close optional Dmitry Torokhov
2004-04-22 7:29 ` Dmitry Torokhov
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=20040421124300.GD12700@lug-owl.de \
--to=jbglaw@lug-owl.de \
--cc=dtor_core@ameritech.net \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
--cc=vojtech@suse.cz \
/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