* [PATCH v2 0/5] iio: dac: ad5758: fix the 4 mA to 20 mA current range
@ 2026-10-06 15:32 Arka Mondal
2026-10-06 15:32 ` [PATCH v2 4/5] dt-bindings: iio: dac: adi,ad5758: Fix " Arka Mondal
2026-10-06 15:32 ` [PATCH v2 5/5] iio: dac: ad5758: " Arka Mondal
0 siblings, 2 replies; 4+ messages in thread
From: Arka Mondal @ 2026-10-06 15:32 UTC (permalink / raw)
To: Jonathan Cameron, Nuno Sá, Michael Hennerich
Cc: David Lechner, Andy Shevchenko, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Stefan Popa, linux-iio, devicetree, linux-kernel,
linux, arkamondalofficial, Arka Mondal
These are patches 4 and 5 of the v1 series, with the deprecated
<4 24000> value dropped as Rob Herring <robh@kernel.org> and
Jonathan Cameron <jic23@kernel.org> asked. Patches 1 to 3 are already
applied on togreg and are not resent.
The binding and the driver give the 4 mA to 20 mA range as <4 24000>,
which is 4 uA to 24 mA. The data sheet (Rev. B, Table 32) and the
original text binding say range code 1010 is 4 mA to 20 mA.
Changes since v1:
- binding: replace <4 24000> with <4000 20000>, instead of adding the
correct pair and marking the old one deprecated.
- driver: drop the mapping from <4 24000> to the corrected range.
A device tree that still has <4 24000> now fails the binding check, and
probe stops with "range invalid".
Compile tested only; no relevant hardware available. The binding was
checked with make dt_binding_check and with test device trees:
<4000 20000> is accepted, <4 24000> is now rejected.
Link: https://lore.kernel.org/r/20260918122032.134947-1-arka@arkamondal.net
Arka Mondal (2):
dt-bindings: iio: dac: adi,ad5758: Fix the 4 mA to 20 mA current range
iio: dac: ad5758: Fix the 4 mA to 20 mA current range
Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml | 4 ++--
drivers/iio/dac/ad5758.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
base-commit: a3b3580713f3ac5a32dc2874ee546828977a1d68
--
2.55.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 4/5] dt-bindings: iio: dac: adi,ad5758: Fix the 4 mA to 20 mA current range
2026-10-06 15:32 [PATCH v2 0/5] iio: dac: ad5758: fix the 4 mA to 20 mA current range Arka Mondal
@ 2026-10-06 15:32 ` Arka Mondal
2026-10-07 10:24 ` Conor Dooley
2026-10-06 15:32 ` [PATCH v2 5/5] iio: dac: ad5758: " Arka Mondal
1 sibling, 1 reply; 4+ messages in thread
From: Arka Mondal @ 2026-10-06 15:32 UTC (permalink / raw)
To: Jonathan Cameron, Nuno Sá, Michael Hennerich
Cc: David Lechner, Andy Shevchenko, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Stefan Popa, linux-iio, devicetree, linux-kernel,
linux, arkamondalofficial, Arka Mondal
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.
Replace it with <4000 20000>. No in-tree device tree uses this binding,
so nothing in the tree changes. A device tree that still has the old
value no longer validates.
Fixes: 777baca07ef1 ("dt-bindings: iio: dac: Add docs for AD5758 DAC")
Signed-off-by: Arka Mondal <arka@arkamondal.net>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
---
Notes:
Checked with make dt_binding_check; no relevant hardware available.
Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml
index 5121685337b5..a0f2649129e0 100644
--- a/Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml
+++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml
@@ -66,8 +66,8 @@ properties:
- const: 0
- enum: [20000, 24000]
- items:
- - const: 4
- - const: 24000
+ - const: 4000
+ - const: 20000
- items:
- const: -20000
- const: 20000
--
2.55.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 5/5] iio: dac: ad5758: Fix the 4 mA to 20 mA current range
2026-10-06 15:32 [PATCH v2 0/5] iio: dac: ad5758: fix the 4 mA to 20 mA current range Arka Mondal
2026-10-06 15:32 ` [PATCH v2 4/5] dt-bindings: iio: dac: adi,ad5758: Fix " Arka Mondal
@ 2026-10-06 15:32 ` Arka Mondal
1 sibling, 0 replies; 4+ messages in thread
From: Arka Mondal @ 2026-10-06 15:32 UTC (permalink / raw)
To: Jonathan Cameron, Nuno Sá, Michael Hennerich
Cc: David Lechner, Andy Shevchenko, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Stefan Popa, linux-iio, devicetree, linux-kernel,
linux, arkamondalofficial, Arka Mondal
Range code 1010 selects 4 mA to 20 mA (data sheet Rev. B, Table 32),
but the driver describes it as 4 uA to 24 mA. With the reported scale
and offset, userspace converts raw code 0 to about 0 mA instead of
4 mA, and full scale to about 23 mA instead of 20 mA.
Describe the range as 4000 to 20000 uA and rename the enum entry to
match. A device tree that still has <4 24000> no longer matches any
entry in the table, so probe fails with "range invalid".
Fixes: 28d1a7ac2a0d ("iio: dac: Add AD5758 support")
Signed-off-by: Arka Mondal <arka@arkamondal.net>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
---
Notes:
Compile tested only; no relevant hardware available.
drivers/iio/dac/ad5758.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/dac/ad5758.c b/drivers/iio/dac/ad5758.c
index 1e21ad2a050d..4c15447ccb6b 100644
--- a/drivers/iio/dac/ad5758.c
+++ b/drivers/iio/dac/ad5758.c
@@ -141,7 +141,7 @@ enum ad5758_output_range {
AD5758_RANGE_PLUSMINUS_10V,
AD5758_RANGE_0mA_20mA = 8,
AD5758_RANGE_0mA_24mA,
- AD5758_RANGE_4mA_24mA,
+ AD5758_RANGE_4mA_20mA,
AD5758_RANGE_PLUSMINUS_20mA,
AD5758_RANGE_PLUSMINUS_24mA,
AD5758_RANGE_MINUS_1mA_PLUS_22mA,
@@ -164,7 +164,7 @@ static const struct ad5758_range ad5758_voltage_range[] = {
static const struct ad5758_range ad5758_current_range[] = {
{ AD5758_RANGE_0mA_20mA, 0, 20000},
{ AD5758_RANGE_0mA_24mA, 0, 24000 },
- { AD5758_RANGE_4mA_24mA, 4, 24000 },
+ { AD5758_RANGE_4mA_20mA, 4000, 20000 },
{ AD5758_RANGE_PLUSMINUS_20mA, -20000, 20000 },
{ AD5758_RANGE_PLUSMINUS_24mA, -24000, 24000 },
{ AD5758_RANGE_MINUS_1mA_PLUS_22mA, -1000, 22000 },
--
2.55.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 4/5] dt-bindings: iio: dac: adi,ad5758: Fix the 4 mA to 20 mA current range
2026-10-06 15:32 ` [PATCH v2 4/5] dt-bindings: iio: dac: adi,ad5758: Fix " Arka Mondal
@ 2026-10-07 10:24 ` Conor Dooley
0 siblings, 0 replies; 4+ messages in thread
From: Conor Dooley @ 2026-10-07 10:24 UTC (permalink / raw)
To: Arka Mondal
Cc: Jonathan Cameron, Nuno Sá, Michael Hennerich, David Lechner,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stefan Popa, linux-iio, devicetree, linux-kernel, linux,
arkamondalofficial
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-10-07 10:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-06 15:32 [PATCH v2 0/5] iio: dac: ad5758: fix the 4 mA to 20 mA current range Arka Mondal
2026-10-06 15:32 ` [PATCH v2 4/5] dt-bindings: iio: dac: adi,ad5758: Fix " Arka Mondal
2026-10-07 10:24 ` Conor Dooley
2026-10-06 15:32 ` [PATCH v2 5/5] iio: dac: ad5758: " Arka Mondal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox