summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-07-10 15:35:26 +0200
committerDaniel Lezcano <daniel.lezcano@linaro.org>2013-07-27 07:56:38 +0200
commit8025395f39c97e332362c24f7c33c86acdd4cd90 (patch)
tree4e39d88e50db21fd6b0378556022cafba7785b40 /arch
parentARM: davinci: cpuidle: Fix target residency (diff)
downloadlinux-8025395f39c97e332362c24f7c33c86acdd4cd90.tar.xz
linux-8025395f39c97e332362c24f7c33c86acdd4cd90.zip
ARM: ux500: cpuidle: Instantiate the driver from platform device
To break the dependency on the "id.h" file we move the cpuidle driver to a platform device. Now we only call the probe() on this driver if we find a corresponding platform device (which is spawned from the PRCMU MFD driver). Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-ux500/cpuidle.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/arm/mach-ux500/cpuidle.c b/arch/arm/mach-ux500/cpuidle.c
index a45dd09daed9..c0cb37c8086c 100644
--- a/arch/arm/mach-ux500/cpuidle.c
+++ b/arch/arm/mach-ux500/cpuidle.c
@@ -16,12 +16,12 @@
#include <linux/smp.h>
#include <linux/mfd/dbx500-prcmu.h>
#include <linux/platform_data/arm-ux500-pm.h>
+#include <linux/platform_device.h>
#include <asm/cpuidle.h>
#include <asm/proc-fns.h>
#include "db8500-regs.h"
-#include "id.h"
static atomic_t master = ATOMIC_INIT(0);
static DEFINE_SPINLOCK(master_lock);
@@ -113,11 +113,8 @@ static struct cpuidle_driver ux500_idle_driver = {
.state_count = 2,
};
-int __init ux500_idle_init(void)
+static int __init dbx500_cpuidle_probe(struct platform_device *pdev)
{
- if (!(cpu_is_u8500_family() || cpu_is_ux540_family()))
- return -ENODEV;
-
/* Configure wake up reasons */
prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) |
PRCMU_WAKEUP(ABB));
@@ -125,4 +122,12 @@ int __init ux500_idle_init(void)
return cpuidle_register(&ux500_idle_driver, NULL);
}
-device_initcall(ux500_idle_init);
+static struct platform_driver dbx500_cpuidle_plat_driver = {
+ .driver = {
+ .name = "cpuidle-dbx500",
+ .owner = THIS_MODULE,
+ },
+ .probe = dbx500_cpuidle_probe,
+};
+
+module_platform_driver(dbx500_cpuidle_plat_driver);