]> git.baikalelectronics.ru Git - kernel.git/commit
pwm: sun4i: Properly check current state
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Sun, 25 Feb 2018 01:55:58 +0000 (02:55 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Tue, 27 Mar 2018 23:07:57 +0000 (01:07 +0200)
commit1af37a6796a87e6a695cb58dca64c4038306b1f6
tree6021a938ed865b1f2008a78d0cd7c6347bb94b92
parent7b94a4e142c3da790ccc50ebf87938371c327555
pwm: sun4i: Properly check current state

Correctly extract the prescaler value from CTRL_REG before comparing it
to PWM_PRESCAL_MASK.

Also, check that both PWM_CLK_GATING and PWM_EN to ensure the PWM is
enabled instead of relying on only one of those.

Fixes: 9afa1fbb572c ("pwm: sun4i: Improve hardware read out")
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-sun4i.c