diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-04-27 19:54:49 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-04-27 19:54:49 -0400 |
commit | e4f5a3adc454745fea35f1c312e14cbeba6e0ea4 (patch) | |
tree | 7dae08f7d3466fcf158808784ec3b706e6cafec6 /arch/arm/mach-imx/cpuidle-imx6q.c | |
parent | ae6208301e1e37a203fab817b59279a0f5d774c6 (diff) | |
parent | a8e39c35b5d09598e129aa9b5e6f35aa3a1915d9 (diff) |
Merge branch 'pm-cpuidle'
* pm-cpuidle: (51 commits)
cpuidle: add maintainer entry
ARM: s3c64xx: cpuidle: use init/exit common routine
SH: cpuidle: use init/exit common routine
cpuidle: fix comment format
ARM: imx: cpuidle: use init/exit common routine
ARM: davinci: cpuidle: use init/exit common routine
ARM: kirkwood: cpuidle: use init/exit common routine
ARM: calxeda: cpuidle: use init/exit common routine
ARM: tegra: cpuidle: use init/exit common routine for tegra3
ARM: tegra: cpuidle: use init/exit common routine for tegra2
ARM: OMAP4: cpuidle: use init/exit common routine
ARM: shmobile: cpuidle: use init/exit common routine
ARM: tegra: cpuidle: use init/exit common routine
ARM: OMAP3: cpuidle: use init/exit common routine
ARM: at91: cpuidle: use init/exit common routine
ARM: ux500: cpuidle: use init/exit common routine
cpuidle: make a single register function for all
ARM: ux500: cpuidle: replace for_each_online_cpu by for_each_possible_cpu
cpuidle: remove en_core_tk_irqen flag
ARM: OMAP3: remove cpuidle_wrap_enter
...
Diffstat (limited to 'arch/arm/mach-imx/cpuidle-imx6q.c')
-rw-r--r-- | arch/arm/mach-imx/cpuidle-imx6q.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/arch/arm/mach-imx/cpuidle-imx6q.c b/arch/arm/mach-imx/cpuidle-imx6q.c index d533e2695f0e..23ddfb693b2d 100644 --- a/arch/arm/mach-imx/cpuidle-imx6q.c +++ b/arch/arm/mach-imx/cpuidle-imx6q.c | |||
@@ -6,7 +6,6 @@ | |||
6 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/clockchips.h> | ||
10 | #include <linux/cpuidle.h> | 9 | #include <linux/cpuidle.h> |
11 | #include <linux/module.h> | 10 | #include <linux/module.h> |
12 | #include <asm/cpuidle.h> | 11 | #include <asm/cpuidle.h> |
@@ -21,10 +20,6 @@ static DEFINE_SPINLOCK(master_lock); | |||
21 | static int imx6q_enter_wait(struct cpuidle_device *dev, | 20 | static int imx6q_enter_wait(struct cpuidle_device *dev, |
22 | struct cpuidle_driver *drv, int index) | 21 | struct cpuidle_driver *drv, int index) |
23 | { | 22 | { |
24 | int cpu = dev->cpu; | ||
25 | |||
26 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu); | ||
27 | |||
28 | if (atomic_inc_return(&master) == num_online_cpus()) { | 23 | if (atomic_inc_return(&master) == num_online_cpus()) { |
29 | /* | 24 | /* |
30 | * With this lock, we prevent other cpu to exit and enter | 25 | * With this lock, we prevent other cpu to exit and enter |
@@ -43,26 +38,13 @@ idle: | |||
43 | cpu_do_idle(); | 38 | cpu_do_idle(); |
44 | done: | 39 | done: |
45 | atomic_dec(&master); | 40 | atomic_dec(&master); |
46 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu); | ||
47 | 41 | ||
48 | return index; | 42 | return index; |
49 | } | 43 | } |
50 | 44 | ||
51 | /* | ||
52 | * For each cpu, setup the broadcast timer because local timer | ||
53 | * stops for the states other than WFI. | ||
54 | */ | ||
55 | static void imx6q_setup_broadcast_timer(void *arg) | ||
56 | { | ||
57 | int cpu = smp_processor_id(); | ||
58 | |||
59 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu); | ||
60 | } | ||
61 | |||
62 | static struct cpuidle_driver imx6q_cpuidle_driver = { | 45 | static struct cpuidle_driver imx6q_cpuidle_driver = { |
63 | .name = "imx6q_cpuidle", | 46 | .name = "imx6q_cpuidle", |
64 | .owner = THIS_MODULE, | 47 | .owner = THIS_MODULE, |
65 | .en_core_tk_irqen = 1, | ||
66 | .states = { | 48 | .states = { |
67 | /* WFI */ | 49 | /* WFI */ |
68 | ARM_CPUIDLE_WFI_STATE, | 50 | ARM_CPUIDLE_WFI_STATE, |
@@ -70,7 +52,8 @@ static struct cpuidle_driver imx6q_cpuidle_driver = { | |||
70 | { | 52 | { |
71 | .exit_latency = 50, | 53 | .exit_latency = 50, |
72 | .target_residency = 75, | 54 | .target_residency = 75, |
73 | .flags = CPUIDLE_FLAG_TIME_VALID, | 55 | .flags = CPUIDLE_FLAG_TIME_VALID | |
56 | CPUIDLE_FLAG_TIMER_STOP, | ||
74 | .enter = imx6q_enter_wait, | 57 | .enter = imx6q_enter_wait, |
75 | .name = "WAIT", | 58 | .name = "WAIT", |
76 | .desc = "Clock off", | 59 | .desc = "Clock off", |
@@ -88,8 +71,5 @@ int __init imx6q_cpuidle_init(void) | |||
88 | /* Set chicken bit to get a reliable WAIT mode support */ | 71 | /* Set chicken bit to get a reliable WAIT mode support */ |
89 | imx6q_set_chicken_bit(); | 72 | imx6q_set_chicken_bit(); |
90 | 73 | ||
91 | /* Configure the broadcast timer on each cpu */ | 74 | return cpuidle_register(&imx6q_cpuidle_driver, NULL); |
92 | on_each_cpu(imx6q_setup_broadcast_timer, NULL, 1); | ||
93 | |||
94 | return imx_cpuidle_init(&imx6q_cpuidle_driver); | ||
95 | } | 75 | } |