[PATCH 3/3] riscv: dts: thead: th1520: add soft PWM fan for Lichee Pi 4A

Drew Fustini fustini at kernel.org
Sat Aug 16 16:27:50 PDT 2025


On Sat, Aug 16, 2025 at 05:32:09PM +0800, Icenowy Zheng wrote:
> Because of the SoM+Dock design of Lichee Pi 4A, heat dissipation does
> not work well; fortunately it comes with a fan port with PWM driving
> capability.
> 
> As the hardware PWM controller of Lichee Pi 4A isn't ready yet, drive it
> with pwm-gpio driver (software PWM) now.
> 
> A long PWM period is used, because not only software PWM is used, but
> also the fan port is a 2-pin one and fast PWM might confuse the BLDC
> driver on fans.
> 
> Signed-off-by: Icenowy Zheng <uwu at icenowy.me>
> ---
>  .../boot/dts/thead/th1520-lichee-pi-4a.dts    | 53 +++++++++++++++++++
>  arch/riscv/boot/dts/thead/th1520.dtsi         |  2 +-
>  2 files changed, 54 insertions(+), 1 deletion(-)

Is it possible to reconcile the work that Michal is doing with the
hardware PWM controller series [1] and this series?

The PWM controller does need Rust which works okay for me when using
llvm but that might not be the case for everyone. Maybe there is some
way to use the pwm controller if available and then failback to gpio if
not.

Thanks,
Drew 

[1] https://lore.kernel.org/linux-riscv/20250806-rust-next-pwm-working-fan-for-sending-v13-7-690b669295b6@samsung.com/



More information about the linux-riscv mailing list