Re: [PATCH 4/5] dt-bindings: iio: dac: adi,ad5758: Fix the 4 mA to 20 mA current range

From: Jonathan Cameron

Date: Sun Sep 20 2026 - 14:40:39 EST


On Fri, 18 Sep 2026 21:20:31 +0900
Arka Mondal <arka@xxxxxxxxxxxxxx> wrote:

> adi,range-microamp gives the 4 mA to 20 mA range as <4 24000>. The
> values are in microamps, so this reads as 4 uA to 24 mA. The original
> text binding described <4 24000> as the "4 mA to 20 mA current range",
> and the data sheet (Rev. B, Table 32) confirms range code 1010 is
> 4 mA to 20 mA.
>
> Add <4000 20000> and mark <4 24000> deprecated, so existing device
> trees still validate.
>
> Fixes: 777baca07ef1 ("dt-bindings: iio: dac: Add docs for AD5758 DAC")
> Signed-off-by: Arka Mondal <arka@xxxxxxxxxxxxxx>

DT reviewers. Better to paper over a dt that is specifying the wrong
range as this does (deprecated) or just make it obvious by failing
the binding checks? I'm thinking failing is better as gets any such
dt fixed up faster. I also suspect no one actually it this because the
disconnect they should have seen when reading the datasheet and considering
what they wanted should have meant they saw this bug!

Jonathan

> ---
>
> Notes:
> Checked with make dt_binding_check; no relevant hardware available.
>
> Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml
> index 5121685337b5..ef0398170eb7 100644
> --- a/Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml
> +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml
> @@ -65,9 +65,13 @@ properties:
> - items:
> - const: 0
> - enum: [20000, 24000]
> + - items:
> + - const: 4000
> + - const: 20000
> - items:
> - const: 4
> - const: 24000
> + deprecated: true
> - items:
> - const: -20000
> - const: 20000