Commit e23db65f authored by Arun Ramamurthy's avatar Arun Ramamurthy Committed by Thierry Reding

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: default avatarArun Ramamurthy <arunrama@broadcom.com>
Reviewed-by: default avatarRay Jui <rjui@broadcom.com>
Signed-off-by: default avatarScott Branden <sbranden@broadcom.com>
Signed-off-by: default avatarTim Kryger <tim.kryger@gmail.com>
Signed-off-by: default avatarJonathan Richardson <jonathar@broadcom.com>
[thierry.reding@gmail.com: use pwmchip_add_with_polarity()]
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent b6a00fae
...@@ -266,18 +266,15 @@ static int kona_pwmc_probe(struct platform_device *pdev) ...@@ -266,18 +266,15 @@ static int kona_pwmc_probe(struct platform_device *pdev)
return ret; return ret;
} }
/* Set smooth mode, push/pull, and normal polarity for all channels */ /* Set push/pull for all channels */
for (chan = 0; chan < kp->chip.npwm; chan++) { for (chan = 0; chan < kp->chip.npwm; chan++)
value |= (1 << PWM_CONTROL_SMOOTH_SHIFT(chan));
value |= (1 << PWM_CONTROL_TYPE_SHIFT(chan)); value |= (1 << PWM_CONTROL_TYPE_SHIFT(chan));
value |= (1 << PWM_CONTROL_POLARITY_SHIFT(chan));
}
writel(value, kp->base + PWM_CONTROL_OFFSET); writel(value, kp->base + PWM_CONTROL_OFFSET);
clk_disable_unprepare(kp->clk); clk_disable_unprepare(kp->clk);
ret = pwmchip_add(&kp->chip); ret = pwmchip_add_with_polarity(&kp->chip, PWM_POLARITY_INVERSED);
if (ret < 0) if (ret < 0)
dev_err(&pdev->dev, "failed to add PWM chip: %d\n", ret); dev_err(&pdev->dev, "failed to add PWM chip: %d\n", ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment