From: Dag Bakke Date: Mon, 30 May 2022 09:57:06 +0000 (+0200) Subject: overlays: dht11: make sensor readable via hwmon X-Git-Tag: accepted/tizen/unified/20230118.172025~561 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=45599fd8fe420ede67b0a28767a335d1d203f9cf;p=platform%2Fkernel%2Flinux-rpi.git overlays: dht11: make sensor readable via hwmon Add a patch to make the sensor readable via the IIO/hwmon bridge. Signed-off-by: Dag Bakke --- diff --git a/arch/arm/boot/dts/overlays/dht11-overlay.dts b/arch/arm/boot/dts/overlays/dht11-overlay.dts index 6feeeb4..8b0fc6b 100644 --- a/arch/arm/boot/dts/overlays/dht11-overlay.dts +++ b/arch/arm/boot/dts/overlays/dht11-overlay.dts @@ -10,13 +10,19 @@ 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>; }; }; }; @@ -24,7 +30,7 @@ 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 @@ -36,6 +42,7 @@ gpiopin = <&dht11_pins>,"brcm,pins:0", <&dht11_pins>, "reg:0", <&dht11>,"gpios:4", - <&dht11>,"reg:0"; + <&dht11>,"reg:0", + <&iio>,"reg:0"; }; };