diff mbox

[U-Boot] rockchip: Set up default PWM flags

Message ID 20170524001514.3480-1-sjg@chromium.org
State Accepted
Commit 385105983abf428de55eab9a1c2464889e94cc1b
Delegated to: Philipp Tomsich
Headers show

Commit Message

Simon Glass May 24, 2017, 12:15 a.m. UTC
At present if the PWM set_invert() method is not called then the flags are
not set up and the driver does not work properly. Fix this by setting up
the default flags when probing.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 874ee59 (rockchip: pwm: implement pwm_set_invert())
---

 drivers/pwm/rk_pwm.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Philipp Tomsich Oct. 6, 2017, 4:26 p.m. UTC | #1
> At present if the PWM set_invert() method is not called then the flags are
> not set up and the driver does not work properly. Fix this by setting up
> the default flags when probing.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Fixes: 874ee59 (rockchip: pwm: implement pwm_set_invert())
> ---
> 
>  drivers/pwm/rk_pwm.c | 1 +
>  1 file changed, 1 insertion(+)
> 

Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Philipp Tomsich Oct. 6, 2017, 4:26 p.m. UTC | #2
> At present if the PWM set_invert() method is not called then the flags are
> not set up and the driver does not work properly. Fix this by setting up
> the default flags when probing.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Fixes: 874ee59 (rockchip: pwm: implement pwm_set_invert())
> ---
> 
>  drivers/pwm/rk_pwm.c | 1 +
>  1 file changed, 1 insertion(+)
> 

Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
diff mbox

Patch

diff --git a/drivers/pwm/rk_pwm.c b/drivers/pwm/rk_pwm.c
index f3b2f7615d..5d78d4a67d 100644
--- a/drivers/pwm/rk_pwm.c
+++ b/drivers/pwm/rk_pwm.c
@@ -92,6 +92,7 @@  static int rk_pwm_probe(struct udevice *dev)
 		return -EINVAL;
 	}
 	priv->freq = clk_get_rate(&clk);
+	priv->enable_conf = PWM_DUTY_POSTIVE | PWM_INACTIVE_POSTIVE;
 
 	return 0;
 }