Skip to content

Commit

Permalink
rockchip: refine fan speed for mmbox anas3035
Browse files Browse the repository at this point in the history
  • Loading branch information
coolsnowwolf committed Nov 29, 2024
1 parent 1609903 commit 007d406
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
+};
--- /dev/null
+++ b/arch/arm/dts/rk3568-mmbox-anas3035.dts
@@ -0,0 +1,758 @@
@@ -0,0 +1,762 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
Expand Down Expand Up @@ -48,34 +48,27 @@
+ pinctrl-0 = <&power_led_pin>, <&sata0_pins>, <&sata1_pins>, <&sata2_pins>;
+
+ power_led: led-0 {
+ color = <LED_COLOR_ID_RED>;
+ function = LED_FUNCTION_POWER;
+ label = "red:power";
+ gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_HIGH>;
+ };
+
+ sata0_led: led-1 {
+ color = <LED_COLOR_ID_BLUE>;
+ function = LED_FUNCTION_DISK;
+ /* for to sata2 slot */
+ function-enumerator = <3>;
+ /* for sata2 slot */
+ label = "blue:sata3";
+ gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "disk-activity";
+ };
+
+ sata1_led: led-2 {
+ color = <LED_COLOR_ID_BLUE>;
+ function = LED_FUNCTION_DISK;
+ /* for to sata0 slot */
+ function-enumerator = <1>;
+ /* for sata0 slot */
+ label = "blue:sata1";
+ gpios = <&gpio4 RK_PC5 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "disk-activity";
+ };
+
+ sata2_led: led-3 {
+ color = <LED_COLOR_ID_BLUE>;
+ function = LED_FUNCTION_DISK;
+ /* for to sata1 slot */
+ function-enumerator = <2>;
+ /* for sata1 slot */
+ label = "blue:sata2";
+ gpios = <&gpio4 RK_PC4 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "disk-activity";
+ };
Expand All @@ -95,7 +88,7 @@
+ fan: pwm-fan {
+ compatible = "pwm-fan";
+ #cooling-cells = <2>;
+ cooling-levels = <0 95 145 195 255>;
+ cooling-levels = <0 80 128 175 230 255>;
+ fan-supply = <&vcc5v0_fan>;
+ pwms = <&pwm5 0 50000 0>;
+ };
Expand Down Expand Up @@ -234,50 +227,61 @@
+
+&cpu_thermal {
+ trips {
+ cpu_trip_active_cool: cpu-trip-active-cool {
+ temperature = <20000>;
+ hysteresis = <2000>;
+ type = "active";
+ };
+
+ cpu_trip_active_low: cpu-trip-active-low {
+ temperature = <50000>;
+ temperature = <30000>;
+ hysteresis = <2000>;
+ type = "active";
+ };
+
+ cpu_trip_active_med: cpu-trip-active-med {
+ temperature = <60000>;
+ temperature = <40000>;
+ hysteresis = <2000>;
+ type = "active";
+ };
+
+ cpu_trip_active_high: cpu-trip-active-high {
+ temperature = <70000>;
+ temperature = <50000>;
+ hysteresis = <2000>;
+ type = "active";
+ };
+
+ cpu_trip_active_hot: cpu-trip-active-hot {
+ temperature = <75000>;
+ temperature = <60000>;
+ hysteresis = <2000>;
+ type = "hot";
+ };
+ };
+
+ cooling-maps {
+ cpu-active-cool {
+ trip = <&cpu_trip_active_cool>;
+ cooling-device = <&fan THERMAL_NO_LIMIT 1>;
+ };
+
+ cpu-active-low {
+ trip = <&cpu_trip_active_low>;
+ cooling-device = <&fan THERMAL_NO_LIMIT 1>;
+ cooling-device = <&fan 1 2>;
+ };
+
+ cpu-active-med {
+ trip = <&cpu_trip_active_med>;
+ cooling-device = <&fan 1 2>;
+ cooling-device = <&fan 2 3>;
+ };
+
+ cpu-active-high {
+ trip = <&cpu_trip_active_high>;
+ cooling-device = <&fan 2 3>;
+ cooling-device = <&fan 3 4>;
+ };
+
+ cpu-active-hot {
+ trip = <&cpu_trip_active_hot>;
+ cooling-device = <&fan 3 THERMAL_NO_LIMIT>;
+ cooling-device = <&fan 4 THERMAL_NO_LIMIT>;
+ };
+ };
+};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
fan: pwm-fan {
compatible = "pwm-fan";
#cooling-cells = <2>;
cooling-levels = <0 95 145 195 255>;
cooling-levels = <0 80 128 175 230 255>;
fan-supply = <&vcc5v0_fan>;
pwms = <&pwm5 0 50000 0>;
};
Expand Down Expand Up @@ -211,50 +211,61 @@

&cpu_thermal {
trips {
cpu_trip_active_cool: cpu-trip-active-cool {
temperature = <20000>;
hysteresis = <2000>;
type = "active";
};

cpu_trip_active_low: cpu-trip-active-low {
temperature = <50000>;
temperature = <30000>;
hysteresis = <2000>;
type = "active";
};

cpu_trip_active_med: cpu-trip-active-med {
temperature = <60000>;
temperature = <40000>;
hysteresis = <2000>;
type = "active";
};

cpu_trip_active_high: cpu-trip-active-high {
temperature = <70000>;
temperature = <50000>;
hysteresis = <2000>;
type = "active";
};

cpu_trip_active_hot: cpu-trip-active-hot {
temperature = <75000>;
temperature = <60000>;
hysteresis = <2000>;
type = "hot";
};
};

cooling-maps {
cpu-active-cool {
trip = <&cpu_trip_active_cool>;
cooling-device = <&fan THERMAL_NO_LIMIT 1>;
};

cpu-active-low {
trip = <&cpu_trip_active_low>;
cooling-device = <&fan THERMAL_NO_LIMIT 1>;
cooling-device = <&fan 1 2>;
};

cpu-active-med {
trip = <&cpu_trip_active_med>;
cooling-device = <&fan 1 2>;
cooling-device = <&fan 2 3>;
};

cpu-active-high {
trip = <&cpu_trip_active_high>;
cooling-device = <&fan 2 3>;
cooling-device = <&fan 3 4>;
};

cpu-active-hot {
trip = <&cpu_trip_active_hot>;
cooling-device = <&fan 3 THERMAL_NO_LIMIT>;
cooling-device = <&fan 4 THERMAL_NO_LIMIT>;
};
};
};
Expand Down

0 comments on commit 007d406

Please sign in to comment.