[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+jURcv-o3g3C6zZhGio7KKtco-b+dGk+vm=3Nj8ps_-yMQRNA@mail.gmail.com>
Date: Mon, 17 May 2021 17:15:37 -0700
From: Harry Cutts <hcutts@...omium.org>
To: Johnny Chuang <johnny.chuang.emc@...il.com>
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>,
Peter Hutterer <peter.hutterer@...-t.net>,
lkml <linux-kernel@...r.kernel.org>,
linux-input <linux-input@...r.kernel.org>,
Johnny Chuang <johnny.chuang@....com.tw>,
James Chen <james.chen@....com.tw>,
Jennifer Tsai <jennifer.tsai@....com.tw>,
Paul Liang <paul.liang@....com.tw>,
Jeff Chuang <jeff.chuang@....com.tw>,
Douglas Anderson <dianders@...omium.org>,
Jingle <jingle.wu@....com.tw>, Paris Yeh <pyeh@...gle.com>,
"sukumar . ghorai" <sukumar.ghorai@...el.corp-partner.google.com>
Subject: Re: [PATCH] HID: i2c-hid: Add I2C_HID_QUIRK_NO_DELAY_AFTER_PWR_ON to
optimize timing
On Mon, 17 May 2021 at 16:57, Johnny Chuang <johnny.chuang.emc@...il.com> wrote:
>
> There is a hard coding 60ms delay after I2C_HID_PWR_ON commadn.
> Elan didn't need the delay, so we add a quirk to reduce boot time and resume time.
>
> Optimized: eef4016243e9("HID: i2c-hid: Always sleep 60ms after I2C_HID_PWR_ON commands")
I don't think Optimized: is a valid commit tag, though I'm not sure if
it'll cause any problems.
>
> Signed-off-by: Johnny Chuang <johnny.chuang.emc@...il.com>
> ---
> drivers/hid/i2c-hid/i2c-hid-core.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
> index 9993133..e7ec280 100644
> --- a/drivers/hid/i2c-hid/i2c-hid-core.c
> +++ b/drivers/hid/i2c-hid/i2c-hid-core.c
> [...snip...]
> @@ -178,6 +179,11 @@ static const struct i2c_hid_quirks {
> I2C_HID_QUIRK_RESET_ON_RESUME },
> { USB_VENDOR_ID_ITE, I2C_DEVICE_ID_ITE_LENOVO_LEGION_Y720,
> I2C_HID_QUIRK_BAD_INPUT_SIZE },
> + /*
> + * Optimize boot time and resume time
> + */
This comment is a bit too vague to be useful; maybe state that Elan
devices don't need the delay instead, or just remove the comment.
Other than that,
Reviewed-by: Harry Cutts <hcutts@...omium.org>
> + { USB_VENDOR_ID_ELAN, HID_ANY_ID,
> + I2C_HID_QUIRK_NO_DELAY_AFTER_PWR_ON },
> { 0, 0 }
> };
>
> @@ -427,7 +433,8 @@ static int i2c_hid_set_power(struct i2c_client *client, int power_state)
> * PWR_ON requests. Testing has confirmed that several devices
> * will not work properly without a delay after a PWR_ON request.
> */
> - if (!ret && power_state == I2C_HID_PWR_ON)
> + if (!ret && power_state == I2C_HID_PWR_ON &&
> + !(ihid->quirks & I2C_HID_QUIRK_NO_DELAY_AFTER_PWR_ON))
> msleep(60);
>
> return ret;
> --
> 2.7.4
>
Powered by blists - more mailing lists