From: David Jander <david@protonic.nl>
To: Conor Dooley <conor@kernel.org>
Cc: "Oleksij Rempel" <o.rempel@pengutronix.de>,
"Jonathan Cameron" <jic23@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
kernel@pengutronix.de, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
"Andy Shevchenko" <andy@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>
Subject: Re: [PATCH v2 2/8] dt-bindings: iio: dac: maxim,ds4424: add maxim,rfs-ohms property
Date: Wed, 28 Jan 2026 09:01:18 +0100 [thread overview]
Message-ID: <20260128090118.5c1d7906@erd003.prtnl> (raw)
In-Reply-To: <20260127-rockiness-finalize-e0b50b9d823f@spud>
On Tue, 27 Jan 2026 19:55:26 +0000
Conor Dooley <conor@kernel.org> wrote:
> On Tue, Jan 27, 2026 at 07:49:20PM +0000, Conor Dooley wrote:
> > On Tue, Jan 27, 2026 at 07:09:33AM +0100, Oleksij Rempel wrote:
> > > The Maxim DS4422/DS4424 and DS4402/DS4404 current DACs determine their
> > > full-scale output current via external resistors (Rfs) connected to the
> > > FSx pins. Without knowing these values, the full-scale range of the
> > > hardware is undefined.
> > >
> > > Add the 'maxim,rfs-ohms' property to describe these physical components.
> > > This property is required to provide a complete description of the
> > > hardware configuration.
> > >
> > > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > > ---
> > > changes v2:
> > > - make maxim,rfs-ohms a required property as the hardware range is undefined
> > > without external resistors.
> > > - add allOf constraints to enforce 2 vs 4 items in maxim,rfs-ohms based on
> > > compatible string.
> > > - drop explicit $ref for maxim,rfs-ohms to fix dt_binding_check warning.
> > > - update example in binding to include the new required property.
> > > ---
> > > .../bindings/iio/dac/maxim,ds4424.yaml | 36 +++++++++++++++++++
> > > 1 file changed, 36 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml b/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml
> > > index efe63e6cb55d..400afd8771aa 100644
> > > --- a/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml
> > > +++ b/Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml
> > > @@ -27,9 +27,44 @@ 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).
> >
> > Add here
> > maxItems: 4
> > minItems: 2
> >
> > Are 40kOhm and 160kOhm actual max/min values, or just a suggested range?
>
> Datasheet for the ds4424 seems to imply they're actual max/min values:
> "Input resistors (RFS) must be between the speciifed values to ensure the
> device meets its accuracy and linearity specifications."
> In that case, consider also adding something like:
> items:
> maximum: 40000
> minimum: 160000
>
> Although, that would complain about the 5100 Ohms you're using. How come
> the example lies outside of the "typical" range?
Sorry to chime in here out of nowhere with this, but 2 things:
1. Rfs for DS4402/4 has a different "typical" range than DS4424 (different
Vref and different output current range).
2. "Typical" or "recommended" ranges should not translate to a hard limit in
the driver. IMHO, no max or min value should be enforced here.
> > > +
> > > required:
> > > - compatible
> > > - reg
> > > + - maxim,rfs-ohms
> > > +
> > > +allOf:
> > > + - if:
> > > + properties:
> > > + compatible:
> > > + contains:
> > > + enum:
> > > + - maxim,ds4402
> > > + - maxim,ds4422
> > > + then:
> > > + properties:
> > > + maxim,rfs-ohms:
> >
> > > + minItems: 2
> >
> > Remove this...
> >
> > > + maxItems: 2
> > > + - if:
> > > + properties:
> > > + compatible:
> > > + contains:
> > > + enum:
> > > + - maxim,ds4404
> > > + - maxim,ds4424
> > > + then:
> > > + properties:
> > > + maxim,rfs-ohms:
> > > + minItems: 4
> >
> >
> > > + maxItems: 4
> >
> > ...and this. The outer-most constraints should be in the definition and
> > the if/else bit just adjusts whichever bounds it needs to.
> >
> > Cheers,
> > Conor.
> >
> > pw-bot: changes-requested
> >
> > >
> > > additionalProperties: false
> > >
> > > @@ -43,6 +78,7 @@ examples:
> > > compatible = "maxim,ds4424";
> > > reg = <0x10>; /* When A0, A1 pins are ground */
> > > vcc-supply = <&vcc_3v3>;
> > > + maxim,rfs-ohms = <5100>, <5100>, <5100>, <5100>;
> > > };
> > > };
> > > ...
> > > --
> > > 2.47.3
> > >
>
>
--
David Jander
next prev parent reply other threads:[~2026-01-28 8:02 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-27 6:09 [PATCH v2 0/8] iio: dac: ds4424: add DS4402/DS4404 support and scale Oleksij Rempel
2026-01-27 6:09 ` [PATCH v2 1/8] dt-bindings: iio: dac: maxim,ds4424: add ds4402/ds4404 Oleksij Rempel
2026-01-27 6:09 ` [PATCH v2 2/8] dt-bindings: iio: dac: maxim,ds4424: add maxim,rfs-ohms property Oleksij Rempel
2026-01-27 19:49 ` Conor Dooley
2026-01-27 19:55 ` Conor Dooley
2026-01-28 8:01 ` David Jander [this message]
2026-01-28 17:00 ` Conor Dooley
2026-01-27 6:09 ` [PATCH v2 3/8] iio: dac: ds4424: add DS4402/DS4404 device IDs Oleksij Rempel
2026-01-27 10:27 ` Andy Shevchenko
2026-01-27 6:09 ` [PATCH v2 4/8] iio: dac: ds4424: sort headers alphabetically Oleksij Rempel
2026-01-27 10:30 ` Andy Shevchenko
2026-01-27 6:09 ` [PATCH v2 5/8] iio: dac: ds4424: convert to regmap Oleksij Rempel
2026-01-27 10:39 ` Andy Shevchenko
2026-02-01 14:42 ` Sander Vanheule
2026-02-01 16:16 ` Oleksij Rempel
2026-02-01 17:24 ` Sander Vanheule
2026-02-03 10:10 ` Andy Shevchenko
2026-02-03 10:13 ` Andy Shevchenko
2026-01-27 6:09 ` [PATCH v2 6/8] iio: dac: ds4424: fix -128 rejection and refactor raw access Oleksij Rempel
2026-01-27 10:42 ` Andy Shevchenko
2026-01-27 10:49 ` Oleksij Rempel
2026-01-27 10:51 ` Andy Shevchenko
2026-01-27 6:09 ` [PATCH v2 7/8] iio: dac: ds4424: add Rfs-based scale and per-variant limits Oleksij Rempel
2026-01-27 10:46 ` Andy Shevchenko
2026-01-27 6:09 ` [PATCH v2 8/8] iio: dac: ds4424: ratelimit read errors and use device context Oleksij Rempel
2026-01-27 10:47 ` Andy Shevchenko
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=20260128090118.5c1d7906@erd003.prtnl \
--to=david@protonic.nl \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=conor@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=o.rempel@pengutronix.de \
--cc=robh@kernel.org \
/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