diff mbox series

[v2,1/7] ath79: jj76pf2: enable TCN75 sensor

Message ID 20220327200534.377029-2-tmn505@gmail.com
State Superseded
Headers show
Series ath79: RedBoot devices cleanup and improvment | expand

Commit Message

Tomasz Maciej Nowak March 27, 2022, 8:05 p.m. UTC
This SBC has Microchip TCN75 sensor, wich measures ambient temperature.
Specify it in dts to allow readout by applications using kernel hwmon
API.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
---
 target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts | 13 +++++++++++++
 target/linux/ath79/image/generic.mk              |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts b/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts
index 826b45ff513e..93a029964a63 100644
--- a/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts
+++ b/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts
@@ -32,6 +32,19 @@ 
 		clock-frequency = <40000000>;
 	};
 
+	i2c {
+		compatible = "i2c-gpio";
+		sda-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
+		scl-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		sensor@48 {
+			compatible = "microchip,tcn75";
+			reg = <0x48>;
+		};
+	};
+
 	leds {
 		compatible = "gpio-leds";
 
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 769c0ee1dab5..9d94c79212cc 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1452,7 +1452,7 @@  define Device/jjplus_ja76pf2
   SOC := ar7161
   DEVICE_VENDOR := jjPlus
   DEVICE_MODEL := JA76PF2
-  DEVICE_PACKAGES += -kmod-ath9k -swconfig -wpad-basic-wolfssl -uboot-envtools fconfig
+  DEVICE_PACKAGES += -kmod-ath9k -swconfig -wpad-basic-wolfssl -uboot-envtools fconfig kmod-hwmon-lm75
   IMAGES += kernel.bin rootfs.bin
   IMAGE/kernel.bin := append-kernel
   IMAGE/rootfs.bin := append-rootfs | pad-rootfs