From patchwork Wed May 16 02:33:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob X-Patchwork-Id: 8669 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 C5C5923E37 for ; Wed, 16 May 2012 02:33:57 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 95E80A1826F for ; Wed, 16 May 2012 02:33:57 +0000 (UTC) Received: by mail-yx0-f180.google.com with SMTP id q6so318914yen.11 for ; Tue, 15 May 2012 19:33:57 -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=hLn+NlIVMglqFuOyyCeA3YGPuN0vlJKXgAT2Yqc5oLIjkbYxRGM42pNQJXfoc+p+R/ yagp0vOiZ0HTpCqVNB3Xk+Lz/kH53jkGg6sDlgf8PVai6JQcTSpE0lWGZ2nrHY80EGPJ Kd0gOkLzMAUobLmC9wRENpUFoaPhWtwNx5J75crDA/5HLgm10tn6l++IzIWXob6PiLn9 TSVmTVq6eVSnJdqJAhcpV0GJ9cjUL7H70JWJajz+XTV+EXzeg+gndc/TI7mESflCs4Kq 97/WZRVHl1F6x4+XVCUs1F3yHAUrzU1k/e/JqE+hAgFeLjJcHgnLaG1ND4mZSEHw2COB nMhw== Received: by 10.50.203.39 with SMTP id kn7mr665626igc.53.1337135637262; Tue, 15 May 2012 19:33:57 -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.35.72 with SMTP id o8csp460630ibd; Tue, 15 May 2012 19:33:56 -0700 (PDT) Received: by 10.236.76.226 with SMTP id b62mr1555550yhe.13.1337135636046; Tue, 15 May 2012 19:33:56 -0700 (PDT) Received: from mail-yw0-f44.google.com (mail-yw0-f44.google.com [209.85.213.44]) by mx.google.com with ESMTPS id y5si958370yha.116.2012.05.15.19.33.55 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 May 2012 19:33:56 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.213.44 is neither permitted nor denied by best guess record for domain of rob.lee@linaro.org) client-ip=209.85.213.44; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.213.44 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-f44.google.com with SMTP id 56so311839yhq.17 for ; Tue, 15 May 2012 19:33:55 -0700 (PDT) Received: by 10.236.190.232 with SMTP id e68mr1396337yhn.119.1337135635799; Tue, 15 May 2012 19:33:55 -0700 (PDT) Received: from localhost.localdomain ([216.59.27.28]) by mx.google.com with ESMTPS id a68sm4346289yhj.22.2012.05.15.19.33.54 (version=SSLv3 cipher=OTHER); Tue, 15 May 2012 19:33:55 -0700 (PDT) From: Robert Lee To: kernel@pengutronix.de Cc: shawn.guo@linaro.org, u.kleine-koenig@pengutronix.de, richard.zhao@freescale.com, 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 v4 7/7] ARM: imx: Add imx6q cpuidle driver Date: Tue, 15 May 2012 21:33:36 -0500 Message-Id: <1337135616-8988-8-git-send-email-rob.lee@linaro.org> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1337135616-8988-1-git-send-email-rob.lee@linaro.org> References: <1337135616-8988-1-git-send-email-rob.lee@linaro.org> X-Gm-Message-State: ALoCoQliHmyoKogzECRubukFvC/xOWiDk67ANqm4jG5SvsyVyGHYfz9ONm1OxtKR3cFzTGvfWIOd 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