From: Tim Kryger <tim.kryger@gmail.com>
To: Jonathan Richardson <jonathar@broadcom.com>
Cc: Arun Ramamurthy <arun.ramamurthy@broadcom.com>,
Scott Branden <sbranden@broadcom.com>,
Thierry Reding <thierry.reding@gmail.com>,
Ray Jui <rjui@broadcom.com>,
Arun Ramamurthy <arunrama@broadcom.com>,
bcm-kernel-feedback-list@broadcom.com, linux-pwm@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/4] pwm: kona: Remove setting default smooth type and polarity for all channels
Date: Sat, 6 Dec 2014 15:13:19 -0800 [thread overview]
Message-ID: <CAD7vxx+zNx40TMtaJ=CjohTHr2xoH8yTT8hGTZFER1FArHaokQ@mail.gmail.com> (raw)
In-Reply-To: <5480C286.6000405@broadcom.com>
On Thu, Dec 4, 2014 at 12:22 PM, Jonathan Richardson
<jonathar@broadcom.com> wrote:
> Hi Tim,
>
> I'm going to take over this submission because I made the changes to the
> driver. Arun was filling in for me while I was on leave. Now I'm back
> and I think I can help clarify why these changes were made. A summary
> for all the changes should help.
>
> There were two problems. First was a problem caused by setting the
> polarity in probe. It caused the speaker to click when the polarity was
> set so we took that out as it didn't seem to serve any useful purpose
> that I could see. The polarity changes should be made in the polarity
> callback.
Please provide more details about your configuration.
Are you using the pwm-beeper driver with a piezo?
After a reset, all PWM output will be low until the PWM clock is
enabled at which point it will be constant high. Are you confident
that this transition is not responsible for the click you are hearing?
> The second and bigger problem was the smooth type sequence. If it isn't
> done according to the spec then one in ten or twenty times you won't
> even get a signal when it's enabled. Following the correct sequence with
> the 400 ns delays solves this problem.
Would the following minor change be sufficient to fix the issue?
diff --git a/drivers/pwm/pwm-bcm-kona.c b/drivers/pwm/pwm-bcm-kona.c
index 02bc048..c537efd 100644
--- a/drivers/pwm/pwm-bcm-kona.c
+++ b/drivers/pwm/pwm-bcm-kona.c
@@ -85,6 +85,9 @@ static void kona_pwmc_apply_settings(struct kona_pwmc *kp, uns
value &= ~(1 << PWM_CONTROL_TRIGGER_SHIFT(chan));
writel(value, kp->base + PWM_CONTROL_OFFSET);
+ ndelay(400);
+
/* Set trigger bit and clear smooth bit to apply new settings */
value &= ~(1 << PWM_CONTROL_SMOOTH_SHIFT(chan));
value |= 1 << PWM_CONTROL_TRIGGER_SHIFT(chan);
>
> Additionally, by not following the sequence you won't get a smooth
> transition. You'll get a change in the settings (duty cycle, period) but
> may get a non smooth transition. So it's important to follow the spec
> here. We don't want non-smooth transitions.
Please provide your rationale for requiring smooth transitions.
Thanks,
Tim Kryger
next prev parent reply other threads:[~2014-12-06 23:13 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Scott Branden <sbranden@broadcom.com>
2014-11-14 18:29 ` [PATCH 0/4] pwm: kona: Drivers fixes Scott Branden
2014-11-14 18:29 ` [PATCH 1/4] pwm: kona: Remove setting default smooth type and polarity for all channels Scott Branden
2014-11-14 18:29 ` [PATCH 2/4] pwm: kona: Fix incorrect enable after channel polarity change Scott Branden
2014-11-14 18:29 ` [PATCH 3/4] pwm: kona: Fix enable, disable and config procedures Scott Branden
2014-11-14 18:30 ` [PATCH 4/4] pwm: kona: Update dependency to ARCH_BCM Scott Branden
2014-11-17 12:52 ` Thierry Reding
2014-11-17 17:33 ` Scott Branden
2014-11-17 12:41 ` [PATCH 0/4] pwm: kona: Drivers fixes Thierry Reding
2014-11-25 19:40 ` [PATCH v2 " Scott Branden
2014-11-25 19:40 ` [PATCH v2 1/4] pwm: kona: Remove setting default smooth type and polarity for all channels Scott Branden
2014-11-26 5:51 ` Tim Kryger
2014-11-28 23:47 ` Arun Ramamurthy
2014-11-29 1:08 ` Tim Kryger
2014-11-29 1:19 ` Arun Ramamurthy
2014-11-29 3:19 ` Tim Kryger
2014-12-01 19:37 ` Arun Ramamurthy
2014-12-04 20:22 ` Jonathan Richardson
2014-12-06 23:13 ` Tim Kryger [this message]
2014-12-10 19:57 ` Jonathan Richardson
2014-11-25 19:40 ` [PATCH v2 2/4] pwm: kona: Fix incorrect enable after channel polarity change Scott Branden
2014-11-26 6:22 ` Tim Kryger
2014-11-28 23:48 ` Arun Ramamurthy
2014-11-29 2:02 ` Tim Kryger
2014-12-04 20:33 ` Jonathan Richardson
2014-11-25 19:40 ` [PATCH v2 3/4] pwm: kona: Fix enable, disable and config procedures Scott Branden
2014-11-26 7:29 ` Tim Kryger
2014-11-27 23:30 ` Scott Branden
2014-11-28 23:49 ` Arun Ramamurthy
2014-11-29 2:30 ` Tim Kryger
2014-12-01 19:37 ` Arun Ramamurthy
2014-12-02 4:29 ` Tim Kryger
2014-12-04 20:26 ` Jonathan Richardson
2014-11-25 19:40 ` [PATCH v2 4/4] pwm: kona: Update dependency to ARCH_BCM Scott Branden
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='CAD7vxx+zNx40TMtaJ=CjohTHr2xoH8yTT8hGTZFER1FArHaokQ@mail.gmail.com' \
--to=tim.kryger@gmail.com \
--cc=arun.ramamurthy@broadcom.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;
as well as URLs for NNTP newsgroup(s).