Skip to contentSkip to conversation

ARM: dts: aspeed: zaius: Add iio-hwmon ADC bridge

PATCH In review Xo Wang 2 participants 2 messages Mar 31, 2017 – Apr 1, 2017

Subsystems (2)
lore
Share & tools
lore

Xo Wang

author
#0 lore raw

PATCH 1/1 ARM: dts: aspeed: zaius: Add iio-hwmon ADC bridge

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.

---
 arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts +8 -0
index dfd0dd7c16e4..7ea66de051d4 100644
@@ -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 {
Signature · 1 line
2.12.2.564.g063fe858b8-goog
Acked-by on v1 1/1
#1 lore raw
Quoted 36 lines · Xo Wang

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.

---
 arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts +8 -1
index dfd0dd7c16e4..7ea66de051d4 100644
@@ -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