aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-samsung/pwm.c
diff options
context:
space:
mode:
authorJoonyoung Shim <jy0922.shim@samsung.com>2011-11-03 21:39:34 -0400
committerKukjin Kim <kgene.kim@samsung.com>2011-11-06 00:53:01 -0400
commitd8633c1da161de7e0b880d919d305a97c01372f4 (patch)
tree39848e1f3c3b155e214e819faafe30ff4185149b /arch/arm/plat-samsung/pwm.c
parent8088041ee35604640760321621e3f058ea2c7061 (diff)
ARM: SAMSUNG: Add clk enable/disable of pwm
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 <jy0922.shim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/plat-samsung/pwm.c')
-rw-r--r--arch/arm/plat-samsung/pwm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/plat-samsung/pwm.c b/arch/arm/plat-samsung/pwm.c
index f37457c52064..dc1185dcf80d 100644
--- a/arch/arm/plat-samsung/pwm.c
+++ b/arch/arm/plat-samsung/pwm.c
@@ -299,6 +299,9 @@ static int s3c_pwm_probe(struct platform_device *pdev)
299 goto err_clk_tin; 299 goto err_clk_tin;
300 } 300 }
301 301
302 clk_enable(pwm->clk);
303 clk_enable(pwm->clk_div);
304
302 local_irq_save(flags); 305 local_irq_save(flags);
303 306
304 tcon = __raw_readl(S3C2410_TCON); 307 tcon = __raw_readl(S3C2410_TCON);
@@ -326,6 +329,8 @@ static int s3c_pwm_probe(struct platform_device *pdev)
326 return 0; 329 return 0;
327 330
328 err_clk_tdiv: 331 err_clk_tdiv:
332 clk_disable(pwm->clk_div);
333 clk_disable(pwm->clk);
329 clk_put(pwm->clk_div); 334 clk_put(pwm->clk_div);
330 335
331 err_clk_tin: 336 err_clk_tin:
@@ -340,6 +345,8 @@ static int __devexit s3c_pwm_remove(struct platform_device *pdev)
340{ 345{
341 struct pwm_device *pwm = platform_get_drvdata(pdev); 346 struct pwm_device *pwm = platform_get_drvdata(pdev);
342 347
348 clk_disable(pwm->clk_div);
349 clk_disable(pwm->clk);
343 clk_put(pwm->clk_div); 350 clk_put(pwm->clk_div);
344 clk_put(pwm->clk); 351 clk_put(pwm->clk);
345 kfree(pwm); 352 kfree(pwm);