On 26/04/23 07:05PM, Jonathan Cameron wrote:
> On Wed, 22 Apr 2026 15:45:48 +0100
> Rodrigo Alencar via B4 Relay <[email protected]> 
> wrote:
> 
> > From: Rodrigo Alencar <[email protected]>
> > 
> > Get optional regulators for vdd, vlogic and vref input power pins. vdd is
> > the input power supply, while vlogic powers the digital side. vref is
> > replacing vcc, which is being deprecated, but still supported. The value
> > of vref_mv is checked so that a device without internal voltage reference
> > cannot proceed without an explicit supply. Error report uses
> > dev_err_probe(), which helps debugging an init issue.

...

> > -   ret = devm_regulator_get_enable_read_voltage(dev, "vcc");
> > +   ret = devm_regulator_get_enable_optional(dev, "vdd");
> > +   if (ret && ret != -ENODEV)
> > +           return dev_err_probe(dev, ret, "failed to enable vdd supply\n");
> vdd is very rarely optional.  Can we not rely on the stub regulator
> that will be provided if there isn't one in DT?

Corret, vdd should not be optional, but I havent made it required in the 
dt-binding
doc. Should I be concerned on breaking existing dts in the driver 
implementation?

> > +
> > +   ret = devm_regulator_get_enable_optional(dev, "vlogic");
> Also doesn't sound very optional.

The same way, that is not required in the dt-binding doc. Also, there are 
different
packaging for the same device, on which vlogic is internally connected to vdd 
and only
vdd is exposed. Some board designs may also do the same externally.

> > +   if (ret && ret != -ENODEV)
> > +           return dev_err_probe(dev, ret, "failed to enable vlogic 
> > supply\n");
> > +
> > +   ret = devm_regulator_get_enable_read_voltage(dev, "vref");
> > +   if (ret == -ENODEV) /* vcc-supply is deprecated, but supported still */
> > +           ret = devm_regulator_get_enable_read_voltage(dev, "vcc");
> >     if (ret < 0 && ret != -ENODEV)
> > -           return ret;
> > +           return dev_err_probe(dev, ret, "failed to read vref voltage\n");
> >  

-- 
Kind regards,

Rodrigo Alencar

Reply via email to