From patchwork Wed Oct 16 16:00:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 3054211 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 E48BABF924 for ; Wed, 16 Oct 2013 16:01:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B571820174 for ; Wed, 16 Oct 2013 16:01:33 +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 77228200D0 for ; Wed, 16 Oct 2013 16:01:32 +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 1VWTXM-0005tK-VT; Wed, 16 Oct 2013 16:01:29 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VWTXK-0004y3-JZ; Wed, 16 Oct 2013 16:01:26 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VWTXG-0004x3-04 for linux-arm-kernel@lists.infradead.org; Wed, 16 Oct 2013 16:01:23 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MUR000JMR5BSFB0@mailout2.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 16 Oct 2013 17:00:54 +0100 (BST) X-AuditID: cbfec7f5-b7ef66d00000795a-da-525eb836abbe Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id BC.80.31066.638BE525; Wed, 16 Oct 2013 17:00:54 +0100 (BST) Received: from amdc1227.digital.local ([106.116.147.199]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0MUR009PCR5EUJ50@eusync2.samsung.com>; Wed, 16 Oct 2013 17:00:54 +0100 (BST) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH] cpufreq: exynos: Convert exynos-cpufreq to platform driver Date: Wed, 16 Oct 2013 18:00:38 +0200 Message-id: <1381939238-30398-1-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.8.3.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCJMWRmVeSWpSXmKPExsVy+t/xK7pmO+KCDK5vZ7V42vSD3aJ3wVU2 i7NNb9gt3jzczGix6fE1VovPvUcYLWac38dkcfsyr8WZ05dYLdbPeM1isfGrhwO3R0tzD5vH nWt72Dw2L6n32HK1ncWjb8sqRo/Pm+QC2KK4bFJSczLLUov07RK4Mrbda2QtuCtZ8f5cK2MD 40yxLkZODgkBE4lJi66yQ9hiEhfurWcDsYUEljJKvL0h1MXIBWT3MUk8vrieBSTBJqAm8bnh EViRiICqxOe2BewgRcwCbcwSMy5MZgZJCAt4SyzecQGsiAWo6OGWaawgNq+Ak8TcDS1MENsU JJZ9Wcs8gZF7ASPDKkbR1NLkguKk9FwjveLE3OLSvHS95PzcTYyQkPq6g3HpMatDjAIcjEo8 vDOWxwUJsSaWFVfmHmKU4GBWEuH9tBUoxJuSWFmVWpQfX1Sak1p8iJGJg1OqgdFWbnG0y/Iq sfIk591ty9uybvceNej+eaU7qkx7U/TBwCiTkqovE7WZTs2fOPfEt4VuKldm7X277d/70zYb rr8yVTku/PipMstW9lcuyzIj8z+cmaEupa7xpsmUdVGL8AsNw1OiOxPWqca1LLw70ybaq+ON YUnLcybBd2d+VrO8W764bL2vrbASS3FGoqEWc1FxIgBXRH2QBwIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131016_120122_144862_D463170C X-CRM114-Status: GOOD ( 13.46 ) X-Spam-Score: -4.4 (----) Cc: Lukasz Majewski , Kukjin Kim , Russell King - ARM Linux , linux-pm@vger.kernel.org, Viresh Kumar , Tomasz Figa , "Rafael J. Wysocki" , cpufreq@vger.kernel.org, Kyungmin Park , 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: , 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=-1.7 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no 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 From: Lukasz Majewski To make the driver multiplatform-friendly, unconditional initialization in an initcall is replaced with a platform driver probed only if respective platform device is registered. Signed-off-by: Lukasz Majewski Signed-off-by: Tomasz Figa Signed-off-by: Kyungmin Park --- arch/arm/mach-exynos/common.c | 5 +++++ arch/arm/mach-exynos/common.h | 1 + arch/arm/mach-exynos/mach-exynos4-dt.c | 1 + arch/arm/mach-exynos/mach-exynos5-dt.c | 1 + drivers/cpufreq/exynos-cpufreq.c | 11 ++++++++++- 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index c17407b..4414d70 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -305,6 +305,11 @@ void __init exynos_cpuidle_init(void) platform_device_register(&exynos_cpuidle); } +void __init exynos_cpufreq_init(void) +{ + platform_device_register_simple("exynos-cpufreq", -1, NULL, 0); +} + 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 b2ac188..61e5f3a 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -23,6 +23,7 @@ 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_cpufreq_init(void); void exynos_init_late(void); void exynos_firmware_init(void); diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c index 53a3dc3..2cbaf63 100644 --- a/arch/arm/mach-exynos/mach-exynos4-dt.c +++ b/arch/arm/mach-exynos/mach-exynos4-dt.c @@ -26,6 +26,7 @@ static void __init exynos4_dt_machine_init(void) { exynos_cpuidle_init(); + exynos_cpufreq_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 c9f7dd1..9144549 100644 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c @@ -48,6 +48,7 @@ static void __init exynos5_dt_machine_init(void) } exynos_cpuidle_init(); + exynos_cpufreq_init(); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); } diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c index 0ef13e8..706570e 100644 --- a/drivers/cpufreq/exynos-cpufreq.c +++ b/drivers/cpufreq/exynos-cpufreq.c @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -277,4 +278,12 @@ err_vdd_arm: kfree(exynos_info); return -EINVAL; } -late_initcall(exynos_cpufreq_init); + +static struct platform_driver exynos_cpufreq_platdrv = { + .driver = { + .name = "exynos-cpufreq", + .owner = THIS_MODULE, + }, + .probe = exynos_cpufreq_init, +}; +module_platform_driver(exynos_cpufreq_platdrv);