summaryrefslogtreecommitdiff
path: root/drivers/pwm/rk_pwm.c
diff options
context:
space:
mode:
authorKever Yang <kever.yang@rock-chips.com>2017-07-19 19:54:23 +0800
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-07-27 14:59:01 +0200
commit06f4e36baf7833c2fa40af34b240e4132898689b (patch)
tree7744769b661b85832623ac794c093f4ea39f2ae1 /drivers/pwm/rk_pwm.c
parent3030c951f19bf69fd12fe700d33c4be3ad2ee734 (diff)
rockchip: pwm: add mask for config setting
Use mask to clear old setting before direct set the new config, or else there it will mess up the config when it's not the same with default value. Fixes: 3851059 rockchip: Setup default PWM flags Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Diffstat (limited to 'drivers/pwm/rk_pwm.c')
-rw-r--r--drivers/pwm/rk_pwm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/pwm/rk_pwm.c b/drivers/pwm/rk_pwm.c
index 28de62d716..2364c2dfdd 100644
--- a/drivers/pwm/rk_pwm.c
+++ b/drivers/pwm/rk_pwm.c
@@ -29,6 +29,7 @@ static int rk_pwm_set_invert(struct udevice *dev, uint channel, bool polarity)
struct rk_pwm_priv *priv = dev_get_priv(dev);
debug("%s: polarity=%u\n", __func__, polarity);
+ priv->enable_conf &= ~(PWM_DUTY_MASK | PWM_INACTIVE_MASK);
if (polarity)
priv->enable_conf |= PWM_DUTY_NEGATIVE | PWM_INACTIVE_POSTIVE;
else