From patchwork Fri Apr 10 17:59:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 6198241 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 661B5BF4A6 for ; Fri, 10 Apr 2015 18:00:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 72A2920430 for ; Fri, 10 Apr 2015 18:00:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7B20520437 for ; Fri, 10 Apr 2015 18:00:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756585AbbDJSAV (ORCPT ); Fri, 10 Apr 2015 14:00:21 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:19937 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756566AbbDJSAO (ORCPT ); Fri, 10 Apr 2015 14:00:14 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NML0018NRC2UJ10@mailout3.samsung.com>; Sat, 11 Apr 2015 03:00:02 +0900 (KST) X-AuditID: cbfee61b-f79536d000000f1f-d3-55280fa2ab42 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id AC.83.03871.2AF08255; Sat, 11 Apr 2015 03:00:02 +0900 (KST) Received: from amdc1032.digital.local ([106.116.147.136]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NML004B7RB00E40@mmp1.samsung.com>; Sat, 11 Apr 2015 03:00:02 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Thomas Abraham , Sylwester Nawrocki , Mike Turquette , Kukjin Kim , Kukjin Kim , Viresh Kumar Cc: Tomasz Figa , Lukasz Majewski , Heiko Stuebner , Chanwoo Choi , Kevin Hilman , Javier Martinez Canillas , linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, b.zolnierkie@samsung.com Subject: [PATCH 5/6] ARM: Exynos: switch to using generic cpufreq driver for Exynos4x12 Date: Fri, 10 Apr 2015 19:59:01 +0200 Message-id: <1428688742-15578-6-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1428688742-15578-1-git-send-email-b.zolnierkie@samsung.com> References: <1428688742-15578-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrALMWRmVeSWpSXmKPExsVy+t9jAd1F/BqhBg9OS1lsnLGe1eL6l+es Fv8fvWa1OPq7wKJ3wVU2i/7Hr5ktvh5ewWjx5uFmRotNj6+xWlzeNYfN4nPvEUaLGef3MVk8 nXCRzeLwm3ZWi45ljBardv1htNj41cNB0OPv8+ssHjtn3WX32LSqk83jzrU9bB6bl9R79G1Z xeix/do8Zo/Pm+QCOKK4bFJSczLLUov07RK4MrqWH2Uq2CZZ0TbtOFsD4zHRLkZODgkBE4kn R3exQthiEhfurWfrYuTiEBJYxCjx7fxNNpCEkMBvRon7zSwgNpuAlcTE9lWMIEUiAh8YJV6/ +wbWwSwwn1liwtNTYFXCApESKw6eAbNZBFQlVnd/ApvEK+AhMe/YV+YuRg6gdQoScybZgIQ5 BTwl9hztYwcJCwGV7G4Pm8DIu4CRYRWjaGpBckFxUnqukV5xYm5xaV66XnJ+7iZGcDg/k97B uKrB4hCjAAejEg9vQ6x6qBBrYllxZe4hRgkOZiUR3povQCHelMTKqtSi/Pii0pzU4kOM0hws SuK8c3TlQoUE0hNLUrNTUwtSi2CyTBycUg2Mwc9CNm54dZGPyzvw0oSNXPu/rbsamMOuEb3S VD+94u6xlCtTtbwXqU347+Ha21Fit5KHM/b5E+YJNyxXZR97GHn7ZUji/aX/Xotsvir9dMP9 oJpPnTucOHbNnK4tleYudvXuwsKMdpdvljos/qln/RI0Gdk0Zls/3X5q85nz095enRrpHbte SImlOCPRUIu5qDgRAHnU6bhjAgAA 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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 new CPU clock type allows the use of generic CPUfreq driver. Switch Exynos4x12 to using generic cpufreq driver. This patch also takes care of making ARM_EXYNOS_CPU_FREQ_BOOST_SW config option depend on cpufreq-dt driver instead of exynos-cpufreq one and fixes the minor issue present with the old code (support for 'boost' mode in the exynos-cpufreq driver was enabled for all supported SoCs even though 'boost' frequency was provided only for Exynos4x12 ones). Cc: Tomasz Figa Cc: Kukjin Kim Cc: Javier Martinez Canillas Cc: Thomas Abraham Signed-off-by: Bartlomiej Zolnierkiewicz --- arch/arm/mach-exynos/exynos.c | 14 ++++++++++++++ drivers/cpufreq/Kconfig.arm | 2 +- drivers/cpufreq/exynos-cpufreq.c | 3 --- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index 4e13de5..637d862 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -197,6 +198,12 @@ static void __init exynos_init_irq(void) exynos_map_pmu(); } +struct cpufreq_dt_platform_data cpufreq_dt_pd = { +#ifdef CONFIG_ARM_EXYNOS_CPU_FREQ_BOOST_SW + .boost_supported = true, +#endif +}; + static const struct of_device_id exynos_cpufreq_matches[] = { { .compatible = "samsung,exynos4210", .data = "cpufreq-dt" }, { /* sentinel */ } @@ -207,6 +214,13 @@ static void __init exynos_cpufreq_init(void) struct device_node *root = of_find_node_by_path("/"); const struct of_device_id *match; + if (of_machine_is_compatible("samsung,exynos4212") || + of_machine_is_compatible("samsung,exynos4412")) { + platform_device_register_data(NULL, "cpufreq-dt", -1, + &cpufreq_dt_pd, sizeof(cpufreq_dt_pd)); + return; + } + match = of_match_node(exynos_cpufreq_matches, root); if (!match) { platform_device_register_simple("exynos-cpufreq", -1, NULL, 0); diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm index 1d7ddc5..78cb0b9 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm @@ -60,7 +60,7 @@ config ARM_EXYNOS5250_CPUFREQ config ARM_EXYNOS_CPU_FREQ_BOOST_SW bool "EXYNOS Frequency Overclocking - Software" - depends on ARM_EXYNOS_CPUFREQ && THERMAL + depends on CPUFREQ_DT && THERMAL select CPU_FREQ_BOOST_SW select EXYNOS_THERMAL help diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c index 2d78f63..e48d4f1 100644 --- a/drivers/cpufreq/exynos-cpufreq.c +++ b/drivers/cpufreq/exynos-cpufreq.c @@ -125,9 +125,6 @@ static struct cpufreq_driver exynos_driver = { .init = exynos_cpufreq_cpu_init, .name = "exynos_cpufreq", .attr = cpufreq_generic_attr, -#ifdef CONFIG_ARM_EXYNOS_CPU_FREQ_BOOST_SW - .boost_supported = true, -#endif #ifdef CONFIG_PM .suspend = cpufreq_generic_suspend, #endif