lkml.org 
[lkml]   [2012]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] pwm: pwm-tiecap: Disable APWM mode after configure
Date
Hi Thierry,

If you do not have any comments, could you please accept it?

Thanks
Avinash

On Thu, Aug 23, 2012 at 12:29:46, Philip, Avinash wrote:
> APWM mode is enabled while configuring PWM device. This was done to
> handle shadow & immediate mode update of period and compare registers.
> However, leaving it enabled after configuring will cause APWM output on
> PWM pin even before enabling PWM device.
> Fix the same by disabling APWM mode after configuring if PWM device is
> not running.
>
> Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
> ---
> :100644 100644 0b66d0f... 4b66889... M drivers/pwm/pwm-tiecap.c
> drivers/pwm/pwm-tiecap.c | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/pwm/pwm-tiecap.c b/drivers/pwm/pwm-tiecap.c
> index 0b66d0f..4b66889 100644
> --- a/drivers/pwm/pwm-tiecap.c
> +++ b/drivers/pwm/pwm-tiecap.c
> @@ -100,6 +100,13 @@ static int ecap_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
> writel(period_cycles, pc->mmio_base + CAP3);
> }
>
> + if (!test_bit(PWMF_ENABLED, &pwm->flags)) {
> + reg_val = readw(pc->mmio_base + ECCTL2);
> + /* Disable APWM mode to put APWM output Low */
> + reg_val &= ~ECCTL2_APWM_MODE;
> + writew(reg_val, pc->mmio_base + ECCTL2);
> + }
> +
> pm_runtime_put_sync(pc->chip.dev);
> return 0;
> }
> --
> 1.7.1
>
>



\
 
 \ /
  Last update: 2012-09-06 09:22    [W:3.734 / U:0.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site