[PATCH linux] ARM: dts: aspeed: zaius: Add iio-hwmon ADC bridge

Xo Wang xow at google.com
Sat Apr 1 10:57:27 AEDT 2017


Add instantiation for iio-hwmon bridge that exports the ADC (an iio
device) channels to hwmon as a device.

This requires CONFIG_SENSORS_IIO_HWMON to function. Note that the hwmon
input numbering is one-indexed, so each input will be numbered one
greater than their corresponding ADC channel.

Signed-off-by: Xo Wang <xow at google.com>
---
 arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts b/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
index dfd0dd7c16e4..7ea66de051d4 100644
--- a/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
@@ -86,6 +86,14 @@
 		enable-gpios = <&gpio ASPEED_GPIO(D, 0) GPIO_ACTIVE_HIGH>;
 		mux-gpios = <&gpio ASPEED_GPIO(P, 6) GPIO_ACTIVE_HIGH>;
 	};
+
+	iio-hwmon {
+		compatible = "iio-hwmon";
+		io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>,
+			<&adc 4>, <&adc 5>, <&adc 6>, <&adc 7>,
+			<&adc 8>, <&adc 9>, <&adc 10>, <&adc 11>,
+			<&adc 12>, <&adc 13>, <&adc 14>, <&adc 15>;
+	};
 };
 
 &fmc {
-- 
2.12.2.564.g063fe858b8-goog



More information about the openbmc mailing list