From patchwork Wed May 2 02:12:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Lee X-Patchwork-Id: 156320 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 29374B6FA4 for ; Wed, 2 May 2012 12:15:38 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SPP4B-0005Vd-92; Wed, 02 May 2012 02:13:19 +0000 Received: from mail-ob0-f177.google.com ([209.85.214.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SPP3m-0005Qp-On for linux-arm-kernel@lists.infradead.org; Wed, 02 May 2012 02:12:56 +0000 Received: by obqv19 with SMTP id v19so320801obq.36 for ; Tue, 01 May 2012 19:12:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=Ll9+TLmHG0/qMyDO0zSQQwbLul/k5NX1MPl2jq7mOpk=; b=TnP4P6swWQDkggKSpqzlmdnn+/y0cnOY3uZvgFVTipo+C4q1wOvi351UGW6j6Ojt1P qYha5OKPJQMw2QZMN34NDavqfdyi63GwL57wkajtfhuJ4ft2P98BSCz16XfFjnE7l4p0 E7yg6+EEZQR+5Ad8Mhi4zA7/wydugZsaJ+i2fcsdio/Dbgya57eGmq93SZ+ABenjfVSI u5NLe+zIhM7Cwq2bIC5B6kWJPEuIPq9xXNSz/L4SZdCsqnXT6wBCRzKs/1u5jCNi1j48 4lwD7bFGzmWzX9epCwWmK4eaSUNdL2SFxji5xsE76Jr+etaHzkOHVRr6MrVh4dbUOXWE kkZA== Received: by 10.182.151.113 with SMTP id up17mr15476392obb.40.1335924774188; Tue, 01 May 2012 19:12:54 -0700 (PDT) Received: from localhost.localdomain ([67.23.168.71]) by mx.google.com with ESMTPS id h2sm472219obn.20.2012.05.01.19.12.51 (version=SSLv3 cipher=OTHER); Tue, 01 May 2012 19:12:53 -0700 (PDT) From: Robert Lee To: kernel@pengutronix.de Subject: [PATCH v2 3/3] ARM: imx: Add imx6q cpuidle driver Date: Tue, 1 May 2012 21:12:40 -0500 Message-Id: <1335924760-796-4-git-send-email-rob.lee@linaro.org> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1335924760-796-1-git-send-email-rob.lee@linaro.org> References: <1335924760-796-1-git-send-email-rob.lee@linaro.org> X-Gm-Message-State: ALoCoQnJuZhlS/B7kWW7qTMevnwoyBR4RvgY4fUlt7f2xTynANw/Wv3jzvPtf9tKgeuqz9+3YajF X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.177 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linaro-dev@lists.linaro.org, patches@linaro.org, daniel.lezcano@linaro.org, linux-kernel@vger.kernel.org, amit.kucheria@linaro.org, jj@chaosbits.net, shawn.guo@linaro.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.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 --- arch/arm/mach-imx/cpuidle-imx6q.c | 33 +++++++++++++++++++++++++++++++++ arch/arm/mach-imx/mach-imx6q.c | 18 ++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 arch/arm/mach-imx/cpuidle-imx6q.c 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 +#include +#include +#include +#include +#include + +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..21e2051 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -21,6 +21,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -29,6 +32,7 @@ #include #include #include +#include void imx6q_restart(char mode, const char *cmd) { @@ -86,6 +90,19 @@ static void __init imx6q_init_machine(void) imx6q_pm_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); +} + static void __init imx6q_map_io(void) { imx_lluart_map_io(); @@ -142,6 +159,7 @@ DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device Tree)") .handle_irq = imx6q_handle_irq, .timer = &imx6q_timer, .init_machine = imx6q_init_machine, + .init_late = imx6q_init_late, .dt_compat = imx6q_dt_compat, .restart = imx6q_restart, MACHINE_END