Thanks for the patch. Since you have khadas mail I'm pretty sure you've
had the possibility to test it on the real vim board and I just don't
get it how it works with the voltage table above. The problem is that
pwm is calculated incorrectly in the upstream pwm-meson driver. That
voltage table appeared to be used in early amlogic bl loader and
appropriate pwm is initialized from a table's record. Duty cycle value
is translated to pwm regs correctly. Later when kernel start running
pwm-regulator driver is probed. It reads the pwm regs, calculates back
duty-cyle and search it in the table. Since calculation algos are not
match and the table doesn't contain full range of 0-100% values
regulator driver doesn't find current voltage. In such case regulator
core sets the minimum voltage from the table [1] and the SoC may hang
(depending on board) due to minimum voltage may be too low for the
current frequency SoC uses.
I'm not sure about the PWM issues, but I checked on the real S905Y4 hardware
and it works.
Or I'm missing something?
There's not-yet-reviewed patch that fixes pwm algo [2]. There's
calculation example in the cover letter.
[1] https://elixir.bootlin.com/linux/v6.19-rc5/source/drivers/regulator/core.c#L1227
[2] https://lkml.iu.edu/2412.3/00826.html
What's the status of such patches?
--
Best regards
George