dt-bindings: iio: afe: current-sense-amplifier: Add io-channel-cells
Subsystems (4)
PATCH v2 1/2 dt-bindings: iio: afe: current-sense-amplifier: Add io-channel-cells
The current-sense-amplifier is an IIO provider thus can be referenced by IIO consumers (via "io-channels" property in consumer device node). Such provider is required to describe number of cells used in phandle lookup with "io-channel-cells" property.
---
Changes in v2:
- refactor commit msg drop warnings introduced by commit #2
- drop Fixes: tag
Link to v1: https://lore.kernel.org/all/[email protected]/
.../devicetree/bindings/iio/afe/current-sense-amplifier.yaml | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/iio/afe/current-sense-amplifier.yaml +4 -0
@@ -24,6 +24,9 @@ properties: description: | Channel node of a voltage io-channel. + "#io-channel-cells": + const: 0 + sense-resistor-micro-ohms: description: The sense resistance.
@@ -46,6 +49,7 @@ examples: - | sysi { compatible = "current-sense-amplifier"; + #io-channel-cells = <0>; io-channels = <&tiadc 0>; sense-resistor-micro-ohms = <20000>;
Signature · 1 line
2.34.1
PATCH v2 2/2 arm64: dts: freescale: imx93-phyboard-nash: Current sense via iio-hwmon
Commit 21179eae56de ("arm64: dts: freescale: imx93-phyboard-nash: Add current sense amplifier") added information about the current sensing circuitry found on the board. Now, lets provide current sense reading also via IIO-hwmon subsystem. This way, SoM current can be read directly via sysfs property more conveniently for the customers. No need for them to manually apply scaling factor calculations anymore.
---
Changes in v2:
- no changes
Link to v1: https://lore.kernel.org/all/[email protected]/
arch/arm64/boot/dts/freescale/imx93-phyboard-nash.dts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx93-phyboard-nash.dts +7 -1
@@ -27,8 +27,9 @@ chosen { stdout-path = &lpuart1; }; - current-sense { + curr_sens: current-sense { compatible = "current-sense-amplifier"; + #io-channel-cells = <0>; io-channels = <&adc1 1>; sense-gain-div = <2>; sense-gain-mult = <50>;
@@ -44,6 +45,11 @@ flexcan1_tc: can-phy0 { standby-gpios = <&gpio4 16 GPIO_ACTIVE_HIGH>; }; + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&curr_sens 0>; + }; + reg_usdhc2_vmmc: regulator-usdhc2 { compatible = "regulator-fixed"; gpio = <&gpio3 7 GPIO_ACTIVE_HIGH>;
Signature · 1 line
2.34.1
Shawn Guo
AppliedRe: [PATCH v2 2/2] arm64: dts: freescale: imx93-phyboard-nash: Current sense via iio-hwmon
Quoted 8 lines · Primoz Fiser
Commit
21179eae56de("arm64: dts: freescale: imx93-phyboard-nash: Add current sense amplifier") added information about the current sensing circuitry found on the board. Now, lets provide current sense reading also via IIO-hwmon subsystem. This way, SoM current can be read directly via sysfs property more conveniently for the customers. No need for them to manually apply scaling factor calculations anymore.Signed-off-by Primoz Fiser <[email protected]>
Applied, thanks!
Quoted 10 lines · Primoz Fiser
The current-sense-amplifier is an IIO provider thus can be referenced by IIO consumers (via "io-channels" property in consumer device node). Such provider is required to describe number of cells used in phandle lookup with "io-channel-cells" property.
Signed-off-by Primoz Fiser <[email protected]>---
Changes in v2:
- refactor commit msg drop warnings introduced by commit #2
- drop Fixes: tag
Best regards,
Krzysztof
Quoted 6 lines · On Fri, 5 Sep 2025 10:20:37 +0200 Krzysztof Kozlowski <[email protected]> wrote:
Quoted 5 lines · Primoz Fiser
The current-sense-amplifier is an IIO provider thus can be referenced by IIO consumers (via "io-channels" property in consumer device node). Such provider is required to describe number of cells used in phandle lookup with "io-channel-cells" property.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Primoz Fiser <[email protected]>---
Changes in v2:
- refactor commit msg drop warnings introduced by commit #2
- drop Fixes: tagReviewed-by Krzysztof Kozlowski <[email protected]>
Applied this patch to the togreg branch of iio.git.
I'll push that out as testing now because some other stuff on there will benefit from 0-day taking a first look at it.
Thanks,
Jonathan
Quoted 4 lines
Best regards,
Krzysztof