diff options
author | Chanwoo Choi <cw00.choi@samsung.com> | 2014-07-10 18:07:32 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 12:00:13 +0900 |
commit | ded12950dfd6edb2f9a52f2ca36d0e9c253b46da (patch) | |
tree | 51c74cf481fe91a699ed2dac700f549d73a1e7c4 | |
parent | cea1c5d1a80d80e82dde98db49f94d24e070df1b (diff) | |
download | linux-3.10-ded12950dfd6edb2f9a52f2ca36d0e9c253b46da.tar.gz linux-3.10-ded12950dfd6edb2f9a52f2ca36d0e9c253b46da.tar.bz2 linux-3.10-ded12950dfd6edb2f9a52f2ca36d0e9c253b46da.zip |
rtc: s3c: Control RTC's source clock
This patch control source clock(32.768KHz) for RTC block. If source clock of RTC
is registerd on clock list of common clk framework, Exynos RTC drvier have to
control this clock.
Clock list for s3c-rtc device:
- rtc : CLK_RTC of CLK_GATE_IP_PERIR is gate clock for RTC.
- rtc_src_clk : XrtcXTI is 32.768.kHz source clock for RTC.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
-rw-r--r-- | drivers/rtc/rtc-s3c.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index 0b495e8b8e6..8fff2d9363e 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -47,6 +47,7 @@ struct s3c_rtc_drv_data { * of these rtc blocks in */ static struct clk *rtc_clk; +static struct clk *rtc_src_clk; static void __iomem *s3c_rtc_base; static int s3c_rtc_alarmno = NO_IRQ; static int s3c_rtc_tickno = NO_IRQ; @@ -425,6 +426,7 @@ static int s3c_rtc_remove(struct platform_device *dev) s3c_rtc_setaie(&dev->dev, 0); + clk_disable_unprepare(rtc_src_clk); clk_unprepare(rtc_clk); rtc_clk = NULL; @@ -483,7 +485,7 @@ static int s3c_rtc_probe(struct platform_device *pdev) rtc_clk = devm_clk_get(&pdev->dev, "rtc"); if (IS_ERR(rtc_clk)) { - dev_err(&pdev->dev, "failed to find rtc clock source\n"); + dev_err(&pdev->dev, "failed to find rtc gate clock\n"); ret = PTR_ERR(rtc_clk); rtc_clk = NULL; return ret; @@ -491,6 +493,14 @@ static int s3c_rtc_probe(struct platform_device *pdev) clk_prepare_enable(rtc_clk); + rtc_src_clk = devm_clk_get(&pdev->dev, "rtc_src_clk"); + if (IS_ERR(rtc_src_clk)) { + dev_warn(&pdev->dev, "failed to find rtc source clock\n"); + rtc_src_clk = NULL; + } + + clk_prepare_enable(rtc_src_clk); + /* check to see if everything is setup correctly */ s3c_rtc_enable(pdev, 1); @@ -568,6 +578,7 @@ static int s3c_rtc_probe(struct platform_device *pdev) err_nortc: s3c_rtc_enable(pdev, 0); + clk_disable_unprepare(rtc_src_clk); clk_disable_unprepare(rtc_clk); return ret; |