devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephan Gerhold <stephan@gerhold.net>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>,
	linux-kernel@vger.kernel.org, Pavel Machek <pavel@ucw.cz>,
	Lee Jones <lee@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Nikita Travkin <nikita@trvn.ru>,
	linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	~postmarketos/upstreaming@lists.sr.ht
Subject: Re: [PATCH v2 1/2] dt-bindings: leds: aw2013: Document vddio-supply
Date: Mon, 20 Mar 2023 19:59:12 +0100	[thread overview]
Message-ID: <ZBitAGOmF/hyxDYP@gerhold.net> (raw)
In-Reply-To: <922eab51-6931-8533-db51-51cd911a36b3@linaro.org>

On Mon, Mar 20, 2023 at 07:04:22PM +0100, Krzysztof Kozlowski wrote:
> On 20/03/2023 18:55, Lin, Meng-Bo wrote:
> > Some LEDs controllers are used with external pull-up for the interrupt
> > line and the I2C lines, so we might need to enable a regulator to bring
> > the lines into usable state.
> 
> Not a property of this device.
> 
> > Otherwise, this might cause spurious
> > interrupts and reading from I2C will fail.
> > 
> > Document support for "vddio-supply" that is enabled by the aw2013 driver
> > so that the regulator gets enabled when needed.
> > 
> > Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
> > ---
> >  Documentation/devicetree/bindings/leds/leds-aw2013.yaml | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/leds/leds-aw2013.yaml b/Documentation/devicetree/bindings/leds/leds-aw2013.yaml
> > index 08f3e1cfc1b1..79b69cf1d1fe 100644
> > --- a/Documentation/devicetree/bindings/leds/leds-aw2013.yaml
> > +++ b/Documentation/devicetree/bindings/leds/leds-aw2013.yaml
> > @@ -23,6 +23,11 @@ properties:
> >    vcc-supply:
> >      description: Regulator providing power to the "VCC" pin.
> >  
> > +  vddio-supply:
> > +    description: |
> > +      Optional regulator that provides digital I/O voltage,
> 
> NAK. I responded to your patch and you just send a v2 without explanation.
> 
> The device does not have VDDIO pin, either.
> 

The power supply Lin is trying to add here is basically the "VIO1"
example in "Figure 1 AW2013 Typical Application Circuit" on page 1 of
the AW2013 datasheet [1]. The I2C pins and the interrupt output are both
open-drain and therefore require external pull-up resistors, connected
to a power supply that might not be always on.

Because of the open-drain pins AW2013 does indeed not have a dedicated
input pin for the I/O supply voltage. However, it is still necessary to
describe the power supply _somewhere_, to ensure that it is enabled when
needed.

It is hard to model this properly but it's generally easiest to handle
this inside the peripheral driver since it knows exactly when I2C and/or
interrupt lines are currently needed or not. This situation is fairly
common for I2C devices so there are several precedents, e.g.:

  1. cypress,tm2-touchkey.yaml: "vddio-supply"
     https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3e730ec11d51283ad62a98436967c01b718132ab
  2. goodix,gt7375p.yaml: "mainboard-vddio-supply"
     https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1d18c1f3b7d938bdefc44289d137b4e6c7a3d502

Would "mainboard-vddio-supply" from the second example be more clear
than the simple "vddio-supply"? Naming things properly while staying
concise is hard. :)

And if you have any suggestions how to describe this in a better way
please let us know!

Thanks,
Stephan

[1]: https://datasheet.lcsc.com/lcsc/1808311530_AWINIC-Shanghai-Awinic-Tech-AW2013DNR_C252440.pdf

  reply	other threads:[~2023-03-20 19:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20 17:50 [PATCH v2 0/2] leds: aw2013: Add vddio regulator Lin, Meng-Bo
2023-03-20 17:55 ` [PATCH v2 2/2] " Lin, Meng-Bo
2023-03-23 19:35   ` Pavel Machek
2023-03-24  8:32     ` Stephan Gerhold
2023-03-29 16:54       ` Luca Weiss
2023-03-20 17:55 ` [PATCH v2 1/2] dt-bindings: leds: aw2013: Document vddio-supply Lin, Meng-Bo
2023-03-20 18:04   ` Krzysztof Kozlowski
2023-03-20 18:59     ` Stephan Gerhold [this message]
2023-03-21  6:42       ` Krzysztof Kozlowski
2023-03-21 20:21         ` Stephan Gerhold
2023-03-21 22:08           ` Rob Herring

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=ZBitAGOmF/hyxDYP@gerhold.net \
    --to=stephan@gerhold.net \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lee@kernel.org \
    --cc=linmengbo0689@protonmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=nikita@trvn.ru \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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).