From: shawn.guo@linaro.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 08/10] ARM: imx: move imx6q_cpuidle_driver into a separate file
Date: Tue, 23 Oct 2012 23:22:57 +0800 [thread overview]
Message-ID: <1351005779-30347-9-git-send-email-shawn.guo@linaro.org> (raw)
In-Reply-To: <1351005779-30347-1-git-send-email-shawn.guo@linaro.org>
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>
---
arch/arm/mach-imx/Makefile | 6 +++++-
arch/arm/mach-imx/cpuidle-imx6q.c | 26 ++++++++++++++++++++++++++
arch/arm/mach-imx/cpuidle.h | 5 +++++
arch/arm/mach-imx/mach-imx6q.c | 12 +-----------
4 files changed, 37 insertions(+), 12 deletions(-)
create mode 100644 arch/arm/mach-imx/cpuidle-imx6q.c
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index fe47b71..a29ed49 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -28,7 +28,11 @@ obj-$(CONFIG_MXC_ULPI) += ulpi.o
obj-$(CONFIG_MXC_USE_EPIT) += epit.o
obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o
obj-$(CONFIG_CPU_FREQ_IMX) += cpufreq.o
-obj-$(CONFIG_CPU_IDLE) += cpuidle.o
+
+ifeq ($(CONFIG_CPU_IDLE),y)
+obj-y += cpuidle.o
+obj-$(CONFIG_SOC_IMX6Q) += cpuidle-imx6q.o
+endif
ifdef CONFIG_SND_IMX_SOC
obj-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 0000000..83facc9
--- /dev/null
+++ b/arch/arm/mach-imx/cpuidle-imx6q.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2012 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/cpuidle.h>
+#include <linux/module.h>
+#include <asm/cpuidle.h>
+
+#include "cpuidle.h"
+
+static struct cpuidle_driver imx6q_cpuidle_driver = {
+ .name = "imx6q_cpuidle",
+ .owner = THIS_MODULE,
+ .en_core_tk_irqen = 1,
+ .states[0] = ARM_CPUIDLE_WFI_STATE,
+ .state_count = 1,
+};
+
+int __init imx6q_cpuidle_init(void)
+{
+ return imx_cpuidle_init(&imx6q_cpuidle_driver);
+}
diff --git a/arch/arm/mach-imx/cpuidle.h b/arch/arm/mach-imx/cpuidle.h
index bc932d1..e092d13 100644
--- a/arch/arm/mach-imx/cpuidle.h
+++ b/arch/arm/mach-imx/cpuidle.h
@@ -14,9 +14,14 @@
#ifdef CONFIG_CPU_IDLE
extern int imx_cpuidle_init(struct cpuidle_driver *drv);
+extern int imx6q_cpuidle_init(void);
#else
static inline int imx_cpuidle_init(struct cpuidle_driver *drv)
{
return -ENODEV;
}
+static inline int imx6q_cpuidle_init(void)
+{
+ return -ENODEV;
+}
#endif
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 1c5acf8..8ecdeb5 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -12,7 +12,6 @@
#include <linux/clk.h>
#include <linux/clkdev.h>
-#include <linux/cpuidle.h>
#include <linux/delay.h>
#include <linux/export.h>
#include <linux/init.h>
@@ -26,7 +25,6 @@
#include <linux/regmap.h>
#include <linux/micrel_phy.h>
#include <linux/mfd/syscon.h>
-#include <asm/cpuidle.h>
#include <asm/smp_twd.h>
#include <asm/hardware/cache-l2x0.h>
#include <asm/hardware/gic.h>
@@ -182,17 +180,9 @@ static void __init imx6q_init_machine(void)
imx6q_usb_init();
}
-static struct cpuidle_driver imx6q_cpuidle_driver = {
- .name = "imx6q_cpuidle",
- .owner = THIS_MODULE,
- .en_core_tk_irqen = 1,
- .states[0] = ARM_CPUIDLE_WFI_STATE,
- .state_count = 1,
-};
-
static void __init imx6q_init_late(void)
{
- imx_cpuidle_init(&imx6q_cpuidle_driver);
+ imx6q_cpuidle_init();
}
static void __init imx6q_map_io(void)
--
1.7.9.5
next prev parent reply other threads:[~2012-10-23 15:22 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-23 15:22 [PATCH 00/10] Support imx6q WAIT mode with coupled cpuidle Shawn Guo
2012-10-23 15:22 ` [PATCH 01/10] ARM: imx6q: print silicon version on boot Shawn Guo
2012-11-15 18:09 ` Moseley, Drew
2012-11-16 2:23 ` Shawn Guo
2012-11-16 6:25 ` Dirk Behme
2012-11-16 6:54 ` Shawn Guo
2012-11-16 6:39 ` Shawn Guo
2012-10-23 15:22 ` [PATCH 02/10] ARM: imx: allow timer counter to roll over Shawn Guo
2012-10-23 15:22 ` [PATCH 03/10] ARM: imx6q: select ARM and PL310 errata Shawn Guo
2013-11-28 12:44 ` Dirk Behme
2013-11-29 2:10 ` Shawn Guo
2012-10-23 15:22 ` [PATCH 04/10] ARM: imx: initialize cpu power up counters Shawn Guo
2012-10-23 15:22 ` [PATCH 05/10] ARM: imx: mask gpc interrupts initially Shawn Guo
2012-10-23 15:22 ` [PATCH 06/10] ARM: imx6q: prepare imx6q_set_lpm for cpudile support Shawn Guo
2012-10-23 15:22 ` [PATCH 07/10] ARM: imx6q: get v7_cpu_resume ready for cpuidle Shawn Guo
2012-10-23 15:22 ` Shawn Guo [this message]
2012-10-23 15:22 ` [PATCH 09/10] ARM: SMP: add function arch_send_wakeup_ipi_mask() Shawn Guo
2012-10-31 3:43 ` Shawn Guo
2012-11-02 13:42 ` Shawn Guo
2012-11-06 3:18 ` Shawn Guo
2012-10-23 15:22 ` [PATCH 10/10] ARM: imx6q: implement WAIT mode with coupled cpuidle Shawn Guo
2012-10-23 16:09 ` Lee Robert-B18647
2012-10-24 14:04 ` Shawn Guo
2012-10-23 17:35 ` Lorenzo Pieralisi
2012-10-24 13:57 ` Shawn Guo
2012-10-24 15:29 ` Lorenzo Pieralisi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1351005779-30347-9-git-send-email-shawn.guo@linaro.org \
--to=shawn.guo@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).