* [PATCH v2 0/2] iio: adc: ad7606: enable Vdrive and Vrefin power supply voltages
@ 2025-05-30 14:27 Angelo Dureghello
2025-05-30 14:27 ` [PATCH v2 1/2] iio: adc: ad7606: enable Vdrive power supply Angelo Dureghello
2025-05-30 14:27 ` [PATCH v2 2/2] iio: adc: ad7606: add enabling of optional Vrefin voltage Angelo Dureghello
0 siblings, 2 replies; 6+ messages in thread
From: Angelo Dureghello @ 2025-05-30 14:27 UTC (permalink / raw)
To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
David Lechner, Nuno Sá, Andy Shevchenko
Cc: linux-iio, linux-kernel, Angelo Dureghello
Enable Vdrive and Vrefin power supply voltages. Related fdt properties
are already defined in ad7606 dt_schema.
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
---
Changes in v2:
- fix "ret < 0" as just "ret",
- set more appropriate error message.
- Link to v1: https://lore.kernel.org/r/20250529-wip-bl-ad7606-reference-voltages-v1-0-9b8f16ef0f20@baylibre.com
---
Angelo Dureghello (2):
iio: adc: ad7606: enable Vdrive power supply
iio: adc: ad7606: add enabling of optional Vrefin voltage
drivers/iio/adc/ad7606.c | 10 ++++++++++
1 file changed, 10 insertions(+)
---
base-commit: aa1b3efb8425b572d67df2f5d47ee4ed25571428
change-id: 20250529-wip-bl-ad7606-reference-voltages-26f49520d12c
Best regards,
--
Angelo Dureghello <adureghello@baylibre.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/2] iio: adc: ad7606: enable Vdrive power supply
2025-05-30 14:27 [PATCH v2 0/2] iio: adc: ad7606: enable Vdrive and Vrefin power supply voltages Angelo Dureghello
@ 2025-05-30 14:27 ` Angelo Dureghello
2025-05-30 14:27 ` [PATCH v2 2/2] iio: adc: ad7606: add enabling of optional Vrefin voltage Angelo Dureghello
1 sibling, 0 replies; 6+ messages in thread
From: Angelo Dureghello @ 2025-05-30 14:27 UTC (permalink / raw)
To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
David Lechner, Nuno Sá, Andy Shevchenko
Cc: linux-iio, linux-kernel, Angelo Dureghello
From: Angelo Dureghello <adureghello@baylibre.com>
Enable Vdrive power supply. The "vdrive-supply" property is mandatory,
already declared in fdt dt_schema.
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
---
drivers/iio/adc/ad7606.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
index 185243dee86ed2e9ebc43b578003d0c010e97a9f..3bbe9c05b5edbc11e8016c995c6ab64104836e7b 100644
--- a/drivers/iio/adc/ad7606.c
+++ b/drivers/iio/adc/ad7606.c
@@ -1330,6 +1330,11 @@ int ad7606_probe(struct device *dev, int irq, void __iomem *base_address,
return dev_err_probe(dev, ret,
"Failed to enable specified AVcc supply\n");
+ ret = devm_regulator_get_enable(dev, "vdrive");
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "Failed to enable Vdrive supply\n");
+
st->chip_info = chip_info;
if (st->chip_info->oversampling_num) {
--
2.49.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] iio: adc: ad7606: add enabling of optional Vrefin voltage
2025-05-30 14:27 [PATCH v2 0/2] iio: adc: ad7606: enable Vdrive and Vrefin power supply voltages Angelo Dureghello
2025-05-30 14:27 ` [PATCH v2 1/2] iio: adc: ad7606: enable Vdrive power supply Angelo Dureghello
@ 2025-05-30 14:27 ` Angelo Dureghello
2025-05-30 15:39 ` David Lechner
2025-05-30 15:56 ` Jonathan Cameron
1 sibling, 2 replies; 6+ messages in thread
From: Angelo Dureghello @ 2025-05-30 14:27 UTC (permalink / raw)
To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
David Lechner, Nuno Sá, Andy Shevchenko
Cc: linux-iio, linux-kernel, Angelo Dureghello
From: Angelo Dureghello <adureghello@baylibre.com>
Add optional refin voltage enabling. The property "refin-supply" is
already available and optional in the current fdt dt_schema.
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
---
drivers/iio/adc/ad7606.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
index 3bbe9c05b5edbc11e8016c995c6ab64104836e7b..4fd9638eb6e56f800c7c97425e45e04f269e3df7 100644
--- a/drivers/iio/adc/ad7606.c
+++ b/drivers/iio/adc/ad7606.c
@@ -1335,6 +1335,11 @@ int ad7606_probe(struct device *dev, int irq, void __iomem *base_address,
return dev_err_probe(dev, ret,
"Failed to enable Vdrive supply\n");
+ ret = devm_regulator_get_enable_optional(dev, "refin");
+ if (ret && ret != -ENODEV)
+ return dev_err_probe(dev, ret,
+ "failed to enable REFIN voltage\n");
+
st->chip_info = chip_info;
if (st->chip_info->oversampling_num) {
--
2.49.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] iio: adc: ad7606: add enabling of optional Vrefin voltage
2025-05-30 14:27 ` [PATCH v2 2/2] iio: adc: ad7606: add enabling of optional Vrefin voltage Angelo Dureghello
@ 2025-05-30 15:39 ` David Lechner
2025-05-31 16:15 ` Jonathan Cameron
2025-05-30 15:56 ` Jonathan Cameron
1 sibling, 1 reply; 6+ messages in thread
From: David Lechner @ 2025-05-30 15:39 UTC (permalink / raw)
To: Angelo Dureghello, Lars-Peter Clausen, Michael Hennerich,
Jonathan Cameron, Nuno Sá, Andy Shevchenko
Cc: linux-iio, linux-kernel
On 5/30/25 9:27 AM, Angelo Dureghello wrote:
> From: Angelo Dureghello <adureghello@baylibre.com>
>
> Add optional refin voltage enabling. The property "refin-supply" is
> already available and optional in the current fdt dt_schema.
>
> Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
> ---
> drivers/iio/adc/ad7606.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
> index 3bbe9c05b5edbc11e8016c995c6ab64104836e7b..4fd9638eb6e56f800c7c97425e45e04f269e3df7 100644
> --- a/drivers/iio/adc/ad7606.c
> +++ b/drivers/iio/adc/ad7606.c
> @@ -1335,6 +1335,11 @@ int ad7606_probe(struct device *dev, int irq, void __iomem *base_address,
> return dev_err_probe(dev, ret,
> "Failed to enable Vdrive supply\n");
>
> + ret = devm_regulator_get_enable_optional(dev, "refin");
> + if (ret && ret != -ENODEV)
> + return dev_err_probe(dev, ret,
> + "failed to enable REFIN voltage\n");
s/failed/Failed/
s/voltage/supply/
to be consistent with AVcc and Vdrive messages
> +
> st->chip_info = chip_info;
>
> if (st->chip_info->oversampling_num) {
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] iio: adc: ad7606: add enabling of optional Vrefin voltage
2025-05-30 14:27 ` [PATCH v2 2/2] iio: adc: ad7606: add enabling of optional Vrefin voltage Angelo Dureghello
2025-05-30 15:39 ` David Lechner
@ 2025-05-30 15:56 ` Jonathan Cameron
1 sibling, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2025-05-30 15:56 UTC (permalink / raw)
To: Angelo Dureghello
Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
David Lechner, Nuno Sá, Andy Shevchenko, linux-iio,
linux-kernel
On Fri, 30 May 2025 16:27:57 +0200
Angelo Dureghello <adureghello@baylibre.com> wrote:
> From: Angelo Dureghello <adureghello@baylibre.com>
>
> Add optional refin voltage enabling. The property "refin-supply" is
> already available and optional in the current fdt dt_schema.
Good to call out either as a comment and/or in the patch description
that we don't need to do anything 'different' dependent on whether
this exists or not because it is coupled with an external pin that
should be tied low to use this supply.
>
> Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
> ---
> drivers/iio/adc/ad7606.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
> index 3bbe9c05b5edbc11e8016c995c6ab64104836e7b..4fd9638eb6e56f800c7c97425e45e04f269e3df7 100644
> --- a/drivers/iio/adc/ad7606.c
> +++ b/drivers/iio/adc/ad7606.c
> @@ -1335,6 +1335,11 @@ int ad7606_probe(struct device *dev, int irq, void __iomem *base_address,
> return dev_err_probe(dev, ret,
> "Failed to enable Vdrive supply\n");
>
> + ret = devm_regulator_get_enable_optional(dev, "refin");
> + if (ret && ret != -ENODEV)
> + return dev_err_probe(dev, ret,
> + "failed to enable REFIN voltage\n");
> +
> st->chip_info = chip_info;
>
> if (st->chip_info->oversampling_num) {
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] iio: adc: ad7606: add enabling of optional Vrefin voltage
2025-05-30 15:39 ` David Lechner
@ 2025-05-31 16:15 ` Jonathan Cameron
0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2025-05-31 16:15 UTC (permalink / raw)
To: David Lechner
Cc: Angelo Dureghello, Lars-Peter Clausen, Michael Hennerich,
Nuno Sá, Andy Shevchenko, linux-iio, linux-kernel
On Fri, 30 May 2025 10:39:27 -0500
David Lechner <dlechner@baylibre.com> wrote:
> On 5/30/25 9:27 AM, Angelo Dureghello wrote:
> > From: Angelo Dureghello <adureghello@baylibre.com>
> >
> > Add optional refin voltage enabling. The property "refin-supply" is
> > already available and optional in the current fdt dt_schema.
> >
> > Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
Tweaked and applied.
I also added:
Note that the driver does not need to take any actions if the supply
is not present because a pin strap is used to change the behavior
of the device if an external reference is connected.
To the description
(applied patch 1 as well)
> > ---
> > drivers/iio/adc/ad7606.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
> > index 3bbe9c05b5edbc11e8016c995c6ab64104836e7b..4fd9638eb6e56f800c7c97425e45e04f269e3df7 100644
> > --- a/drivers/iio/adc/ad7606.c
> > +++ b/drivers/iio/adc/ad7606.c
> > @@ -1335,6 +1335,11 @@ int ad7606_probe(struct device *dev, int irq, void __iomem *base_address,
> > return dev_err_probe(dev, ret,
> > "Failed to enable Vdrive supply\n");
> >
> > + ret = devm_regulator_get_enable_optional(dev, "refin");
> > + if (ret && ret != -ENODEV)
> > + return dev_err_probe(dev, ret,
> > + "failed to enable REFIN voltage\n");
>
> s/failed/Failed/
> s/voltage/supply/
>
> to be consistent with AVcc and Vdrive messages
>
> > +
> > st->chip_info = chip_info;
> >
> > if (st->chip_info->oversampling_num) {
> >
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-05-31 16:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-30 14:27 [PATCH v2 0/2] iio: adc: ad7606: enable Vdrive and Vrefin power supply voltages Angelo Dureghello
2025-05-30 14:27 ` [PATCH v2 1/2] iio: adc: ad7606: enable Vdrive power supply Angelo Dureghello
2025-05-30 14:27 ` [PATCH v2 2/2] iio: adc: ad7606: add enabling of optional Vrefin voltage Angelo Dureghello
2025-05-30 15:39 ` David Lechner
2025-05-31 16:15 ` Jonathan Cameron
2025-05-30 15:56 ` Jonathan Cameron
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).