|
@@ -156,8 +156,12 @@ static int rcar_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
|
|
|
if (div < 0)
|
|
|
return div;
|
|
|
|
|
|
- /* Let the core driver set pwm->period if disabled and duty_ns == 0 */
|
|
|
- if (!pwm_is_enabled(pwm) && !duty_ns)
|
|
|
+ /*
|
|
|
+ * Let the core driver set pwm->period if disabled and duty_ns == 0.
|
|
|
+ * But, this driver should prevent to set the new duty_ns if current
|
|
|
+ * duty_cycle is not set
|
|
|
+ */
|
|
|
+ if (!pwm_is_enabled(pwm) && !duty_ns && !pwm->state.duty_cycle)
|
|
|
return 0;
|
|
|
|
|
|
rcar_pwm_update(rp, RCAR_PWMCR_SYNC, RCAR_PWMCR_SYNC, RCAR_PWMCR);
|