From patchwork Wed Jun 26 10:15:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 2786881 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7F8EE9F3A0 for ; Wed, 26 Jun 2013 16:09:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 20ED320542 for ; Wed, 26 Jun 2013 16:09:25 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 99CA42053E for ; Wed, 26 Jun 2013 16:09:23 +0000 (UTC) Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UrsHF-0005CL-0P; Wed, 26 Jun 2013 16:09:01 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UrsGl-0006iN-1i; Wed, 26 Jun 2013 16:08:31 +0000 Received: from bombadil.infradead.org ([2001:1868:205::9]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Urs25-0005IC-Et for linux-arm-kernel@merlin.infradead.org; Wed, 26 Jun 2013 15:53:21 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Urmn1-0000Rv-Le for linux-arm-kernel@lists.infradead.org; Wed, 26 Jun 2013 10:17:29 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MOZ00DLAWK0TXW0@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 26 Jun 2013 19:16:48 +0900 (KST) X-AuditID: cbfee61b-b7f8e6d00000524c-52-51cabf90d8a4 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 52.14.21068.09FBAC15; Wed, 26 Jun 2013 19:16:48 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MOZ008XEWIOKP80@mmp2.samsung.com>; Wed, 26 Jun 2013 19:16:47 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 5/8] ARM: S3C64XX: move cpuidle driver to drivers/cpuidle/ Date: Wed, 26 Jun 2013 12:15:44 +0200 Message-id: <1372241747-21083-6-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1372241747-21083-1-git-send-email-b.zolnierkie@samsung.com> References: <1372241747-21083-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupikeLIzCtJLcpLzFFi42I5/e+xoO6E/acCDdrm8ltsnLGe1WLSugNM FvM+y1o0b/3KaLFq6k4Wi94FV9ks7qxgtjjb9IbdYsqf5UwWmx5fY7X43HuE0WL5iqfMFg9W v2Wz+Ha5md1if+8GJot1D18wWfQv7GWyeLpuCbPFrS1NbBavDraxWOy/4uUg6rHg11YWj29f J7F4XH/1n8nj76oXzB47Z91l93h14Q6Lx51re9g8Ni+p95h4exqLR/9fA4++LasYPR4tbmH0 +L50DbvH8RvbmTzm/PzG4vF5k1yAYBSXTUpqTmZZapG+XQJXxr6Hc9gK5mhWfL1xmamB8Yxi FyMHh4SAicTEOdldjJxAppjEhXvr2boYuTiEBKYzSty7vQXK6WKSOHewlxWkik3ASmJi+ypG EFtEQENiStdjdhCbWeAes8S+j7kgtrCAl8T01+2sIAtYBFQl/h5zAgnzCnhIPF/xlgVimbzE 0/t9bCA2p4CnxNyZS8FsIaCapWuXMk5g5F3AyLCKUTS1ILmgOCk910ivODG3uDQvXS85P3cT IziGnknvYFzVYHGIUYCDUYmHV2HryUAh1sSy4srcQ4wSHMxKIrxv5p8KFOJNSaysSi3Kjy8q zUktPsQozcGiJM57sNU6UEggPbEkNTs1tSC1CCbLxMEp1cA49eblxkOFvz5VaOxYb+GwarHs 6fy0r9+iWcr/PV4h7q55TG5P6atQt7ONPyO+KhuF3NlS0LF7rtcONblH/gylh9Ur7lwzrZ9Q l/fpU/OZaLs1wlvmv+jmXs1WoFB288LxTqWU5nBvsWOWy2Z0aBdKHCgWvD9rzc476b5vikwX zJDKPDE3Vb1aiaU4I9FQi7moOBEA3+Q7rJ0CAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130626_031727_996690_F16A9E99 X-CRM114-Status: GOOD ( 13.81 ) X-Spam-Score: -6.3 (------) Cc: rjw@sisk.pl, kgene.kim@samsung.com, magnus.damm@gmail.com, ben-linux@fluff.org, linux-pm@vger.kernel.org, khilman@deeprootsystems.com, nsekhar@ti.com, linus.walleij@linaro.org, swarren@wwwdotorg.org, nicolas.ferre@atmel.com, daniel.lezcano@linaro.org, tony@atomide.com, kyungmin.park@samsung.com, horms@verge.net.au, srinidhi.kasagar@stericsson.com, kernel@pengutronix.de, shawn.guo@linaro.org, plagnioj@jcrosoft.com, linux@maxim.org.za, b.zolnierkie@samsung.com 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 X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP While at it: - remove file path from comment Compile tested only. Cc: Ben Dooks Cc: Kukjin Kim Cc: Daniel Lezcano Cc: "Rafael J. Wysocki" Signed-off-by: Kyungmin Park Signed-off-by: Bartlomiej Zolnierkiewicz --- arch/arm/mach-s3c64xx/Makefile | 1 - arch/arm/mach-s3c64xx/cpuidle.c | 63 --------------------------------------- drivers/cpuidle/Makefile | 3 ++ drivers/cpuidle/cpuidle-s3c64xx.c | 62 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 64 deletions(-) delete mode 100644 arch/arm/mach-s3c64xx/cpuidle.c create mode 100644 drivers/cpuidle/cpuidle-s3c64xx.c diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile index 31d0c91..e7a3ee7 100644 --- a/arch/arm/mach-s3c64xx/Makefile +++ b/arch/arm/mach-s3c64xx/Makefile @@ -22,7 +22,6 @@ obj-$(CONFIG_CPU_S3C6410) += s3c6410.o # PM obj-$(CONFIG_PM) += pm.o irq-pm.o sleep.o -obj-$(CONFIG_CPU_IDLE) += cpuidle.o # DMA support diff --git a/arch/arm/mach-s3c64xx/cpuidle.c b/arch/arm/mach-s3c64xx/cpuidle.c deleted file mode 100644 index 3c8ab07..0000000 --- a/arch/arm/mach-s3c64xx/cpuidle.c +++ /dev/null @@ -1,63 +0,0 @@ -/* linux/arch/arm/mach-s3c64xx/cpuidle.c - * - * Copyright (c) 2011 Wolfson Microelectronics, plc - * Copyright (c) 2011 Samsung Electronics Co., Ltd. - * http://www.samsung.com - * - * 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 -#include -#include - -#include - -#include - -#include "regs-sys.h" -#include "regs-syscon-power.h" - -static int s3c64xx_enter_idle(struct cpuidle_device *dev, - struct cpuidle_driver *drv, - int index) -{ - unsigned long tmp; - - /* Setup PWRCFG to enter idle mode */ - tmp = __raw_readl(S3C64XX_PWR_CFG); - tmp &= ~S3C64XX_PWRCFG_CFG_WFI_MASK; - tmp |= S3C64XX_PWRCFG_CFG_WFI_IDLE; - __raw_writel(tmp, S3C64XX_PWR_CFG); - - cpu_do_idle(); - - return index; -} - -static struct cpuidle_driver s3c64xx_cpuidle_driver = { - .name = "s3c64xx_cpuidle", - .owner = THIS_MODULE, - .states = { - { - .enter = s3c64xx_enter_idle, - .exit_latency = 1, - .target_residency = 1, - .flags = CPUIDLE_FLAG_TIME_VALID, - .name = "IDLE", - .desc = "System active, ARM gated", - }, - }, - .state_count = 1, -}; - -static int __init s3c64xx_init_cpuidle(void) -{ - return cpuidle_register(&s3c64xx_cpuidle_driver, NULL); -} -device_initcall(s3c64xx_init_cpuidle); diff --git a/drivers/cpuidle/Makefile b/drivers/cpuidle/Makefile index 6436c67..eed221e 100644 --- a/drivers/cpuidle/Makefile +++ b/drivers/cpuidle/Makefile @@ -31,4 +31,7 @@ ifeq ($(CONFIG_ARCH_OMAP4),y) ccflags-y += -I$(srctree)/arch/arm/mach-omap2/include obj-y += cpuidle-omap44xx.o endif +ifeq ($(CONFIG_ARCH_S3C64XX),y) + obj-y += cpuidle-s3c64xx.o +endif obj-$(CONFIG_CPU_IDLE_ZYNQ) += cpuidle-zynq.o diff --git a/drivers/cpuidle/cpuidle-s3c64xx.c b/drivers/cpuidle/cpuidle-s3c64xx.c new file mode 100644 index 0000000..c18d075 --- /dev/null +++ b/drivers/cpuidle/cpuidle-s3c64xx.c @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2011 Wolfson Microelectronics, plc + * Copyright (c) 2011 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * 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 +#include +#include + +#include + +#include + +#include "../../arch/arm/mach-s3c64xx/regs-sys.h" +#include "../../arch/arm/mach-s3c64xx/regs-syscon-power.h" + +static int s3c64xx_enter_idle(struct cpuidle_device *dev, + struct cpuidle_driver *drv, + int index) +{ + unsigned long tmp; + + /* Setup PWRCFG to enter idle mode */ + tmp = __raw_readl(S3C64XX_PWR_CFG); + tmp &= ~S3C64XX_PWRCFG_CFG_WFI_MASK; + tmp |= S3C64XX_PWRCFG_CFG_WFI_IDLE; + __raw_writel(tmp, S3C64XX_PWR_CFG); + + cpu_do_idle(); + + return index; +} + +static struct cpuidle_driver s3c64xx_cpuidle_driver = { + .name = "s3c64xx_cpuidle", + .owner = THIS_MODULE, + .states = { + { + .enter = s3c64xx_enter_idle, + .exit_latency = 1, + .target_residency = 1, + .flags = CPUIDLE_FLAG_TIME_VALID, + .name = "IDLE", + .desc = "System active, ARM gated", + }, + }, + .state_count = 1, +}; + +static int __init s3c64xx_init_cpuidle(void) +{ + return cpuidle_register(&s3c64xx_cpuidle_driver, NULL); +} +device_initcall(s3c64xx_init_cpuidle);