diff options
-rw-r--r-- | arch/arm/mach-zynq/common.c | 6 | ||||
-rw-r--r-- | drivers/cpuidle/cpuidle-zynq.c | 13 |
2 files changed, 17 insertions, 2 deletions
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index 5f252569c689..9a7bd137c8fd 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c | |||
@@ -44,6 +44,10 @@ static struct of_device_id zynq_of_bus_ids[] __initdata = { | |||
44 | {} | 44 | {} |
45 | }; | 45 | }; |
46 | 46 | ||
47 | static struct platform_device zynq_cpuidle_device = { | ||
48 | .name = "cpuidle-zynq", | ||
49 | }; | ||
50 | |||
47 | /** | 51 | /** |
48 | * zynq_init_machine - System specific initialization, intended to be | 52 | * zynq_init_machine - System specific initialization, intended to be |
49 | * called from board specific initialization. | 53 | * called from board specific initialization. |
@@ -56,6 +60,8 @@ static void __init zynq_init_machine(void) | |||
56 | l2x0_of_init(0x02060000, 0xF0F0FFFF); | 60 | l2x0_of_init(0x02060000, 0xF0F0FFFF); |
57 | 61 | ||
58 | of_platform_bus_probe(NULL, zynq_of_bus_ids, NULL); | 62 | of_platform_bus_probe(NULL, zynq_of_bus_ids, NULL); |
63 | |||
64 | platform_device_register(&zynq_cpuidle_device); | ||
59 | } | 65 | } |
60 | 66 | ||
61 | static void __init zynq_timer_init(void) | 67 | static void __init zynq_timer_init(void) |
diff --git a/drivers/cpuidle/cpuidle-zynq.c b/drivers/cpuidle/cpuidle-zynq.c index ab6c4b4ffc7b..aded75928028 100644 --- a/drivers/cpuidle/cpuidle-zynq.c +++ b/drivers/cpuidle/cpuidle-zynq.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/cpu_pm.h> | 29 | #include <linux/cpu_pm.h> |
30 | #include <linux/cpuidle.h> | 30 | #include <linux/cpuidle.h> |
31 | #include <linux/platform_device.h> | ||
31 | #include <asm/proc-fns.h> | 32 | #include <asm/proc-fns.h> |
32 | #include <asm/cpuidle.h> | 33 | #include <asm/cpuidle.h> |
33 | 34 | ||
@@ -69,11 +70,19 @@ static struct cpuidle_driver zynq_idle_driver = { | |||
69 | }; | 70 | }; |
70 | 71 | ||
71 | /* Initialize CPU idle by registering the idle states */ | 72 | /* Initialize CPU idle by registering the idle states */ |
72 | static int __init zynq_cpuidle_init(void) | 73 | static int zynq_cpuidle_probe(struct platform_device *pdev) |
73 | { | 74 | { |
74 | pr_info("Xilinx Zynq CpuIdle Driver started\n"); | 75 | pr_info("Xilinx Zynq CpuIdle Driver started\n"); |
75 | 76 | ||
76 | return cpuidle_register(&zynq_idle_driver, NULL); | 77 | return cpuidle_register(&zynq_idle_driver, NULL); |
77 | } | 78 | } |
78 | 79 | ||
79 | device_initcall(zynq_cpuidle_init); | 80 | static struct platform_driver zynq_cpuidle_driver = { |
81 | .driver = { | ||
82 | .name = "cpuidle-zynq", | ||
83 | .owner = THIS_MODULE, | ||
84 | }, | ||
85 | .probe = zynq_cpuidle_probe, | ||
86 | }; | ||
87 | |||
88 | module_platform_driver(zynq_cpuidle_driver); | ||