From patchwork Mon Apr 16 23:50:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Lee X-Patchwork-Id: 153017 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 D4393B7008 for ; Tue, 17 Apr 2012 09:53:15 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SJvhW-0005Ie-VJ; Mon, 16 Apr 2012 23:51:18 +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 1SJvhO-0005E1-1x for linux-arm-kernel@lists.infradead.org; Mon, 16 Apr 2012 23:51:11 +0000 Received: by mail-ob0-f177.google.com with SMTP id ni5so158047obc.36 for ; Mon, 16 Apr 2012 16:51:09 -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=nxNFoM+bNJgBNDWFtiDR6hP6c+ld4ueppi7GhgJf6Hk=; b=flMclgt7Y3QpvhGiF1OWnHQSnim1F7qDmysRFtEvKUmsTeG3auPZdZpADuNLjMWCgq lTH1UCQmjioOzAfUBXaSzIlZCxjebIQENkKR+ahG7LAJbzG7SCBpujBjzQn6Vwlt72P5 W0JptyAfUSwzg4D1Z1a+MV1I+wbl67CbLwwkx+O2nQUmlWBAlRIV0wOP7xq8mcQ97jnH W+GkdM15+EMn05k+RXLf0kTiJtRoW3fxb2glRnlD/zArvAOB8DwKlNnPmra49nWjtQ31 EZnNLqVyVlvLcuO5mZw/X543M/QghsBSSPKjeoG3EaDO0YI+7GQwOt54tujhYuLzu1kV 7t3w== Received: by 10.60.32.210 with SMTP id l18mr18625201oei.1.1334620269870; Mon, 16 Apr 2012 16:51:09 -0700 (PDT) Received: from localhost.localdomain ([216.59.27.108]) by mx.google.com with ESMTPS id xb7sm21169537obb.10.2012.04.16.16.51.06 (version=SSLv3 cipher=OTHER); Mon, 16 Apr 2012 16:51:09 -0700 (PDT) From: Robert Lee To: kernel@pengutronix.de Subject: [PATCH 3/3] ARM: imx: Add imx6q cpuidle driver Date: Mon, 16 Apr 2012 18:50:14 -0500 Message-Id: <1334620214-25803-4-git-send-email-rob.lee@linaro.org> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1334620214-25803-1-git-send-email-rob.lee@linaro.org> References: <1334620214-25803-1-git-send-email-rob.lee@linaro.org> X-Gm-Message-State: ALoCoQmYtqWljhKsbfmfRQQzn6tH+D/dzxPu6T04YypkGDnajTUaR/Ugyk0eHPBzTe/wU0nLrOVS 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, 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/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 +#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..6f31ca6 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -29,6 +29,7 @@ #include #include #include +#include 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)