Commit 54a4d1b8 authored by Gregory CLEMENT's avatar Gregory CLEMENT Committed by Jason Cooper

ARM: mvebu: make the cpuidle initialization more generic

In preparation to the addition of the cpuidle support for more SoCs,
this patch moves the Armada XP specific initialization to a separate
function.
Signed-off-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Link: https://lkml.kernel.org/r/1406120453-29291-7-git-send-email-thomas.petazzoni@free-electrons.comSigned-off-by: default avatarJason Cooper <jason@lakedaemon.net>
parent 898ef3e9
...@@ -311,31 +311,39 @@ static struct notifier_block mvebu_v7_cpu_pm_notifier = { ...@@ -311,31 +311,39 @@ static struct notifier_block mvebu_v7_cpu_pm_notifier = {
.notifier_call = mvebu_v7_cpu_pm_notify, .notifier_call = mvebu_v7_cpu_pm_notify,
}; };
static int __init mvebu_v7_cpu_pm_init(void) static int __init armada_xp_cpuidle_init(void)
{ {
struct device_node *np; struct device_node *np;
/*
* Check that all the requirements are available to enable
* cpuidle. So far, it is only supported on Armada XP, cpuidle
* needs the coherency fabric and the PMSU enabled
*/
if (!of_machine_is_compatible("marvell,armadaxp"))
return 0;
np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric"); np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric");
if (!np) if (!np)
return 0; return -ENODEV;
of_node_put(np); of_node_put(np);
mvebu_v7_cpuidle_device.dev.platform_data = armada_370_xp_cpu_suspend;
return 0;
}
static int __init mvebu_v7_cpu_pm_init(void)
{
struct device_node *np;
int ret;
np = of_find_matching_node(NULL, of_pmsu_table); np = of_find_matching_node(NULL, of_pmsu_table);
if (!np) if (!np)
return 0; return 0;
of_node_put(np); of_node_put(np);
if (of_machine_is_compatible("marvell,armadaxp"))
ret = armada_xp_cpuidle_init();
else
return 0;
if (ret)
return ret;
mvebu_v7_pmsu_enable_l2_powerdown_onidle(); mvebu_v7_pmsu_enable_l2_powerdown_onidle();
mvebu_v7_cpuidle_device.dev.platform_data = armada_370_xp_cpu_suspend;
platform_device_register(&mvebu_v7_cpuidle_device); platform_device_register(&mvebu_v7_cpuidle_device);
cpu_pm_register_notifier(&mvebu_v7_cpu_pm_notifier); cpu_pm_register_notifier(&mvebu_v7_cpu_pm_notifier);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment