Package: inputattach
Version: 20051019-12
Severity: wishlist
Tags: patch

It would be nice to include the patch necessary to support the wacom_w8001
input driver in the kernel for use with inputattach.

I put together the attached patch from bits found on the Redhat bugzilla
site[1].

The patch generally works fine on my Fujitsu T2010[2] (although it does not
return after a resume, as udev never re-init's the serial device it
seems) but does require inputattach to be placed in /lib/udev to
function neatly.
----
# cp -a /usr/bin/inputattach /lib/udev
# cat <<'EOF' >> /etc/udev/rules.d/99-local.rules
SUBSYSTEM=="tty", KERNEL=="ttyS[0-9]*", ATTRS{id}=="FUJ02e5", ACTION=="add", 
RUN+="inputattach --daemon --baud 19200 --w8001 /dev/%k"
EOF
----

The above udev line works well for me, but as /usr is a seperate
mountpoint for my system, it is not available when udev initially loads
at boot.

So, a two fold request:
 * include patch
 * if possible place copy of inputattach in / somewhere, I felt
        /lib/udev was the most apprioate place, but do not really mind

Cheers

[1] https://bugzilla.redhat.com/show_bug.cgi?id=645235
[2] http://www.digriz.org.uk/debian/fujitsu/t2010#Touchscreen

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (900, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.37.1 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages inputattach depends on:
ii  libc6                         2.11.2-13  Embedded GNU C Library: Shared lib

inputattach recommends no packages.

inputattach suggests no packages.

-- no debconf information
--- joystick-20051019/utils/inputattach.c	2011-02-19 21:38:06.000000000 +0000
+++ joystick-20051019.new/utils/inputattach.c	2011-02-19 14:08:20.619998303 +0000
@@ -539,6 +539,9 @@
 { "--dump",		"-dump",	"Just enable device",
 	B2400, CS8,
 	0,			0x00,	0x00,	0,	dump_init },
+{ "--w8001",		"-w8001",	"Wacom W8001",
+	B38400, CS8,
+	SERIO_W8001,		0x00,	0x00,	0,	NULL },
 { NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL }
 };
 
@@ -547,7 +550,7 @@
 	struct input_types *type;
 
 	puts("");
-	puts("Usage: inputattach [--daemon] [--always] [--noinit] <mode> <device>");
+	puts("Usage: inputattach [--daemon] [--baud <baud>] [--always] [--noinit] <mode> <device>");
 	puts("");
 	puts("Modes:");
 
@@ -571,6 +574,7 @@
 	int i;
 	unsigned char c;
 	int retval;
+	int baud = -1;
 	int ignore_init_res = 0;
 	int no_init = 0;
 
@@ -587,6 +591,15 @@
 		} else if (need_device) {
 			device = argv[i];
 			need_device = 0;
+		} else if (!strcasecmp(argv[i], "--baud")) {
+			if (argc <= i + 1) {
+				show_help();
+				fprintf(stderr,
+					"inputattach: require baud rate\n");
+				return EXIT_FAILURE;
+			}
+
+			baud = atoi(argv[++i]);
 		} else {
 			if (type && type->name) {
 				fprintf(stderr,
@@ -627,6 +640,19 @@
 		return 1;
 	}
 
+	switch(baud) {
+	case -1: break;
+	case 2400: type->speed = B2400; break;
+	case 4800: type->speed = B4800; break;
+	case 9600: type->speed = B9600; break;
+	case 19200: type->speed = B19200; break;
+	case 38400: type->speed = B38400; break;
+	default:
+		fprintf(stderr, "inputattach: invalid baud rate '%d'\n",
+				baud);
+		return EXIT_FAILURE;
+	}
+
 	setline(fd, type->flags, type->speed);
 
 	if (type->flush)

Reply via email to