From: Hans de Goede <hdegoede@redhat.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Mathias Gottschlag <mgottschlag@gmail.com>, linux-input@vger.kernel.org
Subject: Re: [PATCH] psmouse: Add some support for the FocalTech PS/2 protocol extensions.
Date: Tue, 11 Nov 2014 19:58:22 +0100 [thread overview]
Message-ID: <54625C4E.6010407@redhat.com> (raw)
In-Reply-To: <20141111165553.GA27720@dtor-ws>
Hi,
On 11/11/2014 05:55 PM, Dmitry Torokhov wrote:
> Hi Hans,
>
> On Mon, Oct 27, 2014 at 10:40:20AM +0100, Hans de Goede wrote:
>> Hi Matthias,
>>
>> On 10/25/2014 02:01 PM, Mathias Gottschlag wrote:
>>> +static void focaltech_report_state(struct psmouse *psmouse)
>>> +{
>>> + int i;
>>> + struct focaltech_data *priv = psmouse->private;
>>> + struct focaltech_hw_state *state = &priv->state;
>>> + struct input_dev *dev = psmouse->dev;
>>> + int finger_count = 0;
>>> +
>>> + for (i = 0; i < FOC_MAX_FINGERS; i++) {
>>> + struct focaltech_finger_state *finger = &state->fingers[i];
>>> + int active = finger->active && finger->valid;
>>> + input_mt_slot(dev, i);
>>> + input_mt_report_slot_state(dev, MT_TOOL_FINGER, active);
>>> + if (active) {
>>> + finger_count++;
>>> + input_report_abs(dev, ABS_MT_POSITION_X, finger->x);
>>> + input_report_abs(dev, ABS_MT_POSITION_Y,
>>> + focaltech_invert_y(finger->y));
>>> + }
>>> + }
>>> + input_mt_report_pointer_emulation(dev, false);
>>> + input_mt_report_finger_count(dev, finger_count);
>>
>> These 2 lines should be replace with:
>> input_mt_report_pointer_emulation(dev, finger_count);
>>
>> So that BTN_TOUCH properly gets set when at least one finger is down (this is
>> mandatory when not reporting pressure).
>
> I am baffled by this suggestion. input_mt_report_pointer_emulation()
> always report BTN_TOUCH, regardless of the value of the 2nd argument.
My bad, I misread the code (I think I mixed up the use_count and count vars).
> Also, the name of the 2nd argument is "use_count" and it is boolean, so
> I am not sure why you are suggesting that we basically do:
>
> if (finger_count)
> input_mt_report_pointer_emulation(dev, true /*count them again */);
> else
> input_mt_report_pointer_emulation(dve, false);
>
> Did you mean to tell Mathias to call
> input_mt_report_pointer_emulation(dev, *true*); to instruct MT core to
> count contacts and emit appropriate BTN_TOOL_* based on number of
> contacts (if any)?
Right, rereading things, their is no need for the focaltech code to do
its own finger counting, and these 2 calls:
input_mt_report_pointer_emulation(dev, false);
input_mt_report_finger_count(dev, finger_count);
Should be replaced with:
input_mt_report_pointer_emulation(dev, true);
Sorry for the confusion.
Regards,
Hans
next prev parent reply other threads:[~2014-11-11 18:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-25 12:01 [PATCH] psmouse: Add some support for the FocalTech PS/2 protocol extensions Mathias Gottschlag
2014-10-26 19:30 ` Mathias Gottschlag
2014-10-27 9:40 ` Hans de Goede
2014-10-27 13:44 ` Benjamin Tissoires
2014-10-30 12:48 ` Mathias Gottschlag
2014-11-11 16:55 ` Dmitry Torokhov
2014-11-11 18:58 ` Hans de Goede [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-11-12 22:56 Mathias Gottschlag
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=54625C4E.6010407@redhat.com \
--to=hdegoede@redhat.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=mgottschlag@gmail.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).