Commit 30fe7643 authored by Jaecheol Lee's avatar Jaecheol Lee Committed by Kukjin Kim

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: default avatarJaecheol Lee <jc.lee@samsung.com>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent 1663895c
...@@ -206,12 +206,28 @@ static cycle_t exynos4_pwm4_read(struct clocksource *cs) ...@@ -206,12 +206,28 @@ static cycle_t exynos4_pwm4_read(struct clocksource *cs)
return (cycle_t) ~__raw_readl(S3C_TIMERREG(0x40)); return (cycle_t) ~__raw_readl(S3C_TIMERREG(0x40));
} }
static void exynos4_pwm4_resume(struct clocksource *cs)
{
unsigned long pclk;
pclk = clk_get_rate(timerclk);
clk_set_rate(tdiv4, pclk / 2);
clk_set_parent(tin4, tdiv4);
exynos4_pwm_init(4, ~0);
exynos4_pwm_start(4, 1);
}
struct clocksource pwm_clocksource = { struct clocksource pwm_clocksource = {
.name = "pwm_timer4", .name = "pwm_timer4",
.rating = 250, .rating = 250,
.read = exynos4_pwm4_read, .read = exynos4_pwm4_read,
.mask = CLOCKSOURCE_MASK(32), .mask = CLOCKSOURCE_MASK(32),
.flags = CLOCK_SOURCE_IS_CONTINUOUS , .flags = CLOCK_SOURCE_IS_CONTINUOUS ,
#ifdef CONFIG_PM
.resume = exynos4_pwm4_resume,
#endif
}; };
static void __init exynos4_clocksource_init(void) static void __init exynos4_clocksource_init(void)
......
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