linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Kai-Heng Feng <kai.heng.feng@canonical.com>,
	jikos@kernel.org, benjamin.tissoires@redhat.com
Cc: Pavel Balan <admin@kryma.net>,
	Daniel Playfair Cal <daniel.playfair.cal@gmail.com>,
	HungNien Chen <hn.chen@weidahitech.com>,
	You-Sheng Yang <vicamo.yang@canonical.com>,
	Aaron Ma <aaron.ma@canonical.com>,
	"open list:HID CORE LAYER" <linux-input@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] HID: i2c-hid: Add 60ms delay after SET_POWER ON
Date: Mon, 10 Aug 2020 18:13:06 +0200	[thread overview]
Message-ID: <bbe5fde3-e0df-053e-a30a-a55c780b1f69@redhat.com> (raw)
In-Reply-To: <20200810142928.12552-1-kai.heng.feng@canonical.com>

Hi,

On 10-08-2020 16:29, Kai-Heng Feng wrote:
> Goodix touchpad fails to operate in I2C mode after system suspend.
> 
> According to the vendor, Windows is more forgiving and there's a 60ms
> delay after SET_POWER ON command.
> 
> So let's do the same here, to workaround for the touchpads that depend
> on the delay.
> 
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>

Interesting I send a very similar patch a couple of days ago,
after debugging some touchpads issues on a BMAX Y13 laptop:

https://patchwork.kernel.org/patch/11701541/

If you look at that patch you will see that if we add a
sleep on power-on to i2c_hid_set_power(), we can remove
an existing sleep after power-on from i2c_hid_hwreset().

And there is an interesting comment there which should
probably be moved (as my patch does) and corrected for the
new knowledge so that people reading the code in the future
now why the sleep is there.

Other then that we've come to the same conclusion, but
your sleep is much longer. I guess that is ok though,
are you sure we need 60ms as a minimum? Is that what goodix
said?

Regards,

Hans


> ---
>   drivers/hid/i2c-hid/i2c-hid-core.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
> index 294c84e136d7..7b24a27fad95 100644
> --- a/drivers/hid/i2c-hid/i2c-hid-core.c
> +++ b/drivers/hid/i2c-hid/i2c-hid-core.c
> @@ -419,6 +419,9 @@ static int i2c_hid_set_power(struct i2c_client *client, int power_state)
>   	if (ret)
>   		dev_err(&client->dev, "failed to change power setting.\n");
>   
> +	if (!ret && power_state == I2C_HID_PWR_ON)
> +		msleep(60);
> +
>   set_pwr_exit:
>   	return ret;
>   }
> 


  reply	other threads:[~2020-08-10 16:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-10 14:29 [PATCH] HID: i2c-hid: Add 60ms delay after SET_POWER ON Kai-Heng Feng
2020-08-10 16:13 ` Hans de Goede [this message]
2020-08-11  6:00   ` Kai-Heng Feng
2020-08-11 12:59     ` Hans de Goede

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=bbe5fde3-e0df-053e-a30a-a55c780b1f69@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=aaron.ma@canonical.com \
    --cc=admin@kryma.net \
    --cc=benjamin.tissoires@redhat.com \
    --cc=daniel.playfair.cal@gmail.com \
    --cc=hn.chen@weidahitech.com \
    --cc=jikos@kernel.org \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vicamo.yang@canonical.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).