From c17e7da48026845d343f6443217a9896f9456e80 Mon Sep 17 00:00:00 2001 From: Eric Miao Date: Tue, 23 Nov 2010 17:00:03 +0800 Subject: [PATCH] --- yaml --- r: 225955 b: refs/heads/master c: f113fe4e844be15394edcbc32b0ec196cdd0a0ff h: refs/heads/master i: 225953: 7181a5f053cde606515ae30f9d97f50a17cc9dfe 225951: 1f2af3de50ca526bfd10b99b04eabde4e69eeaab v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-pxa/clock-pxa2xx.c | 26 ++++++++++++++++++++++++++ trunk/arch/arm/mach-pxa/clock.h | 3 +++ trunk/arch/arm/mach-pxa/pxa25x.c | 7 +++---- trunk/arch/arm/mach-pxa/pxa27x.c | 7 +++---- 5 files changed, 36 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index f562f8ee24a1..ae7818afe7e5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2a125dd56b3a853701063fe8a678ad7603e385fd +refs/heads/master: f113fe4e844be15394edcbc32b0ec196cdd0a0ff diff --git a/trunk/arch/arm/mach-pxa/clock-pxa2xx.c b/trunk/arch/arm/mach-pxa/clock-pxa2xx.c index 416b3f06efb7..66eb531ae29b 100644 --- a/trunk/arch/arm/mach-pxa/clock-pxa2xx.c +++ b/trunk/arch/arm/mach-pxa/clock-pxa2xx.c @@ -9,6 +9,7 @@ #include #include #include +#include #include @@ -28,3 +29,28 @@ const struct clkops clk_pxa2xx_cken_ops = { .enable = clk_pxa2xx_cken_enable, .disable = clk_pxa2xx_cken_disable, }; + +#ifdef CONFIG_PM +static uint32_t saved_cken; + +static int pxa2xx_clock_suspend(struct sys_device *d, pm_message_t state) +{ + saved_cken = CKEN; + return 0; +} + +static int pxa2xx_clock_resume(struct sys_device *d) +{ + CKEN = saved_cken; + return 0; +} +#else +#define pxa2xx_clock_suspend NULL +#define pxa2xx_clock_resume NULL +#endif + +struct sysdev_class pxa2xx_clock_sysclass = { + .name = "pxa2xx-clock", + .suspend = pxa2xx_clock_suspend, + .resume = pxa2xx_clock_resume, +}; diff --git a/trunk/arch/arm/mach-pxa/clock.h b/trunk/arch/arm/mach-pxa/clock.h index 04348781ad79..8ffc1d0b78e0 100644 --- a/trunk/arch/arm/mach-pxa/clock.h +++ b/trunk/arch/arm/mach-pxa/clock.h @@ -1,3 +1,4 @@ +#include #include struct clkops { @@ -53,6 +54,8 @@ extern const struct clkops clk_pxa2xx_cken_ops; void clk_pxa2xx_cken_enable(struct clk *clk); void clk_pxa2xx_cken_disable(struct clk *clk); +extern struct sysdev_class pxa2xx_clock_sysclass; + #ifdef CONFIG_PXA3xx #define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay) \ struct clk clk_##_name = { \ diff --git a/trunk/arch/arm/mach-pxa/pxa25x.c b/trunk/arch/arm/mach-pxa/pxa25x.c index 65051bb6d62c..3f5241c84894 100644 --- a/trunk/arch/arm/mach-pxa/pxa25x.c +++ b/trunk/arch/arm/mach-pxa/pxa25x.c @@ -222,20 +222,17 @@ static struct clk_lookup pxa25x_hwuart_clkreg = */ enum { SLEEP_SAVE_PSTR, - SLEEP_SAVE_CKEN, SLEEP_SAVE_COUNT }; static void pxa25x_cpu_pm_save(unsigned long *sleep_save) { - SAVE(CKEN); SAVE(PSTR); } static void pxa25x_cpu_pm_restore(unsigned long *sleep_save) { - RESTORE(CKEN); RESTORE(PSTR); } @@ -358,7 +355,9 @@ static struct sys_device pxa25x_sysdev[] = { .cls = &pxa2xx_mfp_sysclass, }, { .cls = &pxa_gpio_sysclass, - }, + }, { + .cls = &pxa2xx_clock_sysclass, + } }; static int __init pxa25x_init(void) diff --git a/trunk/arch/arm/mach-pxa/pxa27x.c b/trunk/arch/arm/mach-pxa/pxa27x.c index 6d2254b92adc..b2130b7a7b52 100644 --- a/trunk/arch/arm/mach-pxa/pxa27x.c +++ b/trunk/arch/arm/mach-pxa/pxa27x.c @@ -258,7 +258,6 @@ int __init pxa27x_set_pwrmode(unsigned int mode) */ enum { SLEEP_SAVE_PSTR, - SLEEP_SAVE_CKEN, SLEEP_SAVE_MDREFR, SLEEP_SAVE_PCFR, SLEEP_SAVE_COUNT @@ -269,7 +268,6 @@ void pxa27x_cpu_pm_save(unsigned long *sleep_save) sleep_save[SLEEP_SAVE_MDREFR] = __raw_readl(MDREFR); SAVE(PCFR); - SAVE(CKEN); SAVE(PSTR); } @@ -280,7 +278,6 @@ void pxa27x_cpu_pm_restore(unsigned long *sleep_save) PSSR = PSSR_RDH | PSSR_PH; - RESTORE(CKEN); RESTORE(PSTR); } @@ -438,7 +435,9 @@ static struct sys_device pxa27x_sysdev[] = { .cls = &pxa2xx_mfp_sysclass, }, { .cls = &pxa_gpio_sysclass, - }, + }, { + .cls = &pxa2xx_clock_sysclass, + } }; static int __init pxa27x_init(void)