aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos4
diff options
context:
space:
mode:
authorJaecheol Lee <jc.lee@samsung.com>2011-03-08 18:22:31 -0500
committerKukjin Kim <kgene.kim@samsung.com>2011-03-11 20:18:34 -0500
commit30fe76437bc2463b25e9a64ff1b28f293e3f3413 (patch)
treed15667b6f73d37003c50af93a1076e0c9f4b6ac6 /arch/arm/mach-exynos4
parent1663895cb434b586d022d6414f03316469cf284d (diff)
ARM: EXYNOS4: Update HRT for supporting PM
This patch updates HRT driver for supporting PM. The resume function of PWM4 timer which is used clocksource is needed when kernel is resuming for restarting. Signed-off-by: Jaecheol Lee <jc.lee@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-exynos4')
-rw-r--r--arch/arm/mach-exynos4/time.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos4/time.c b/arch/arm/mach-exynos4/time.c
index e30ac7043095..86b9fa0d3639 100644
--- a/arch/arm/mach-exynos4/time.c
+++ b/arch/arm/mach-exynos4/time.c
@@ -206,12 +206,28 @@ static cycle_t exynos4_pwm4_read(struct clocksource *cs)
206 return (cycle_t) ~__raw_readl(S3C_TIMERREG(0x40)); 206 return (cycle_t) ~__raw_readl(S3C_TIMERREG(0x40));
207} 207}
208 208
209static void exynos4_pwm4_resume(struct clocksource *cs)
210{
211 unsigned long pclk;
212
213 pclk = clk_get_rate(timerclk);
214
215 clk_set_rate(tdiv4, pclk / 2);
216 clk_set_parent(tin4, tdiv4);
217
218 exynos4_pwm_init(4, ~0);
219 exynos4_pwm_start(4, 1);
220}
221
209struct clocksource pwm_clocksource = { 222struct clocksource pwm_clocksource = {
210 .name = "pwm_timer4", 223 .name = "pwm_timer4",
211 .rating = 250, 224 .rating = 250,
212 .read = exynos4_pwm4_read, 225 .read = exynos4_pwm4_read,
213 .mask = CLOCKSOURCE_MASK(32), 226 .mask = CLOCKSOURCE_MASK(32),
214 .flags = CLOCK_SOURCE_IS_CONTINUOUS , 227 .flags = CLOCK_SOURCE_IS_CONTINUOUS ,
228#ifdef CONFIG_PM
229 .resume = exynos4_pwm4_resume,
230#endif
215}; 231};
216 232
217static void __init exynos4_clocksource_init(void) 233static void __init exynos4_clocksource_init(void)