Commit 8f906860 authored by Chris Bagwell's avatar Chris Bagwell Committed by Dmitry Torokhov

Input: wacom - fix touch parsing on newer Bamboos

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

For touch detection, switch to a Touch Present single bit that
all versions of Bamboo support.

For touch 2 offset, calculate offset based on a bit that is set
different between the two packet layouts.

Since touch pressure reports were removed from driver, there was
no need to be reading pressure any more.
Signed-off-by: default avatarChris Bagwell <chris@cnpbagwell.com>
Reviewed-by: default avatarPing Cheng <pinglinux@gmail.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 1c601bea
...@@ -800,20 +800,22 @@ static int wacom_bpt_touch(struct wacom_wac *wacom) ...@@ -800,20 +800,22 @@ static int wacom_bpt_touch(struct wacom_wac *wacom)
int i; int i;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
int p = data[9 * i + 2]; int offset = (data[1] & 0x80) ? (8 * i) : (9 * i);
bool touch = p && !wacom->shared->stylus_in_proximity; 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 * Touch events need to be disabled while stylus is
* in proximity because user's hand is resting on touchpad * in proximity because user's hand is resting on touchpad
* and sending unwanted events. User expects tablet buttons * and sending unwanted events. User expects tablet buttons
* to continue working though. * to continue working though.
*/ */
touch = touch && !wacom->shared->stylus_in_proximity;
input_mt_slot(input, i);
input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
if (touch) { if (touch) {
int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff; int x = get_unaligned_be16(&data[offset + 3]) & 0x7ff;
int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff; int y = get_unaligned_be16(&data[offset + 5]) & 0x7ff;
if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) { if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) {
x <<= 5; x <<= 5;
y <<= 5; y <<= 5;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment