Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Martyn Welch <martyn.welch@collabora.com>
To: Shawn Guo <shawnguo@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: kernel@collabora.com, Martyn Welch <martyn.welch@collabora.com>,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: arm64: dts: ls1028a-rdb: Add iio-hwmon compatibility table
Date: Mon,  9 Sep 2024 17:36:07 +0100	[thread overview]
Message-ID: <20240909163608.80541-1-martyn.welch@collabora.com> (raw)

The ls1028ardb uses the TI ina220 power monitor. This device has an IIO and
hwmon drivers, but can't be used with both at the same time. To enable us
to utilise the iio framework, but also access power information via the
hwmon framework, add an iio-hwmon map. This allows the IIO driver to be
used for the ina220, with the iio-hwmon driver mapping the data from the
IIO framework into hwmon.

Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
---
 arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
index ecd2c1e..b062de5 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
@@ -94,6 +94,12 @@ simple-audio-card,codec {
 			system-clock-frequency = <25000000>;
 		};
 	};
+
+	iio-hwmon {
+		compatible = "iio-hwmon";
+		io-channels = <&ina220 0>, <&ina220 1>,
+			<&ina220 2>, <&ina220 3>;
+	};
 };
 
 &can0 {
@@ -222,8 +228,9 @@ i2c@2 {
 			#size-cells = <0>;
 			reg = <0x02>;
 
-			current-monitor@40 {
+			ina220: current-monitor@40 {
 				compatible = "ti,ina220";
+				#io-channel-cells = <1>;
 				reg = <0x40>;
 				shunt-resistor = <500>;
 			};


             reply	other threads:[~2024-09-09 16:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-09 16:36 Martyn Welch [this message]
2024-09-09 18:17 ` arm64: dts: ls1028a-rdb: Add iio-hwmon compatibility table Frank Li
2024-09-10  8:19   ` Martyn Welch

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=20240909163608.80541-1-martyn.welch@collabora.com \
    --to=martyn.welch@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@collabora.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=shawnguo@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