From patchwork Mon May 7 21:16:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob X-Patchwork-Id: 8436 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 1660823E49 for ; Mon, 7 May 2012 21:17:04 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id D9C3CA18803 for ; Mon, 7 May 2012 21:17:03 +0000 (UTC) Received: by mail-yw0-f52.google.com with SMTP id p61so647749yhp.11 for ; Mon, 07 May 2012 14:17:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=GcpWks7LB+rHIbrRbe9ZEPog7mLdC+LVzpIMjuh+aTo=; b=aIT9ykQ1K3pI2IZH2RmjidZXCTOqeUr5301YCNaG61ogpAnFnKeHh2C7Y3wsL8WEP6 gPUDIzC9W0tcdjecVqh2tD2LphHv5jkZzd+EDC7cEEqKz+WF6JqPbIfoFA3j2AaPJTAC JVs0JlNFvc9HZXJbLy+XIED/RKKASS5BkQLVekehZ//c6h7itGv07Q18sQyKYEXL5n8H aDs3IB+EvGVUCbhj3FEVBDUIui4jfrmvVi3vtqtG4WWXPofHjmh5QzsmZ4DGxzJ/Thuo 3od9k8e8CGYjMGSqx1vZ3tKvZuE0HivO4VyTuAFcwzcliQX4j7jsV1kpp/Ku41eXasUQ /oRw== Received: by 10.50.160.225 with SMTP id xn1mr6012328igb.3.1336425423501; Mon, 07 May 2012 14:17:03 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.73.147 with SMTP id q19csp154771ibj; Mon, 7 May 2012 14:17:02 -0700 (PDT) Received: by 10.236.109.66 with SMTP id r42mr21074043yhg.39.1336425422143; Mon, 07 May 2012 14:17:02 -0700 (PDT) Received: from mail-yw0-f50.google.com (mail-yw0-f50.google.com [209.85.213.50]) by mx.google.com with ESMTPS id v69si12907798yhl.86.2012.05.07.14.17.01 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 May 2012 14:17:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.213.50 is neither permitted nor denied by best guess record for domain of rob.lee@linaro.org) client-ip=209.85.213.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.213.50 is neither permitted nor denied by best guess record for domain of rob.lee@linaro.org) smtp.mail=rob.lee@linaro.org Received: by mail-yw0-f50.google.com with SMTP id j63so1022064yhj.37 for ; Mon, 07 May 2012 14:17:01 -0700 (PDT) Received: by 10.42.153.10 with SMTP id k10mr701426icw.24.1336425421698; Mon, 07 May 2012 14:17:01 -0700 (PDT) Received: from localhost.localdomain ([216.59.27.36]) by mx.google.com with ESMTPS id kn9sm6940883igc.8.2012.05.07.14.16.59 (version=SSLv3 cipher=OTHER); Mon, 07 May 2012 14:17:01 -0700 (PDT) From: Robert Lee To: kernel@pengutronix.de Cc: shawn.guo@linaro.org, amit.kucheria@linaro.org, daniel.lezcano@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org, patches@linaro.org, jj@chaosbits.net Subject: [PATCH v3 3/3] ARM: imx: Add imx6q cpuidle driver Date: Mon, 7 May 2012 16:16:47 -0500 Message-Id: <1336425407-20308-4-git-send-email-rob.lee@linaro.org> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1336425407-20308-1-git-send-email-rob.lee@linaro.org> References: <1336425407-20308-1-git-send-email-rob.lee@linaro.org> X-Gm-Message-State: ALoCoQkRnrROktIxLLLZzxGpQD1hxQCQicoua8t0/O0yarO1eg8EriiKa0HOe5gRW9IOV09haJzU 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/mach-imx6q.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index da6c1d9..4fc1fe7 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -10,7 +10,9 @@ * http://www.gnu.org/copyleft/gpl.html */ +#include #include +#include #include #include #include @@ -21,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -28,8 +31,10 @@ #include #include #include +#include #include + void imx6q_restart(char mode, const char *cmd) { struct device_node *np; @@ -86,6 +91,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 +160,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