linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Hutterer <peter.hutterer@who-t.net>
To: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Nick Dyer <nick@shmanahar.org>,
	lkml <linux-kernel@vger.kernel.org>,
	"open list:HID CORE LAYER" <linux-input@vger.kernel.org>,
	cphealy@gmail.com, nikita.yoush@cogentembedded.com,
	l.stach@pengutronix.de, nick.dyer@itdev.co.uk
Subject: Re: [PATCH v1 09/10] Input: atmel_mxt_ts - tool type is ignored when slot is closed
Date: Wed, 25 Jul 2018 15:26:41 +1000	[thread overview]
Message-ID: <20180725052641.GA7072@jelly> (raw)
In-Reply-To: <CAO-hwJ+BoWdXbH1sbde2+qb_sgFBMarM0156a1VrRSQdhNf3xQ@mail.gmail.com>

On Tue, Jul 24, 2018 at 10:23:27AM +0200, Benjamin Tissoires wrote:
> On Tue, Jul 24, 2018 at 12:34 AM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > On Fri, Jul 20, 2018 at 10:51:21PM +0100, Nick Dyer wrote:
> > > From: Nick Dyer <nick.dyer@itdev.co.uk>
> > >
> > > input_mt_report_slot_state() ignores the tool when the slot is closed.
> > > Remove the tool type from these function calls, which has caused a bit of
> > > confusion.
> >
> > Hmm, maybe we could introduce MT_TOOL_NONE or MT_TOOL_INACTIVE and get
> > rid of the 3rd parameter? It will require a bit of macro trickery for a
> > release or 2...
> 
> I am not sure what would be the benefit of adding those new tools, if
> the input_mt code discards them. Do you want to forward them to the
> userspace with the release?
> This reminds me the discussion we had recently with the touchscreens
> releasing the slots with a MT_TOOL_PALM.
> 
> Anyway, better include Peter as he will be using this new MT_TOOL.

thanks for the CC, would've missed this.

>From what I read this would be a helper for internal changes only, not
exposed to userspace? If so maybe it's better/easier/more readable to break
it into two functions
  input_mt_open_slot(dev, MT_TOOL_FINGER)
  input_mt_close_slot(dev)
  
This removes any ambiguity about the handling of the tool and should be a
fairly trivial search/replace. Replace the 'open/close' terminology with
whatever suits better.

Cheers,
   Peter

> > > Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
> > > ---
> > >  drivers/input/touchscreen/atmel_mxt_ts.c | 5 ++---
> > >  1 file changed, 2 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
> > > index d7023d261458..c31af790ef84 100644
> > > --- a/drivers/input/touchscreen/atmel_mxt_ts.c
> > > +++ b/drivers/input/touchscreen/atmel_mxt_ts.c
> > > @@ -838,8 +838,7 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message)
> > >                * have happened.
> > >                */
> > >               if (status & MXT_T9_RELEASE) {
> > > -                     input_mt_report_slot_state(input_dev,
> > > -                                                MT_TOOL_FINGER, 0);
> > > +                     input_mt_report_slot_state(input_dev, 0, 0);
> > >                       mxt_input_sync(data);
> > >               }
> > >
> > > @@ -855,7 +854,7 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message)
> > >               input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, area);
> > >       } else {
> > >               /* Touch no longer active, close out slot */
> > > -             input_mt_report_slot_state(input_dev, MT_TOOL_FINGER, 0);
> > > +             input_mt_report_slot_state(input_dev, 0, 0);
> > >       }
> > >
> > >       data->update_input = true;
> > > --
> > > 2.17.1
> > >
> >
> > --
> > Dmitry
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2018-07-25  5:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20 21:51 [PATCH v1 01/10] Input: atmel_mxt_ts - only use first T9 instance Nick Dyer
2018-07-20 21:51 ` [PATCH v1 02/10] Input: atmel_mxt_ts - use BIT() macro everywhere Nick Dyer
2018-07-20 21:51 ` [PATCH v1 03/10] Input: atmel_mxt_ts - remove duplicate setup of ABS_MT_PRESSURE Nick Dyer
2018-07-20 21:51 ` [PATCH v1 04/10] Input: atmel_mxt_ts - remove unnecessary debug on ENOMEM Nick Dyer
2018-07-20 21:51 ` [PATCH v1 05/10] Input: atmel_mxt_ts - config CRC may start at T71 Nick Dyer
2018-07-20 21:51 ` [PATCH v1 06/10] Input: atmel_mxt_ts - refactor config update code to add context struct Nick Dyer
2018-07-20 21:51 ` [PATCH v1 07/10] Input: atmel_mxt_ts - zero terminate config firmware file Nick Dyer
2018-07-23 22:35   ` Dmitry Torokhov
2018-07-24 20:43     ` Nick Dyer
2018-07-20 21:51 ` [PATCH v1 08/10] Input: atmel_mxt_ts - don't report zero pressure from T9 Nick Dyer
2018-07-20 21:51 ` [PATCH v1 09/10] Input: atmel_mxt_ts - tool type is ignored when slot is closed Nick Dyer
2018-07-23 22:33   ` Dmitry Torokhov
2018-07-24  8:23     ` Benjamin Tissoires
2018-07-25  5:26       ` Peter Hutterer [this message]
2018-07-25 23:21         ` Dmitry Torokhov
2018-07-20 21:51 ` [PATCH v1 10/10] Input: atmel_mxt_ts - move completion to after config crc is updated Nick Dyer
2018-07-27 18:54 ` [PATCH v1 01/10] Input: atmel_mxt_ts - only use first T9 instance Dmitry Torokhov

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=20180725052641.GA7072@jelly \
    --to=peter.hutterer@who-t.net \
    --cc=benjamin.tissoires@redhat.com \
    --cc=cphealy@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=l.stach@pengutronix.de \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nick.dyer@itdev.co.uk \
    --cc=nick@shmanahar.org \
    --cc=nikita.yoush@cogentembedded.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).