Commit d8633c1d authored by Joonyoung Shim's avatar Joonyoung Shim Committed by Kukjin Kim

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: default avatarJoonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent 8088041e
...@@ -299,6 +299,9 @@ static int s3c_pwm_probe(struct platform_device *pdev) ...@@ -299,6 +299,9 @@ static int s3c_pwm_probe(struct platform_device *pdev)
goto err_clk_tin; goto err_clk_tin;
} }
clk_enable(pwm->clk);
clk_enable(pwm->clk_div);
local_irq_save(flags); local_irq_save(flags);
tcon = __raw_readl(S3C2410_TCON); tcon = __raw_readl(S3C2410_TCON);
...@@ -326,6 +329,8 @@ static int s3c_pwm_probe(struct platform_device *pdev) ...@@ -326,6 +329,8 @@ static int s3c_pwm_probe(struct platform_device *pdev)
return 0; return 0;
err_clk_tdiv: err_clk_tdiv:
clk_disable(pwm->clk_div);
clk_disable(pwm->clk);
clk_put(pwm->clk_div); clk_put(pwm->clk_div);
err_clk_tin: err_clk_tin:
...@@ -340,6 +345,8 @@ static int __devexit s3c_pwm_remove(struct platform_device *pdev) ...@@ -340,6 +345,8 @@ static int __devexit s3c_pwm_remove(struct platform_device *pdev)
{ {
struct pwm_device *pwm = platform_get_drvdata(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_div);
clk_put(pwm->clk); clk_put(pwm->clk);
kfree(pwm); kfree(pwm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment