On Tue, Nov 25, 2014 at 11:40 AM, Scott Branden <sbranden@xxxxxxxxxxxx> wrote: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.
From: Arun Ramamurthy <arunrama@xxxxxxxxxxxx>
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.
Keep in mind that polarity matters even when a PWMThe 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.
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.
updated to reflect the requested polarity change prior to returning to
the caller.
--
Signed-off-by: Arun Ramamurthy <arunrama@xxxxxxxxxxxx>
Reviewed-by: Ray Jui <rjui@xxxxxxxxxxxx>
Signed-off-by: Scott Branden <sbranden@xxxxxxxxxxxx>
---
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