kernel: bump 5.4 to 5.4.48
[oweals/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0486-Reduce-noise-from-rpi-poe-hat-fan.patch
1 From 863dace20e48954a7e013a2e88e27c692ce165b0 Mon Sep 17 00:00:00 2001
2 From: Nick B <nick@pelagiris.org>
3 Date: Mon, 9 Mar 2020 09:05:39 -0400
4 Subject: [PATCH] Reduce noise from rpi poe hat fan
5
6 This adds 2 extra states, at 40c and 45c, with PWM of 31 and 63 (out
7 of 255) for the rpi poe hat fan.  This significantly improves user
8 experience by providing a smoother ramp up of the fan, from a pwm 0
9 to 31 to 63 then finally to 150, and additionally makes it very easy
10 for users to further tweak the values as needed for their specific
11 application.
12
13 The possible concerns I have are that a hysteresis of 2000 (2c) could
14 be too narrow, and that running the fan more at a reduced temperature
15 (40000 - 40c) could cause problems.
16
17 Signed-off-by: Nick B <nick@pelagiris.org>
18 ---
19  .../arm/boot/dts/overlays/rpi-poe-overlay.dts | 35 ++++++++++++++++---
20  1 file changed, 30 insertions(+), 5 deletions(-)
21
22 --- a/arch/arm/boot/dts/overlays/rpi-poe-overlay.dts
23 +++ b/arch/arm/boot/dts/overlays/rpi-poe-overlay.dts
24 @@ -14,9 +14,9 @@
25                                 compatible = "raspberrypi,rpi-poe-fan";
26                                 firmware = <&firmware>;
27                                 cooling-min-state = <0>;
28 -                               cooling-max-state = <2>;
29 +                               cooling-max-state = <4>;
30                                 #cooling-cells = <2>;
31 -                               cooling-levels = <0 150 255>;
32 +                               cooling-levels = <0 31 63 150 255>;
33                                 status = "okay";
34                         };
35                 };
36 @@ -27,12 +27,21 @@
37                 __overlay__ {
38                         trips {
39                                 trip0: trip0 {
40 -                                       temperature = <50000>;
41 -                                       hysteresis = <5000>;
42 +                                       temperature = <40000>;
43 +                                       hysteresis = <2000>;
44                                         type = "active";
45                                 };
46                                 trip1: trip1 {
47 -
48 +                                       temperature = <45000>;
49 +                                       hysteresis = <2000>;
50 +                                       type = "active";
51 +                               };
52 +                               trip2: trip2 {
53 +                                       temperature = <50000>;
54 +                                       hysteresis = <2000>;
55 +                                       type = "active";
56 +                               };
57 +                               trip3: trip3 {
58                                         temperature = <55000>;
59                                         hysteresis = <5000>;
60                                         type = "active";
61 @@ -47,6 +56,14 @@
62                                         trip = <&trip1>;
63                                         cooling-device = <&fan0 1 2>;
64                                 };
65 +                               map2 {
66 +                                       trip = <&trip2>;
67 +                                       cooling-device = <&fan0 2 3>;
68 +                               };
69 +                               map3 {
70 +                                       trip = <&trip3>;
71 +                                       cooling-device = <&fan0 3 4>;
72 +                               };
73                         };
74                 };
75         };
76 @@ -58,6 +75,10 @@
77                         poe_fan_temp0_hyst =    <&trip0>,"hysteresis:0";
78                         poe_fan_temp1 =         <&trip1>,"temperature:0";
79                         poe_fan_temp1_hyst =    <&trip1>,"hysteresis:0";
80 +                       poe_fan_temp2 =         <&trip2>,"temperature:0";
81 +                       poe_fan_temp2_hyst =    <&trip2>,"hysteresis:0";
82 +                       poe_fan_temp3 =         <&trip3>,"temperature:0";
83 +                       poe_fan_temp3_hyst =    <&trip3>,"hysteresis:0";
84                 };
85         };
86  
87 @@ -66,5 +87,9 @@
88                 poe_fan_temp0_hyst =    <&trip0>,"hysteresis:0";
89                 poe_fan_temp1 =         <&trip1>,"temperature:0";
90                 poe_fan_temp1_hyst =    <&trip1>,"hysteresis:0";
91 +               poe_fan_temp2 =         <&trip2>,"temperature:0";
92 +               poe_fan_temp2_hyst =    <&trip2>,"hysteresis:0";
93 +               poe_fan_temp3 =         <&trip3>,"temperature:0";
94 +               poe_fan_temp3_hyst =    <&trip3>,"hysteresis:0";
95         };
96  };