Ok I did some experiments and the below settings in the devicetree work well for me. The normal operating temperature when just browsing and such is mostly below 60deg (~57) so the fan starts working only at 60 and above. Due to the higher polling delay it will not stop immediately when below 60. It is tricky I have to say. If you find an operation point that keeps the temp around 60 then the fan will go on/off all the time. But with the settings below it did not happen to me.
Under /
fan: gpio-fan {
#cooling-cells = <2>;
compatible = "gpio-fan";
gpio-fan,speed-map = <0 0 3000 1>;
gpios = <&gpio3 RK_PA0 GPIO_ACTIVE_HIGH>;
};
Add new thermal trips and cooling maps:
&cpu_thermal {
polling-delay = <3000>;
trips {
cpu_hot: cpu_hot {
temperature = <60000>;
hysteresis = <5000>;
type = "active";
};
};
cooling-maps {
map2 {
trip = <&cpu_hot>;
cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
An alternative would be to write an own gpio-fan driver and add a timeout to the “disable” function. Here we could add a timeout value to the devicetree. Say 10s, so whenever the kernel switches off the fan it will keep running for another 10s before it goes off.
Also I installed “cpupower” and “cpupower-gui” and with these tools you can nicely configure profiles to your needs. So you can select various governors for the little and big cpus so the temperature stays in range unless you need max power. With these tools there is no need for the gears script so far unless you also want to set the gpu frequency.