10-19-2020, 03:45 PM
The 5.x kernels define a pwm-fan device in the device tree, but don't set up any parameters to control it, so the kernel turns it fully on by default.
On 5.x kernels, you should have a sysfs file /sys/devices/platform/pwm-fan/hwmon/hwmon0/pwm1 which can be used to control the fan from userspace, e.g.
writing values 0 to 255 to the file will set the speed to approx 0 to 100%.
More advanced, you can have the kernel thermal subsystem to control the fan, e.g. by applying this device tree overlay to your device tree - it runs the fan progressively more as CPU speed rises through 54-64°C. For more detail Read the documentation on how thermal devices are described in device trees.
On 5.x kernels, you should have a sysfs file /sys/devices/platform/pwm-fan/hwmon/hwmon0/pwm1 which can be used to control the fan from userspace, e.g.
Code:
echo 128 > /sys/devices/platform/pwm-fan/hwmon/hwmon0/pwm1
More advanced, you can have the kernel thermal subsystem to control the fan, e.g. by applying this device tree overlay to your device tree - it runs the fan progressively more as CPU speed rises through 54-64°C. For more detail Read the documentation on how thermal devices are described in device trees.