Skip to content

Commit

Permalink
ARM: SAMSUNG: Add clk enable/disable of pwm
Browse files Browse the repository at this point in the history
PWM timers use pclk("timers" clk) as parent clk. If this pclk is the
disabled state when PWM driver is probed, then it causes wrong read and
write operation about registers of PWM.

Signed-off-by: Joonyoung Shim <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: Kukjin Kim <[email protected]>
  • Loading branch information
Joonyoung Shim authored and kgene committed Nov 6, 2011
1 parent 8088041 commit d8633c1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/arm/plat-samsung/pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ static int s3c_pwm_probe(struct platform_device *pdev)
goto err_clk_tin;
}

clk_enable(pwm->clk);
clk_enable(pwm->clk_div);

local_irq_save(flags);

tcon = __raw_readl(S3C2410_TCON);
Expand Down Expand Up @@ -326,6 +329,8 @@ static int s3c_pwm_probe(struct platform_device *pdev)
return 0;

err_clk_tdiv:
clk_disable(pwm->clk_div);
clk_disable(pwm->clk);
clk_put(pwm->clk_div);

err_clk_tin:
Expand All @@ -340,6 +345,8 @@ static int __devexit s3c_pwm_remove(struct platform_device *pdev)
{
struct pwm_device *pwm = platform_get_drvdata(pdev);

clk_disable(pwm->clk_div);
clk_disable(pwm->clk);
clk_put(pwm->clk_div);
clk_put(pwm->clk);
kfree(pwm);
Expand Down

0 comments on commit d8633c1

Please sign in to comment.