From: "Johnny.Chuang" <johnny.chuang@emc.com.tw>
To: "'Harry Cutts'" <hcutts@chromium.org>,
"'Johnny Chuang'" <johnny.chuang.emc@gmail.com>
Cc: "'Dmitry Torokhov'" <dmitry.torokhov@gmail.com>,
"'Benjamin Tissoires'" <benjamin.tissoires@redhat.com>,
"'Peter Hutterer'" <peter.hutterer@who-t.net>,
"'lkml'" <linux-kernel@vger.kernel.org>,
"'linux-input'" <linux-input@vger.kernel.org>,
"'James Chen'" <james.chen@emc.com.tw>,
"'Jennifer Tsai'" <jennifer.tsai@emc.com.tw>,
"'Paul Liang'" <paul.liang@emc.com.tw>,
"'Jeff Chuang'" <jeff.chuang@emc.com.tw>,
"'Douglas Anderson'" <dianders@chromium.org>,
"'Jingle'" <jingle.wu@emc.com.tw>,
"'Paris Yeh'" <pyeh@google.com>,
"'sukumar . ghorai'"
<sukumar.ghorai@intel.corp-partner.google.com>
Subject: RE: [PATCH] HID: i2c-hid: Add I2C_HID_QUIRK_NO_DELAY_AFTER_PWR_ON to optimize timing
Date: Tue, 18 May 2021 09:07:53 +0800 [thread overview]
Message-ID: <089701d74b82$3b0c1c00$b1245400$@emc.com.tw> (raw)
In-Reply-To: <CA+jURcv-o3g3C6zZhGio7KKtco-b+dGk+vm=3Nj8ps_-yMQRNA@mail.gmail.com>
> On Mon, 17 May 2021 at 16:57, Johnny Chuang
> <johnny.chuang.emc@gmail.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.
I will change to Fixed tag at PATCH v2.
>
> >
> > Signed-off-by: Johnny Chuang <johnny.chuang.emc@gmail.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,
Okay, I will change to Elan devices don't need the delay at PATCH v2.
>
> Reviewed-by: Harry Cutts <hcutts@chromium.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
> >
prev parent reply other threads:[~2021-05-18 1:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-17 23:57 [PATCH] HID: i2c-hid: Add I2C_HID_QUIRK_NO_DELAY_AFTER_PWR_ON to optimize timing Johnny Chuang
2021-05-18 0:15 ` Harry Cutts
2021-05-18 1:07 ` Johnny.Chuang [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='089701d74b82$3b0c1c00$b1245400$@emc.com.tw' \
--to=johnny.chuang@emc.com.tw \
--cc=benjamin.tissoires@redhat.com \
--cc=dianders@chromium.org \
--cc=dmitry.torokhov@gmail.com \
--cc=hcutts@chromium.org \
--cc=james.chen@emc.com.tw \
--cc=jeff.chuang@emc.com.tw \
--cc=jennifer.tsai@emc.com.tw \
--cc=jingle.wu@emc.com.tw \
--cc=johnny.chuang.emc@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul.liang@emc.com.tw \
--cc=peter.hutterer@who-t.net \
--cc=pyeh@google.com \
--cc=sukumar.ghorai@intel.corp-partner.google.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