From: Arun Ramamurthy <arun.ramamurthy@broadcom.com>
To: Tim Kryger <tim.kryger@gmail.com>, Scott Branden <sbranden@broadcom.com>
Cc: 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 2/4] pwm: kona: Fix incorrect enable after channel polarity change
Date: Fri, 28 Nov 2014 15:48:00 -0800 [thread overview]
Message-ID: <547909B0.2090408@broadcom.com> (raw)
In-Reply-To: <CAD7vxxKgcu9QLY8qH8WR0b_5WBu+MNxcemmZ8syYa__JaC6tsQ@mail.gmail.com>
On 14-11-25 10:22 PM, Tim Kryger wrote:
> On Tue, Nov 25, 2014 at 11:40 AM, Scott Branden <sbranden@broadcom.com> wrote:
>> From: Arun Ramamurthy <arunrama@broadcom.com>
>>
>> The pwm core code requires a separate call for enabling the channel
>> and hence the driver does not need to set pwm_trigger after a
>> polarity change
>
> The framework does restrict when polarity changes can occur but it
> isn't clear to me that there is any reason to delay applying the
> polarity change.
I examined several other drivers such as pwm-atmel-tcb.c, pwm-ep93xx.c,
pwm-renesas-tpu.c, pwm-samsung.c in the 3.17 kernel tree and none of
them enable the channel after changing polarity. We would be the first
driver to do so.
> Keep in mind that polarity matters even when a PWM
> is disabled. While disabled, the output should be equivalent to an
> enabled configuration with zero duty. Thus for normal polarity the
> output is constant low and for inversed polarity the output is
> constant high.
The driver does set the duty cycle to zero when disabling the pwm
channel.However since the frame work prevents polarity change when the
pwm is enabled, I don’t see how one could expect the polarity change to
be reflected immediately without a separate call to pwm enable.
I believe there is an expectation that the output is
> updated to reflect the requested polarity change prior to returning to
> the caller.
Once again I disagree with this based on other pwm drivers which only
change the polarity and do not enable the channel when their set
polarity functions are called.
>
>>
>> Signed-off-by: Arun Ramamurthy <arunrama@broadcom.com>
>> Reviewed-by: Ray Jui <rjui@broadcom.com>
>> Signed-off-by: Scott Branden <sbranden@broadcom.com>
>> ---
>> drivers/pwm/pwm-bcm-kona.c | 5 -----
>> 1 file changed, 5 deletions(-)
>>
>> diff --git a/drivers/pwm/pwm-bcm-kona.c b/drivers/pwm/pwm-bcm-kona.c
>> index 29eef9e..fa0b5bf 100644
>> --- a/drivers/pwm/pwm-bcm-kona.c
>> +++ b/drivers/pwm/pwm-bcm-kona.c
>> @@ -173,11 +173,6 @@ static int kona_pwmc_set_polarity(struct pwm_chip *chip, struct pwm_device *pwm,
>>
>> writel(value, kp->base + PWM_CONTROL_OFFSET);
>>
>> - kona_pwmc_apply_settings(kp, chan);
>> -
>> - /* Wait for waveform to settle before gating off the clock */
>> - ndelay(400);
>> -
>> clk_disable_unprepare(kp->clk);
>>
>> return 0;
>> --
>> 2.1.3
>>
next prev parent reply other threads:[~2014-11-28 23:48 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
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 [this message]
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=547909B0.2090408@broadcom.com \
--to=arun.ramamurthy@broadcom.com \
--cc=arunrama@broadcom.com \
--cc=bcm-kernel-feedback-list@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 \
--cc=tim.kryger@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).