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: Rob X-Patchwork-Id: 7881 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 2BD0223E1D for ; Mon, 16 Apr 2012 23:51:11 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id E579DA18737 for ; Mon, 16 Apr 2012 23:51:10 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so11132973iag.11 for ; Mon, 16 Apr 2012 16:51:10 -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=nxNFoM+bNJgBNDWFtiDR6hP6c+ld4ueppi7GhgJf6Hk=; b=S0M2ChGUiaQtX6MR06AT6Q5w21aacBUQdJnvLrn9mlaJTUEc04OVXqEBLmGhxqmVGX 6wLtHc+p3QKr1jv7WV01Dyr4nw5nxEQEZSMec5x4pKGwiE6Qc1FcrKq1EqsL5o/3eknR SQF4LgzVTlGOqj/gwDjtRKdpratM46r/GB3bQJWOUEHAlGwtPjAhpferLyw8sr0Qa6XW EhSEn0t5HkZALyplNc0fNsLgOiZXDFHLr/DkZQXiYdRLHDMsA06v8c4NK+mEA82EGJA0 OhJLobl9QPjKmJxFl4NWz8TJ0jSUZPOzUdfc4g/ASAJcFv53NOSFb1lLo8GEWB0i9Xqs +Tdg== Received: by 10.50.194.163 with SMTP id hx3mr7382176igc.49.1334620270533; Mon, 16 Apr 2012 16:51:10 -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 x6csp112781ibt; Mon, 16 Apr 2012 16:51:10 -0700 (PDT) Received: by 10.182.155.35 with SMTP id vt3mr18741208obb.63.1334620270023; Mon, 16 Apr 2012 16:51:10 -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 ry6si1733251obc.20.2012.04.16.16.51.09 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Apr 2012 16:51:10 -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 k16so10344658obf.37 for ; Mon, 16 Apr 2012 16:51:09 -0700 (PDT) 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 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 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: ALoCoQn1j+KFCbbc/6byWWf5sG4f0g7dls6YeguJYMMZFUpSukNr4cq+V4occLsDJ4uD9KEqKgs/ 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)