Here's a stab at a PWM driver for the rockchip rk3399, using the new PWM api. I have never written a driver before, but it seemed pretty straightforward.
The hardware itself is four channel, but the dts assumes multiple attachment for some reason.
I can control the fan on my ROCKPRO64 by enabling the second pwm in the device tree:
Index: sys/gnu/dts/arm64/rockchip/rk3399-rockpro64.dts =================================================================== --- sys/gnu/dts/arm64/rockchip/rk3399-rockpro64.dts (revision 343327) +++ sys/gnu/dts/arm64/rockchip/rk3399-rockpro64.dts (working copy) @@ -560,6 +560,10 @@ status = "okay"; }; +&pwm1 { + status = "okay"; +}; + &pwm2 { status = "okay"; };