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: 2445191 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id B05863FD1A for ; Mon, 15 Apr 2013 13:30:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750827Ab3DONaH (ORCPT ); Mon, 15 Apr 2013 09:30:07 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:43679 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751361Ab3DONaG (ORCPT ); Mon, 15 Apr 2013 09:30:06 -0400 Received: by mail-wi0-f170.google.com with SMTP id hm11so1589116wib.3 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=cE8aSQKlrkfzuI8WELtIhvSuilwqAzz8n7W6aRvZTjCbEseIitg3SIeOoE+qEfW3na NXufuJ+2a4C60X1sWomuMszizXBJxMglYXdpd+Dq8mrXvq7gbkKdnG5gtAxvBEtr034m EDcO/Ie83q6N1CYQEr/zk91mXrETTP3EDWQg3GJlFQsGkCA9EWE3oWZmR18rbFOl3wK7 8pX+BbDMoaKR0yj90MsCxOofVhP7zh5KP3Chxfkd3TuvKERfAZ/1cMCorIIs8F1m+Y2H hTft6WSmq7nK9LrbRTywNuH9AFcvCCS03+NzmmO6j6nxrzknrddvx1ozTL/VHOahruUa KNew== 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 Cc: linaro-kernel@lists.linaro.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: ALoCoQnqK1JmPsSQ1qDNBj9BrVpqE720n+jiB+H2RqxlklEI7s08JddzIuknz/I8kOMzeEhmr1h4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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);