riscv: dts: thead: Enable thead fan 33/316033/2
authorMichal Wilczynski <m.wilczynski@samsung.com>
Fri, 9 Aug 2024 15:58:12 +0000 (17:58 +0200)
committerMichal Wilczynski <m.wilczynski@samsung.com>
Tue, 13 Aug 2024 08:21:59 +0000 (10:21 +0200)
The drivers responsible for supporting thead fan are already in the
repo. Enable the fan in the device tree for better SoC usability.
Ported from [1].

[1] - https://github.com/revyos/thead-kernel.git

Change-Id: I8b7efb97ec4ceb0c0484dd49631aef9a4101ab3b
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi

index 9507df3ea7c7d8906830262976ace99f7d84fd84..52f3c4c68d5a09e2e77b55407a2f36ea20bf61a7 100644 (file)
                default-brightness-level = <7>;
        };
 
+       thermal-zones {
+               cpu-thermal-zone {
+                       sustainable-power = <1600>;
+
+                       trips {
+                               fan_config0: fan-trip0 {
+                                       temperature = <40000>;
+                                       hysteresis = <5000>;
+                                       type = "active";
+                               };
+
+                               fan_config1: fan-trip1 {
+                                       temperature = <50000>;
+                                       hysteresis = <5000>;
+                                       type = "active";
+                               };
+
+                               fan_config2: fan-trip2 {
+                                       temperature = <60000>;
+                                       hysteresis = <5000>;
+                                       type = "active";
+                               };
+                       };
+
+                       cooling-maps {
+                               fan-on {
+                                       trip = <&fan_config0>;
+                                       cooling-device =
+                                               <&fan 1 1>;
+                               };
+                               fan-faster {
+                                       trip = <&fan_config1>;
+                                       cooling-device =
+                                               <&fan 2 2>;
+                               };
+                               fan-full {
+                                       trip = <&fan_config2>;
+                                       cooling-device =
+                                               <&fan 3 3>;
+                               };
+                       };
+               };
+
+               dev-thermal-zone {
+                       sustainable-power = <3000>;
+               };
+       };
+
+       fan: pwm-fan {
+               compatible = "pwm-fan";
+               #cooling-cells = <2>;
+               pwms = <&pwm 1 10000000 0>;
+               cooling-levels = <0 64 192 255>;
+       };
+
        aon: aon {
                compatible = "thead,light-aon";
                mbox-names = "aon";