public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/2] iio: dac: ad5504: fix voltage scaling and add missing bindings
@ 2026-02-12 18:19 Taha Ed-Dafili
  2026-02-12 18:19 ` [PATCH v1 1/2] dt-bindings: iio: dac: ad5504: add output-range and missing gpios Taha Ed-Dafili
  2026-02-12 18:19 ` [PATCH v1 2/2] iio: dac: ad5504: use adi,output-range-volts for scale calculation Taha Ed-Dafili
  0 siblings, 2 replies; 11+ messages in thread
From: Taha Ed-Dafili @ 2026-02-12 18:19 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Michael Hennerich,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, linux-iio,
	devicetree, linux-kernel, linux-mentees, me, skhan,
	Taha Ed-Dafili

This series fixes the voltage scale calculation for the AD5504 DAC and
updates the devicetree bindings to support the necessary hardware
configuration.

Previously, the driver calculated the scale based on the VCC supply
voltage.

However, as confirmed by the datasheet (Rev. B) and discussion on
the mailing list [1], the AD5504 has an integrated precision reference,
and the output range is determined strictly by the state of the
R_SEL pin (0-30V or 0-60V).

To address this:
1. Patch 1 adds `adi,output-range-volts` (and GPIO equivalents) to the
   bindings to describe the hardware state of the R_SEL pin, along with
   other missing properties (vlogic, clear, ldac).
2. Patch 2 updates the driver to use this property for scale calculation,
   falling back to the 60V range if unspecified, while retaining the VCC
   regulator enable for power.

Link: https://lore.kernel.org/linux-iio/20260210121032.4630-1-0rayn.dev@gmail.com/ [1]

Taha Ed-Dafili (2):
  dt-bindings: iio: dac: ad5504: add output-range and missing gpios
  iio: dac: ad5504: use adi,output-range-volts for scale calculation

 Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml | 20 ++++++++++++++++++++
 drivers/iio/dac/ad5504.c                                  | 15 ++++++++++-----
 2 files changed, 30 insertions(+), 5 deletions(-)

Taha Ed-Dafili (2):
  dt-bindings: iio: dac: ad5504: add output-range and missing gpios
  iio: dac: ad5504: use adi,output-range-volts for scale calculation

 .../bindings/iio/dac/adi,ad5504.yaml          | 38 +++++++++++++++++++
 drivers/iio/dac/ad5504.c                      | 26 ++++++++-----
 2 files changed, 54 insertions(+), 10 deletions(-)

-- 
2.47.3


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v1 1/2] dt-bindings: iio: dac: ad5504: add output-range and missing gpios
  2026-02-12 18:19 [PATCH v1 0/2] iio: dac: ad5504: fix voltage scaling and add missing bindings Taha Ed-Dafili
@ 2026-02-12 18:19 ` Taha Ed-Dafili
  2026-02-13  8:11   ` Krzysztof Kozlowski
  2026-02-12 18:19 ` [PATCH v1 2/2] iio: dac: ad5504: use adi,output-range-volts for scale calculation Taha Ed-Dafili
  1 sibling, 1 reply; 11+ messages in thread
From: Taha Ed-Dafili @ 2026-02-12 18:19 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Michael Hennerich,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, linux-iio,
	devicetree, linux-kernel, linux-mentees, me, skhan,
	Taha Ed-Dafili

The AD5504 output range (0-30V or 0-60V) is determined by the R_SEL pin.

Add `adi,output-range-volts` and `adi,output-range-gpios` to describe
this hardware state, using `allOf` to enforce mutual exclusivity.
Also add `vlogic-supply`, `clear-gpios`, and `ldac-gpios` to complete
the hardware description.

Suggested-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com>
---
 .../bindings/iio/dac/adi,ad5504.yaml          | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml
index 9c2c038683b4..3e832e501b0e 100644
--- a/Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml
+++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml
@@ -27,12 +27,50 @@ properties:
     maxItems: 1
 
   vcc-supply: true
+  vlogic-supply: true
+
+  adi,output-range-volts:
+    description:
+      Hard-wired /R_SEL pin state. 30 V when pin is high and 60 V when
+      pin is low.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [30, 60]
+    default: 60
+
+  adi,output-range-gpios:
+    description:
+      GPIO connected to the R_SEL pin to select the output voltage range.
+    maxItems: 1
+
+  clear-gpios:
+    description: GPIO that controls the /CLR pin (active low).
+    maxItems: 1
+
+  ldac-gpios:
+    description: GPIO that controls the /LDAC pin (active low).
+    maxItems: 1
 
 additionalProperties: false
 
 required:
   - compatible
   - reg
+  - vcc-supply
+
+allOf:
+  - if:
+      required:
+        - adi,output-range-gpios
+    then:
+      properties:
+        adi,output-range-volts: false
+
+  - if:
+      required:
+        - adi,output-range-volts
+    then:
+      properties:
+        adi,output-range-gpios: false
 
 examples:
   - |
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v1 2/2] iio: dac: ad5504: use adi,output-range-volts for scale calculation
  2026-02-12 18:19 [PATCH v1 0/2] iio: dac: ad5504: fix voltage scaling and add missing bindings Taha Ed-Dafili
  2026-02-12 18:19 ` [PATCH v1 1/2] dt-bindings: iio: dac: ad5504: add output-range and missing gpios Taha Ed-Dafili
@ 2026-02-12 18:19 ` Taha Ed-Dafili
  2026-02-12 20:15   ` Andy Shevchenko
  1 sibling, 1 reply; 11+ messages in thread
From: Taha Ed-Dafili @ 2026-02-12 18:19 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Michael Hennerich,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, linux-iio,
	devicetree, linux-kernel, linux-mentees, me, skhan,
	Taha Ed-Dafili

The driver previously used VCC to calculate the scale, but the datasheet
states the output range is fixed by the R_SEL pin (0-30V or 0-60V).

Update probe to read `adi,output-range-volts` for the scale. Default
to the 60V range if the property is missing, while keeping the VCC
regulator enable for power.

Suggested-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com>
---
 drivers/iio/dac/ad5504.c | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/drivers/iio/dac/ad5504.c b/drivers/iio/dac/ad5504.c
index 355bcb6a8ba0..1796a9b1e750 100644
--- a/drivers/iio/dac/ad5504.c
+++ b/drivers/iio/dac/ad5504.c
@@ -15,6 +15,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/module.h>
 #include <linux/bitops.h>
+#include <linux/property.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
@@ -274,6 +275,7 @@ static int ad5504_probe(struct spi_device *spi)
 	struct iio_dev *indio_dev;
 	struct ad5504_state *st;
 	int ret;
+	u32 val;
 
 	indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
 	if (!indio_dev)
@@ -281,17 +283,21 @@ static int ad5504_probe(struct spi_device *spi)
 
 	st = iio_priv(indio_dev);
 
-	ret = devm_regulator_get_enable_read_voltage(&spi->dev, "vcc");
-	if (ret < 0 && ret != -ENODEV)
+	ret = devm_regulator_get_enable(&spi->dev, "vcc");
+	if (ret)
 		return ret;
-	if (ret == -ENODEV) {
-		if (pdata->vref_mv)
-			st->vref_mv = pdata->vref_mv;
-		else
-			dev_warn(&spi->dev, "reference voltage unspecified\n");
-	} else {
-		st->vref_mv = ret / 1000;
-	}
+
+	ret = device_property_read_u32(&spi->dev, "adi,output-range-volts", &val);
+	if (ret)
+		val = 60;
+
+	if (val == 60)
+		st->vref_mv = 60000;
+	else
+		st->vref_mv = 30000;
+
+	if (pdata && pdata->vref_mv)
+		st->vref_mv = pdata->vref_mv;
 
 	st->spi = spi;
 	indio_dev->name = spi_get_device_id(st->spi)->name;
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v1 2/2] iio: dac: ad5504: use adi,output-range-volts for scale calculation
  2026-02-12 18:19 ` [PATCH v1 2/2] iio: dac: ad5504: use adi,output-range-volts for scale calculation Taha Ed-Dafili
@ 2026-02-12 20:15   ` Andy Shevchenko
  2026-02-13 17:05     ` Taha Ed-Dafili
  2026-02-15 18:05     ` Jonathan Cameron
  0 siblings, 2 replies; 11+ messages in thread
From: Andy Shevchenko @ 2026-02-12 20:15 UTC (permalink / raw)
  To: Taha Ed-Dafili
  Cc: Jonathan Cameron, Lars-Peter Clausen, Michael Hennerich,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, David Lechner,
	Nuno Sá, Andy Shevchenko, linux-iio, devicetree,
	linux-kernel, linux-mentees, me, skhan

On Thu, Feb 12, 2026 at 07:19:55PM +0100, Taha Ed-Dafili wrote:
> The driver previously used VCC to calculate the scale, but the datasheet
> states the output range is fixed by the R_SEL pin (0-30V or 0-60V).
> 
> Update probe to read `adi,output-range-volts` for the scale. Default
> to the 60V range if the property is missing, while keeping the VCC
> regulator enable for power.

...

>  #include <linux/regulator/consumer.h>
>  #include <linux/module.h>
>  #include <linux/bitops.h>
> +#include <linux/property.h>

Add it before 'linux/s*.h' includes to make less ordering issues.
Ideally one additional patch to sort the headers and one to replace
"proxy" headers (following IWYU principle).

...

> +	ret = device_property_read_u32(&spi->dev, "adi,output-range-volts", &val);

You can pack this into 80 limit with help of

	struct device *dev = &spi->dev;

being defined in the top of the function.

> +	if (ret)
> +		val = 60;

Also this seems an optional, so

	val = 60;
	device_property_read_u32(dev, "adi,output-range-volts", &val);

would be enough.

...

> +	if (val == 60)
> +		st->vref_mv = 60000;

60 * MILLI;

> +	else
> +		st->vref_mv = 30000;

30 * MILLI;

Needs units.h.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1 1/2] dt-bindings: iio: dac: ad5504: add output-range and missing gpios
  2026-02-12 18:19 ` [PATCH v1 1/2] dt-bindings: iio: dac: ad5504: add output-range and missing gpios Taha Ed-Dafili
@ 2026-02-13  8:11   ` Krzysztof Kozlowski
  2026-02-13 17:05     ` Taha Ed-Dafili
  0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-13  8:11 UTC (permalink / raw)
  To: Taha Ed-Dafili
  Cc: Jonathan Cameron, Lars-Peter Clausen, Michael Hennerich,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, David Lechner,
	Nuno Sá, Andy Shevchenko, linux-iio, devicetree,
	linux-kernel, linux-mentees, me, skhan

On Thu, Feb 12, 2026 at 07:19:54PM +0100, Taha Ed-Dafili wrote:
> The AD5504 output range (0-30V or 0-60V) is determined by the R_SEL pin.
> 
> Add `adi,output-range-volts` and `adi,output-range-gpios` to describe
> this hardware state, using `allOf` to enforce mutual exclusivity.
> Also add `vlogic-supply`, `clear-gpios`, and `ldac-gpios` to complete
> the hardware description.
> 
> Suggested-by: David Lechner <dlechner@baylibre.com>
> Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com>
> ---
>  .../bindings/iio/dac/adi,ad5504.yaml          | 38 +++++++++++++++++++
>  1 file changed, 38 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml
> index 9c2c038683b4..3e832e501b0e 100644
> --- a/Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml
> +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml
> @@ -27,12 +27,50 @@ properties:
>      maxItems: 1
>  
>    vcc-supply: true
> +  vlogic-supply: true
> +
> +  adi,output-range-volts:

Use proper property unit suffix, see dt-schema.


And really, you should have checked - you already have properties for
this! See dac schema.

> +    description:
> +      Hard-wired /R_SEL pin state. 30 V when pin is high and 60 V when
> +      pin is low.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    enum: [30, 60]
> +    default: 60
> +
> +  adi,output-range-gpios:

So another same roperty? If you looked around you would find
adi,range-gpios, which would be better than multiplying properties.
Anyway, gpios do not take vendor prefixes, so you want range-sel-gpios
or range-gpios. I guess the latter.


> +    description:
> +      GPIO connected to the R_SEL pin to select the output voltage range.
> +    maxItems: 1
> +
> +  clear-gpios:
> +    description: GPIO that controls the /CLR pin (active low).
> +    maxItems: 1
> +
> +  ldac-gpios:
> +    description: GPIO that controls the /LDAC pin (active low).
> +    maxItems: 1
>  
>  additionalProperties: false
>  
>  required:
>    - compatible
>    - reg
> +  - vcc-supply
> +
> +allOf:

allOf:
  - not:
      required:
        - foo
	- bar

Should give you exactly same result, with less code.

> +  - if:
> +      required:
> +        - adi,output-range-gpios
> +    then:
> +      properties:
> +        adi,output-range-volts: false
> +
> +  - if:
> +      required:
> +        - adi,output-range-volts
> +    then:
> +      properties:
> +        adi,output-range-gpios: false
>  
>  examples:
>    - |
> -- 
> 2.47.3
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1 2/2] iio: dac: ad5504: use adi,output-range-volts for scale calculation
  2026-02-12 20:15   ` Andy Shevchenko
@ 2026-02-13 17:05     ` Taha Ed-Dafili
  2026-02-15 18:03       ` Jonathan Cameron
  2026-02-15 18:05     ` Jonathan Cameron
  1 sibling, 1 reply; 11+ messages in thread
From: Taha Ed-Dafili @ 2026-02-13 17:05 UTC (permalink / raw)
  To: andriy.shevchenko
  Cc: 0rayn.dev, Michael.Hennerich, andy, conor+dt, devicetree,
	dlechner, jic23, krzk+dt, lars, linux-iio, linux-kernel,
	linux-mentees, me, nuno.sa, robh, skhan

Hi Andy,

Thank you for the detailed feedback, I'll make sure to add those changes
in the upcoming v2 series.

Best regards,
Taha

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1 1/2] dt-bindings: iio: dac: ad5504: add output-range and missing gpios
  2026-02-13  8:11   ` Krzysztof Kozlowski
@ 2026-02-13 17:05     ` Taha Ed-Dafili
  2026-02-13 17:07       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 11+ messages in thread
From: Taha Ed-Dafili @ 2026-02-13 17:05 UTC (permalink / raw)
  To: krzk
  Cc: 0rayn.dev, Michael.Hennerich, andy, conor+dt, devicetree,
	dlechner, jic23, krzk+dt, lars, linux-iio, linux-kernel,
	linux-mentees, me, nuno.sa, robh, skhan

Hello Krzysztof,

Thank you for the detailed review and for pointing me toward the standard
DAC schema.

I'll update the bindings in v2 to address your comments, and I will also
ensure I check the common schemas more thoroughly for future patches.

Best regards,
Taha

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1 1/2] dt-bindings: iio: dac: ad5504: add output-range and missing gpios
  2026-02-13 17:05     ` Taha Ed-Dafili
@ 2026-02-13 17:07       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 11+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-13 17:07 UTC (permalink / raw)
  To: Taha Ed-Dafili
  Cc: Michael.Hennerich, andy, conor+dt, devicetree, dlechner, jic23,
	krzk+dt, lars, linux-iio, linux-kernel, linux-mentees, me,
	nuno.sa, robh, skhan

On 13/02/2026 18:05, Taha Ed-Dafili wrote:
> Hello Krzysztof,
> 
> Thank you for the detailed review and for pointing me toward the standard
> DAC schema.
> 
> I'll update the bindings in v2 to address your comments, and I will also
> ensure I check the common schemas more thoroughly for future patches.

Thanks.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1 2/2] iio: dac: ad5504: use adi,output-range-volts for scale calculation
  2026-02-13 17:05     ` Taha Ed-Dafili
@ 2026-02-15 18:03       ` Jonathan Cameron
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2026-02-15 18:03 UTC (permalink / raw)
  To: Taha Ed-Dafili
  Cc: andriy.shevchenko, Michael.Hennerich, andy, conor+dt, devicetree,
	dlechner, krzk+dt, lars, linux-iio, linux-kernel, linux-mentees,
	me, nuno.sa, robh, skhan

On Fri, 13 Feb 2026 18:05:02 +0100
Taha Ed-Dafili <0rayn.dev@gmail.com> wrote:

> Hi Andy,
> 
> Thank you for the detailed feedback, I'll make sure to add those changes
> in the upcoming v2 series.
> 
> Best regards,
> Taha

Hi Taha,

Small process thing.  Please save thanks like this for the change log
on the next version.  I know it can feel a little less polite, but if everyone
sent a thanks message, that would add at least 1/3rd to the volume of emails
and we have too many of those :(

A simple, thanks under the --- or in the cover letter for the next version
doesn't have that problem and still acknowledges the inputs of reviewers.

Thanks,

Jonathan


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1 2/2] iio: dac: ad5504: use adi,output-range-volts for scale calculation
  2026-02-12 20:15   ` Andy Shevchenko
  2026-02-13 17:05     ` Taha Ed-Dafili
@ 2026-02-15 18:05     ` Jonathan Cameron
  2026-02-16  7:21       ` Andy Shevchenko
  1 sibling, 1 reply; 11+ messages in thread
From: Jonathan Cameron @ 2026-02-15 18:05 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Taha Ed-Dafili, Lars-Peter Clausen, Michael Hennerich,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, David Lechner,
	Nuno Sá, Andy Shevchenko, linux-iio, devicetree,
	linux-kernel, linux-mentees, me, skhan

On Thu, 12 Feb 2026 22:15:55 +0200
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:

> On Thu, Feb 12, 2026 at 07:19:55PM +0100, Taha Ed-Dafili wrote:
> > The driver previously used VCC to calculate the scale, but the datasheet
> > states the output range is fixed by the R_SEL pin (0-30V or 0-60V).
> > 
> > Update probe to read `adi,output-range-volts` for the scale. Default
> > to the 60V range if the property is missing, while keeping the VCC
> > regulator enable for power.  
> 
> ...
> 
> >  #include <linux/regulator/consumer.h>
> >  #include <linux/module.h>
> >  #include <linux/bitops.h>
> > +#include <linux/property.h>  
> 
> Add it before 'linux/s*.h' includes to make less ordering issues.
> Ideally one additional patch to sort the headers and one to replace
> "proxy" headers (following IWYU principle).
> 
> ...
> 
> > +	ret = device_property_read_u32(&spi->dev, "adi,output-range-volts", &val);  
> 
> You can pack this into 80 limit with help of
> 
> 	struct device *dev = &spi->dev;
> 
> being defined in the top of the function.
> 
> > +	if (ret)
> > +		val = 60;  
> 
> Also this seems an optional, so
> 
> 	val = 60;
> 	device_property_read_u32(dev, "adi,output-range-volts", &val);
> 
> would be enough.
> 
> ...
> 
> > +	if (val == 60)
> > +		st->vref_mv = 60000;  
> 
> 60 * MILLI;

val * MILLI
given it only takes the values 30 and 60 I think. If you want to protect
against other values, then check it explicitly rather than everything than
isn't 60 being assumed to be 30.

Thanks,

J


> 
> > +	else
> > +		st->vref_mv = 30000;  
> 
> 30 * MILLI;
> 
> Needs units.h.
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1 2/2] iio: dac: ad5504: use adi,output-range-volts for scale calculation
  2026-02-15 18:05     ` Jonathan Cameron
@ 2026-02-16  7:21       ` Andy Shevchenko
  0 siblings, 0 replies; 11+ messages in thread
From: Andy Shevchenko @ 2026-02-16  7:21 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Taha Ed-Dafili, Lars-Peter Clausen, Michael Hennerich,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, David Lechner,
	Nuno Sá, Andy Shevchenko, linux-iio, devicetree,
	linux-kernel, linux-mentees, me, skhan

On Sun, Feb 15, 2026 at 06:05:38PM +0000, Jonathan Cameron wrote:
> On Thu, 12 Feb 2026 22:15:55 +0200
> Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> > On Thu, Feb 12, 2026 at 07:19:55PM +0100, Taha Ed-Dafili wrote:

...

> > > +	ret = device_property_read_u32(&spi->dev, "adi,output-range-volts", &val);  
> > 
> > You can pack this into 80 limit with help of
> > 
> > 	struct device *dev = &spi->dev;
> > 
> > being defined in the top of the function.
> > 
> > > +	if (ret)
> > > +		val = 60;  
> > 
> > Also this seems an optional, so
> > 
> > 	val = 60;
> > 	device_property_read_u32(dev, "adi,output-range-volts", &val);
> > 
> > would be enough.
> > 
> > ...
> > 
> > > +	if (val == 60)
> > > +		st->vref_mv = 60000;  
> > 
> > 60 * MILLI;
> 
> val * MILLI
> given it only takes the values 30 and 60 I think. If you want to protect
> against other values, then check it explicitly rather than everything than
> isn't 60 being assumed to be 30.

With comment on DT in mind I think this multiplication will gone
(as IIUC the DT units is microvolts or so).

> > > +	else
> > > +		st->vref_mv = 30000;  
> > 
> > 30 * MILLI;
> > 
> > Needs units.h.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-02-16  7:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-12 18:19 [PATCH v1 0/2] iio: dac: ad5504: fix voltage scaling and add missing bindings Taha Ed-Dafili
2026-02-12 18:19 ` [PATCH v1 1/2] dt-bindings: iio: dac: ad5504: add output-range and missing gpios Taha Ed-Dafili
2026-02-13  8:11   ` Krzysztof Kozlowski
2026-02-13 17:05     ` Taha Ed-Dafili
2026-02-13 17:07       ` Krzysztof Kozlowski
2026-02-12 18:19 ` [PATCH v1 2/2] iio: dac: ad5504: use adi,output-range-volts for scale calculation Taha Ed-Dafili
2026-02-12 20:15   ` Andy Shevchenko
2026-02-13 17:05     ` Taha Ed-Dafili
2026-02-15 18:03       ` Jonathan Cameron
2026-02-15 18:05     ` Jonathan Cameron
2026-02-16  7:21       ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox