From patchwork Mon Apr 15 13:29:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 2445211 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id B103EDF2E5 for ; Mon, 15 Apr 2013 13:31:49 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1URjUo-000829-0i; Mon, 15 Apr 2013 13:30:59 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1URjUL-0002W1-Ur; Mon, 15 Apr 2013 13:30:29 +0000 Received: from mail-wg0-f48.google.com ([74.125.82.48]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1URjTy-0002T4-8a for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2013 13:30:08 +0000 Received: by mail-wg0-f48.google.com with SMTP id f11so142811wgh.27 for ; Mon, 15 Apr 2013 06:30:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=54O4hyLIoweWa6sORUnJ6YJ28BvRBMR+WRMzZJeCxXM=; b=NrWSy8nH9lHhkSmIPp+BSD1Sxj79YcQ/pE0QKpUZ4Ob7aDqHDVpckFVwG7aUye1YXC r91irnQMElKWdRar71J6/cfVZ6FkA+GiXljB144SfhdFJ+J5IC0PukRBrrsAAQOj1Bzi GyAr7DMPK2YUgmg+9DHFJsSvC6dc6cPNL05WMCllUrDEc+n5up1uvBczgZbWxx+/zRxY 3SId+26xWXmqJT2AGFC1dhPu5SFyZyWZtag2jt01ffRLm9uk/hF/L867On2zBt7n4zB2 FKeA0JvlBzXnvojGucMkyiPv9nPgd8heFcxFTCQc/wSP/rG17icc0v4bJyJjxzH+Qu1w jjRw== X-Received: by 10.180.211.50 with SMTP id mz18mr12017484wic.24.1366032604655; Mon, 15 Apr 2013 06:30:04 -0700 (PDT) Received: from mai.home (AToulouse-654-1-349-85.w90-55.abo.wanadoo.fr. [90.55.188.85]) by mx.google.com with ESMTPS id n2sm13520972wiy.6.2013.04.15.06.30.02 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Apr 2013 06:30:03 -0700 (PDT) From: Daniel Lezcano To: linux@maxim.org.za, nicolas.ferre@atmel.com, linux-arm-kernel@lists.infradead.org, rjw@sisk.pl, plagnioj@jcrosoft.com, linux-pm@vger.kernel.org Subject: [RFC patch 2/2] ARM: at91: cpuidle: move the driver to drivers/cpuidle directory Date: Mon, 15 Apr 2013 15:29:58 +0200 Message-Id: <1366032598-23053-3-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1366032598-23053-1-git-send-email-daniel.lezcano@linaro.org> References: <1366032598-23053-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQmB98uNa10vUwovBY+Lfv93pcQCDRIDHlgnagYeQhpUnmn3kBD09BrlGR2eSSt+vmrUeIi1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130415_093006_457979_413F1902 X-CRM114-Status: GOOD ( 18.89 ) 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 [74.125.82.48 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linaro-kernel@lists.linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org We don't have any dependency with the SoC specific code. Move the driver to the drivers/cpuidle directory. Add Nicolas Ferre as author of the driver, so it will be in copy of the emails. Signed-off-by: Daniel Lezcano --- arch/arm/mach-at91/Makefile | 1 - arch/arm/mach-at91/cpuidle.c | 55 ---------------------------------------- drivers/cpuidle/Makefile | 1 + drivers/cpuidle/at91.c | 57 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 56 deletions(-) delete mode 100644 arch/arm/mach-at91/cpuidle.c create mode 100644 drivers/cpuidle/at91.c diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index 39218ca..3c7fca1 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile @@ -99,7 +99,6 @@ obj-y += leds.o # Power Management obj-$(CONFIG_PM) += pm.o obj-$(CONFIG_AT91_SLOW_CLOCK) += pm_slowclock.o -obj-$(CONFIG_CPU_IDLE) += cpuidle.o ifeq ($(CONFIG_PM_DEBUG),y) CFLAGS_pm.o += -DDEBUG diff --git a/arch/arm/mach-at91/cpuidle.c b/arch/arm/mach-at91/cpuidle.c deleted file mode 100644 index b2bec92..0000000 --- a/arch/arm/mach-at91/cpuidle.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * based on arch/arm/mach-kirkwood/cpuidle.c - * - * CPU idle support for AT91 SoC - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. - * - * The cpu idle uses wait-for-interrupt and RAM self refresh in order - * to implement two idle states - - * #1 wait-for-interrupt - * #2 wait-for-interrupt and RAM self refresh - */ - -#include -#include -#include -#include - -#define AT91_MAX_STATES 2 - -extern void (*at91_standby_ops)(void); - -/* Actual code that puts the SoC in different idle states */ -static int at91_enter_idle(struct cpuidle_device *dev, - struct cpuidle_driver *drv, - int index) -{ - at91_standby_ops(); - return index; -} - -static struct cpuidle_driver at91_idle_driver = { - .name = "at91_idle", - .owner = THIS_MODULE, - .states[0] = ARM_CPUIDLE_WFI_STATE, - .states[1] = { - .enter = at91_enter_idle, - .exit_latency = 10, - .target_residency = 100000, - .flags = CPUIDLE_FLAG_TIME_VALID, - .name = "RAM_SR", - .desc = "WFI and DDR Self Refresh", - }, - .state_count = AT91_MAX_STATES, -}; - -/* Initialize CPU idle by registering the idle states */ -static int __init at91_init_cpuidle(void) -{ - return cpuidle_register(&at91_idle_driver, NULL); -} - -device_initcall(at91_init_cpuidle); diff --git a/drivers/cpuidle/Makefile b/drivers/cpuidle/Makefile index 0d8bd55..ba4e977 100644 --- a/drivers/cpuidle/Makefile +++ b/drivers/cpuidle/Makefile @@ -7,3 +7,4 @@ obj-$(CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED) += coupled.o obj-$(CONFIG_CPU_IDLE_CALXEDA) += cpuidle-calxeda.o obj-$(CONFIG_ARCH_KIRKWOOD) += cpuidle-kirkwood.o +obj-$(CONFIG_ARCH_AT91) += at91.o diff --git a/drivers/cpuidle/at91.c b/drivers/cpuidle/at91.c new file mode 100644 index 0000000..2bc745b --- /dev/null +++ b/drivers/cpuidle/at91.c @@ -0,0 +1,57 @@ +/* + * based on arch/arm/mach-kirkwood/cpuidle.c + * + * CPU idle support for AT91 SoC + * + * Author: Nicolas Ferre + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + * + * The cpu idle uses wait-for-interrupt and RAM self refresh in order + * to implement two idle states - + * #1 wait-for-interrupt + * #2 wait-for-interrupt and RAM self refresh + */ + +#include +#include +#include +#include + +#define AT91_MAX_STATES 2 + +extern void (*at91_standby_ops)(void); + +/* Actual code that puts the SoC in different idle states */ +static int at91_enter_idle(struct cpuidle_device *dev, + struct cpuidle_driver *drv, + int index) +{ + at91_standby_ops(); + return index; +} + +static struct cpuidle_driver at91_idle_driver = { + .name = "at91_idle", + .owner = THIS_MODULE, + .states[0] = ARM_CPUIDLE_WFI_STATE, + .states[1] = { + .enter = at91_enter_idle, + .exit_latency = 10, + .target_residency = 100000, + .flags = CPUIDLE_FLAG_TIME_VALID, + .name = "RAM_SR", + .desc = "WFI and DDR Self Refresh", + }, + .state_count = AT91_MAX_STATES, +}; + +/* Initialize CPU idle by registering the idle states */ +static int __init at91_init_cpuidle(void) +{ + return cpuidle_register(&at91_idle_driver, NULL); +} + +device_initcall(at91_init_cpuidle);