aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/cpuidle.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91/cpuidle.c')
-rw-r--r--arch/arm/mach-at91/cpuidle.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/arch/arm/mach-at91/cpuidle.c b/arch/arm/mach-at91/cpuidle.c
index 4ec6a6d9b9be..a0774370c6bc 100644
--- a/arch/arm/mach-at91/cpuidle.c
+++ b/arch/arm/mach-at91/cpuidle.c
@@ -21,26 +21,17 @@
21#include <linux/export.h> 21#include <linux/export.h>
22#include <asm/proc-fns.h> 22#include <asm/proc-fns.h>
23#include <asm/cpuidle.h> 23#include <asm/cpuidle.h>
24#include <mach/cpu.h>
25
26#include "pm.h"
27 24
28#define AT91_MAX_STATES 2 25#define AT91_MAX_STATES 2
29 26
27static void (*at91_standby)(void);
28
30/* Actual code that puts the SoC in different idle states */ 29/* Actual code that puts the SoC in different idle states */
31static int at91_enter_idle(struct cpuidle_device *dev, 30static int at91_enter_idle(struct cpuidle_device *dev,
32 struct cpuidle_driver *drv, 31 struct cpuidle_driver *drv,
33 int index) 32 int index)
34{ 33{
35 if (cpu_is_at91rm9200()) 34 at91_standby();
36 at91rm9200_standby();
37 else if (cpu_is_at91sam9g45())
38 at91sam9g45_standby();
39 else if (cpu_is_at91sam9263())
40 at91sam9263_standby();
41 else
42 at91sam9_standby();
43
44 return index; 35 return index;
45} 36}
46 37
@@ -60,9 +51,19 @@ static struct cpuidle_driver at91_idle_driver = {
60}; 51};
61 52
62/* Initialize CPU idle by registering the idle states */ 53/* Initialize CPU idle by registering the idle states */
63static int __init at91_init_cpuidle(void) 54static int at91_cpuidle_probe(struct platform_device *dev)
64{ 55{
56 at91_standby = (void *)(dev->dev.platform_data);
57
65 return cpuidle_register(&at91_idle_driver, NULL); 58 return cpuidle_register(&at91_idle_driver, NULL);
66} 59}
67 60
68device_initcall(at91_init_cpuidle); 61static struct platform_driver at91_cpuidle_driver = {
62 .driver = {
63 .name = "cpuidle-at91",
64 .owner = THIS_MODULE,
65 },
66 .probe = at91_cpuidle_probe,
67};
68
69module_platform_driver(at91_cpuidle_driver);