summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryiming.li <yiming.li@starfivetech.com>2021-03-15 20:45:19 +0300
committerEmil Renner Berthing <kernel@esmil.dk>2021-06-07 02:11:17 +0300
commit338e5edcb7b1baf43843f490220efe32b6140f81 (patch)
tree84b160126245126b38d7a79a1176ee6f8b9d9d53
parentd313c5cb394a838272d5f6b7ca17d8aae92eeeb6 (diff)
downloadlinux-338e5edcb7b1baf43843f490220efe32b6140f81.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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pwm/pwm-sifive-ptc.c b/drivers/pwm/pwm-sifive-ptc.c
index e510181b32bb..9f149a064ed8 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;
}