summaryrefslogtreecommitdiffstats
path: root/drivers/pwm
diff options
context:
space:
mode:
authorArun Ramamurthy <arunrama@broadcom.com>2015-05-26 22:08:17 +0200
committerThierry Reding <thierry.reding@gmail.com>2015-06-12 11:42:33 +0200
commite23db65f3dac944d51ba97c8c03a17cfc12390cd (patch)
treec220ca93f9db6ecac58935f1e8bcf798a737ddc9 /drivers/pwm
parentpwm: Add pwmchip_add_with_polarity() API (diff)
downloadlinux-e23db65f3dac944d51ba97c8c03a17cfc12390cd.tar.xz
linux-e23db65f3dac944d51ba97c8c03a17cfc12390cd.zip
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 <arunrama@broadcom.com> Reviewed-by: Ray Jui <rjui@broadcom.com> Signed-off-by: Scott Branden <sbranden@broadcom.com> Signed-off-by: Tim Kryger <tim.kryger@gmail.com> Signed-off-by: Jonathan Richardson <jonathar@broadcom.com> [thierry.reding@gmail.com: use pwmchip_add_with_polarity()] Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm')
-rw-r--r--drivers/pwm/pwm-bcm-kona.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/pwm/pwm-bcm-kona.c b/drivers/pwm/pwm-bcm-kona.c
index 02bc048892a9..7af8fea2dc5b 100644
--- a/drivers/pwm/pwm-bcm-kona.c
+++ b/drivers/pwm/pwm-bcm-kona.c
@@ -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);