diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-08-06 19:10:22 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-09-03 19:44:56 -0400 |
commit | 0d09f450b6ee2065436df9fd4e0f83f9b6d71eaa (patch) | |
tree | dc2faf2ef1b34f91f3182884a3962fa213ce8a51 /arch/arm/mach-shmobile | |
parent | 7fcb304792649e763e460c47abc4c53085bffaee (diff) |
ARM: shmobile: Add routine for automatic PM domains initialization
Add a new routine, rmobile_init_domains(), allowing the caller
to initialize all generic PM objects stored in a table in one
operation.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Magnus Damm <damm@opensource.se>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/pm-rmobile.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/pm-rmobile.c | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/include/mach/pm-rmobile.h b/arch/arm/mach-shmobile/include/mach/pm-rmobile.h index 7e2487790122..4c264c74760f 100644 --- a/arch/arm/mach-shmobile/include/mach/pm-rmobile.h +++ b/arch/arm/mach-shmobile/include/mach/pm-rmobile.h | |||
@@ -31,10 +31,12 @@ struct rmobile_pm_domain *to_rmobile_pd(struct generic_pm_domain *d) | |||
31 | 31 | ||
32 | #ifdef CONFIG_PM | 32 | #ifdef CONFIG_PM |
33 | extern void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd); | 33 | extern void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd); |
34 | extern void rmobile_init_domains(struct rmobile_pm_domain domains[], int num); | ||
34 | extern void rmobile_add_device_to_domain(const char *domain_name, | 35 | extern void rmobile_add_device_to_domain(const char *domain_name, |
35 | struct platform_device *pdev); | 36 | struct platform_device *pdev); |
36 | #else | 37 | #else |
37 | #define rmobile_init_pm_domain(pd) do { } while (0) | 38 | #define rmobile_init_pm_domain(pd) do { } while (0) |
39 | #define rmobile_init_domains(domains, num) do { } while (0) | ||
38 | #define rmobile_add_device_to_domain(name, pdev) do { } while (0) | 40 | #define rmobile_add_device_to_domain(name, pdev) do { } while (0) |
39 | #endif /* CONFIG_PM */ | 41 | #endif /* CONFIG_PM */ |
40 | 42 | ||
diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c index 6c47843c511b..4b6f2ea3169f 100644 --- a/arch/arm/mach-shmobile/pm-rmobile.c +++ b/arch/arm/mach-shmobile/pm-rmobile.c | |||
@@ -149,6 +149,14 @@ void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd) | |||
149 | __rmobile_pd_power_up(rmobile_pd, false); | 149 | __rmobile_pd_power_up(rmobile_pd, false); |
150 | } | 150 | } |
151 | 151 | ||
152 | void rmobile_init_domains(struct rmobile_pm_domain domains[], int num) | ||
153 | { | ||
154 | int j; | ||
155 | |||
156 | for (j = 0; j < num; j++) | ||
157 | rmobile_init_pm_domain(&domains[j]); | ||
158 | } | ||
159 | |||
152 | void rmobile_add_device_to_domain(const char *domain_name, | 160 | void rmobile_add_device_to_domain(const char *domain_name, |
153 | struct platform_device *pdev) | 161 | struct platform_device *pdev) |
154 | { | 162 | { |