From patchwork Tue Oct 23 15:22:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 193514 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 38C522C00F3 for ; Wed, 24 Oct 2012 02:27:33 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TQgLX-0001TE-E7; Tue, 23 Oct 2012 15:24:47 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TQgJs-0000aH-Gn for linux-arm-kernel@lists.infradead.org; Tue, 23 Oct 2012 15:23:05 +0000 Received: by mail-pb0-f49.google.com with SMTP id xa7so468340pbc.36 for ; Tue, 23 Oct 2012 08:23:04 -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=UCAIEYDftu3HaPSik3XdibP0aBW6ieGELkOFDlABO6g=; b=pddaDmqmrCcGikdebKVzujVaGVnmPCJvzOHfYTdmZlbICS5Na33y6PNAU1vDDQg1kO n9CA4VyAiwxTNsK4KZrDnsaaHvHz+S4MfW+rGajqJnknC3iuPKMbM/qfU2SiKO1mt0JL eMRj0yvViDSJEajXiKeCDaueQNQ4Droov6DyYcHaLoP9AgXfJf9SpzIeBs66LVZjcI18 04O2jj0HsfcGi9G/nvmzybWeJzintIErj25a8GShzlTndeVePScqlB2XMqhtk4Yqw15w jXP9+9bITc2PGwLRCh8tNSbtrX4+yWu3LjDPzOmVz72mb2IlpZOCAoNEJzFkA+eSGbFk 696g== Received: by 10.68.213.6 with SMTP id no6mr1879988pbc.113.1351005784254; Tue, 23 Oct 2012 08:23:04 -0700 (PDT) Received: from S2101-09.ap.freescale.net ([58.209.136.71]) by mx.google.com with ESMTPS id pj10sm7842864pbb.46.2012.10.23.08.22.59 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Oct 2012 08:23:03 -0700 (PDT) From: Shawn Guo To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 08/10] ARM: imx: move imx6q_cpuidle_driver into a separate file Date: Tue, 23 Oct 2012 23:22:57 +0800 Message-Id: <1351005779-30347-9-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1351005779-30347-1-git-send-email-shawn.guo@linaro.org> References: <1351005779-30347-1-git-send-email-shawn.guo@linaro.org> X-Gm-Message-State: ALoCoQkYBTbNPTbsEoBKEZTxRxWQKO2LfStN1hN+5pS/F0Lf1h1czWiIxetlXq11spzhzkb8E4xO 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.160.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Sascha Hauer , Shawn Guo , Robert Lee 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 Move imx6q_cpuidle_driver into a separate file as more codes will be added when WAIT mode gets implemented as cpuidle. Signed-off-by: Shawn Guo --- arch/arm/mach-imx/Makefile | 6 +++++- arch/arm/mach-imx/cpuidle-imx6q.c | 26 ++++++++++++++++++++++++++ arch/arm/mach-imx/cpuidle.h | 5 +++++ arch/arm/mach-imx/mach-imx6q.c | 12 +----------- 4 files changed, 37 insertions(+), 12 deletions(-) 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 fe47b71..a29ed49 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile @@ -28,7 +28,11 @@ obj-$(CONFIG_MXC_ULPI) += ulpi.o obj-$(CONFIG_MXC_USE_EPIT) += epit.o obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o obj-$(CONFIG_CPU_FREQ_IMX) += cpufreq.o -obj-$(CONFIG_CPU_IDLE) += cpuidle.o + +ifeq ($(CONFIG_CPU_IDLE),y) +obj-y += cpuidle.o +obj-$(CONFIG_SOC_IMX6Q) += cpuidle-imx6q.o +endif ifdef CONFIG_SND_IMX_SOC obj-y += ssi-fiq.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..83facc9 --- /dev/null +++ b/arch/arm/mach-imx/cpuidle-imx6q.c @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2012 Freescale Semiconductor, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include + +#include "cpuidle.h" + +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) +{ + return imx_cpuidle_init(&imx6q_cpuidle_driver); +} diff --git a/arch/arm/mach-imx/cpuidle.h b/arch/arm/mach-imx/cpuidle.h index bc932d1..e092d13 100644 --- a/arch/arm/mach-imx/cpuidle.h +++ b/arch/arm/mach-imx/cpuidle.h @@ -14,9 +14,14 @@ #ifdef CONFIG_CPU_IDLE extern int imx_cpuidle_init(struct cpuidle_driver *drv); +extern int imx6q_cpuidle_init(void); #else static inline int imx_cpuidle_init(struct cpuidle_driver *drv) { return -ENODEV; } +static inline int imx6q_cpuidle_init(void) +{ + return -ENODEV; +} #endif diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 1c5acf8..8ecdeb5 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -12,7 +12,6 @@ #include #include -#include #include #include #include @@ -26,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -182,17 +180,9 @@ static void __init imx6q_init_machine(void) imx6q_usb_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); + imx6q_cpuidle_init(); } static void __init imx6q_map_io(void)