linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: rob.lee@linaro.org (Robert Lee)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] ARM: imx: Add imx6q cpuidle driver
Date: Mon, 16 Apr 2012 18:50:14 -0500	[thread overview]
Message-ID: <1334620214-25803-4-git-send-email-rob.lee@linaro.org> (raw)
In-Reply-To: <1334620214-25803-1-git-send-email-rob.lee@linaro.org>

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>
---
 arch/arm/mach-imx/Makefile        |    2 +-
 arch/arm/mach-imx/cpuidle-imx6q.c |   33 +++++++++++++++++++++++++++++++++
 arch/arm/mach-imx/mach-imx6q.c    |    2 ++
 3 files changed, 36 insertions(+), 1 deletion(-)
 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 84b8976..530f0fd 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -70,7 +70,7 @@ obj-$(CONFIG_CPU_V7) += head-v7.o
 AFLAGS_head-v7.o :=-Wa,-march=armv7-a
 obj-$(CONFIG_SMP) += platsmp.o
 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
-obj-$(CONFIG_SOC_IMX6Q) += clock-imx6q.o mach-imx6q.o
+obj-$(CONFIG_SOC_IMX6Q) += clock-imx6q.o mach-imx6q.o cpuidle-imx6q.o
 
 ifeq ($(CONFIG_PM),y)
 obj-$(CONFIG_SOC_IMX6Q) += pm-imx6q.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..b74557f
--- /dev/null
+++ b/arch/arm/mach-imx/cpuidle-imx6q.c
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2012 Linaro Ltd.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/cpuidle.h>
+#include <linux/export.h>
+#include <asm/cpuidle.h>
+#include <mach/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)
+{
+	imx_cpuidle_set_driver(&imx6q_cpuidle_driver);
+
+	return 0;
+}
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index da6c1d9..6f31ca6 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -29,6 +29,7 @@
 #include <asm/system_misc.h>
 #include <mach/common.h>
 #include <mach/hardware.h>
+#include <mach/cpuidle.h>
 
 void imx6q_restart(char mode, const char *cmd)
 {
@@ -84,6 +85,7 @@ static void __init imx6q_init_machine(void)
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
 	imx6q_pm_init();
+	imx6q_cpuidle_init();
 }
 
 static void __init imx6q_map_io(void)
-- 
1.7.10

      parent reply	other threads:[~2012-04-16 23:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16 23:50 [PATCH 0/3] Add imx cpuidle Robert Lee
2012-04-16 23:50 ` [PATCH 1/3] ARM: imx: Add common imx cpuidle init functionality Robert Lee
2012-04-16 23:56   ` Jesper Juhl
2012-04-17  7:43   ` Sascha Hauer
2012-04-17 13:54     ` Rob Lee
2012-04-17 14:13       ` Christian Robottom Reis
2012-04-17 14:32         ` Rob Lee
2012-04-17 17:42       ` Sascha Hauer
2012-04-17 19:32         ` Rob Lee
2012-04-19  4:18           ` Rob Lee
2012-04-19  6:43             ` Sascha Hauer
2012-04-20  2:08               ` Shawn Guo
2012-04-23  4:44                 ` Rob Lee
2012-04-23  5:18                   ` Shawn Guo
2012-04-23  6:27                     ` Sascha Hauer
2012-04-23  6:53                       ` Shawn Guo
2012-04-23  6:56                         ` Sascha Hauer
2012-04-23  7:10                           ` Shawn Guo
2012-04-23  7:48                             ` Sascha Hauer
2012-04-23 15:45                               ` Rob Lee
2012-04-24  1:38                                 ` Shawn Guo
2012-04-24  7:54                                   ` Russell King - ARM Linux
2012-04-24  8:36                                     ` Shawn Guo
2012-04-24 15:40                                       ` Rob Lee
2012-04-24 19:51                                         ` Russell King - ARM Linux
2012-04-25  2:06                                           ` Shawn Guo
2012-04-16 23:50 ` [PATCH 2/3] ARM: imx: Add imx5 cpuidle driver Robert Lee
2012-04-16 23:50 ` Robert Lee [this message]

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=1334620214-25803-4-git-send-email-rob.lee@linaro.org \
    --to=rob.lee@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).