From patchwork Fri May 16 10:18:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jhbird.choi@samsung.com X-Patchwork-Id: 4189881 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 E91D0BFF02 for ; Fri, 16 May 2014 10:18:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CCD78202FF for ; Fri, 16 May 2014 10:18:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF8E6202EC for ; Fri, 16 May 2014 10:18:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756993AbaEPKSd (ORCPT ); Fri, 16 May 2014 06:18:33 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:14763 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756802AbaEPKSb (ORCPT ); Fri, 16 May 2014 06:18:31 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N5N008HQWMTND20@mailout2.samsung.com>; Fri, 16 May 2014 19:18:29 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.50]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id E8.CF.14563.5F5E5735; Fri, 16 May 2014 19:18:29 +0900 (KST) X-AuditID: cbfee68e-b7fd86d0000038e3-e2-5375e5f58fbc Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 58.45.27725.4F5E5735; Fri, 16 May 2014 19:18:29 +0900 (KST) Received: from DOJHBIRDCHO03 ([12.36.166.127]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N5N004ZGWMSY350@mmp1.samsung.com>; Fri, 16 May 2014 19:18:28 +0900 (KST) From: Jonghwan Choi To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, cpufreq@vger.kernel.org Cc: 'Kukjin Kim' , "'Rafael J. Wysocki'" , Jonghwan Choi , 'Viresh Kumar' Subject: [PATCH v3] cpufreq: exynos: Fix the compile error Date: Fri, 16 May 2014 19:18:28 +0900 Message-id: <000001cf70f0$2e48f930$8adaeb90$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: Ac9w8Bys5oureijdRHmj4/8cOX4uYA== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKIsWRmVeSWpSXmKPExsVy+t8zI92vT0uDDRofclo8bfrBbjH/yDlW i71H1rJY9C64ymax6fE1VosZ5/cxWZw5fYnVYuNXDwcOj52z7rJ73Lm2h81j85J6jy1X21k8 +rasYvT4vEkugC2KyyYlNSezLLVI3y6BK+PX7TfsBTfUK1Z+nMncwPhesYuRk0NCwERi0Y1u NghbTOLCvfVANheHkMAyRokbK68ywxRdObeKFSKxiFHi0umtUFX/GCW6r60Gq2IT0JU4tn4L WJWIQBOjxKubv5lBHGaBFYwSD5ZNYwSpEhawlph2cBmYzSKgKvHjXyPYcl4BS4neeffZIWxB iR+T77GA2MwCWhLrdx5ngrDlJTaveQt1k4LEjrOvweaICOhJvG++yg5RIyKx78U7RpDFEgKP 2CVOvDjJBrFMQOLb5ENAQzmAErISmw5AzZGUOLjiBssERrFZSFbPQrJ6FpLVs5CsWMDIsopR NLUguaA4Kb3ISK84Mbe4NC9dLzk/dxMjJEr7djD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6e+2UMGMlX9FHu1JPsoiw3HrInPiT9cAv u7nrSpMm7X7V4qe2fofl5x3z1wbWPPzq83JLifZ2Bta23Qfb7CsW71Bn5d7YUpubv+FOUsK3 1zlL1rhrXHNotIq4+arrwmbJe9G5i9YH3I9mr+Zl37FdiaU4I9FQi7moOBEAd90ESEUDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Commit 7da83a80 ("ARM: EXYNOS: Migrate Exynos specific macros from plat to mach") which lands in samsung tree causes build breakage for cpufreq-exynos like following: drivers/cpufreq/exynos-cpufreq.c: In function 'exynos_cpufreq_probe': drivers/cpufreq/exynos-cpufreq.c:166:2: error: implicit declaration of function 'soc_is_exynos4210' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4412' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:170:2: error: implicit declaration of function 'soc_is_exynos5250' [-Werror=implicit-function-declaration] cc1: some warnings being treated as errors make[2]: *** [drivers/cpufreq/exynos-cpufreq.o] Error 1 make[2]: *** Waiting for unfinished jobs.... drivers/cpufreq/exynos4x12-cpufreq.c: In function 'exynos4x12_set_clkdiv': drivers/cpufreq/exynos4x12-cpufreq.c:118:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration] cc1: some warnings being treated as errors make[2]: *** [drivers/cpufreq/exynos4x12-cpufreq.o] Error 1 make[1]: *** [drivers/cpufreq] Error 2 This fixes above error with getting SoC information via of_machine_is_compatible() instead of soc_is_exynosXXXX(). Signed-off-by: Jonghwan Choi --- drivers/cpufreq/exynos-cpufreq.c | 20 +++++++++++++++++--- drivers/cpufreq/exynos-cpufreq.h | 8 ++++++++ drivers/cpufreq/exynos4x12-cpufreq.c | 11 ++++------- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c index f99cfe2..9aecffef 100644 --- a/drivers/cpufreq/exynos-cpufreq.c +++ b/drivers/cpufreq/exynos-cpufreq.c @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -163,11 +164,24 @@ static int exynos_cpufreq_probe(struct platform_device *pdev) if (!exynos_info) return -ENOMEM; - if (soc_is_exynos4210()) + if (of_machine_is_compatible("samsung,exynos4210")) { + exynos_info->type = EXYNOS_SOC_4210; + } else if (of_machine_is_compatible("samsung,exynos4212")) { + exynos_info->type = EXYNOS_SOC_4212; + } else if (of_machine_is_compatible("samsung,exynos4412")) { + exynos_info->type = EXYNOS_SOC_4212; + } else if (of_machine_is_compatible("samsung,exynos5250")) { + exynos_info->type = EXYNOS_SOC_5250; + } else { + pr_err("%s: Unknown SoC type\n", __func__); + return -ENODEV; + } + + if (exynos_info->type == EXYNOS_SOC_4210) ret = exynos4210_cpufreq_init(exynos_info); - else if (soc_is_exynos4212() || soc_is_exynos4412()) + else if (exynos_info->type == EXYNOS_SOC_4212 || exynos_info->type == EXYNOS_SOC_4412) ret = exynos4x12_cpufreq_init(exynos_info); - else if (soc_is_exynos5250()) + else if (exynos_info->type == EXYNOS_SOC_5250) ret = exynos5250_cpufreq_init(exynos_info); else return 0; diff --git a/drivers/cpufreq/exynos-cpufreq.h b/drivers/cpufreq/exynos-cpufreq.h index 3ddade8..f189547 100644 --- a/drivers/cpufreq/exynos-cpufreq.h +++ b/drivers/cpufreq/exynos-cpufreq.h @@ -17,6 +17,13 @@ enum cpufreq_level_index { L20, }; +enum exynos_soc_type { + EXYNOS_SOC_4210, + EXYNOS_SOC_4212, + EXYNOS_SOC_4412, + EXYNOS_SOC_5250, +}; + #define APLL_FREQ(f, a0, a1, a2, a3, a4, a5, a6, a7, b0, b1, b2, m, p, s) \ { \ .freq = (f) * 1000, \ @@ -34,6 +41,7 @@ struct apll_freq { }; struct exynos_dvfs_info { + enum exynos_soc_type type; unsigned long mpll_freq_khz; unsigned int pll_safe_idx; struct clk *cpu_clk; diff --git a/drivers/cpufreq/exynos4x12-cpufreq.c b/drivers/cpufreq/exynos4x12-cpufreq.c index 466c76a..63a3907 100644 --- a/drivers/cpufreq/exynos4x12-cpufreq.c +++ b/drivers/cpufreq/exynos4x12-cpufreq.c @@ -100,7 +100,6 @@ static struct apll_freq apll_freq_4412[] = { static void exynos4x12_set_clkdiv(unsigned int div_index) { unsigned int tmp; - unsigned int stat_cpu1; /* Change Divider - CPU0 */ @@ -115,13 +114,11 @@ static void exynos4x12_set_clkdiv(unsigned int div_index) tmp = apll_freq_4x12[div_index].clk_div_cpu1; __raw_writel(tmp, EXYNOS4_CLKDIV_CPU1); - if (soc_is_exynos4212()) - stat_cpu1 = 0x11; - else - stat_cpu1 = 0x111; - while (__raw_readl(EXYNOS4_CLKDIV_STATCPU1) & stat_cpu1) + do { cpu_relax(); + tmp = __raw_readl(EXYNOS4_CLKDIV_STATCPU1); + } while (tmp != 0x0); } static void exynos4x12_set_apll(unsigned int index) @@ -184,7 +181,7 @@ int exynos4x12_cpufreq_init(struct exynos_dvfs_info *info) if (IS_ERR(mout_apll)) goto err_mout_apll; - if (soc_is_exynos4212()) + if (info->type == EXYNOS_SOC_4212) apll_freq_4x12 = apll_freq_4212; else apll_freq_4x12 = apll_freq_4412;