This seems to work:https://github.com/raspberrypi/linux/bl ... 4259-L4296 can be used as a template If you want to allow for temp control. having the target changed to your HDD temp (hddtemp, what is your output of 'ls -l /sys/class/hwmon/'?) should do the trick https://github.com/raspberrypi/linux/bl ... ay.dts#L97
If you just want to have a fixed PWM duty that you're still able to control I would suggest to make use of a SW PWM https://github.com/raspberrypi/linux/bl ... 4253-L4256.
Adding an LED node which defaults to 'on' and having a max-brightness Set to 127 will Run your fan at 50% duty, still allowing to change PWM-duty from 0 to 50% via sysfs control during runtime.
[all]
dtoverlay=pwm-gpio-fan,fan_gpio=18,fan_temp0=35000,fan_temp1=40000,fan_temp2=47500,fan_temp3=55000
Here's the output of
sbelyo@RPISTORE:~ $ ls -l /sys/class/hwmon/
total 0
lrwxrwxrwx 1 root root 0 Feb 25 18:17 hwmon0 -> ../../devices/virtual/thermal/thermal_zone0/hwmon0
lrwxrwxrwx 1 root root 0 Feb 25 18:20 hwmon1 -> ../../devices/platform/axi/1000120000.pcie/1f000c8000.adc/hwmon/hwmon1
lrwxrwxrwx 1 root root 0 Feb 25 18:20 hwmon2 -> ../../devices/platform/cooling_fan/hwmon/hwmon2
lrwxrwxrwx 1 root root 0 Feb 25 18:20 hwmon3 -> ../../devices/platform/pwm-fan/hwmon/hwmon3
lrwxrwxrwx 1 root root 0 Feb 25 18:20 hwmon4 -> ../../devices/platform/soc@107c000000/soc@107c000000:firmware/raspberrypi-hwmon/hwmon/hwmon4
Statistics: Posted by sbelyo — Wed Feb 25, 2026 11:21 pm