[PATCH v1 2/8] dt-bindings: iio: dac: maxim,ds4424: add maxim,rfs-ohms property

Oleksij Rempel posted 8 patches 3 weeks ago
There is a newer version of this series
[PATCH v1 2/8] dt-bindings: iio: dac: maxim,ds4424: add maxim,rfs-ohms property
Posted by Oleksij Rempel 3 weeks ago
Introduce the 'maxim,rfs-ohms' property. The full-scale output current
of these DACs is determined by external resistors (Rfs) connected to
the FS pins. The driver requires the physical resistance values to
calculate the correct current scale (Amps per step) for the IIO
subsystem.

Keep it optional to avoid forcing updates of existing DTs; without it
the driver cannot derive a correct IIO scale.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 .../devicetree/bindings/iio/dac/maxim,ds4424.yaml     | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml b/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml
index efe63e6cb55d..b7af8464a4fc 100644
--- a/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml
+++ b/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml
@@ -27,6 +27,17 @@ properties:
 
   vcc-supply: true
 
+  maxim,rfs-ohms:
+    description: |
+      Array of resistance values in Ohms for the external Rfs resistors
+      connected to the FS pins.
+      - For DS44x2 (2 channels): 2 values required.
+      - For DS44x4 (4 channels): 4 values required.
+      Typical values range from 40000 (40 kOhm) to 160000 (160 kOhm).
+    minItems: 2
+    maxItems: 4
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+
 required:
   - compatible
   - reg
-- 
2.47.3
Re: [PATCH v1 2/8] dt-bindings: iio: dac: maxim,ds4424: add maxim,rfs-ohms property
Posted by Krzysztof Kozlowski 2 weeks, 6 days ago
On Mon, Jan 19, 2026 at 07:24:18PM +0100, Oleksij Rempel wrote:
> Introduce the 'maxim,rfs-ohms' property. The full-scale output current
> of these DACs is determined by external resistors (Rfs) connected to
> the FS pins. The driver requires the physical resistance values to
> calculate the correct current scale (Amps per step) for the IIO
> subsystem.
> 
> Keep it optional to avoid forcing updates of existing DTs; without it
> the driver cannot derive a correct IIO scale.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  .../devicetree/bindings/iio/dac/maxim,ds4424.yaml     | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml b/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml
> index efe63e6cb55d..b7af8464a4fc 100644
> --- a/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml
> +++ b/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml
> @@ -27,6 +27,17 @@ properties:
>  
>    vcc-supply: true
>  
> +  maxim,rfs-ohms:
> +    description: |
> +      Array of resistance values in Ohms for the external Rfs resistors
> +      connected to the FS pins.
> +      - For DS44x2 (2 channels): 2 values required.
> +      - For DS44x4 (4 channels): 4 values required.
> +      Typical values range from 40000 (40 kOhm) to 160000 (160 kOhm).
> +    minItems: 2
> +    maxItems: 4
> +    $ref: /schemas/types.yaml#/definitions/uint32-array

Drop. You should see a warning, so I claim this wasn't tested/checked.

Best regards,
Krzysztof
Re: [PATCH v1 2/8] dt-bindings: iio: dac: maxim,ds4424: add maxim,rfs-ohms property
Posted by Conor Dooley 3 weeks ago
On Mon, Jan 19, 2026 at 07:24:18PM +0100, Oleksij Rempel wrote:
> Introduce the 'maxim,rfs-ohms' property. The full-scale output current
> of these DACs is determined by external resistors (Rfs) connected to
> the FS pins. The driver requires the physical resistance values to
> calculate the correct current scale (Amps per step) for the IIO
> subsystem.
> 
> Keep it optional to avoid forcing updates of existing DTs; without it
> the driver cannot derive a correct IIO scale.

I don't really follow the logic here, if the driver doesn't work
properly without it, shouldn't it be a required property even if that
means existing devicetrees get new warnings? Warnings are preferable to
the drivers malfunctioning on those devices, after all!

> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  .../devicetree/bindings/iio/dac/maxim,ds4424.yaml     | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml b/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml
> index efe63e6cb55d..b7af8464a4fc 100644
> --- a/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml
> +++ b/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml
> @@ -27,6 +27,17 @@ properties:
>  
>    vcc-supply: true
>  
> +  maxim,rfs-ohms:
> +    description: |
> +      Array of resistance values in Ohms for the external Rfs resistors
> +      connected to the FS pins.
> +      - For DS44x2 (2 channels): 2 values required.
> +      - For DS44x4 (4 channels): 4 values required.
> +      Typical values range from 40000 (40 kOhm) to 160000 (160 kOhm).
> +    minItems: 2
> +    maxItems: 4
> +    $ref: /schemas/types.yaml#/definitions/uint32-array
> +
>  required:
>    - compatible
>    - reg
> -- 
> 2.47.3
> 
Re: [PATCH v1 2/8] dt-bindings: iio: dac: maxim,ds4424: add maxim,rfs-ohms property
Posted by Jonathan Cameron 2 weeks, 3 days ago
On Mon, 19 Jan 2026 18:27:52 +0000
Conor Dooley <conor@kernel.org> wrote:

> On Mon, Jan 19, 2026 at 07:24:18PM +0100, Oleksij Rempel wrote:
> > Introduce the 'maxim,rfs-ohms' property. The full-scale output current
> > of these DACs is determined by external resistors (Rfs) connected to
> > the FS pins. The driver requires the physical resistance values to
> > calculate the correct current scale (Amps per step) for the IIO
> > subsystem.
> > 
> > Keep it optional to avoid forcing updates of existing DTs; without it
> > the driver cannot derive a correct IIO scale.  
> 
> I don't really follow the logic here, if the driver doesn't work
> properly without it, shouldn't it be a required property even if that
> means existing devicetrees get new warnings? Warnings are preferable to
> the drivers malfunctioning on those devices, after all!

Agreed. The driver can paper over holes or I guess we could provide a default
if the datasheet has some reference value or similar?  

DT binding should require it.

> 
> > 
> > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > ---
> >  .../devicetree/bindings/iio/dac/maxim,ds4424.yaml     | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml b/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml
> > index efe63e6cb55d..b7af8464a4fc 100644
> > --- a/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml
> > +++ b/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml
> > @@ -27,6 +27,17 @@ properties:
> >  
> >    vcc-supply: true
> >  
> > +  maxim,rfs-ohms:
> > +    description: |
> > +      Array of resistance values in Ohms for the external Rfs resistors
> > +      connected to the FS pins.
> > +      - For DS44x2 (2 channels): 2 values required.
> > +      - For DS44x4 (4 channels): 4 values required.
> > +      Typical values range from 40000 (40 kOhm) to 160000 (160 kOhm).
> > +    minItems: 2
> > +    maxItems: 4
> > +    $ref: /schemas/types.yaml#/definitions/uint32-array
> > +
> >  required:
> >    - compatible
> >    - reg
> > -- 
> > 2.47.3
> >
Re: [PATCH v1 2/8] dt-bindings: iio: dac: maxim,ds4424: add maxim,rfs-ohms property
Posted by Oleksij Rempel 2 weeks, 3 days ago
On Fri, Jan 23, 2026 at 09:28:19AM +0000, Jonathan Cameron wrote:
> On Mon, 19 Jan 2026 18:27:52 +0000
> Conor Dooley <conor@kernel.org> wrote:
> 
> > On Mon, Jan 19, 2026 at 07:24:18PM +0100, Oleksij Rempel wrote:
> > > Introduce the 'maxim,rfs-ohms' property. The full-scale output current
> > > of these DACs is determined by external resistors (Rfs) connected to
> > > the FS pins. The driver requires the physical resistance values to
> > > calculate the correct current scale (Amps per step) for the IIO
> > > subsystem.
> > > 
> > > Keep it optional to avoid forcing updates of existing DTs; without it
> > > the driver cannot derive a correct IIO scale.  
> > 
> > I don't really follow the logic here, if the driver doesn't work
> > properly without it, shouldn't it be a required property even if that
> > means existing devicetrees get new warnings? Warnings are preferable to
> > the drivers malfunctioning on those devices, after all!
> 
> Agreed. The driver can paper over holes or I guess we could provide a default
> if the datasheet has some reference value or similar?  

No, this DAC controls the current. The current range is application specific and
defined by the load resistors. Is it better to not provide scale if this
information not available, guessing it will make things worse and
potentially damage some HW.

> DT binding should require it.

ACK
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
Re: [PATCH v1 2/8] dt-bindings: iio: dac: maxim,ds4424: add maxim,rfs-ohms property
Posted by Jonathan Cameron 2 weeks, 1 day ago
On Fri, 23 Jan 2026 11:03:38 +0100
Oleksij Rempel <o.rempel@pengutronix.de> wrote:

> On Fri, Jan 23, 2026 at 09:28:19AM +0000, Jonathan Cameron wrote:
> > On Mon, 19 Jan 2026 18:27:52 +0000
> > Conor Dooley <conor@kernel.org> wrote:
> >   
> > > On Mon, Jan 19, 2026 at 07:24:18PM +0100, Oleksij Rempel wrote:  
> > > > Introduce the 'maxim,rfs-ohms' property. The full-scale output current
> > > > of these DACs is determined by external resistors (Rfs) connected to
> > > > the FS pins. The driver requires the physical resistance values to
> > > > calculate the correct current scale (Amps per step) for the IIO
> > > > subsystem.
> > > > 
> > > > Keep it optional to avoid forcing updates of existing DTs; without it
> > > > the driver cannot derive a correct IIO scale.    
> > > 
> > > I don't really follow the logic here, if the driver doesn't work
> > > properly without it, shouldn't it be a required property even if that
> > > means existing devicetrees get new warnings? Warnings are preferable to
> > > the drivers malfunctioning on those devices, after all!  
> > 
> > Agreed. The driver can paper over holes or I guess we could provide a default
> > if the datasheet has some reference value or similar?    
> 
> No, this DAC controls the current. The current range is application specific and
> defined by the load resistors. Is it better to not provide scale if this
> information not available, guessing it will make things worse and
> potentially damage some HW.
> 
Then does this need to be a fix on the driver side?
Or are you just suggesting not proving the scale if we don't have enough info?
That's fine if so.

> > DT binding should require it.  
> 
> ACK
Re: [PATCH v1 2/8] dt-bindings: iio: dac: maxim,ds4424: add maxim,rfs-ohms property
Posted by Oleksij Rempel 2 weeks ago
On Sun, Jan 25, 2026 at 10:22:07AM +0000, Jonathan Cameron wrote:
> On Fri, 23 Jan 2026 11:03:38 +0100
> Oleksij Rempel <o.rempel@pengutronix.de> wrote:
> 
> > On Fri, Jan 23, 2026 at 09:28:19AM +0000, Jonathan Cameron wrote:
> > > On Mon, 19 Jan 2026 18:27:52 +0000
> > > Conor Dooley <conor@kernel.org> wrote:
> > >   
> > > > On Mon, Jan 19, 2026 at 07:24:18PM +0100, Oleksij Rempel wrote:  
> > > > > Introduce the 'maxim,rfs-ohms' property. The full-scale output current
> > > > > of these DACs is determined by external resistors (Rfs) connected to
> > > > > the FS pins. The driver requires the physical resistance values to
> > > > > calculate the correct current scale (Amps per step) for the IIO
> > > > > subsystem.
> > > > > 
> > > > > Keep it optional to avoid forcing updates of existing DTs; without it
> > > > > the driver cannot derive a correct IIO scale.    
> > > > 
> > > > I don't really follow the logic here, if the driver doesn't work
> > > > properly without it, shouldn't it be a required property even if that
> > > > means existing devicetrees get new warnings? Warnings are preferable to
> > > > the drivers malfunctioning on those devices, after all!  
> > > 
> > > Agreed. The driver can paper over holes or I guess we could provide a default
> > > if the datasheet has some reference value or similar?    
> > 
> > No, this DAC controls the current. The current range is application specific and
> > defined by the load resistors. Is it better to not provide scale if this
> > information not available, guessing it will make things worse and
> > potentially damage some HW.
> > 
> Then does this need to be a fix on the driver side?
> Or are you just suggesting not proving the scale if we don't have enough info?
> That's fine if so.

I suggest to not provide scale if we don't have enough info. It will be
disabled in the driver if maxim,rfs-ohms is not provided in the DT.

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |