aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-07 15:31:21 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-07 15:31:21 -0400
commitac9f1cc2ce1a178696763444f2a2f8a0ec661772 (patch)
treee3817e926e50f80cc1b707733d694ec3517dfc4a
parent494b2449671a8fe7f2470ed6610520a2e19d1e2e (diff)
parent35baa3369d1c68921b37af64495f63933850ad80 (diff)
Merge back earlier cpuidle material for v3.13.
-rw-r--r--arch/arm/mach-exynos/common.c11
-rw-r--r--arch/arm/mach-exynos/common.h1
-rw-r--r--arch/arm/mach-exynos/cpuidle.c14
-rw-r--r--arch/arm/mach-exynos/mach-exynos4-dt.c2
-rw-r--r--arch/arm/mach-exynos/mach-exynos5-dt.c2
-rw-r--r--drivers/idle/intel_idle.c16
6 files changed, 36 insertions, 10 deletions
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index ba95e5db2501..c17407b16d7c 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -30,6 +30,7 @@
30#include <linux/clk-provider.h> 30#include <linux/clk-provider.h>
31#include <linux/irqchip/arm-gic.h> 31#include <linux/irqchip/arm-gic.h>
32#include <linux/irqchip/chained_irq.h> 32#include <linux/irqchip/chained_irq.h>
33#include <linux/platform_device.h>
33 34
34#include <asm/proc-fns.h> 35#include <asm/proc-fns.h>
35#include <asm/exception.h> 36#include <asm/exception.h>
@@ -294,6 +295,16 @@ void exynos5_restart(enum reboot_mode mode, const char *cmd)
294 __raw_writel(val, addr); 295 __raw_writel(val, addr);
295} 296}
296 297
298static struct platform_device exynos_cpuidle = {
299 .name = "exynos_cpuidle",
300 .id = -1,
301};
302
303void __init exynos_cpuidle_init(void)
304{
305 platform_device_register(&exynos_cpuidle);
306}
307
297void __init exynos_init_late(void) 308void __init exynos_init_late(void)
298{ 309{
299 if (of_machine_is_compatible("samsung,exynos5440")) 310 if (of_machine_is_compatible("samsung,exynos5440"))
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 8646a141ae46..b2ac1885d381 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -22,6 +22,7 @@ struct map_desc;
22void exynos_init_io(void); 22void exynos_init_io(void);
23void exynos4_restart(enum reboot_mode mode, const char *cmd); 23void exynos4_restart(enum reboot_mode mode, const char *cmd);
24void exynos5_restart(enum reboot_mode mode, const char *cmd); 24void exynos5_restart(enum reboot_mode mode, const char *cmd);
25void exynos_cpuidle_init(void);
25void exynos_init_late(void); 26void exynos_init_late(void);
26 27
27void exynos_firmware_init(void); 28void exynos_firmware_init(void);
diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c
index ac139226d63c..1bde6ad07d93 100644
--- a/arch/arm/mach-exynos/cpuidle.c
+++ b/arch/arm/mach-exynos/cpuidle.c
@@ -15,6 +15,7 @@
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/export.h> 16#include <linux/export.h>
17#include <linux/time.h> 17#include <linux/time.h>
18#include <linux/platform_device.h>
18 19
19#include <asm/proc-fns.h> 20#include <asm/proc-fns.h>
20#include <asm/smp_scu.h> 21#include <asm/smp_scu.h>
@@ -192,7 +193,7 @@ static void __init exynos5_core_down_clk(void)
192 __raw_writel(tmp, EXYNOS5_PWR_CTRL2); 193 __raw_writel(tmp, EXYNOS5_PWR_CTRL2);
193} 194}
194 195
195static int __init exynos4_init_cpuidle(void) 196static int __init exynos_cpuidle_probe(struct platform_device *pdev)
196{ 197{
197 int cpu_id, ret; 198 int cpu_id, ret;
198 struct cpuidle_device *device; 199 struct cpuidle_device *device;
@@ -226,4 +227,13 @@ static int __init exynos4_init_cpuidle(void)
226 227
227 return 0; 228 return 0;
228} 229}
229device_initcall(exynos4_init_cpuidle); 230
231static struct platform_driver exynos_cpuidle_driver = {
232 .probe = exynos_cpuidle_probe,
233 .driver = {
234 .name = "exynos_cpuidle",
235 .owner = THIS_MODULE,
236 },
237};
238
239module_platform_driver(exynos_cpuidle_driver);
diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c
index 0099c6c13bba..53a3dc37a730 100644
--- a/arch/arm/mach-exynos/mach-exynos4-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos4-dt.c
@@ -25,6 +25,8 @@
25 25
26static void __init exynos4_dt_machine_init(void) 26static void __init exynos4_dt_machine_init(void)
27{ 27{
28 exynos_cpuidle_init();
29
28 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 30 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
29} 31}
30 32
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c
index f874b773ca13..c9f7dd1cdc8f 100644
--- a/arch/arm/mach-exynos/mach-exynos5-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
@@ -47,6 +47,8 @@ static void __init exynos5_dt_machine_init(void)
47 } 47 }
48 } 48 }
49 49
50 exynos_cpuidle_init();
51
50 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 52 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
51} 53}
52 54
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index fa6964d8681a..33e599ebbe96 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -123,7 +123,7 @@ static struct cpuidle_state *cpuidle_state_table;
123 * which is also the index into the MWAIT hint array. 123 * which is also the index into the MWAIT hint array.
124 * Thus C0 is a dummy. 124 * Thus C0 is a dummy.
125 */ 125 */
126static struct cpuidle_state nehalem_cstates[CPUIDLE_STATE_MAX] = { 126static struct cpuidle_state nehalem_cstates[] __initdata = {
127 { 127 {
128 .name = "C1-NHM", 128 .name = "C1-NHM",
129 .desc = "MWAIT 0x00", 129 .desc = "MWAIT 0x00",
@@ -156,7 +156,7 @@ static struct cpuidle_state nehalem_cstates[CPUIDLE_STATE_MAX] = {
156 .enter = NULL } 156 .enter = NULL }
157}; 157};
158 158
159static struct cpuidle_state snb_cstates[CPUIDLE_STATE_MAX] = { 159static struct cpuidle_state snb_cstates[] __initdata = {
160 { 160 {
161 .name = "C1-SNB", 161 .name = "C1-SNB",
162 .desc = "MWAIT 0x00", 162 .desc = "MWAIT 0x00",
@@ -196,7 +196,7 @@ static struct cpuidle_state snb_cstates[CPUIDLE_STATE_MAX] = {
196 .enter = NULL } 196 .enter = NULL }
197}; 197};
198 198
199static struct cpuidle_state ivb_cstates[CPUIDLE_STATE_MAX] = { 199static struct cpuidle_state ivb_cstates[] __initdata = {
200 { 200 {
201 .name = "C1-IVB", 201 .name = "C1-IVB",
202 .desc = "MWAIT 0x00", 202 .desc = "MWAIT 0x00",
@@ -236,7 +236,7 @@ static struct cpuidle_state ivb_cstates[CPUIDLE_STATE_MAX] = {
236 .enter = NULL } 236 .enter = NULL }
237}; 237};
238 238
239static struct cpuidle_state hsw_cstates[CPUIDLE_STATE_MAX] = { 239static struct cpuidle_state hsw_cstates[] __initdata = {
240 { 240 {
241 .name = "C1-HSW", 241 .name = "C1-HSW",
242 .desc = "MWAIT 0x00", 242 .desc = "MWAIT 0x00",
@@ -297,7 +297,7 @@ static struct cpuidle_state hsw_cstates[CPUIDLE_STATE_MAX] = {
297 .enter = NULL } 297 .enter = NULL }
298}; 298};
299 299
300static struct cpuidle_state atom_cstates[CPUIDLE_STATE_MAX] = { 300static struct cpuidle_state atom_cstates[] __initdata = {
301 { 301 {
302 .name = "C1E-ATM", 302 .name = "C1E-ATM",
303 .desc = "MWAIT 0x00", 303 .desc = "MWAIT 0x00",
@@ -490,7 +490,7 @@ MODULE_DEVICE_TABLE(x86cpu, intel_idle_ids);
490/* 490/*
491 * intel_idle_probe() 491 * intel_idle_probe()
492 */ 492 */
493static int intel_idle_probe(void) 493static int __init intel_idle_probe(void)
494{ 494{
495 unsigned int eax, ebx, ecx; 495 unsigned int eax, ebx, ecx;
496 const struct x86_cpu_id *id; 496 const struct x86_cpu_id *id;
@@ -558,7 +558,7 @@ static void intel_idle_cpuidle_devices_uninit(void)
558 * intel_idle_cpuidle_driver_init() 558 * intel_idle_cpuidle_driver_init()
559 * allocate, initialize cpuidle_states 559 * allocate, initialize cpuidle_states
560 */ 560 */
561static int intel_idle_cpuidle_driver_init(void) 561static int __init intel_idle_cpuidle_driver_init(void)
562{ 562{
563 int cstate; 563 int cstate;
564 struct cpuidle_driver *drv = &intel_idle_driver; 564 struct cpuidle_driver *drv = &intel_idle_driver;
@@ -628,7 +628,7 @@ static int intel_idle_cpu_init(int cpu)
628 int num_substates, mwait_hint, mwait_cstate, mwait_substate; 628 int num_substates, mwait_hint, mwait_cstate, mwait_substate;
629 629
630 if (cpuidle_state_table[cstate].enter == NULL) 630 if (cpuidle_state_table[cstate].enter == NULL)
631 continue; 631 break;
632 632
633 if (cstate + 1 > max_cstate) { 633 if (cstate + 1 > max_cstate) {
634 printk(PREFIX "max_cstate %d reached\n", max_cstate); 634 printk(PREFIX "max_cstate %d reached\n", max_cstate);