On Mon, Sep 01, 2025 at 06:51:19PM +0200, Duje Mihanović wrote:
> On Monday, 1 September 2025 17:35:23 Central European Summer Time Andy 
> Shevchenko wrote:
> > On Sun, Aug 31, 2025 at 12:33:05PM +0200, Duje Mihanović wrote:

...

> > > + .max_register = PM886_REG_GPADC_VBAT_SLP + 1,
> > 
> > What is this + 1 register? Why is it not defined / documented?
> 
> It is the second field of the vbat_slp channel.

Can you define it separately? Or define _MAX_REGISTER to be equal to that and
put a comment that _VBAT_SLP takes two (byte) offsets.

...

> > > +err:
> > > + gpadc_set_bias(gpadc, chan->channel, false);
> > 
> > You do the same in the other branch and checking there for an error. Why 
> > this
> > one is so special?
> 
> My rationale here was to not override the error from either the first
> gpadc_set_bias() call or the subsequent gpadc_find_bias_current() call.

Maybe this needs splitting / refactoring to call bias setting separately?

...

> > > + iio->dev.of_node = dev->parent->of_node;
> > 
> > No, use device_set_node() with the respective parameters.
> > 
> > But rather debug why firmware node (or OF in your case) is not propagated 
> > from
> > the parent device.
> 
> I guess it is because the IIO device is registered as a child of the
> GPADC platform device, which does not have a node unlike the PMIC
> device (GPADC pdev's parent). It seems that the regulator cell
> registers its regulators directly under the PMIC dev, so maybe I should
> do the same here with the IIO dev?

Maybe. Not an expert in DT.

-- 
With Best Regards,
Andy Shevchenko



Reply via email to