]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
qualcommax: ipq807x: ax9000: wire up the fan 22942/head
authorRobert Marko <robimarko@gmail.com>
Wed, 15 Apr 2026 11:01:29 +0000 (13:01 +0200)
committerRobert Marko <robimarko@gmail.com>
Sat, 18 Apr 2026 10:46:31 +0000 (12:46 +0200)
Now that we have a proper driver support for the onboard EMC2301 lets
wire up the fan as a cooling device on the Xiaomi AX9000.

Link: https://github.com/openwrt/openwrt/pull/22942
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/qualcommax/dts/ipq8072-ax9000.dts
target/linux/qualcommax/image/ipq807x.mk

index 54c13885976ff69ad14a5258bf0c41c6f9ebbe56..b44eaa4c42821cb1d602753e4746c2b9624a169d 100644 (file)
@@ -9,6 +9,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/leds/common.h>
+#include <dt-bindings/pwm/pwm.h>
 
 / {
        model = "Xiaomi AX9000";
 
        pinctrl-0 = <&i2c_pins>;
        pinctrl-names = "default";
+
+       fan_controller: fan-controller@2f {
+               compatible = "microchip,emc2301", "microchip,emc2305";
+               reg = <0x2f>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               #pwm-cells = <3>;
+
+               fan: fan@0 {
+                       reg = <0>;
+                       pwms = <&fan_controller 26000 0 1>;
+                       #cooling-cells = <2>;
+               };
+       };
 };
 
 &prng {
 
        qcom,ath11k-calibration-variant = "Xiaomi-AX9000";
 };
+
+&cpu0_thermal {
+       trips {
+               cpu0_active: cpu-active {
+                       temperature = <70000>;
+                       hysteresis = <2000>;
+                       type = "active";
+               };
+       };
+
+       cooling-maps {
+               map2 {
+                       trip = <&cpu0_active>;
+                       cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&cpu1_thermal {
+       trips {
+               cpu1_active: cpu-active {
+                       temperature = <70000>;
+                       hysteresis = <2000>;
+                       type = "active";
+               };
+       };
+
+       cooling-maps {
+               map2 {
+                       trip = <&cpu1_active>;
+                       cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&cpu2_thermal {
+       trips {
+               cpu2_active: cpu-active {
+                       temperature = <70000>;
+                       hysteresis = <2000>;
+                       type = "active";
+               };
+       };
+
+       cooling-maps {
+               map2 {
+                       trip = <&cpu2_active>;
+                       cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&cpu3_thermal {
+       trips {
+               cpu3_active: cpu-active {
+                       temperature = <70000>;
+                       hysteresis = <2000>;
+                       type = "active";
+               };
+       };
+
+       cooling-maps {
+               map2 {
+                       trip = <&cpu3_active>;
+                       cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&cluster_thermal {
+       trips {
+               cluster_active: cluster-active {
+                       temperature = <70000>;
+                       hysteresis = <2000>;
+                       type = "active";
+               };
+       };
+
+       cooling-maps {
+               map2 {
+                       trip = <&cluster_active>;
+                       cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+               };
+       };
+};
index 747123fe20d80a45c715e0630a4f620574f0d80c..d1f42dd617843f0ba08e0f3cdfc20837a226f94c 100644 (file)
@@ -539,7 +539,7 @@ define Device/xiaomi_ax9000
        SOC := ipq8072
        KERNEL_SIZE := 57344k
        DEVICE_PACKAGES := ipq-wifi-xiaomi_ax9000 kmod-ath11k-pci ath11k-firmware-qcn9074 \
-               kmod-ath10k-ct ath10k-firmware-qca9887-ct
+               kmod-ath10k-ct ath10k-firmware-qca9887-ct kmod-hwmon-emc2305
 ifeq ($(IB),)
 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
        ARTIFACTS := initramfs-factory.ubi