Skip to content

Commit

Permalink
separate entry for protocol5 in inputattach, also sets higher baudrate
Browse files Browse the repository at this point in the history
  • Loading branch information
RoaldFre committed Jul 13, 2011
1 parent 1a7a443 commit 0a397cf
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 12 deletions.
69 changes: 61 additions & 8 deletions inputattach.patch
@@ -1,25 +1,78 @@
diff -u joystick-1.4.1/utils/inputattach.c joystick-patched/utils/inputattach.c
--- joystick-1.4.1/utils/inputattach.c 2011-06-25 09:16:58.000000000 -0400
+++ joystick-patched/utils/inputattach.c 2011-07-01 13:48:15.000000000 -0400
@@ -588,6 +588,9 @@
diff -rupN linuxconsoletools-1.4.1-original/inputattach.patch linuxconsoletools-1.4.1/inputattach.patch
--- linuxconsoletools-1.4.1-original/inputattach.patch 1970-01-01 01:00:00.000000000 +0100
+++ linuxconsoletools-1.4.1/inputattach.patch 2011-07-11 12:06:30.331999922 +0200
@@ -0,0 +1,25 @@
+diff -u joystick-1.4.1/utils/inputattach.c joystick-patched/utils/inputattach.c
+--- joystick-1.4.1/utils/inputattach.c 2011-06-25 09:16:58.000000000 -0400
++++ joystick-patched/utils/inputattach.c 2011-07-01 13:48:15.000000000 -0400
+@@ -588,6 +588,9 @@
+ { "--w8001", "-w8001", "Wacom W8001",
+ B38400, CS8,
+ SERIO_W8001, 0x00, 0x00, 0, NULL },
++{ "--wacom_iv", "-wacom_iv", "Wacom protocol 4 tablet",
++ B9600, CS8,
++ SERIO_WACOM_IV, 0x00, 0x00, 0, NULL },
+ { NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL }
+ };
+
+diff -u joystick-1.4.1/utils/serio-ids.h joystick-patched/utils/serio-ids.h
+--- joystick-1.4.1/utils/serio-ids.h 2010-11-04 02:15:02.000000000 -0400
++++ joystick-patched/utils/serio-ids.h 2011-07-01 13:48:33.000000000 -0400
+@@ -125,5 +125,8 @@
+ #ifndef SERIO_PSMULT
+ # define SERIO_PS2MULT 0x3c
+ #endif
++#ifndef SERIO_WACOM_IV
++# define SERIO_WACOM_IV 0x3d
++#endif
+
+ #endif
diff -rupN linuxconsoletools-1.4.1-original/utils/inputattach.c linuxconsoletools-1.4.1/utils/inputattach.c
--- linuxconsoletools-1.4.1-original/utils/inputattach.c 2011-06-25 15:16:58.000000000 +0200
+++ linuxconsoletools-1.4.1/utils/inputattach.c 2011-07-13 13:15:37.231000078 +0200
@@ -459,6 +459,17 @@ static int dump_init(int fd, unsigned lo
}
}

+static int wacom_v_init(int fd, unsigned long *id, unsigned long *extra)
+{
+ if (write(fd, "BA19\r", 5) != 5)
+ return -1;
+
+ usleep(100 * 1000);
+
+ setline(fd, CS8, B19200);
+ return 0;
+}
+
struct input_types {
const char *name;
const char *name2;
@@ -588,6 +599,12 @@ static struct input_types input_types[]
{ "--w8001", "-w8001", "Wacom W8001",
B38400, CS8,
SERIO_W8001, 0x00, 0x00, 0, NULL },
+{ "--wacom_iv", "-wacom_iv", "Wacom protocol 4 tablet",
+ B9600, CS8,
+ SERIO_WACOM_IV, 0x00, 0x00, 0, NULL },
+{ "--wacom_v", "-wacom_v", "Wacom protocol 5 tablet",
+ B9600, CS8,
+ SERIO_WACOM_V, 0x00, 0x00, 0, wacom_v_init },
{ NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL }
};

diff -u joystick-1.4.1/utils/serio-ids.h joystick-patched/utils/serio-ids.h
--- joystick-1.4.1/utils/serio-ids.h 2010-11-04 02:15:02.000000000 -0400
+++ joystick-patched/utils/serio-ids.h 2011-07-01 13:48:33.000000000 -0400
@@ -125,5 +125,8 @@
diff -rupN linuxconsoletools-1.4.1-original/utils/serio-ids.h linuxconsoletools-1.4.1/utils/serio-ids.h
--- linuxconsoletools-1.4.1-original/utils/serio-ids.h 2010-11-04 07:15:02.000000000 +0100
+++ linuxconsoletools-1.4.1/utils/serio-ids.h 2011-07-13 13:11:55.223000078 +0200
@@ -125,5 +125,11 @@
#ifndef SERIO_PSMULT
# define SERIO_PS2MULT 0x3c
#endif
+#ifndef SERIO_WACOM_IV
+# define SERIO_WACOM_IV 0x3d
+#endif
+#ifndef SERIO_WACOM_V
+# define SERIO_WACOM_V 0x3e
+#endif

#endif
8 changes: 4 additions & 4 deletions wacom_serial5.c
Expand Up @@ -44,8 +44,8 @@
#include <linux/completion.h>

/* XXX To be removed before (widespread) release. */
#ifndef SERIO_WACOM_IV
#define SERIO_WACOM_IV 0x3d
#ifndef SERIO_WACOM_V
#define SERIO_WACOM_V 0x3e
#endif

#define DRIVER_AUTHOR "Roald Frederickx <roald.frederickx@gmail.com>"
Expand Down Expand Up @@ -571,7 +571,7 @@ static int wacom_connect(struct serio *serio, struct serio_driver *drv)
input_dev->name = DEVICE_NAME;
input_dev->phys = wacom->phys;
input_dev->id.bustype = BUS_RS232;
input_dev->id.vendor = SERIO_WACOM_IV;
input_dev->id.vendor = SERIO_WACOM_V;
input_dev->id.product = serio->id.extra;
input_dev->id.version = 0x0100;
input_dev->dev.parent = &serio->dev;
Expand Down Expand Up @@ -619,7 +619,7 @@ static int wacom_connect(struct serio *serio, struct serio_driver *drv)
static struct serio_device_id wacom_serio_ids[] = {
{
.type = SERIO_RS232,
.proto = SERIO_WACOM_IV,
.proto = SERIO_WACOM_V,
.id = SERIO_ANY,
.extra = SERIO_ANY,
},
Expand Down

0 comments on commit 0a397cf

Please sign in to comment.