diff options
author | Robert Lee <rob.lee@linaro.org> | 2012-05-21 18:50:30 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-06-05 02:53:33 -0400 |
commit | b9d18dc3a05d59894d60d5e173ebfb89a4b91bdf (patch) | |
tree | 731a683c6f0bcb538c71671012a6b7ea1ed536cc /arch/arm/mach-imx | |
parent | ccc12b32dc8c8e88a5b35f8df34ec7c80f2e10b0 (diff) |
ARM: imx: Add imx6q cpuidle driver
Add basic imx6q cpuidle driver. For now, only basic WFI state is
supported. Deeper idle states will be added in the future.
Signed-off-by: Robert Lee <rob.lee@linaro.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r-- | arch/arm/mach-imx/mach-imx6q.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index b47e98b7d539..d4ca2c470142 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c | |||
@@ -12,7 +12,9 @@ | |||
12 | 12 | ||
13 | #include <linux/clk.h> | 13 | #include <linux/clk.h> |
14 | #include <linux/clkdev.h> | 14 | #include <linux/clkdev.h> |
15 | #include <linux/cpuidle.h> | ||
15 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
17 | #include <linux/export.h> | ||
16 | #include <linux/init.h> | 18 | #include <linux/init.h> |
17 | #include <linux/io.h> | 19 | #include <linux/io.h> |
18 | #include <linux/irq.h> | 20 | #include <linux/irq.h> |
@@ -24,6 +26,7 @@ | |||
24 | #include <linux/pinctrl/machine.h> | 26 | #include <linux/pinctrl/machine.h> |
25 | #include <linux/phy.h> | 27 | #include <linux/phy.h> |
26 | #include <linux/micrel_phy.h> | 28 | #include <linux/micrel_phy.h> |
29 | #include <asm/cpuidle.h> | ||
27 | #include <asm/smp_twd.h> | 30 | #include <asm/smp_twd.h> |
28 | #include <asm/hardware/cache-l2x0.h> | 31 | #include <asm/hardware/cache-l2x0.h> |
29 | #include <asm/hardware/gic.h> | 32 | #include <asm/hardware/gic.h> |
@@ -31,8 +34,10 @@ | |||
31 | #include <asm/mach/time.h> | 34 | #include <asm/mach/time.h> |
32 | #include <asm/system_misc.h> | 35 | #include <asm/system_misc.h> |
33 | #include <mach/common.h> | 36 | #include <mach/common.h> |
37 | #include <mach/cpuidle.h> | ||
34 | #include <mach/hardware.h> | 38 | #include <mach/hardware.h> |
35 | 39 | ||
40 | |||
36 | void imx6q_restart(char mode, const char *cmd) | 41 | void imx6q_restart(char mode, const char *cmd) |
37 | { | 42 | { |
38 | struct device_node *np; | 43 | struct device_node *np; |
@@ -129,6 +134,19 @@ static void __init imx6q_init_machine(void) | |||
129 | imx6q_pm_init(); | 134 | imx6q_pm_init(); |
130 | } | 135 | } |
131 | 136 | ||
137 | static struct cpuidle_driver imx6q_cpuidle_driver = { | ||
138 | .name = "imx6q_cpuidle", | ||
139 | .owner = THIS_MODULE, | ||
140 | .en_core_tk_irqen = 1, | ||
141 | .states[0] = ARM_CPUIDLE_WFI_STATE, | ||
142 | .state_count = 1, | ||
143 | }; | ||
144 | |||
145 | static void __init imx6q_init_late(void) | ||
146 | { | ||
147 | imx_cpuidle_init(&imx6q_cpuidle_driver); | ||
148 | } | ||
149 | |||
132 | static void __init imx6q_map_io(void) | 150 | static void __init imx6q_map_io(void) |
133 | { | 151 | { |
134 | imx_lluart_map_io(); | 152 | imx_lluart_map_io(); |
@@ -186,6 +204,7 @@ DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device Tree)") | |||
186 | .handle_irq = imx6q_handle_irq, | 204 | .handle_irq = imx6q_handle_irq, |
187 | .timer = &imx6q_timer, | 205 | .timer = &imx6q_timer, |
188 | .init_machine = imx6q_init_machine, | 206 | .init_machine = imx6q_init_machine, |
207 | .init_late = imx6q_init_late, | ||
189 | .dt_compat = imx6q_dt_compat, | 208 | .dt_compat = imx6q_dt_compat, |
190 | .restart = imx6q_restart, | 209 | .restart = imx6q_restart, |
191 | MACHINE_END | 210 | MACHINE_END |