[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9dbb81f8-7c75-411d-a77c-b670302f0dfe@gmail.com>
Date: Mon, 4 Dec 2023 18:49:21 +0200
From: Ceclan Dumitru <mitrutzceclan@...il.com>
To: Jonathan Cameron <jic23@...nel.org>
Cc: linus.walleij@...aro.org, brgl@...ev.pl, andy@...nel.org,
linux-gpio@...r.kernel.org, Lars-Peter Clausen <lars@...afoo.de>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Michael Walle <michael@...le.cc>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Arnd Bergmann <arnd@...db.de>,
ChiaEn Wu <chiaen_wu@...htek.com>,
Niklas Schnelle <schnelle@...ux.ibm.com>,
Leonard Göhrs <l.goehrs@...gutronix.de>,
Mike Looijmans <mike.looijmans@...ic.nl>,
Haibo Chen <haibo.chen@....com>,
Hugo Villeneuve <hvilleneuve@...onoff.com>,
Ceclan Dumitru <dumitru.ceclan@...log.com>,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 2/2] iio: adc: ad7173: add AD7173 driver
On 11/25/23 19:21, Jonathan Cameron wrote:
> On Thu, 23 Nov 2023 17:23:22 +0200
> mitrutzceclan <mitrutzceclan@...il.com> wrote:
>
>> From: Dumitru Ceclan <mitrutzceclan@...il.com>
...
>> + st->regulators[0].supply = ad7173_ref_sel_str[AD7173_SETUP_REF_SEL_EXT_REF];
>> + st->regulators[1].supply = ad7173_ref_sel_str[AD7173_SETUP_REF_SEL_EXT_REF2];
>> + st->regulators[2].supply = ad7173_ref_sel_str[AD7173_SETUP_REF_SEL_AVDD1_AVSS];
>> +
>> + ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(st->regulators),
>> + st->regulators);
>
> If only some of them are supplied, the driver works fine as long as no channel is using them?
> If so should probably get the optionally then check for availability of the ones you
> want. I'm sure someone will just wire up ref. Incidentally, ref2 isn't there for all chips
> I think, so we should not get it on the ones where it can't exist.
>
This sets a dummy regulator in place if no proper supply is found. Then
the call regulator_get_voltage() on the dummy will fail. About getting
ref2, sure, I'll set the string only with the right ID.
...
>> + ret = ad7173_get_ref_voltage_milli(st, (u8)ref_sel);
>> + if (ret < 0)
>> + return dev_err_probe(dev, ret,
>> + "Cannot use reference %u", ref_sel);
Here the probe would not continue if a channel selects a supply that is
not available in the DT.
Powered by blists - more mailing lists