linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Henrik Rydberg <rydberg@euromail.se>
To: Jiri Kosina <jkosina@suse.cz>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Ping Cheng <pingc@wacom.com>,
	Chris Bagwell <chris@cnpbagwell.com>,
	Peter Hutterer <peter.hutterer@who-t.net>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] input: mt: Move tracking and pointer emulation to input-mt
Date: Tue, 07 Dec 2010 21:04:29 +0100	[thread overview]
Message-ID: <4CFE934D.4040309@euromail.se> (raw)
In-Reply-To: <alpine.LNX.2.00.1012071553100.14806@pobox.suse.cz>

On 12/07/2010 03:53 PM, Jiri Kosina wrote:

> On Tue, 7 Dec 2010, Henrik Rydberg wrote:
> 
>> The drivers using the type B protocol all report tracking information
>> the same way. The contact id is semantically equivalent to
>> ABS_MT_SLOT, and the handling of ABS_MT_TRACKING_ID only complicates
>> the driver. The situation can be improved upon by providing a common
>> pointer emulation code, thereby removing the need for the tracking id
>> in the driver.  This patch moves all tracking event handling over to
>> the input core, simplifying both the existing drivers and the ones
>> currently in preparation.
>>
>> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
>> ---
>> This is revision three of the patch, with changes to incorporate the
>> active use of ABS_MT_TOOL_TYPE. Example usages are found in pen and
>> touch tablets and simple dual touch devices. The report_slot_state()
>> function now takes the tool type as argument, since a change in either
>> tool type of touch state should trigger a new tracking id.
>>
>> Thanks,
>> Henrik
>>
>>  drivers/hid/hid-3m-pct.c                |   30 +---------
> 
> Acked-by: Jiri Kosina <jkosina@suse.cz>
> 


Thanks Jiri. Ping, you acked a previous version, but I did not want to presume
this version was ok as well. And, as it turned out, I managed to introduce an
error (pressure is zero or one). Corrected and properly tested on a Bamboo
Touch. With the patch below folded in, do I have your ack?

Thanks,
Henrik
---
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 4e59b93..0104e1a 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -866,17 +866,18 @@ static int wacom_bpt_touch(struct wacom_wac *wacom)
        int i;

        for (i = 0; i < 2; i++) {
-               int p = data[9 * i + 2] && !wacom->shared->stylus_in_proximity;
+               int p = data[9 * i + 2];
+               bool touch = p && !wacom->shared->stylus_in_proximity;

                input_mt_slot(input, i);
-               input_mt_report_slot_state(input, MT_TOOL_FINGER, p);
+               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 (p) {
+               if (touch) {
                        int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff;
                        int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff;
                        if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) {

  reply	other threads:[~2010-12-07 20:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-07 11:45 [PATCH v3] input: mt: Move tracking and pointer emulation to input-mt Henrik Rydberg
2010-12-07 14:53 ` Jiri Kosina
2010-12-07 20:04   ` Henrik Rydberg [this message]
2010-12-07 20:39     ` Ping Cheng
2010-12-07 20:58       ` Henrik Rydberg
2010-12-07 21:17         ` Ping Cheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CFE934D.4040309@euromail.se \
    --to=rydberg@euromail.se \
    --cc=chris@cnpbagwell.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.hutterer@who-t.net \
    --cc=pingc@wacom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).