]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64: dts: freescale: imx93-phyboard-nash: Current sense via iio-hwmon
authorPrimoz Fiser <primoz.fiser@norik.com>
Fri, 5 Sep 2025 06:55:03 +0000 (08:55 +0200)
committerShawn Guo <shawnguo@kernel.org>
Thu, 11 Sep 2025 03:27:15 +0000 (11:27 +0800)
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 <primoz.fiser@norik.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm64/boot/dts/freescale/imx93-phyboard-nash.dts

index 3f9efa32cddc894b5cb9f624c780ea7a77dba9d7..5599e296919f4d38f966d96c2def3db565362203 100644 (file)
@@ -48,8 +48,9 @@
                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>;
                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>;