Hi All,

I've made a patch that hopefully fixes touch on the newer Bamboo's.
Since I do not have access to one, I need others to help test.  I can
only say for sure that it doesn't make things worse on the older
Bamboo's and no animals were harmed in making this patch.

I'm sure this will fix the 1 finger issues.  I am making an educated
guess that 1 bit is always reliable to detect newer Bamboo's at run
time (so I don't have to create a new BAMBOO_PT2 and do it based on
product ID's).

Steps to test:  Download latest wacom driver in Linux Input staging
area, apply my patch on top of it, compile and install.

mkdir wacom
cd wacom
wget -O wacom.h
"http://git.kernel.org/?p=linux/kernel/git/dtor/input.git;a=blob_plain;f=drivers/input/tablet/wacom.h;hb=refs/heads/for-linus";
wget -O wacom_sys.c
"http://git.kernel.org/?p=linux/kernel/git/dtor/input.git;a=blob_plain;f=drivers/input/tablet/wacom_sys.c;hb=refs/heads/for-linus";
wget -O wacom_wac.c
"http://git.kernel.org/?p=linux/kernel/git/dtor/input.git;a=blob_plain;f=drivers/input/tablet/wacom_wac.c;hb=refs/heads/for-linus";
wget -O wacom_wac.h
"http://git.kernel.org/?p=linux/kernel/git/dtor/input.git;a=blob_plain;f=drivers/input/tablet/wacom_wac.h;hb=refs/heads/for-linus";
patch -p4 < /path/to/0001.patch
echo "wacom-objs += wacom_wac.o wacom_sys.o" > Makefile
echo "obj-m += wacom.o" >> Makefile
make -C /lib/modules/$(uname -r)/build SUBDIRS=$(pwd) modules
sudo cp wacom.ko /lib/modules/$(uname -r)/updates
sudo depmod -a
reboot

Chris
From 9136a015bfd82b16f7eb893dcf036aee40f6afc7 Mon Sep 17 00:00:00 2001
From: Chris Bagwell <ch...@cnpbagwell.com>
Date: Thu, 1 Sep 2011 19:23:51 -0500
Subject: [PATCH] Input: wacom - Fix touch on newer Bamboo's

Bamboo's with Product ID's > 0xD4 return values unrelated to pressure
in touch 1 pressure field.  They also report touch 2's X/Y values
shifted down 1 byte (were pressure was).  This results in jumpy
1 finger touch and totally invalid 2 finger touches.

For touch detection, switch to a single bit Touch Present bit that
all versions of Bamboo support.
For touch 2 offset, calculate offset based on a bit that is set
different between different models.

Touch pressure reports were removed in an earlier commit which made
this patch simple.

Signed-off-by: Chris Bagwell <ch...@cnpbagwell.com>
---
 drivers/input/tablet/wacom_wac.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 2d88316..be02aee 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -800,20 +800,23 @@ static int wacom_bpt_touch(struct wacom_wac *wacom)
 	int i;
 
 	for (i = 0; i < 2; i++) {
-		int p = data[9 * i + 2];
-		bool touch = p && !wacom->shared->stylus_in_proximity;
+		int offset = (data[1] & 0x80) ? (8*i) : (9*i);
+		bool touch = data[offset + 3] & 0x80;
 
-		input_mt_slot(input, i);
-		input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
 		/*
 		 * Touch events need to be disabled while stylus is
 		 * in proximity because user's hand is resting on touchpad
 		 * and sending unwanted events.  User expects tablet buttons
 		 * to continue working though.
 		 */
+		if (wacom->shared->stylus_in_proximity)
+			touch = 0;
+
+		input_mt_slot(input, i);
+		input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
 		if (touch) {
-			int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff;
-			int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff;
+			int x = get_unaligned_be16(&data[offset + 3]) & 0x7ff;
+			int y = get_unaligned_be16(&data[offset + 5]) & 0x7ff;
 			if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) {
 				x <<= 5;
 				y <<= 5;
-- 
1.7.6

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to