Add a patch to make the sensor readable via the IIO/hwmon bridge.
Signed-off-by: Dag Bakke <dag@bakke.com>
fragment@0 {
target-path = "/";
__overlay__ {
-
- dht11: dht11@0 {
+ dht11: dht11@4 {
compatible = "dht11";
pinctrl-names = "default";
pinctrl-0 = <&dht11_pins>;
gpios = <&gpio 4 0>;
status = "okay";
+ #io-channel-cells = <1>;
+ };
+
+ iio: iio-hwmon@4 {
+ compatible = "iio-hwmon";
+ status = "okay";
+ io-channels = <&dht11 0>, <&dht11 1>;
};
};
};
fragment@1 {
target = <&gpio>;
__overlay__ {
- dht11_pins: dht11_pins@0 {
+ dht11_pins: dht11_pins@4 {
brcm,pins = <4>;
brcm,function = <0>; // in
brcm,pull = <0>; // off
gpiopin = <&dht11_pins>,"brcm,pins:0",
<&dht11_pins>, "reg:0",
<&dht11>,"gpios:4",
- <&dht11>,"reg:0";
+ <&dht11>,"reg:0",
+ <&iio>,"reg:0";
};
};