pwm: bcm-kona: Don't set polarity in probe

Omit setting the polarity to normal during probe and instead use the new
pwmchip_add_with_polarity() function to register a PWM chip with inverse
polarity by default for all channels to reflect the hardware default.

Signed-off-by: Arun Ramamurthy <[email protected]>
Reviewed-by: Ray Jui <[email protected]>
Signed-off-by: Scott Branden <[email protected]>
Signed-off-by: Tim Kryger <[email protected]>
Signed-off-by: Jonathan Richardson <[email protected]>
[[email protected]: use pwmchip_add_with_polarity()]
Signed-off-by: Thierry Reding <[email protected]>
This commit is contained in:
Arun Ramamurthy 2015-05-26 13:08:17 -07:00 • committed by Thierry Reding
commit e23db65f3d

View file

@ -266,18 +266,15 @@ static int kona_pwmc_probe(struct platform_device *pdev)
return ret;
}
/* Set smooth mode, push/pull, and normal polarity for all channels */
for (chan = 0; chan < kp->chip.npwm; chan++) {
value |= (1 << PWM_CONTROL_SMOOTH_SHIFT(chan));
/* Set push/pull for all channels */
for (chan = 0; chan < kp->chip.npwm; chan++)
value |= (1 << PWM_CONTROL_TYPE_SHIFT(chan));
value |= (1 << PWM_CONTROL_POLARITY_SHIFT(chan));
}
writel(value, kp->base + PWM_CONTROL_OFFSET);
clk_disable_unprepare(kp->clk);
ret = pwmchip_add(&kp->chip);
ret = pwmchip_add_with_polarity(&kp->chip, PWM_POLARITY_INVERSED);
if (ret < 0)
dev_err(&pdev->dev, "failed to add PWM chip: %d\n", ret);