From: Ceclan Dumitru <mitrutzceclan@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: linus.walleij@linaro.org, brgl@bgdev.pl, andy@kernel.org,
linux-gpio@vger.kernel.org,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Michael Walle" <michael@walle.cc>,
"Andy Shevchenko" <andy.shevchenko@gmail.com>,
"Arnd Bergmann" <arnd@arndb.de>,
"ChiaEn Wu" <chiaen_wu@richtek.com>,
"Niklas Schnelle" <schnelle@linux.ibm.com>,
"Leonard Göhrs" <l.goehrs@pengutronix.de>,
"Mike Looijmans" <mike.looijmans@topic.nl>,
"Haibo Chen" <haibo.chen@nxp.com>,
"Hugo Villeneuve" <hvilleneuve@dimonoff.com>,
"Ceclan Dumitru" <dumitru.ceclan@analog.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/2] iio: adc: ad7173: add AD7173 driver
Date: Mon, 4 Dec 2023 18:49:21 +0200 [thread overview]
Message-ID: <9dbb81f8-7c75-411d-a77c-b670302f0dfe@gmail.com> (raw)
In-Reply-To: <20231125172125.1b0f1ae7@jic23-huawei>
On 11/25/23 19:21, Jonathan Cameron wrote:
> On Thu, 23 Nov 2023 17:23:22 +0200
> mitrutzceclan <mitrutzceclan@gmail.com> wrote:
>
>> From: Dumitru Ceclan <mitrutzceclan@gmail.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.
next prev parent reply other threads:[~2023-12-04 16:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-23 15:23 [PATCH v6 1/2] dt-bindings: adc: add AD7173 mitrutzceclan
2023-11-23 15:23 ` [PATCH v6 2/2] iio: adc: ad7173: add AD7173 driver mitrutzceclan
2023-11-23 16:47 ` Andy Shevchenko
2023-11-23 17:06 ` Andy Shevchenko
2023-11-23 19:09 ` Jonathan Cameron
2023-11-24 9:49 ` kernel test robot
2023-11-25 17:21 ` Jonathan Cameron
2023-12-04 16:49 ` Ceclan Dumitru [this message]
2023-12-04 17:22 ` Jonathan Cameron
2023-11-23 18:02 ` [PATCH v6 1/2] dt-bindings: adc: add AD7173 Conor Dooley
2023-11-27 16:10 ` Ceclan Dumitru
2023-11-25 16:56 ` Jonathan Cameron
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=9dbb81f8-7c75-411d-a77c-b670302f0dfe@gmail.com \
--to=mitrutzceclan@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=andy@kernel.org \
--cc=arnd@arndb.de \
--cc=brgl@bgdev.pl \
--cc=chiaen_wu@richtek.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dumitru.ceclan@analog.com \
--cc=haibo.chen@nxp.com \
--cc=hvilleneuve@dimonoff.com \
--cc=jic23@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=l.goehrs@pengutronix.de \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael@walle.cc \
--cc=mike.looijmans@topic.nl \
--cc=robh+dt@kernel.org \
--cc=schnelle@linux.ibm.com \
/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).