aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2012-12-04 09:55:14 -0500
committerShawn Guo <shawn.guo@linaro.org>2013-01-30 08:08:42 -0500
commit12bb344074cfc50482121c76571e3cda07c4bc09 (patch)
tree7edee0ab4514e32267ae96f641040a75037924c1 /arch/arm/mach-imx
parent485863b8fa02d515e48ce6b59f01d62172d2fe0d (diff)
ARM: imx: move imx6q_cpuidle_driver into a separate file
Move imx6q_cpuidle_driver into a separate file as more codes will be added when WAIT mode gets implemented as cpuidle. Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/Makefile6
-rw-r--r--arch/arm/mach-imx/cpuidle-imx6q.c26
-rw-r--r--arch/arm/mach-imx/cpuidle.h5
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c12
4 files changed, 37 insertions, 12 deletions
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 240e0294c372..c4ce0906d76a 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -28,7 +28,11 @@ obj-$(CONFIG_MXC_ULPI) += ulpi.o
28obj-$(CONFIG_MXC_USE_EPIT) += epit.o 28obj-$(CONFIG_MXC_USE_EPIT) += epit.o
29obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o 29obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o
30obj-$(CONFIG_CPU_FREQ_IMX) += cpufreq.o 30obj-$(CONFIG_CPU_FREQ_IMX) += cpufreq.o
31obj-$(CONFIG_CPU_IDLE) += cpuidle.o 31
32ifeq ($(CONFIG_CPU_IDLE),y)
33obj-y += cpuidle.o
34obj-$(CONFIG_SOC_IMX6Q) += cpuidle-imx6q.o
35endif
32 36
33ifdef CONFIG_SND_IMX_SOC 37ifdef CONFIG_SND_IMX_SOC
34obj-y += ssi-fiq.o 38obj-y += ssi-fiq.o
diff --git a/arch/arm/mach-imx/cpuidle-imx6q.c b/arch/arm/mach-imx/cpuidle-imx6q.c
new file mode 100644
index 000000000000..83facc97b5da
--- /dev/null
+++ b/arch/arm/mach-imx/cpuidle-imx6q.c
@@ -0,0 +1,26 @@
1/*
2 * Copyright (C) 2012 Freescale Semiconductor, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include <linux/cpuidle.h>
10#include <linux/module.h>
11#include <asm/cpuidle.h>
12
13#include "cpuidle.h"
14
15static struct cpuidle_driver imx6q_cpuidle_driver = {
16 .name = "imx6q_cpuidle",
17 .owner = THIS_MODULE,
18 .en_core_tk_irqen = 1,
19 .states[0] = ARM_CPUIDLE_WFI_STATE,
20 .state_count = 1,
21};
22
23int __init imx6q_cpuidle_init(void)
24{
25 return imx_cpuidle_init(&imx6q_cpuidle_driver);
26}
diff --git a/arch/arm/mach-imx/cpuidle.h b/arch/arm/mach-imx/cpuidle.h
index bc932d1af372..e092d1359d94 100644
--- a/arch/arm/mach-imx/cpuidle.h
+++ b/arch/arm/mach-imx/cpuidle.h
@@ -14,9 +14,14 @@
14 14
15#ifdef CONFIG_CPU_IDLE 15#ifdef CONFIG_CPU_IDLE
16extern int imx_cpuidle_init(struct cpuidle_driver *drv); 16extern int imx_cpuidle_init(struct cpuidle_driver *drv);
17extern int imx6q_cpuidle_init(void);
17#else 18#else
18static inline int imx_cpuidle_init(struct cpuidle_driver *drv) 19static inline int imx_cpuidle_init(struct cpuidle_driver *drv)
19{ 20{
20 return -ENODEV; 21 return -ENODEV;
21} 22}
23static inline int imx6q_cpuidle_init(void)
24{
25 return -ENODEV;
26}
22#endif 27#endif
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index ce7476d49271..27726de3537e 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -12,7 +12,6 @@
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>
16#include <linux/delay.h> 15#include <linux/delay.h>
17#include <linux/export.h> 16#include <linux/export.h>
18#include <linux/init.h> 17#include <linux/init.h>
@@ -26,7 +25,6 @@
26#include <linux/regmap.h> 25#include <linux/regmap.h>
27#include <linux/micrel_phy.h> 26#include <linux/micrel_phy.h>
28#include <linux/mfd/syscon.h> 27#include <linux/mfd/syscon.h>
29#include <asm/cpuidle.h>
30#include <asm/smp_twd.h> 28#include <asm/smp_twd.h>
31#include <asm/hardware/cache-l2x0.h> 29#include <asm/hardware/cache-l2x0.h>
32#include <asm/hardware/gic.h> 30#include <asm/hardware/gic.h>
@@ -202,17 +200,9 @@ static void __init imx6q_init_machine(void)
202 imx6q_1588_init(); 200 imx6q_1588_init();
203} 201}
204 202
205static struct cpuidle_driver imx6q_cpuidle_driver = {
206 .name = "imx6q_cpuidle",
207 .owner = THIS_MODULE,
208 .en_core_tk_irqen = 1,
209 .states[0] = ARM_CPUIDLE_WFI_STATE,
210 .state_count = 1,
211};
212
213static void __init imx6q_init_late(void) 203static void __init imx6q_init_late(void)
214{ 204{
215 imx_cpuidle_init(&imx6q_cpuidle_driver); 205 imx6q_cpuidle_init();
216} 206}
217 207
218static void __init imx6q_map_io(void) 208static void __init imx6q_map_io(void)