Linux-Devicetree Archive mirror
 help / color / mirror / Atom feed
From: Doug Anderson <dianders@chromium.org>
To: Johan Hovold <johan@kernel.org>
Cc: Johan Hovold <johan+linaro@kernel.org>,
	Jiri Kosina <jikos@kernel.org>,
	 Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	 Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	 Bjorn Andersson <andersson@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
Subject: Re: [PATCH 0/6] HID/arm64: dts: qcom: sc8280xp-x13s: fix touchscreen power on
Date: Wed, 24 Apr 2024 09:24:48 -0700	[thread overview]
Message-ID: <CAD=FV=X+RaSxsWtY704-si9vrqkoUey0W11R6X8pTxgJkt6Fiw@mail.gmail.com> (raw)
In-Reply-To: <ZijH6EaqWKHWRcdK@hovoldconsulting.com>

Hi,

On Wed, Apr 24, 2024 at 1:50 AM Johan Hovold <johan@kernel.org> wrote:
>
> On Tue, Apr 23, 2024 at 01:36:18PM -0700, Doug Anderson wrote:
> > On Tue, Apr 23, 2024 at 6:46 AM Johan Hovold <johan+linaro@kernel.org> wrote:
> > > The Elan eKTH5015M touch controller on the X13s requires a 300 ms delay
> > > before sending commands after having deasserted reset during power on.
> > >
> > > This series switches the X13s devicetree to use the Elan specific
> > > binding so that the OS can determine the required power-on sequence and
> > > make sure that the controller is always detected during boot. [1]
> > >
> > > The Elan hid-i2c driver currently asserts reset unconditionally during
> > > suspend, which does not work on the X13s where the touch controller
> > > supply is shared with other peripherals that may remain powered. Holding
> > > the controller in reset can increase power consumption and also leaks
> > > current through the reset circuitry pull ups.
> >
> > Can you provide more details about which devices exactly it shares
> > power with? I'm worried that you may be shooting yourself in the foot
> > to avoid shooting yourself in the arm.
> >
> > Specifically, if those other peripherals that may remain powered ever
> > power themselves off then you'll end up back-driving the touchscreen
> > through the reset line, won't you? Since reset is active low then not
> > asserting reset drives the reset line high and, if you power it off,
> > it can leach power backwards through the reset line. The
> > "goodix,no-reset-during-suspend" property that I added earlier
> > specifically worked on systems where the rail was always-on so I could
> > guarantee that didn't happen.
> >
> > From looking at your dts patch it looks like your power _is_ on an
> > always-on rail so you should be OK, but it should be documented that
> > this only works for always-on rails.
> >
> > ..also, from your patch description it sounds as if (maybe?) you
> > intend to eventually let the rail power off if the trackpad isn't a
> > wakeup source. If you eventually plan to do that then you definitely
> > need something more complex here...
>
> No, that's the whole point: the hardware is designed so that the reset
> line can be left deasserted by the CPU also when the supply is off.
>
> The supply in this case is shared with the keyboard and touchpad, but
> also some other devices which are not yet fully described. As you
> rightly noted, the intention is to allow the supply to eventually be
> disabled when none of these devices are enabled as wakeup sources.
>
> I did not want to get in to too much details on exactly how this
> particular reset circuit is designed, but basically you have a pull up
> to an always-on 1.8 V rail on the CPU side, a FET level shifter, and a
> pull up to the supply voltage on the peripheral side.
>
> With this design, the reset line can be left deasserted by the CPU
> (tri-stated or driven high), but the important part is that the reset
> signal that goes into the controller will be pulled to 3.3 V only when
> the supply is left on and otherwise it will be connected to ground.

Ah, got it. The level shifter isolating things makes sense.


> > I guess one last thought is: what do we do if/when someone needs the
> > same solution but they want multiple sources of touchscreens, assuming
> > we ever get the second-sourcing problem solved well. In that case the
> > different touchscreen drivers might have a different idea of how the
> > GPIO should be left when the driver exits...
>
> The second-source problem is arguable a separate one, and as we've
> discussed in the past, the current approach of describing both devices
> in the devicetree only works when the devices are truly compatible in
> terms of external resources (supplies, gpios, pinconfig). For anything
> more complex, we need a more elaborate implementation.
>
> In this case it should not be a problem, though, as the reset circuit
> should have the same properties regardless of which controller you
> connect (e.g. both nodes would have the 'no-reset-on-power-off'
> property).

The reset circuitry may be the same, but the properties of the
touchscreen might not be. It would be easy to imagine a different
touchscreen that consumes less power when held in reset.

In any case, not a problem we need to solve right now.


-Doug

      reply	other threads:[~2024-04-24 16:25 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 13:46 [PATCH 0/6] HID/arm64: dts: qcom: sc8280xp-x13s: fix touchscreen power on Johan Hovold
2024-04-23 13:46 ` [PATCH 1/6] dt-bindings: HID: i2c-hid: add dedicated Ilitek ILI2901 schema Johan Hovold
2024-04-23 16:23   ` Krzysztof Kozlowski
2024-04-23 13:46 ` [PATCH 2/6] dt-bindings: HID: i2c-hid: elan: add Elan eKTH5015M Johan Hovold
2024-04-23 16:24   ` Krzysztof Kozlowski
2024-04-24  7:03     ` Johan Hovold
2024-04-24  8:32       ` Krzysztof Kozlowski
2024-04-23 13:46 ` [PATCH 3/6] dt-bindings: HID: i2c-hid: elan: add 'no-reset-on-power-off' property Johan Hovold
2024-04-23 16:29   ` Krzysztof Kozlowski
2024-04-24  7:34     ` Johan Hovold
2024-04-25  9:39       ` Krzysztof Kozlowski
2024-05-02  9:56         ` Johan Hovold
2024-05-03  9:11           ` Krzysztof Kozlowski
2024-05-03  9:25             ` Johan Hovold
2024-05-03  7:40   ` Linus Walleij
2024-05-03  8:47     ` Johan Hovold
2024-05-06  6:29       ` Linus Walleij
2024-05-07 14:30         ` Johan Hovold
2024-04-23 13:46 ` [PATCH 4/6] HID: i2c-hid: elan: fix reset suspend current leakage Johan Hovold
2024-04-23 20:37   ` Doug Anderson
2024-04-24 10:56     ` Johan Hovold
2024-04-24 16:24       ` Doug Anderson
2024-04-26  9:29         ` Johan Hovold
2024-04-23 13:46 ` [PATCH 5/6] arm64: dts: qcom: sc8280xp-x13s: fix touchscreen power on Johan Hovold
2024-04-23 13:46 ` [PATCH 6/6] arm64: dts: qcom: sc8280xp-crd: use external pull up for touch reset Johan Hovold
2024-04-23 19:34 ` [PATCH 0/6] HID/arm64: dts: qcom: sc8280xp-x13s: fix touchscreen power on Steev Klimaszewski
2024-04-24  7:38   ` Johan Hovold
2024-04-23 20:36 ` Doug Anderson
2024-04-24  8:50   ` Johan Hovold
2024-04-24 16:24     ` Doug Anderson [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='CAD=FV=X+RaSxsWtY704-si9vrqkoUey0W11R6X8pTxgJkt6Fiw@mail.gmail.com' \
    --to=dianders@chromium.org \
    --cc=andersson@kernel.org \
    --cc=benjamin.tissoires@redhat.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jikos@kernel.org \
    --cc=johan+linaro@kernel.org \
    --cc=johan@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 \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).