diff options
author | Tomasz Figa <t.figa@samsung.com> | 2014-03-17 18:28:10 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2014-03-20 15:09:25 -0400 |
commit | b27899178c53226a5ff780a17657c84eb5e32338 (patch) | |
tree | 7f9072ef4258ff729173ed5b96c8673e0d37f3b4 /arch/arm/plat-samsung/include | |
parent | 72551f6cf13e2f3a1d273b7007b5d7d7fd69c554 (diff) |
ARM: SAMSUNG: Move common save/restore helpers to separate file
To separate legacy PM code from generic helpers, this patch moves the
generic register save/restore helpers to a new file called pm-common.c
that is compiled always when CONFIG_PM_SLEEP is enabled, to allow
platforms that do not want to use the legacy PM code use the generic
helpers.
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/plat-samsung/include')
-rw-r--r-- | arch/arm/plat-samsung/include/plat/pm-common.h | 26 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/pm.h | 25 |
2 files changed, 26 insertions, 25 deletions
diff --git a/arch/arm/plat-samsung/include/plat/pm-common.h b/arch/arm/plat-samsung/include/plat/pm-common.h index f72974a762bf..741723eb8cd7 100644 --- a/arch/arm/plat-samsung/include/plat/pm-common.h +++ b/arch/arm/plat-samsung/include/plat/pm-common.h | |||
@@ -13,6 +13,32 @@ | |||
13 | #ifndef __PLAT_SAMSUNG_PM_COMMON_H | 13 | #ifndef __PLAT_SAMSUNG_PM_COMMON_H |
14 | #define __PLAT_SAMSUNG_PM_COMMON_H __FILE__ | 14 | #define __PLAT_SAMSUNG_PM_COMMON_H __FILE__ |
15 | 15 | ||
16 | #include <linux/irq.h> | ||
17 | |||
18 | /* sleep save info */ | ||
19 | |||
20 | /** | ||
21 | * struct sleep_save - save information for shared peripherals. | ||
22 | * @reg: Pointer to the register to save. | ||
23 | * @val: Holder for the value saved from reg. | ||
24 | * | ||
25 | * This describes a list of registers which is used by the pm core and | ||
26 | * other subsystem to save and restore register values over suspend. | ||
27 | */ | ||
28 | struct sleep_save { | ||
29 | void __iomem *reg; | ||
30 | unsigned long val; | ||
31 | }; | ||
32 | |||
33 | #define SAVE_ITEM(x) \ | ||
34 | { .reg = (x) } | ||
35 | |||
36 | /* helper functions to save/restore lists of registers. */ | ||
37 | |||
38 | extern void s3c_pm_do_save(struct sleep_save *ptr, int count); | ||
39 | extern void s3c_pm_do_restore(const struct sleep_save *ptr, int count); | ||
40 | extern void s3c_pm_do_restore_core(const struct sleep_save *ptr, int count); | ||
41 | |||
16 | /* PM debug functions */ | 42 | /* PM debug functions */ |
17 | 43 | ||
18 | /** | 44 | /** |
diff --git a/arch/arm/plat-samsung/include/plat/pm.h b/arch/arm/plat-samsung/include/plat/pm.h index 2e04396eb3f3..4099e8d6f5f9 100644 --- a/arch/arm/plat-samsung/include/plat/pm.h +++ b/arch/arm/plat-samsung/include/plat/pm.h | |||
@@ -15,7 +15,6 @@ | |||
15 | * management | 15 | * management |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include <linux/irq.h> | ||
19 | #include <plat/pm-common.h> | 18 | #include <plat/pm-common.h> |
20 | 19 | ||
21 | struct device; | 20 | struct device; |
@@ -59,30 +58,6 @@ extern unsigned long s3c_pm_flags; | |||
59 | 58 | ||
60 | extern int s3c2410_cpu_suspend(unsigned long); | 59 | extern int s3c2410_cpu_suspend(unsigned long); |
61 | 60 | ||
62 | /* sleep save info */ | ||
63 | |||
64 | /** | ||
65 | * struct sleep_save - save information for shared peripherals. | ||
66 | * @reg: Pointer to the register to save. | ||
67 | * @val: Holder for the value saved from reg. | ||
68 | * | ||
69 | * This describes a list of registers which is used by the pm core and | ||
70 | * other subsystem to save and restore register values over suspend. | ||
71 | */ | ||
72 | struct sleep_save { | ||
73 | void __iomem *reg; | ||
74 | unsigned long val; | ||
75 | }; | ||
76 | |||
77 | #define SAVE_ITEM(x) \ | ||
78 | { .reg = (x) } | ||
79 | |||
80 | /* helper functions to save/restore lists of registers. */ | ||
81 | |||
82 | extern void s3c_pm_do_save(struct sleep_save *ptr, int count); | ||
83 | extern void s3c_pm_do_restore(const struct sleep_save *ptr, int count); | ||
84 | extern void s3c_pm_do_restore_core(const struct sleep_save *ptr, int count); | ||
85 | |||
86 | #ifdef CONFIG_SAMSUNG_PM | 61 | #ifdef CONFIG_SAMSUNG_PM |
87 | extern int s3c_irq_wake(struct irq_data *data, unsigned int state); | 62 | extern int s3c_irq_wake(struct irq_data *data, unsigned int state); |
88 | extern int s3c_irqext_wake(struct irq_data *data, unsigned int state); | 63 | extern int s3c_irqext_wake(struct irq_data *data, unsigned int state); |