devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Johan Hovold <johan+linaro@kernel.org>,
	Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org, Steev Klimaszewski <steev@kali.org>
Subject: Re: [PATCH v2 4/7] HID: i2c-hid: elan: fix reset suspend current leakage
Date: Mon, 20 May 2024 13:52:32 +0200	[thread overview]
Message-ID: <Zks5gJ7H6ZuWr_Xm@hovoldconsulting.com> (raw)
In-Reply-To: <Zks3hp5iUhTe3rLH@hovoldconsulting.com>

On Mon, May 20, 2024 at 01:44:06PM +0200, Johan Hovold wrote:
> On Fri, May 10, 2024 at 04:36:08PM -0700, Doug Anderson wrote:
> > On Tue, May 7, 2024 at 7:48 AM Johan Hovold <johan+linaro@kernel.org> wrote:

> > > @@ -67,7 +77,14 @@ static void elan_i2c_hid_power_down(struct i2chid_ops *ops)
> > >         struct i2c_hid_of_elan *ihid_elan =
> > >                 container_of(ops, struct i2c_hid_of_elan, ops);
> > >
> > > -       gpiod_set_value_cansleep(ihid_elan->reset_gpio, 1);
> > > +       /*
> > > +        * Do not assert reset when the hardware allows for it to remain
> > > +        * deasserted regardless of the state of the (shared) power supply to
> > > +        * avoid wasting power when the supply is left on.
> > > +        */
> > > +       if (!ihid_elan->no_reset_on_power_off)
> > > +               gpiod_set_value_cansleep(ihid_elan->reset_gpio, 1);
> > > +
> > >         if (ihid_elan->chip_data->post_gpio_reset_off_delay_ms)
> > >                 msleep(ihid_elan->chip_data->post_gpio_reset_off_delay_ms);
> > 
> > Shouldn't  the above two lines be inside the "if
> > (!ihid_elan->no_reset_on_power_off)" test? If you're not setting the
> > reset GPIO then you don't need to do the delay, right?
> 
> Yes, I guess you're right. The off-delay is weird and not normally used,
> but apparently it is needed by some panel-follower use case. AFAICT it's
> not even related to the reset line, just a hack to add a delay before
> the panel is reset by some other driver (see f2f43bf15d7a ("HID:
> i2c-hid: elan: Add ili9882t timing")).
> 
> I think that's why I just looked the other way and left this little
> oddity here unchanged.

Hit send too soon.

Since this hack does not appear to be related to the reset line, I think
it's correct to not have it depend on whether the reset line is asserted
or not (e.g. as there could be 'panel-followers' with
'no_reset_on_power_off'):

	 The datasheet specifies there should be 60ms between touch SDA
	 sleep and panel RESX. Doug's series[1] allows panels and
	 touchscreens to power on/off together, so we can add the 65 ms
	 delay in i2c_hid_core_suspend before panel_unprepare.

The power-off delay variable should probably be renamed, but that's a
separate change.

So I think v2 of this series is good to go.

Johan

  reply	other threads:[~2024-05-20 11:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07 14:48 [PATCH v2 0/7] HID/arm64: dts: qcom: sc8280xp-x13s: fix touchscreen power on Johan Hovold
2024-05-07 14:48 ` [PATCH v2 1/7] dt-bindings: HID: i2c-hid: add dedicated Ilitek ILI2901 schema Johan Hovold
2024-05-07 14:48 ` [PATCH v2 2/7] dt-bindings: HID: i2c-hid: elan: add Elan eKTH5015M Johan Hovold
2024-05-07 14:48 ` [PATCH v2 3/7] dt-bindings: HID: i2c-hid: elan: add 'no-reset-on-power-off' property Johan Hovold
2024-05-08  7:29   ` Krzysztof Kozlowski
2024-05-27 13:01   ` Linus Walleij
2024-05-07 14:48 ` [PATCH v2 4/7] HID: i2c-hid: elan: fix reset suspend current leakage Johan Hovold
2024-05-10 23:36   ` Doug Anderson
2024-05-20 11:44     ` Johan Hovold
2024-05-20 11:52       ` Johan Hovold [this message]
2024-05-20 15:38         ` Doug Anderson
2024-05-07 14:48 ` [PATCH v2 5/7] arm64: dts: qcom: sc8280xp-x13s: fix touchscreen power on Johan Hovold
2024-05-07 14:48 ` [PATCH v2 6/7] arm64: dts: qcom: sc8280xp-crd: use external pull up for touch reset Johan Hovold
2024-05-07 14:48 ` [PATCH v2 7/7] arm64: defconfig: enable Elan i2c-hid driver Johan Hovold
2024-06-05 12:25 ` [PATCH v2 0/7] HID/arm64: dts: qcom: sc8280xp-x13s: fix touchscreen power on Johan Hovold
2024-06-06  6:57   ` Benjamin Tissoires
2024-06-06  7:10     ` Johan Hovold
2024-06-07  9:24       ` Benjamin Tissoires
2024-06-07  9:19 ` (subset) " Benjamin Tissoires
2024-06-07 18:48 ` Bjorn Andersson

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=Zks5gJ7H6ZuWr_Xm@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=andersson@kernel.org \
    --cc=benjamin.tissoires@redhat.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jikos@kernel.org \
    --cc=johan+linaro@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzk+dt@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=steev@kali.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).