mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
pwm: rockchip: Add comments for why to add delay before disabling the dclk for PWM v4
Fixes: 42e759004f ("pwm: rockchip: add one period delay before disabling the dclk")
Change-Id: I612fde2adf60940e17146a115a104caf302109b2
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
This commit is contained in:
@@ -873,6 +873,11 @@ static int rockchip_pwm_enable_v4(struct pwm_chip *chip, struct pwm_device *pwm,
|
||||
|
||||
writel_relaxed(PWM_EN(enable) | PWM_CLK_EN(enable), pc->base + ENABLE);
|
||||
|
||||
/*
|
||||
* For pwm v4, the disable operation, which sets polarity to inactive state,
|
||||
* will not take effect until the end of current period. Therefore, it makes
|
||||
* sense to delay one period before disabling the dclk.
|
||||
*/
|
||||
if (!enable) {
|
||||
pwm_get_state(pwm, &curstate);
|
||||
delay_us = DIV_ROUND_UP_ULL(curstate.period, NSEC_PER_USEC);
|
||||
|
||||
Reference in New Issue
Block a user