[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aLa9zbls-Cl4PNQd@smile.fi.intel.com>
Date: Tue, 2 Sep 2025 12:50:05 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Duje Mihanović <duje@...emihanovic.xyz>
Cc: Jonathan Cameron <jic23@...nel.org>,
David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>, Karel Balej <balejk@...fyz.cz>,
Lee Jones <lee@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
David Wronek <david@...nlining.org>, phone-devel@...r.kernel.org,
~postmarketos/upstreaming@...ts.sr.ht, linux-kernel@...r.kernel.org,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH v2 2/3] iio: adc: Add driver for Marvell 88PM886 PMIC ADC
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
Powered by blists - more mailing lists