linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Loic Poulain <loic.poulain@linaro.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: nick@shmanahar.org, linux-input@vger.kernel.org
Subject: Re: [PATCH 1/2] Input: atmel_mxt_ts: Add wake-up support
Date: Thu, 24 Jun 2021 09:56:55 +0200	[thread overview]
Message-ID: <CAMZdPi85FZvJ_jr_CR+t8NQZaLa2W4QiXirLpEX=aTeRRgAhEQ@mail.gmail.com> (raw)
In-Reply-To: <YNPUzjrJaJEnR7vo@google.com>

Hi Dmitry,

On Thu, 24 Jun 2021 at 02:41, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
>
> Hi Loic,
>
> On Wed, Jun 23, 2021 at 03:56:36PM +0200, Loic Poulain wrote:
> > Add capability for the touchscreen to wakeup the host on touch event.
> >
> > Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> > ---
> >  drivers/input/touchscreen/atmel_mxt_ts.c | 18 ++++++++++++++----
> >  1 file changed, 14 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
> > index 05de92c..807f449 100644
> > --- a/drivers/input/touchscreen/atmel_mxt_ts.c
> > +++ b/drivers/input/touchscreen/atmel_mxt_ts.c
> > @@ -3223,6 +3223,8 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
> >               return error;
> >       }
> >
> > +     device_set_wakeup_capable(&client->dev, true);
>
> We do not want to make the touch controller be wakeup source
> unconditionally. I2C core recognized "wakeup-source" in device tree,
> other platforms may employ different techniques setting I2C_CLIENT_WAKE
> when registering I2C devices to mark them as wakeup capable/enabled.

Contrary to device_init_wakeup(), used in some other input drivers,
device_set_wakeup_capable() does not enable the device as a wakeup
source but just sets it as wakeup capable, and it's up to the user or
distro policy to enable it as a wakeup source or not. It's a quite
common way to do, and it does not change the behavior of this driver.
The I2C_CLIENT_WAKE forces enabling wakeup source, which is maybe not
what we want by default for a touchscreen. remote-wakeup enabling is a
device configuration not a hardware property. Thoughts?

I should probably also add dev_pm_set_wake_irq() for auto-enabling
wake on suspend instead of doing it manually.

Regards,
Loic

      reply	other threads:[~2021-06-24  7:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-23 13:56 [PATCH 1/2] Input: atmel_mxt_ts: Add wake-up support Loic Poulain
2021-06-23 13:56 ` [PATCH 2/2] Input: atmel_mxt_ts: atmel_mxt_ts: Fix event loss Loic Poulain
2021-06-24  0:48   ` Dmitry Torokhov
2021-06-24  5:57     ` Peter Hutterer
2021-06-24  8:05       ` Loic Poulain
2021-06-24  0:41 ` [PATCH 1/2] Input: atmel_mxt_ts: Add wake-up support Dmitry Torokhov
2021-06-24  7:56   ` Loic Poulain [this message]

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='CAMZdPi85FZvJ_jr_CR+t8NQZaLa2W4QiXirLpEX=aTeRRgAhEQ@mail.gmail.com' \
    --to=loic.poulain@linaro.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=nick@shmanahar.org \
    /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).