Skip to content

Commit

Permalink
drivers/pwm/pwm-sifive-ptc: Clear PWM CNTR
Browse files Browse the repository at this point in the history
Clear CNTR of PWM after setting period & duty_cycle
  • Loading branch information
yiming.li authored and esmil committed Dec 27, 2021
1 parent 5bf95df commit 5f695a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/pwm/pwm-sifive-ptc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5f695a7

Please sign in to comment.