FAN never stops in sleep mode (on VIM2)

I use fan on my VIM2.
VIM2 drives the fan in automatic mode (the fan turns on at 50 degrees).
If the fan is on and VIM2 goes into a sleep mode, the fan never stops!!!
The fan stops when resuming from sleep only.

How to fix it?

Did you means depth sleep or early suspend?
It need to modify the Fan driver drivers/misc/khadas-fan.c

I mean on depth sleep - fan never stops.

I’m sorry to reply for you so late. You can refer to this commit

1 Like

Thank you, Terry!

What about:

and

Hi, terry.

Found some bug:
If I turn fan on “always on” mode, It does stop after some time. This is chaotic and there is no pattern.
You need to go to the settings, switch to another position, and then turn on again. But after some time, fan does stop again…

How to fix it?

Can you provide below informations for me when it happens?

# adb shell
# cat /sys/class/fan/ctrl/mode
# cat /sys/class/fan/ctrl/level
# cat /sys/class/fan/ctrl/enable

BTW, you can give me more informations.

# adb shell
# getprop

Thanks!

1 Like

@Terry
Hi!
I modif drivers/misc/khadas-fan.c and rebilg kernel.

#define KHADAS_FAN_TRIG_TEMP_LEVEL0 60 // 50 degree if not set
#define KHADAS_FAN_TRIG_TEMP_LEVEL1 65 // 60 degree if not set
#define KHADAS_FAN_TRIG_TEMP_LEVEL2 70 // 70 degree if not set

But fan switched on in 50 degrees again…
Please tell me, what did I wrong?

Thank you!

You should modify the kvim2.dts. Thanks

diff --git a/arch/arm64/boot/dts/kvim2.dts b/arch/arm64/boot/dts/kvim2.dts
index 58f239c..d425256 100644
--- a/arch/arm64/boot/dts/kvim2.dts
+++ b/arch/arm64/boot/dts/kvim2.dts
@@ -148,8 +148,8 @@
                compatible = "fanctl";
                fan_ctl0 = <&gpio GPIODV_14 GPIO_ACTIVE_HIGH>;
                fan_ctl1 = <&gpio GPIODV_15 GPIO_ACTIVE_HIGH>;
-               trig_temp_level0 = <50>;
-               trig_temp_level1 = <60>;
+               trig_temp_level0 = <60>;
+               trig_temp_level1 = <65>;
                trig_temp_level2 = <70>;
        };

1 Like