This is an overlay for a PWM Fan running on Raspberry Pi 4. It combines these overlays:
- raspberrypi/linux/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b.dts - doesn't work on RPI4.
- How to check the pi4 official fan's status? - doesn't use kernel driver so it has to poll the CPU temperature.
This dts uses GPIO pin 18. You can change it to a different hardware PWM pin.
sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/pwm-fan.dtbo pwm-fan-overlay.dts