diff options
| author | Geert Uytterhoeven <geert+renesas@glider.be> | 2015-01-14 07:11:20 -0500 |
|---|---|---|
| committer | Simon Horman <horms+renesas@verge.net.au> | 2015-01-15 21:02:31 -0500 |
| commit | e43ee86efb68808c8847de17e58f5427b006363c (patch) | |
| tree | 2c278fa6985f56be231ab416bf96e10d430ff587 | |
| parent | 2173fc7cb681c38b9e5bc526211045caecf96e44 (diff) | |
ARM: shmobile: R-Mobile: Consolidate rmobile_pd_suspend_*()
Consolidate the identical rmobile_pd_suspend_*() routines that just
return -EBUSY to prevent a PM domain from being powered down into a
single rmobile_pd_suspend_busy().
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
| -rw-r--r-- | arch/arm/mach-shmobile/pm-rmobile.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c index 85a7fdd9823b..e1be4b8919ef 100644 --- a/arch/arm/mach-shmobile/pm-rmobile.c +++ b/arch/arm/mach-shmobile/pm-rmobile.c | |||
| @@ -200,11 +200,10 @@ void rmobile_add_devices_to_domains(struct pm_domain_device data[], | |||
| 200 | 200 | ||
| 201 | #else /* !CONFIG_ARCH_SHMOBILE_LEGACY */ | 201 | #else /* !CONFIG_ARCH_SHMOBILE_LEGACY */ |
| 202 | 202 | ||
| 203 | static int rmobile_pd_suspend_cpu(void) | 203 | static int rmobile_pd_suspend_busy(void) |
| 204 | { | 204 | { |
| 205 | /* | 205 | /* |
| 206 | * This domain contains the CPU core and therefore it should | 206 | * This domain should not be turned off. |
| 207 | * only be turned off if the CPU is not in use. | ||
| 208 | */ | 207 | */ |
| 209 | return -EBUSY; | 208 | return -EBUSY; |
| 210 | } | 209 | } |
| @@ -218,16 +217,6 @@ static int rmobile_pd_suspend_console(void) | |||
| 218 | return console_suspend_enabled ? 0 : -EBUSY; | 217 | return console_suspend_enabled ? 0 : -EBUSY; |
| 219 | } | 218 | } |
| 220 | 219 | ||
| 221 | static int rmobile_pd_suspend_debug(void) | ||
| 222 | { | ||
| 223 | /* | ||
| 224 | * This domain contains the Coresight-ETM hardware block and | ||
| 225 | * therefore it should only be turned off if the debug module is | ||
| 226 | * not in use. | ||
| 227 | */ | ||
| 228 | return -EBUSY; | ||
| 229 | } | ||
| 230 | |||
| 231 | #define MAX_NUM_CPU_PDS 8 | 220 | #define MAX_NUM_CPU_PDS 8 |
| 232 | 221 | ||
| 233 | static unsigned int num_cpu_pds __initdata; | 222 | static unsigned int num_cpu_pds __initdata; |
| @@ -303,17 +292,26 @@ static void __init rmobile_setup_pm_domain(struct device_node *np, | |||
| 303 | const char *name = pd->genpd.name; | 292 | const char *name = pd->genpd.name; |
| 304 | 293 | ||
| 305 | if (pd_contains_cpu(np)) { | 294 | if (pd_contains_cpu(np)) { |
| 295 | /* | ||
| 296 | * This domain contains the CPU core and therefore it should | ||
| 297 | * only be turned off if the CPU is not in use. | ||
| 298 | */ | ||
| 306 | pr_debug("PM domain %s contains CPU\n", name); | 299 | pr_debug("PM domain %s contains CPU\n", name); |
| 307 | pd->gov = &pm_domain_always_on_gov; | 300 | pd->gov = &pm_domain_always_on_gov; |
| 308 | pd->suspend = rmobile_pd_suspend_cpu; | 301 | pd->suspend = rmobile_pd_suspend_busy; |
| 309 | } else if (np == console_pd) { | 302 | } else if (np == console_pd) { |
| 310 | pr_debug("PM domain %s contains serial console\n", name); | 303 | pr_debug("PM domain %s contains serial console\n", name); |
| 311 | pd->gov = &pm_domain_always_on_gov; | 304 | pd->gov = &pm_domain_always_on_gov; |
| 312 | pd->suspend = rmobile_pd_suspend_console; | 305 | pd->suspend = rmobile_pd_suspend_console; |
| 313 | } else if (np == debug_pd) { | 306 | } else if (np == debug_pd) { |
| 307 | /* | ||
| 308 | * This domain contains the Coresight-ETM hardware block and | ||
| 309 | * therefore it should only be turned off if the debug module | ||
| 310 | * is not in use. | ||
| 311 | */ | ||
| 314 | pr_debug("PM domain %s contains Coresight-ETM\n", name); | 312 | pr_debug("PM domain %s contains Coresight-ETM\n", name); |
| 315 | pd->gov = &pm_domain_always_on_gov; | 313 | pd->gov = &pm_domain_always_on_gov; |
| 316 | pd->suspend = rmobile_pd_suspend_debug; | 314 | pd->suspend = rmobile_pd_suspend_busy; |
| 317 | } | 315 | } |
| 318 | 316 | ||
| 319 | rmobile_init_pm_domain(pd); | 317 | rmobile_init_pm_domain(pd); |
