From patchwork Wed Jan 28 13:16:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 5728221 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E94109F1C5 for ; Wed, 28 Jan 2015 13:19:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0801320263 for ; Wed, 28 Jan 2015 13:19:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2ACEA20218 for ; Wed, 28 Jan 2015 13:19:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YGSVb-0004GC-L5; Wed, 28 Jan 2015 13:18:15 +0000 Received: from mout.kundenserver.de ([212.227.126.131]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YGSV6-0003mH-FM for linux-arm-kernel@lists.infradead.org; Wed, 28 Jan 2015 13:17:45 +0000 Received: from wuerfel.lan. ([149.172.15.242]) by mrelayeu.kundenserver.de (mreue005) with ESMTPSA (Nemesis) id 0LjfXI-1Xevsn1fKK-00beOJ; Wed, 28 Jan 2015 14:17:05 +0100 From: Arnd Bergmann To: linux-pm@vger.kernel.org Subject: [PATCH 3/3] cpufreq: exynos: allow modular build Date: Wed, 28 Jan 2015 14:16:55 +0100 Message-Id: <1422451015-390439-4-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.1.0.rc2 In-Reply-To: <1422451015-390439-1-git-send-email-arnd@arndb.de> References: <1422451015-390439-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:GjkdEFX/Rwnre8bFAKG+mx7J1WlGkRs+Z9nghx/gAjf+j7j8m9w F2kgv27WwvfPlUjOpIiEodFhjfZsa05cGu+ZmW2gR+lD+WMx+uxNSkBXXn1wdhJtQjQMHfP sSdTAEbUKcZuazlmwcQMLSuiCzJ434MrkMsJDg1xMScBOmgYOhKkXh3uPzGXXQ78b5PtIFu oVz4P7g6xmnMIyOCmpCrw== X-UI-Out-Filterresults: notjunk:1; X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150128_051744_886479_5E43D2B7 X-CRM114-Status: GOOD ( 12.60 ) X-Spam-Score: -0.0 (/) Cc: linux-samsung-soc@vger.kernel.org, Viresh Kumar , "Rafael J. Wysocki" , Eduardo Valentin , Kukjin Kim , Zhang Rui , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 The exynos cpufreq driver code recently gained a dependency on the cooling code, which may be a loadable module. This breaks an ARM allmodconfig build: drivers/built-in.o: In function `exynos_cpufreq_probe': :(.text+0x1748e8): undefined reference to `of_cpufreq_cooling_register' To avoid this problem, change cpufreq Kconfig to allow the drivers to be loadable modules as well and enforce a dependency on the thermal module. Also, export the symbols that are used for communicating between the three cpu-specific parts of the driver and the main module. Signed-off-by: Arnd Bergmann Fixes: e725d26c4857 ("cpufreq: exynos: Use device tree to determine if cpufreq cooling should be registered") --- drivers/cpufreq/Kconfig.arm | 14 +++++++++----- drivers/cpufreq/exynos-cpufreq.h | 6 +++--- drivers/cpufreq/exynos4210-cpufreq.c | 1 + drivers/cpufreq/exynos4x12-cpufreq.c | 1 + drivers/cpufreq/exynos5250-cpufreq.c | 1 + 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm index 0f9a2c3c0e0d..99ac56746ebd 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm @@ -26,11 +26,12 @@ config ARM_VEXPRESS_SPC_CPUFREQ config ARM_EXYNOS_CPUFREQ - bool + tristate config ARM_EXYNOS4210_CPUFREQ - bool "SAMSUNG EXYNOS4210" + tristate "SAMSUNG EXYNOS4210" depends on CPU_EXYNOS4210 + depends on THERMAL default y select ARM_EXYNOS_CPUFREQ help @@ -40,8 +41,9 @@ config ARM_EXYNOS4210_CPUFREQ If in doubt, say N. config ARM_EXYNOS4X12_CPUFREQ - bool "SAMSUNG EXYNOS4x12" + tristate "SAMSUNG EXYNOS4x12" depends on SOC_EXYNOS4212 || SOC_EXYNOS4412 + depends on THERMAL default y select ARM_EXYNOS_CPUFREQ help @@ -51,8 +53,9 @@ config ARM_EXYNOS4X12_CPUFREQ If in doubt, say N. config ARM_EXYNOS5250_CPUFREQ - bool "SAMSUNG EXYNOS5250" + tristate "SAMSUNG EXYNOS5250" depends on SOC_EXYNOS5250 + depends on THERMAL default y select ARM_EXYNOS_CPUFREQ help @@ -62,9 +65,10 @@ config ARM_EXYNOS5250_CPUFREQ If in doubt, say N. config ARM_EXYNOS5440_CPUFREQ - bool "SAMSUNG EXYNOS5440" + tristate "SAMSUNG EXYNOS5440" depends on SOC_EXYNOS5440 depends on HAVE_CLK && OF + depends on THERMAL select PM_OPP default y help diff --git a/drivers/cpufreq/exynos-cpufreq.h b/drivers/cpufreq/exynos-cpufreq.h index 9f2062a7cc02..32a895af4961 100644 --- a/drivers/cpufreq/exynos-cpufreq.h +++ b/drivers/cpufreq/exynos-cpufreq.h @@ -53,7 +53,7 @@ struct exynos_dvfs_info { void __iomem *cmu_regs; }; -#ifdef CONFIG_ARM_EXYNOS4210_CPUFREQ +#if IS_ENABLED(CONFIG_ARM_EXYNOS4210_CPUFREQ) extern int exynos4210_cpufreq_init(struct exynos_dvfs_info *); #else static inline int exynos4210_cpufreq_init(struct exynos_dvfs_info *info) @@ -61,7 +61,7 @@ static inline int exynos4210_cpufreq_init(struct exynos_dvfs_info *info) return -EOPNOTSUPP; } #endif -#ifdef CONFIG_ARM_EXYNOS4X12_CPUFREQ +#if IS_ENABLED(CONFIG_ARM_EXYNOS4X12_CPUFREQ) extern int exynos4x12_cpufreq_init(struct exynos_dvfs_info *); #else static inline int exynos4x12_cpufreq_init(struct exynos_dvfs_info *info) @@ -69,7 +69,7 @@ static inline int exynos4x12_cpufreq_init(struct exynos_dvfs_info *info) return -EOPNOTSUPP; } #endif -#ifdef CONFIG_ARM_EXYNOS5250_CPUFREQ +#if IS_ENABLED(CONFIG_ARM_EXYNOS5250_CPUFREQ) extern int exynos5250_cpufreq_init(struct exynos_dvfs_info *); #else static inline int exynos5250_cpufreq_init(struct exynos_dvfs_info *info) diff --git a/drivers/cpufreq/exynos4210-cpufreq.c b/drivers/cpufreq/exynos4210-cpufreq.c index 843ec824fd91..4b5de19f0ea2 100644 --- a/drivers/cpufreq/exynos4210-cpufreq.c +++ b/drivers/cpufreq/exynos4210-cpufreq.c @@ -182,3 +182,4 @@ err_moutcore: pr_debug("%s: failed initialization\n", __func__); return -EINVAL; } +EXPORT_SYMBOL_GPL(exynos4210_cpufreq_init); diff --git a/drivers/cpufreq/exynos4x12-cpufreq.c b/drivers/cpufreq/exynos4x12-cpufreq.c index 9e78a850e29f..d2924e1bc909 100644 --- a/drivers/cpufreq/exynos4x12-cpufreq.c +++ b/drivers/cpufreq/exynos4x12-cpufreq.c @@ -234,3 +234,4 @@ err_moutcore: pr_debug("%s: failed initialization\n", __func__); return -EINVAL; } +EXPORT_SYMBOL_GPL(exynos4x12_cpufreq_init); diff --git a/drivers/cpufreq/exynos5250-cpufreq.c b/drivers/cpufreq/exynos5250-cpufreq.c index 3eafdc7ba787..b2810b839331 100644 --- a/drivers/cpufreq/exynos5250-cpufreq.c +++ b/drivers/cpufreq/exynos5250-cpufreq.c @@ -208,3 +208,4 @@ err_moutcore: pr_err("%s: failed initialization\n", __func__); return -EINVAL; } +EXPORT_SYMBOL_GPL(exynos5250_cpufreq_init);