diff options
Diffstat (limited to 'drivers/pwm/pwm-lpc32xx.c')
-rw-r--r-- | drivers/pwm/pwm-lpc32xx.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/pwm/pwm-lpc32xx.c b/drivers/pwm/pwm-lpc32xx.c index 4d470c1a406a..a9b3cff96aac 100644 --- a/drivers/pwm/pwm-lpc32xx.c +++ b/drivers/pwm/pwm-lpc32xx.c | |||
@@ -25,6 +25,7 @@ struct lpc32xx_pwm_chip { | |||
25 | }; | 25 | }; |
26 | 26 | ||
27 | #define PWM_ENABLE BIT(31) | 27 | #define PWM_ENABLE BIT(31) |
28 | #define PWM_PIN_LEVEL BIT(30) | ||
28 | 29 | ||
29 | #define to_lpc32xx_pwm_chip(_chip) \ | 30 | #define to_lpc32xx_pwm_chip(_chip) \ |
30 | container_of(_chip, struct lpc32xx_pwm_chip, chip) | 31 | container_of(_chip, struct lpc32xx_pwm_chip, chip) |
@@ -103,6 +104,7 @@ static int lpc32xx_pwm_probe(struct platform_device *pdev) | |||
103 | struct lpc32xx_pwm_chip *lpc32xx; | 104 | struct lpc32xx_pwm_chip *lpc32xx; |
104 | struct resource *res; | 105 | struct resource *res; |
105 | int ret; | 106 | int ret; |
107 | u32 val; | ||
106 | 108 | ||
107 | lpc32xx = devm_kzalloc(&pdev->dev, sizeof(*lpc32xx), GFP_KERNEL); | 109 | lpc32xx = devm_kzalloc(&pdev->dev, sizeof(*lpc32xx), GFP_KERNEL); |
108 | if (!lpc32xx) | 110 | if (!lpc32xx) |
@@ -128,6 +130,11 @@ static int lpc32xx_pwm_probe(struct platform_device *pdev) | |||
128 | return ret; | 130 | return ret; |
129 | } | 131 | } |
130 | 132 | ||
133 | /* When PWM is disable, configure the output to the default value */ | ||
134 | val = readl(lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2)); | ||
135 | val &= ~PWM_PIN_LEVEL; | ||
136 | writel(val, lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2)); | ||
137 | |||
131 | platform_set_drvdata(pdev, lpc32xx); | 138 | platform_set_drvdata(pdev, lpc32xx); |
132 | 139 | ||
133 | return 0; | 140 | return 0; |