diff options
author | Steven Miao <realmz6@gmail.com> | 2012-06-07 02:17:12 -0400 |
---|---|---|
committer | Bob Liu <lliubbo@gmail.com> | 2012-07-24 01:39:50 -0400 |
commit | 923680cbee19bf7be11c3ec3ad6e5c14c4aa2194 (patch) | |
tree | 5bbef34c76134c285b9ce1ecd1fecf2d76232ccb | |
parent | 5f78028b1a1764cbd479092f568efe17a18af26f (diff) |
bf60x: pm: add smc nor flash syscore ops
Signed-off-by: Steven Miao <realmz6@gmail.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
-rw-r--r-- | arch/blackfin/mach-bf609/include/mach/pm.h | 3 | ||||
-rw-r--r-- | arch/blackfin/mach-bf609/pm.c | 23 |
2 files changed, 25 insertions, 1 deletions
diff --git a/arch/blackfin/mach-bf609/include/mach/pm.h b/arch/blackfin/mach-bf609/include/mach/pm.h index 68435f9bafca..3ca0fb965636 100644 --- a/arch/blackfin/mach-bf609/include/mach/pm.h +++ b/arch/blackfin/mach-bf609/include/mach/pm.h | |||
@@ -18,4 +18,7 @@ extern void bf609_pm_finish(void); | |||
18 | void bf609_hibernate(void); | 18 | void bf609_hibernate(void); |
19 | void bfin_sec_raise_irq(unsigned int sid); | 19 | void bfin_sec_raise_irq(unsigned int sid); |
20 | void coreb_enable(void); | 20 | void coreb_enable(void); |
21 | |||
22 | int bf609_nor_flash_init(void); | ||
23 | void bf609_nor_flash_exit(void); | ||
21 | #endif | 24 | #endif |
diff --git a/arch/blackfin/mach-bf609/pm.c b/arch/blackfin/mach-bf609/pm.c index 6094c7d3b1f2..4f6977762630 100644 --- a/arch/blackfin/mach-bf609/pm.c +++ b/arch/blackfin/mach-bf609/pm.c | |||
@@ -11,8 +11,8 @@ | |||
11 | #include <linux/interrupt.h> | 11 | #include <linux/interrupt.h> |
12 | #include <linux/gpio.h> | 12 | #include <linux/gpio.h> |
13 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
14 | |||
15 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
15 | #include <linux/syscore_ops.h> | ||
16 | 16 | ||
17 | #include <asm/dpmc.h> | 17 | #include <asm/dpmc.h> |
18 | #include <asm/pm.h> | 18 | #include <asm/pm.h> |
@@ -293,6 +293,23 @@ static struct bfin_cpu_pm_fns bf609_cpu_pm = { | |||
293 | .finish = bf609_cpu_pm_finish, | 293 | .finish = bf609_cpu_pm_finish, |
294 | }; | 294 | }; |
295 | 295 | ||
296 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) | ||
297 | static void smc_pm_syscore_suspend(void) | ||
298 | { | ||
299 | bf609_nor_flash_exit(); | ||
300 | } | ||
301 | |||
302 | static void smc_pm_syscore_resume(void) | ||
303 | { | ||
304 | bf609_nor_flash_init(); | ||
305 | } | ||
306 | |||
307 | static struct syscore_ops smc_pm_syscore_ops = { | ||
308 | .suspend = smc_pm_syscore_suspend, | ||
309 | .resume = smc_pm_syscore_resume, | ||
310 | }; | ||
311 | #endif | ||
312 | |||
296 | static irqreturn_t test_isr(int irq, void *dev_id) | 313 | static irqreturn_t test_isr(int irq, void *dev_id) |
297 | { | 314 | { |
298 | printk(KERN_DEBUG "gpio irq %d\n", irq); | 315 | printk(KERN_DEBUG "gpio irq %d\n", irq); |
@@ -312,6 +329,10 @@ static int __init bf609_init_pm(void) | |||
312 | int irq; | 329 | int irq; |
313 | int error; | 330 | int error; |
314 | 331 | ||
332 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) | ||
333 | register_syscore_ops(&smc_pm_syscore_ops); | ||
334 | #endif | ||
335 | |||
315 | #ifdef CONFIG_PM_BFIN_WAKE_PE12 | 336 | #ifdef CONFIG_PM_BFIN_WAKE_PE12 |
316 | irq = gpio_to_irq(GPIO_PE12); | 337 | irq = gpio_to_irq(GPIO_PE12); |
317 | if (irq < 0) { | 338 | if (irq < 0) { |