diff options
Diffstat (limited to 'drivers/cpuidle/cpuidle-kirkwood.c')
-rw-r--r-- | drivers/cpuidle/cpuidle-kirkwood.c | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/drivers/cpuidle/cpuidle-kirkwood.c b/drivers/cpuidle/cpuidle-kirkwood.c index 670aa1e55cd6..521b0a7fdd89 100644 --- a/drivers/cpuidle/cpuidle-kirkwood.c +++ b/drivers/cpuidle/cpuidle-kirkwood.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/mach-kirkwood/cpuidle.c | ||
3 | * | ||
4 | * CPU idle Marvell Kirkwood SoCs | 2 | * CPU idle Marvell Kirkwood SoCs |
5 | * | 3 | * |
6 | * This file is licensed under the terms of the GNU General Public | 4 | * This file is licensed under the terms of the GNU General Public |
@@ -11,6 +9,9 @@ | |||
11 | * to implement two idle states - | 9 | * to implement two idle states - |
12 | * #1 wait-for-interrupt | 10 | * #1 wait-for-interrupt |
13 | * #2 wait-for-interrupt and DDR self refresh | 11 | * #2 wait-for-interrupt and DDR self refresh |
12 | * | ||
13 | * Maintainer: Jason Cooper <jason@lakedaemon.net> | ||
14 | * Maintainer: Andrew Lunn <andrew@lunn.ch> | ||
14 | */ | 15 | */ |
15 | 16 | ||
16 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
@@ -41,7 +42,6 @@ static int kirkwood_enter_idle(struct cpuidle_device *dev, | |||
41 | static struct cpuidle_driver kirkwood_idle_driver = { | 42 | static struct cpuidle_driver kirkwood_idle_driver = { |
42 | .name = "kirkwood_idle", | 43 | .name = "kirkwood_idle", |
43 | .owner = THIS_MODULE, | 44 | .owner = THIS_MODULE, |
44 | .en_core_tk_irqen = 1, | ||
45 | .states[0] = ARM_CPUIDLE_WFI_STATE, | 45 | .states[0] = ARM_CPUIDLE_WFI_STATE, |
46 | .states[1] = { | 46 | .states[1] = { |
47 | .enter = kirkwood_enter_idle, | 47 | .enter = kirkwood_enter_idle, |
@@ -53,9 +53,6 @@ static struct cpuidle_driver kirkwood_idle_driver = { | |||
53 | }, | 53 | }, |
54 | .state_count = KIRKWOOD_MAX_STATES, | 54 | .state_count = KIRKWOOD_MAX_STATES, |
55 | }; | 55 | }; |
56 | static struct cpuidle_device *device; | ||
57 | |||
58 | static DEFINE_PER_CPU(struct cpuidle_device, kirkwood_cpuidle_device); | ||
59 | 56 | ||
60 | /* Initialize CPU idle by registering the idle states */ | 57 | /* Initialize CPU idle by registering the idle states */ |
61 | static int kirkwood_cpuidle_probe(struct platform_device *pdev) | 58 | static int kirkwood_cpuidle_probe(struct platform_device *pdev) |
@@ -66,26 +63,16 @@ static int kirkwood_cpuidle_probe(struct platform_device *pdev) | |||
66 | if (res == NULL) | 63 | if (res == NULL) |
67 | return -EINVAL; | 64 | return -EINVAL; |
68 | 65 | ||
69 | ddr_operation_base = devm_request_and_ioremap(&pdev->dev, res); | 66 | ddr_operation_base = devm_ioremap_resource(&pdev->dev, res); |
70 | if (!ddr_operation_base) | 67 | if (IS_ERR(ddr_operation_base)) |
71 | return -EADDRNOTAVAIL; | 68 | return PTR_ERR(ddr_operation_base); |
72 | 69 | ||
73 | device = &per_cpu(kirkwood_cpuidle_device, smp_processor_id()); | 70 | return cpuidle_register(&kirkwood_idle_driver, NULL); |
74 | device->state_count = KIRKWOOD_MAX_STATES; | ||
75 | |||
76 | cpuidle_register_driver(&kirkwood_idle_driver); | ||
77 | if (cpuidle_register_device(device)) { | ||
78 | pr_err("kirkwood_init_cpuidle: Failed registering\n"); | ||
79 | return -EIO; | ||
80 | } | ||
81 | return 0; | ||
82 | } | 71 | } |
83 | 72 | ||
84 | int kirkwood_cpuidle_remove(struct platform_device *pdev) | 73 | int kirkwood_cpuidle_remove(struct platform_device *pdev) |
85 | { | 74 | { |
86 | cpuidle_unregister_device(device); | 75 | cpuidle_unregister(&kirkwood_idle_driver); |
87 | cpuidle_unregister_driver(&kirkwood_idle_driver); | ||
88 | |||
89 | return 0; | 76 | return 0; |
90 | } | 77 | } |
91 | 78 | ||