@@ -130,9 +130,13 @@ static int lpc32xx_pwm_probe(struct platform_device *pdev)
return ret;
}
- /* When PWM is disable, configure the output to the default value */
+ /* When PWM is disable, configure the output correctly */
val = readl(lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2));
- val &= ~PWM_PIN_LEVEL;
+ if (device_property_read_bool(&pdev->dev,
+ "nxp,pwm-disabled-level-high"))
+ val |= PWM_PIN_LEVEL;
+ else
+ val &= ~PWM_PIN_LEVEL;
writel(val, lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2));
platform_set_drvdata(pdev, lpc32xx);