diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2013-09-27 06:47:45 -0400 |
---|---|---|
committer | Rob Herring <rob.herring@calxeda.com> | 2013-10-01 17:30:20 -0400 |
commit | 60a66e370007e8535b7a561353b07b37deaf35ba (patch) | |
tree | 30bac2353ff9dd8f72b898b3933d0b14645ca251 | |
parent | 34a5eeb202eb43f36dd39a287669e0b686ddf728 (diff) |
ARM: highbank: cpuidle: convert to platform driver
As the ux500 and the kirkwood driver, make the calxeda driver a platform driver
[Compiled only]
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
-rw-r--r-- | arch/arm/mach-highbank/highbank.c | 8 | ||||
-rw-r--r-- | drivers/cpuidle/cpuidle-calxeda.c | 18 |
2 files changed, 20 insertions, 6 deletions
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index 8e63ccdb0de3..a78ed62d6542 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/of_address.h> | 25 | #include <linux/of_address.h> |
26 | #include <linux/amba/bus.h> | 26 | #include <linux/amba/bus.h> |
27 | #include <linux/clk-provider.h> | 27 | #include <linux/clk-provider.h> |
28 | #include <linux/platform_device.h> | ||
28 | 29 | ||
29 | #include <asm/cacheflush.h> | 30 | #include <asm/cacheflush.h> |
30 | #include <asm/cputype.h> | 31 | #include <asm/cputype.h> |
@@ -153,6 +154,10 @@ static struct notifier_block highbank_platform_nb = { | |||
153 | .notifier_call = highbank_platform_notifier, | 154 | .notifier_call = highbank_platform_notifier, |
154 | }; | 155 | }; |
155 | 156 | ||
157 | static struct platform_device highbank_cpuidle_device = { | ||
158 | .name = "cpuidle-calxeda", | ||
159 | }; | ||
160 | |||
156 | static void __init highbank_init(void) | 161 | static void __init highbank_init(void) |
157 | { | 162 | { |
158 | pm_power_off = highbank_power_off; | 163 | pm_power_off = highbank_power_off; |
@@ -162,6 +167,9 @@ static void __init highbank_init(void) | |||
162 | bus_register_notifier(&amba_bustype, &highbank_amba_nb); | 167 | bus_register_notifier(&amba_bustype, &highbank_amba_nb); |
163 | 168 | ||
164 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 169 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
170 | |||
171 | if (of_machine_is_compatible("calxeda,highbank")) | ||
172 | platform_device_register(&highbank_cpuidle_device); | ||
165 | } | 173 | } |
166 | 174 | ||
167 | static const char *highbank_match[] __initconst = { | 175 | static const char *highbank_match[] __initconst = { |
diff --git a/drivers/cpuidle/cpuidle-calxeda.c b/drivers/cpuidle/cpuidle-calxeda.c index bed707ab6d6e..6d49527d4a0c 100644 --- a/drivers/cpuidle/cpuidle-calxeda.c +++ b/drivers/cpuidle/cpuidle-calxeda.c | |||
@@ -24,10 +24,10 @@ | |||
24 | #include <linux/cpu_pm.h> | 24 | #include <linux/cpu_pm.h> |
25 | #include <linux/init.h> | 25 | #include <linux/init.h> |
26 | #include <linux/io.h> | 26 | #include <linux/io.h> |
27 | #include <linux/of.h> | ||
28 | #include <linux/time.h> | 27 | #include <linux/time.h> |
29 | #include <linux/delay.h> | 28 | #include <linux/delay.h> |
30 | #include <linux/suspend.h> | 29 | #include <linux/suspend.h> |
30 | #include <linux/platform_device.h> | ||
31 | #include <asm/cpuidle.h> | 31 | #include <asm/cpuidle.h> |
32 | #include <asm/proc-fns.h> | 32 | #include <asm/proc-fns.h> |
33 | #include <asm/smp_scu.h> | 33 | #include <asm/smp_scu.h> |
@@ -92,11 +92,17 @@ static struct cpuidle_driver calxeda_idle_driver = { | |||
92 | .state_count = 2, | 92 | .state_count = 2, |
93 | }; | 93 | }; |
94 | 94 | ||
95 | static int __init calxeda_cpuidle_init(void) | 95 | static int __init calxeda_cpuidle_probe(struct platform_device *pdev) |
96 | { | 96 | { |
97 | if (!of_machine_is_compatible("calxeda,highbank")) | ||
98 | return -ENODEV; | ||
99 | |||
100 | return cpuidle_register(&calxeda_idle_driver, NULL); | 97 | return cpuidle_register(&calxeda_idle_driver, NULL); |
101 | } | 98 | } |
102 | module_init(calxeda_cpuidle_init); | 99 | |
100 | static struct platform_driver calxeda_cpuidle_plat_driver = { | ||
101 | .driver = { | ||
102 | .name = "cpuidle-calxeda", | ||
103 | .owner = THIS_MODULE, | ||
104 | }, | ||
105 | .probe = calxeda_cpuidle_probe, | ||
106 | }; | ||
107 | |||
108 | module_platform_driver(calxeda_cpuidle_plat_driver); | ||