linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kai Heng Feng <kai.heng.feng@canonical.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	linux-input@vger.kernel.org
Subject: Re: [PATCH] HID: i2c-hid: Send power-on command after reset
Date: Mon, 21 Oct 2019 15:17:01 +0800	[thread overview]
Message-ID: <097221D1-9115-41C6-8208-6A69FA0EA0CA@canonical.com> (raw)
In-Reply-To: <20191020214718.150906-1-hdegoede@redhat.com>

Hi Hans,

> On Oct 21, 2019, at 5:47 AM, Hans de Goede <hdegoede@redhat.com> wrote:
> 
> Before commit 67b18dfb8cfc ("HID: i2c-hid: Remove runtime power
> management"), any i2c-hid touchscreens would typically be runtime-suspended
> between the driver loading and Xorg or a Wayland compositor opening it,
> causing it to be resumed again. This means that before this change,
> we would call i2c_hid_set_power(OFF), i2c_hid_set_power(ON) before the
> graphical session would start listening to the touchscreen.
> 
> It turns out that at least some SIS touchscreens, such as the one found
> on the Asus T100HA, need a power-on command after reset, otherwise they
> will not send any events.

As You-Sheng pointed out before, device may need a 60ms delay between ON and RESET command.
Does adding the delay help?

Kai-Heng

> 
> Fixes: 67b18dfb8cfc ("HID: i2c-hid: Remove runtime power management")
> Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/hid/i2c-hid/i2c-hid-core.c | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
> index d9c55e30f986..04c088131e04 100644
> --- a/drivers/hid/i2c-hid/i2c-hid-core.c
> +++ b/drivers/hid/i2c-hid/i2c-hid-core.c
> @@ -447,8 +447,12 @@ static int i2c_hid_hwreset(struct i2c_client *client)
> 	if (ret) {
> 		dev_err(&client->dev, "failed to reset device.\n");
> 		i2c_hid_set_power(client, I2C_HID_PWR_SLEEP);
> +		goto out_unlock;
> 	}
> 
> +	/* At least some SIS devices need this after reset */
> +	ret = i2c_hid_set_power(client, I2C_HID_PWR_ON);
> +
> out_unlock:
> 	mutex_unlock(&ihid->reset_lock);
> 	return ret;
> -- 
> 2.23.0
> 


  reply	other threads:[~2019-10-21  7:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-20 21:47 [PATCH] HID: i2c-hid: Send power-on command after reset Hans de Goede
2019-10-21  7:17 ` Kai Heng Feng [this message]
2019-10-30 15:11   ` Hans de Goede
2019-10-30 17:39     ` Kai-Heng Feng
2019-10-31  6:23       ` Kai-Heng Feng
2019-10-31 22:05         ` Hans de Goede
2019-11-02 19:35 ` Jiri Kosina

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=097221D1-9115-41C6-8208-6A69FA0EA0CA@canonical.com \
    --to=kai.heng.feng@canonical.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=hdegoede@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.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).