All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: SAMSUNG: Add clk enable/disable of pwm
@ 2011-10-25  1:21 ` Joonyoung Shim
  0 siblings, 0 replies; 24+ messages in thread
From: Joonyoung Shim @ 2011-10-25  1:21 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-samsung-soc, kgene.kim, ben-linux, kyungmin.park

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>
---
 arch/arm/plat-samsung/pwm.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-samsung/pwm.c b/arch/arm/plat-samsung/pwm.c
index f37457c..dc1185d 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)
 		goto err_clk_tin;
 	}
 
+	clk_enable(pwm->clk);
+	clk_enable(pwm->clk_div);
+
 	local_irq_save(flags);
 
 	tcon = __raw_readl(S3C2410_TCON);
@@ -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:
@@ -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);
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2011-11-04  5:01 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-25  1:21 [PATCH] ARM: SAMSUNG: Add clk enable/disable of pwm Joonyoung Shim
2011-10-25  1:21 ` Joonyoung Shim
2011-11-03  1:59 ` Kukjin Kim
2011-11-03  1:59   ` Kukjin Kim
2011-11-03  2:24   ` Joonyoung Shim
2011-11-03  2:24     ` Joonyoung Shim
2011-11-03  7:46     ` Kukjin Kim
2011-11-03  7:46       ` Kukjin Kim
2011-11-03  7:53       ` Joonyoung Shim
2011-11-03  7:53         ` Joonyoung Shim
2011-11-03  8:25         ` Kyungmin Park
2011-11-03  8:25           ` Kyungmin Park
2011-11-03  8:28           ` Kyungmin Park
2011-11-03  8:28             ` Kyungmin Park
2011-11-03  9:08             ` Kukjin Kim
2011-11-03  9:08               ` Kukjin Kim
2011-11-03  9:10               ` Russell King - ARM Linux
2011-11-03  9:10                 ` Russell King - ARM Linux
2011-11-03  9:43               ` Kyungmin Park
2011-11-03  9:43                 ` Kyungmin Park
2011-11-03 10:20               ` Joonyoung Shim
2011-11-03 10:20                 ` Joonyoung Shim
2011-11-04  5:01                 ` Kukjin Kim
2011-11-04  5:01                   ` Kukjin Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.