From patchwork Fri Aug 30 10:15:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 2851865 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C813DC0AB5 for ; Fri, 30 Aug 2013 10:15:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C79920203 for ; Fri, 30 Aug 2013 10:15:49 +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 B82B6201FE for ; Fri, 30 Aug 2013 10:15:46 +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 1VFLjy-0001rx-Gz; Fri, 30 Aug 2013 10:15:42 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VFLjw-0001ju-1Q; Fri, 30 Aug 2013 10:15:40 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VFLjs-0001jB-0a for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2013 10:15:37 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MSC00AVN9SXRB10@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2013 19:15:10 +0900 (KST) X-AuditID: cbfee61b-b7f776d0000016c8-8f-522070ae61c7 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 32.D0.05832.EA070225; Fri, 30 Aug 2013 19:15:10 +0900 (KST) Received: from amdc1032.localnet ([106.116.147.136]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MSC008OS9T8IGE0@mmp1.samsung.com>; Fri, 30 Aug 2013 19:15:10 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Kukjin Kim Subject: [PATCH 1/2] ARM: EXYNOS: convert cpuidle driver to be a platform driver Date: Fri, 30 Aug 2013 12:15:04 +0200 Message-id: <86136702.IKrZfWSsO8@amdc1032> User-Agent: KMail/4.8.4 (Linux/3.2.0-52-generic-pae; KDE/4.8.5; i686; ; ) MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCLMWRmVeSWpSXmKPExsVy+t9jAd11BQpBBk1T9SwaroZYzPssa9G7 4CqbxabH11gtPvceYbSYcX4fk0X/wl4mi/UzXrM4cHjcubaHzWPzknqPvi2rGD0eLW5h9Pi8 SS6ANYrLJiU1J7MstUjfLoErY2v7AsaCFfIVi3pbmRsY70p1MXJySAiYSBz7eZoVwhaTuHBv PVsXIxeHkMAiRokVO2eCJYQEWpgklj/JALHZBKwkJravYgSxRQTUJHoWb2UEaWAW6GWSWN+6 mAkkISwQIHHhyG2gBAcHi4CqxNkFMiAmr4CWRMuKFJAKUQFPiU+TljKD2LwCghI/Jt9jAbGZ BeQl9u2fygpha0ms33mcaQIj3ywkZbOQlM1CUraAkXkVo2hqQXJBcVJ6rpFecWJucWleul5y fu4mRnDYPpPewbiqweIQowAHoxIPb8NU+SAh1sSy4srcQ4wSHMxKIrwVqQpBQrwpiZVVqUX5 8UWlOanFhxilOViUxHkPtloHCgmkJ5akZqemFqQWwWSZODilGhgbHoTLflTfJsKY8teU5YbM 9JZvjBXK6fKLMrMXTHhc5K/x9QFn463ZYvzax/uuv+aQ2J6oI56gZL6/WG7P8Z77HF0S5Tfu zSv43DS/+I7v85lheccv2F08LVF574hiWf3XF3+nB0tmZb/8d6GU5fNLldreQ9oi2XO99biL Cl7cePNizerGz5lKLMUZiYZazEXFiQASf/jkVwIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130830_061536_288794_E749B3CB X-CRM114-Status: GOOD ( 16.54 ) X-Spam-Score: -9.0 (---------) Cc: linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, Tomasz Figa , Daniel Lezcano , "Rafael J. Wysocki" , Amit Daniel Kachhap , linux-arm-kernel@lists.infradead.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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.3 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 ARM EXYNOS cpuidle driver is currently not multiplatform support ready (as it uses device_initcall() for initialization and doesn't check on what platform it is running). Fix it by converting the driver to be a platform driver and registering exynos_cpuidle platform device from exynos[4,5]_dt_machine_init(). Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Kyungmin Park Cc: Tomasz Figa Cc: Amit Daniel Kachhap Acked-by: Daniel Lezcano --- arch/arm/mach-exynos/common.c | 11 +++++++++++ arch/arm/mach-exynos/common.h | 1 + arch/arm/mach-exynos/cpuidle.c | 14 ++++++++++++-- arch/arm/mach-exynos/mach-exynos4-dt.c | 2 ++ arch/arm/mach-exynos/mach-exynos5-dt.c | 2 ++ 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index ba95e5d..c17407b 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -294,6 +295,16 @@ void exynos5_restart(enum reboot_mode mode, const char *cmd) __raw_writel(val, addr); } +static struct platform_device exynos_cpuidle = { + .name = "exynos_cpuidle", + .id = -1, +}; + +void __init exynos_cpuidle_init(void) +{ + platform_device_register(&exynos_cpuidle); +} + void __init exynos_init_late(void) { if (of_machine_is_compatible("samsung,exynos5440")) diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index 8646a14..b2ac188 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -22,6 +22,7 @@ struct map_desc; void exynos_init_io(void); void exynos4_restart(enum reboot_mode mode, const char *cmd); void exynos5_restart(enum reboot_mode mode, const char *cmd); +void exynos_cpuidle_init(void); void exynos_init_late(void); void exynos_firmware_init(void); diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c index 225ee84..8e881e0 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -192,7 +193,7 @@ static void __init exynos5_core_down_clk(void) __raw_writel(tmp, EXYNOS5_PWR_CTRL2); } -static int __init exynos4_init_cpuidle(void) +static int __init exynos_cpuidle_probe(struct platform_device *pdev) { int cpu_id, ret; struct cpuidle_device *device; @@ -223,4 +224,13 @@ static int __init exynos4_init_cpuidle(void) return 0; } -device_initcall(exynos4_init_cpuidle); + +static struct platform_driver exynos_cpuidle_driver = { + .probe = exynos_cpuidle_probe, + .driver = { + .name = "exynos_cpuidle", + .owner = THIS_MODULE, + }, +}; + +module_platform_driver(exynos_cpuidle_driver); diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c index 0099c6c..53a3dc3 100644 --- a/arch/arm/mach-exynos/mach-exynos4-dt.c +++ b/arch/arm/mach-exynos/mach-exynos4-dt.c @@ -25,6 +25,8 @@ static void __init exynos4_dt_machine_init(void) { + exynos_cpuidle_init(); + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); } diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c index f874b77..c9f7dd1 100644 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c @@ -47,6 +47,8 @@ static void __init exynos5_dt_machine_init(void) } } + exynos_cpuidle_init(); + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); }