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>
This commit is contained in:
parent
2173fc7cb6
commit
e43ee86efb
|
@ -200,11 +200,10 @@ void rmobile_add_devices_to_domains(struct pm_domain_device data[],
|
||||||
|
|
||||||
#else /* !CONFIG_ARCH_SHMOBILE_LEGACY */
|
#else /* !CONFIG_ARCH_SHMOBILE_LEGACY */
|
||||||
|
|
||||||
static int rmobile_pd_suspend_cpu(void)
|
static int rmobile_pd_suspend_busy(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* This domain contains the CPU core and therefore it should
|
* This domain should not be turned off.
|
||||||
* only be turned off if the CPU is not in use.
|
|
||||||
*/
|
*/
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
@ -218,16 +217,6 @@ static int rmobile_pd_suspend_console(void)
|
||||||
return console_suspend_enabled ? 0 : -EBUSY;
|
return console_suspend_enabled ? 0 : -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rmobile_pd_suspend_debug(void)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* This domain contains the Coresight-ETM hardware block and
|
|
||||||
* therefore it should only be turned off if the debug module is
|
|
||||||
* not in use.
|
|
||||||
*/
|
|
||||||
return -EBUSY;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define MAX_NUM_CPU_PDS 8
|
#define MAX_NUM_CPU_PDS 8
|
||||||
|
|
||||||
static unsigned int num_cpu_pds __initdata;
|
static unsigned int num_cpu_pds __initdata;
|
||||||
|
@ -303,17 +292,26 @@ static void __init rmobile_setup_pm_domain(struct device_node *np,
|
||||||
const char *name = pd->genpd.name;
|
const char *name = pd->genpd.name;
|
||||||
|
|
||||||
if (pd_contains_cpu(np)) {
|
if (pd_contains_cpu(np)) {
|
||||||
|
/*
|
||||||
|
* This domain contains the CPU core and therefore it should
|
||||||
|
* only be turned off if the CPU is not in use.
|
||||||
|
*/
|
||||||
pr_debug("PM domain %s contains CPU\n", name);
|
pr_debug("PM domain %s contains CPU\n", name);
|
||||||
pd->gov = &pm_domain_always_on_gov;
|
pd->gov = &pm_domain_always_on_gov;
|
||||||
pd->suspend = rmobile_pd_suspend_cpu;
|
pd->suspend = rmobile_pd_suspend_busy;
|
||||||
} else if (np == console_pd) {
|
} else if (np == console_pd) {
|
||||||
pr_debug("PM domain %s contains serial console\n", name);
|
pr_debug("PM domain %s contains serial console\n", name);
|
||||||
pd->gov = &pm_domain_always_on_gov;
|
pd->gov = &pm_domain_always_on_gov;
|
||||||
pd->suspend = rmobile_pd_suspend_console;
|
pd->suspend = rmobile_pd_suspend_console;
|
||||||
} else if (np == debug_pd) {
|
} else if (np == debug_pd) {
|
||||||
|
/*
|
||||||
|
* This domain contains the Coresight-ETM hardware block and
|
||||||
|
* therefore it should only be turned off if the debug module
|
||||||
|
* is not in use.
|
||||||
|
*/
|
||||||
pr_debug("PM domain %s contains Coresight-ETM\n", name);
|
pr_debug("PM domain %s contains Coresight-ETM\n", name);
|
||||||
pd->gov = &pm_domain_always_on_gov;
|
pd->gov = &pm_domain_always_on_gov;
|
||||||
pd->suspend = rmobile_pd_suspend_debug;
|
pd->suspend = rmobile_pd_suspend_busy;
|
||||||
}
|
}
|
||||||
|
|
||||||
rmobile_init_pm_domain(pd);
|
rmobile_init_pm_domain(pd);
|
||||||
|
|
Loading…
Reference in New Issue