On 09/04/2022 15:40, Martin Jücker wrote: > Hello, > > I have some trouble with a pwm backlight in the p4note and I'm not sure > what the cause is. The problem is with setting the backlight brightness > to its maximum value, which will actually turn off the display. All the > other values seem to be working just fine. A bit similar issues was fixed by Mårten (5d82e661398e ("pwm: pwm-samsung: Trigger manual update when disabling PWM") ). I assume you test on a tree having that commit. > > Looking at the documentation for the pwm driver in the exynos4412 > manual, I found that for pwm, the higher the tcmp value, the lower the > pwm value is. Enabling debug logging, this seems to be exactly what's > happening for values below 100% duty, but when the duty reaches 100%, > the tcmp is zero and then gets decreased which causes it to wrap around. > Looking at the rest of the code, this seems to be expected behaviour and > I would assume that it should cause the pwm to never switch the value > from high to low which would also fit. I miss here some details. The tcmp=-1 is written to registers for the next duty cycle. When current duty cycle finishes, this new tcmp=-1 should be loaded into the PWM. It seems that this loading does not happen in your case. Correct? I tried this on Odroid HC1 and works correctly: duty_ns=2000000, period_ns=2000000 tin_ns=240 tcmp=4294967295 tcnt=8332 What values do you have? How can I reproduce your case? Best regards, Krzysztof