* arm64: dts: ls1028a-rdb: Add iio-hwmon compatibility table
@ 2024-09-09 16:36 Martyn Welch
2024-09-09 18:17 ` Frank Li
0 siblings, 1 reply; 3+ messages in thread
From: Martyn Welch @ 2024-09-09 16:36 UTC (permalink / raw)
To: Shawn Guo, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: kernel, Martyn Welch, linux-arm-kernel, devicetree, linux-kernel
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>;
};
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: arm64: dts: ls1028a-rdb: Add iio-hwmon compatibility table
2024-09-09 16:36 arm64: dts: ls1028a-rdb: Add iio-hwmon compatibility table Martyn Welch
@ 2024-09-09 18:17 ` Frank Li
2024-09-10 8:19 ` Martyn Welch
0 siblings, 1 reply; 3+ messages in thread
From: Frank Li @ 2024-09-09 18:17 UTC (permalink / raw)
To: Martyn Welch
Cc: Shawn Guo, Rob Herring, Krzysztof Kozlowski, Conor Dooley, kernel,
linux-arm-kernel, devicetree, linux-kernel
On Mon, Sep 09, 2024 at 05:36:07PM +0100, Martyn Welch wrote:
> 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.
Can you simply said:
Add an iio-hwmon map to utilise the iio framework and access power
information via the hwmon framework at the same time.
Frank
>
> 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>;
> };
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: arm64: dts: ls1028a-rdb: Add iio-hwmon compatibility table
2024-09-09 18:17 ` Frank Li
@ 2024-09-10 8:19 ` Martyn Welch
0 siblings, 0 replies; 3+ messages in thread
From: Martyn Welch @ 2024-09-10 8:19 UTC (permalink / raw)
To: Frank Li
Cc: Shawn Guo, Rob Herring, Krzysztof Kozlowski, Conor Dooley, kernel,
linux-arm-kernel, devicetree, linux-kernel
On Mon, 2024-09-09 at 14:17 -0400, Frank Li wrote:
> On Mon, Sep 09, 2024 at 05:36:07PM +0100, Martyn Welch wrote:
> > 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.
>
> Can you simply said:
>
> Add an iio-hwmon map to utilise the iio framework and access power
> information via the hwmon framework at the same time.
>
> Frank
>
Sure
Martyn
> > 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>;
> > };
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-10 8:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-09 16:36 arm64: dts: ls1028a-rdb: Add iio-hwmon compatibility table Martyn Welch
2024-09-09 18:17 ` Frank Li
2024-09-10 8:19 ` Martyn Welch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox