linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Make kbtab play nice with wacom_drv in Xorg/XFree86
@ 2004-10-20 11:27 Dave Ahlswede
  2004-10-20 13:04 ` Vojtech Pavlik
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Ahlswede @ 2004-10-20 11:27 UTC (permalink / raw)
  To: linux-kernel; +Cc: vojtech

In its current state, the kbtab driver can be made to work with the
XF86/Xorg Wacom driver, but only once per modprobe. If X is restarted,
the driver won't report any input events. This is because the driver
always reports the pen tool as being in use, and the information doesn't
seem to be passed after the first time the device is opened.

This patch fixes the issue by causing the driver to briefly report the
pen not in use each time the device is opened. 

Also, while the specs say the tablet is supposed to have 256 levels of
pressure sensitivity, it only seems to report 0-127 on both tablets that
I have access to. This patch changes the reported bounds to cooperate
better with Gimp 2.1.

To actually use this in X, it may require the latest stable driver from
http://linuxwacom.sourceforge.net
--Dave Ahlswede

(Please CC me personally with any replies, as I'm not subscribed to the
list-- thanks!)

Patch follows:
--- linux-2.6.7-orig/drivers/usb/input/kbtab.c	2004-06-16 01:18:38 -0400
+++ linux-2.6.7-da1/drivers/usb/input/kbtab.c	2004-08-08 11:08:00 -0400
@@ -13,6 +13,9 @@
  * v0.0.2 - Updated, works with 2.5.62 and 2.4.20;
  *           - added pressure-threshold modules param code from
  *              Alex Perry <alex.perry@ieee.org>
+ *           - fixed so driver always reports the pen tool in use
+ *              after first device open, and max pressure limit(?)
+ *              Dave Ahlswede <mightyquinn@letterboxes.org>
  */
 
 #define DRIVER_VERSION "v0.0.2"
@@ -105,9 +108,10 @@
 {
 	struct kbtab *kbtab = dev->private;
 
-	if (kbtab->open++)
+	if (kbtab->open++) {
+		input_report_key(dev, BTN_TOOL_PEN, 0);
 		return 0;
-
+	}
 	kbtab->irq->dev = kbtab->usbdev;
 	if (usb_submit_urb(kbtab->irq, GFP_KERNEL)) {
 		kbtab->open--;
@@ -160,7 +164,7 @@
 
 	kbtab->dev.absmax[ABS_X] = 0x2000;
 	kbtab->dev.absmax[ABS_Y] = 0x1750;
-	kbtab->dev.absmax[ABS_PRESSURE] = 0xff;
+	kbtab->dev.absmax[ABS_PRESSURE] = 0x7F;
 	
 	kbtab->dev.absfuzz[ABS_X] = 4;
 	kbtab->dev.absfuzz[ABS_Y] = 4;



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Make kbtab play nice with wacom_drv in Xorg/XFree86
  2004-10-20 11:27 [PATCH] Make kbtab play nice with wacom_drv in Xorg/XFree86 Dave Ahlswede
@ 2004-10-20 13:04 ` Vojtech Pavlik
  2004-10-20 15:55   ` Dave Ahlswede
  0 siblings, 1 reply; 3+ messages in thread
From: Vojtech Pavlik @ 2004-10-20 13:04 UTC (permalink / raw)
  To: mightyquinn; +Cc: linux-kernel

On Wed, Oct 20, 2004 at 07:27:21AM -0400, Dave Ahlswede wrote:

> In its current state, the kbtab driver can be made to work with the
> XF86/Xorg Wacom driver, but only once per modprobe. If X is restarted,
> the driver won't report any input events. This is because the driver
> always reports the pen tool as being in use, and the information doesn't
> seem to be passed after the first time the device is opened.
> 
> This patch fixes the issue by causing the driver to briefly report the
> pen not in use each time the device is opened. 

It's a bug in the X Wacom driver that it doesn't check the initial state
of the tool. It should use EVIOCGKEY() to do that.

A good way to get this working in the driver would be report the PEN
tool as not in use when the position is invalid (the pen is not within
reach), if that is possible with the hardware. It's what the bit should
signify.

> Also, while the specs say the tablet is supposed to have 256 levels of
> pressure sensitivity, it only seems to report 0-127 on both tablets that
> I have access to. This patch changes the reported bounds to cooperate
> better with Gimp 2.1.

No problem with that.

> To actually use this in X, it may require the latest stable driver from
> http://linuxwacom.sourceforge.net

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Make kbtab play nice with wacom_drv in Xorg/XFree86
  2004-10-20 13:04 ` Vojtech Pavlik
@ 2004-10-20 15:55   ` Dave Ahlswede
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Ahlswede @ 2004-10-20 15:55 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: linux-kernel

On Wed, 2004-10-20 at 15:04 +0200, Vojtech Pavlik wrote:
> On Wed, Oct 20, 2004 at 07:27:21AM -0400, Dave Ahlswede wrote:
> 
> > In its current state, the kbtab driver can be made to work with the
> > XF86/Xorg Wacom driver, but only once per modprobe. If X is restarted,
> > the driver won't report any input events. This is because the driver
> > always reports the pen tool as being in use, and the information doesn't
> > seem to be passed after the first time the device is opened.
> > 
> > This patch fixes the issue by causing the driver to briefly report the
> > pen not in use each time the device is opened. 
> 
> It's a bug in the X Wacom driver that it doesn't check the initial state
> of the tool. It should use EVIOCGKEY() to do that.

I'll talk to the developer about that, thanks.

> A good way to get this working in the driver would be report the PEN
> tool as not in use when the position is invalid (the pen is not within
> reach), if that is possible with the hardware. It's what the bit should
> signify.

Unfortunately, when the pen is out of bounds, the hardware simply stops
sending packets. I experimented with a change that would report no tool
in use when pressure was zero, but that made the tablet unusable. (It
would only track movement when the pen was being pressed to the tablet)




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-10-20 15:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-20 11:27 [PATCH] Make kbtab play nice with wacom_drv in Xorg/XFree86 Dave Ahlswede
2004-10-20 13:04 ` Vojtech Pavlik
2004-10-20 15:55   ` Dave Ahlswede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).