From: Tim Kryger <tim.kryger@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>,
Scott Branden <sbranden@broadcom.com>,
Arun Ramamurthy <arunrama@broadcom.com>,
Jonathan Richardson <jonathar@broadcom.com>
Cc: Ray Jui <rjui@broadcom.com>,
Linux PWM <linux-pwm@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Broadcom Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>,
Tim Kryger <tim.kryger@gmail.com>
Subject: [PATCH 2/2] drivers: pwm: bcm-kona: Dont set polarity in probe
Date: Sun, 4 Jan 2015 17:12:56 -0800 [thread overview]
Message-ID: <1420420376-13087-3-git-send-email-tim.kryger@gmail.com> (raw)
In-Reply-To: <1420420376-13087-1-git-send-email-tim.kryger@gmail.com>
From: Arun Ramamurthy <arunrama@broadcom.com>
Omit setting the polarity to normal during probe and instead use the
new pwmchip_add_inversed function to register a PWM chip with default
polarity of inversed for all channels as this is the actual 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>
---
This is based on Arun's patch (originally posted by Scott)
https://lkml.org/lkml/2014/11/25/1019
I modified it to use the pwmchip_add_inversed function so the polarity
could be safely left at the power on default and updated the commit
message accordingly.
drivers/pwm/pwm-bcm-kona.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/pwm/pwm-bcm-kona.c b/drivers/pwm/pwm-bcm-kona.c
index 02bc048..32b3ec6 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_inversed(&kp->chip);
if (ret < 0)
dev_err(&pdev->dev, "failed to add PWM chip: %d\n", ret);
--
1.9.1
prev parent reply other threads:[~2015-01-05 1:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-05 1:12 [PATCH 0/2] Allow registration of default inversed polarity PWMs Tim Kryger
2015-01-05 1:12 ` [PATCH 1/2] drivers: pwm: core: Add pwmchip_add_inversed Tim Kryger
2015-01-06 21:16 ` Jonathan Richardson
2015-01-13 20:44 ` Scott Branden
2015-01-05 1:12 ` Tim Kryger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1420420376-13087-3-git-send-email-tim.kryger@gmail.com \
--to=tim.kryger@gmail.com \
--cc=arunrama@broadcom.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=jonathar@broadcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.com \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome