diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2013-07-10 09:35:26 -0400 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2013-07-27 01:56:38 -0400 |
commit | 8025395f39c97e332362c24f7c33c86acdd4cd90 (patch) | |
tree | 4e39d88e50db21fd6b0378556022cafba7785b40 /arch/arm/mach-ux500/cpuidle.c | |
parent | 7006b8a1facc5dcafb2afa27a1209d924f99a2eb (diff) |
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/arm/mach-ux500/cpuidle.c')
-rw-r--r-- | arch/arm/mach-ux500/cpuidle.c | 17 |
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 @@ | |||
16 | #include <linux/smp.h> | 16 | #include <linux/smp.h> |
17 | #include <linux/mfd/dbx500-prcmu.h> | 17 | #include <linux/mfd/dbx500-prcmu.h> |
18 | #include <linux/platform_data/arm-ux500-pm.h> | 18 | #include <linux/platform_data/arm-ux500-pm.h> |
19 | #include <linux/platform_device.h> | ||
19 | 20 | ||
20 | #include <asm/cpuidle.h> | 21 | #include <asm/cpuidle.h> |
21 | #include <asm/proc-fns.h> | 22 | #include <asm/proc-fns.h> |
22 | 23 | ||
23 | #include "db8500-regs.h" | 24 | #include "db8500-regs.h" |
24 | #include "id.h" | ||
25 | 25 | ||
26 | static atomic_t master = ATOMIC_INIT(0); | 26 | static atomic_t master = ATOMIC_INIT(0); |
27 | static DEFINE_SPINLOCK(master_lock); | 27 | static DEFINE_SPINLOCK(master_lock); |
@@ -113,11 +113,8 @@ static struct cpuidle_driver ux500_idle_driver = { | |||
113 | .state_count = 2, | 113 | .state_count = 2, |
114 | }; | 114 | }; |
115 | 115 | ||
116 | int __init ux500_idle_init(void) | 116 | static int __init dbx500_cpuidle_probe(struct platform_device *pdev) |
117 | { | 117 | { |
118 | if (!(cpu_is_u8500_family() || cpu_is_ux540_family())) | ||
119 | return -ENODEV; | ||
120 | |||
121 | /* Configure wake up reasons */ | 118 | /* Configure wake up reasons */ |
122 | prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) | | 119 | prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) | |
123 | PRCMU_WAKEUP(ABB)); | 120 | PRCMU_WAKEUP(ABB)); |
@@ -125,4 +122,12 @@ int __init ux500_idle_init(void) | |||
125 | return cpuidle_register(&ux500_idle_driver, NULL); | 122 | return cpuidle_register(&ux500_idle_driver, NULL); |
126 | } | 123 | } |
127 | 124 | ||
128 | device_initcall(ux500_idle_init); | 125 | static struct platform_driver dbx500_cpuidle_plat_driver = { |
126 | .driver = { | ||
127 | .name = "cpuidle-dbx500", | ||
128 | .owner = THIS_MODULE, | ||
129 | }, | ||
130 | .probe = dbx500_cpuidle_probe, | ||
131 | }; | ||
132 | |||
133 | module_platform_driver(dbx500_cpuidle_plat_driver); | ||