devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Weiss <luca@z3ntu.xyz>
To: Pavel Machek <pavel@ucw.cz>, ~postmarketos/upstreaming@lists.sr.ht
Cc: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>,
	linux-kernel@vger.kernel.org, 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,
	Stephan Gerhold <stephan@gerhold.net>
Subject: Re: [PATCH v2 2/2] leds: aw2013: Add vddio regulator
Date: Wed, 29 Mar 2023 18:54:54 +0200	[thread overview]
Message-ID: <2672233.mvXUDI8C0e@z3ntu.xyz> (raw)
In-Reply-To: <ZB1gNJBFeFSdagF1@gerhold.net>

On Freitag, 24. März 2023 09:32:52 CEST Stephan Gerhold wrote:
> Hi Pavel,
> 
> On Thu, Mar 23, 2023 at 08:35:02PM +0100, Pavel Machek 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. Otherwise, this might cause spurious
> > > interrupts and reading from I2C will fail.
> > > 
> > > Implement 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>
> > > 
> > > @@ -348,16 +350,20 @@ static int aw2013_probe(struct i2c_client *client)
> > > 
> > >  		goto error;
> > >  	
> > >  	}
> > > 
> > > -	chip->vcc_regulator = devm_regulator_get(&client->dev, "vcc");
> > > -	ret = PTR_ERR_OR_ZERO(chip->vcc_regulator);
> > > -	if (ret) {
> > > +	chip->regulators[0].supply = "vcc";
> > > +	chip->regulators[1].supply = "vddio";
> > > +	ret = devm_regulator_bulk_get(&client->dev,
> > > +				      ARRAY_SIZE(chip->regulators),
> > > +				      chip->regulators);
> > > +	if (ret < 0) {
> > > 
> > >  		if (ret != -EPROBE_DEFER)
> > >  		
> > >  			dev_err(&client->dev,
> > >  			
> > >  				"Failed to request regulator: %d\n", 
ret);
> > >  		
> > >  		goto error;
> > 
> > Won't this cause failures when optional vddio is unavailable?
> 
> The regulator core should print a warning "supply vddio not found, using
> dummy regulator" but then proceed normally.
> 
> I think in almost all cases a separate I/O supply should actually exist
> that could be described in the device tree. It was likely just omitted
> because it's always-on or indirectly being enabled by other devices.
> So perhaps having this warning is even a good thing?

Just briefly jumping in, there was some activity adding bus_regulator to the 
i2c-core a while back, maybe that can be revived instead? For CCI (camera i2c) 
we also need pull-ups and I don't think adding vddio or whatever to all 
sensors is a good idea long term...

https://lore.kernel.org/lkml/20210527075556.1709140-1-hsinyi@chromium.org/

Regards
Luca

> 
> Thanks,
> Stephan





  reply	other threads:[~2023-03-29 16:55 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 [this message]
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
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=2672233.mvXUDI8C0e@z3ntu.xyz \
    --to=luca@z3ntu.xyz \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@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=stephan@gerhold.net \
    --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).