diff options
author | yiming.li <yiming.li@starfivetech.com> | 2021-03-15 20:45:19 +0300 |
---|---|---|
committer | Emil Renner Berthing <kernel@esmil.dk> | 2021-09-27 03:08:15 +0300 |
commit | 7cf2ace63f66f925bb643d372ff4054941d94257 (patch) | |
tree | b48ba364ae242d7419ff19d0274b5e6129f1281e | |
parent | d8956cba01b5bc36072add5b189a483f4f327bba (diff) | |
download | linux-7cf2ace63f66f925bb643d372ff4054941d94257.tar.xz |
drivers/pwm/pwm-sifive-ptc: Clear PWM CNTR
Clear CNTR of PWM after setting period & duty_cycle
-rw-r--r-- | drivers/pwm/pwm-sifive-ptc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pwm/pwm-sifive-ptc.c b/drivers/pwm/pwm-sifive-ptc.c index 599059805e87..29e29844799d 100644 --- a/drivers/pwm/pwm-sifive-ptc.c +++ b/drivers/pwm/pwm-sifive-ptc.c @@ -167,6 +167,10 @@ static int sifive_pwm_ptc_apply(struct pwm_chip *chip, struct pwm_device *dev, s printk("[sifive_pwm_ptc_config]lrc ok....\n"); #endif + /* Clear REG_RPTC_CNTR after setting period & duty_cycle*/ + reg_addr = REG_PTC_RPTC_CNTR(pwm->regs, dev->hwpwm); + iowrite32(0, reg_addr); + return 0; } |