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: Rob X-Patchwork-Id: 8343 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 9968323E23 for ; Wed, 2 May 2012 02:12:55 +0000 (UTC) Received: from mail-gy0-f180.google.com (mail-gy0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 651B2A18078 for ; Wed, 2 May 2012 02:12:55 +0000 (UTC) Received: by mail-gy0-f180.google.com with SMTP id z12so203041ghb.11 for ; Tue, 01 May 2012 19:12:55 -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=Ll9+TLmHG0/qMyDO0zSQQwbLul/k5NX1MPl2jq7mOpk=; b=d1YYvDFBtafiY157Jjdzf3UjRoFWY6Z/MIXKsv342vXbdm3WrxxnPzENadDD+PH67k R/pQu6JU7EQzgsxBlWzF4Yj3PHP0W8/LrOCTowgbZEo838eIalPw965slKJtnGJ2Tp4k G43dKtATJj1Db/ygWI/4CjEs4aP0r4N0Jr1MyRWNxdaPrqUur/as8Czi2qZ48zoJYgWy q+QRqoINQ7xFhGb/zO9l5fGikkkXyL0KnfBkAomejbFh7UmtGxpRpdb75cgxL3GIEoWK HF5AjxGx8/XVEPAzzVfiApj9z4sP+WTlk8tcylvacob3gJecYQtod9K0xCuGOfWcqOaA 4K7w== Received: by 10.50.57.129 with SMTP id i1mr3424698igq.33.1335924774976; Tue, 01 May 2012 19:12:54 -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.137.198 with SMTP id x6csp219939ibt; Tue, 1 May 2012 19:12:54 -0700 (PDT) Received: by 10.182.183.73 with SMTP id ek9mr11775146obc.15.1335924774386; Tue, 01 May 2012 19:12:54 -0700 (PDT) Received: from mail-ob0-f178.google.com (mail-ob0-f178.google.com [209.85.214.178]) by mx.google.com with ESMTPS id sq3si131309obb.133.2012.05.01.19.12.54 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 01 May 2012 19:12:54 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.214.178 is neither permitted nor denied by best guess record for domain of rob.lee@linaro.org) client-ip=209.85.214.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.214.178 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-ob0-f178.google.com with SMTP id eq6so356286obc.37 for ; Tue, 01 May 2012 19:12:54 -0700 (PDT) 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 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 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: ALoCoQmus26QDoK2oDiQDiVDZ8moAEYyVMN/EAqXsRN1NbS6JS9E08GAajZ4Odzj6hgj9P/v2NX1 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