From patchwork Thu Jul 9 15:43:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 6757111 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 5BCA1C05AC for ; Thu, 9 Jul 2015 15:47:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 73F6D2049E for ; Thu, 9 Jul 2015 15:47:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 140C3206FC for ; Thu, 9 Jul 2015 15:47:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753392AbbGIPrS (ORCPT ); Thu, 9 Jul 2015 11:47:18 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:55922 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752490AbbGIPpC (ORCPT ); Thu, 9 Jul 2015 11:45:02 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NR802JX8930G540@mailout1.samsung.com>; Fri, 10 Jul 2015 00:45:00 +0900 (KST) X-AuditID: cbfee61a-f79516d000006302-95-559e96fb5e68 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 78.AC.25346.BF69E955; Fri, 10 Jul 2015 00:45:00 +0900 (KST) Received: from AMDC1976.DIGITAL.local ([106.120.53.102]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NR800J1C91IAM40@mmp2.samsung.com>; Fri, 10 Jul 2015 00:44:59 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Thomas Abraham , Sylwester Nawrocki , Michael Turquette , Kukjin Kim , Kukjin Kim , Viresh Kumar , Krzysztof Kozlowski Cc: Tomasz Figa , Lukasz Majewski , Heiko Stuebner , Chanwoo Choi , Kevin Hilman , Javier Martinez Canillas , Tobias Jakobi , Anand Moon , linux-samsung-soc@vger.kernel.org, linux-clk@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 v2 6/7] ARM: Exynos: switch to using generic cpufreq driver for Exynos4x12 Date: Thu, 09 Jul 2015 17:43:40 +0200 Message-id: <1436456621-29839-7-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1436456621-29839-1-git-send-email-b.zolnierkie@samsung.com> References: <1436456621-29839-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLLMWRmVeSWpSXmKPExsVy+t9jQd0/0+aFGvRM5bDYOGM9q8X1L89Z Lf4/es1qce33DDaL1y8MLXoXXGWz6H/8mtni6+EVjBZvHm5mtNj0+Bqrxceee6wWl3fNYbP4 3HuE0WLG+X1MFus23mK3uHjK1eLwm3ZWi45ljBZtqz+wWqza9YfRYuNXDwdRj/c3Wtk9/s5u ZfbYOesuu8emVZ1sHneu7WHz2Lyk3uPfMXaPvi2rGD22X5vH7PF5k1wAVxSXTUpqTmZZapG+ XQJXxv0//awF5yUrDvUeYG5gfCTaxcjJISFgItHT/5oRwhaTuHBvPVsXIxeHkMB0RolHuy4z QTi/GCWm3N3BBlLFJmAlMbF9FSNIQkRgBZPE9Cf72EEcZoFWFonlb2cCZTg4hAViJPq+h4A0 sAioSvR2HwRr5hXwkFgx9QUzxDo5iZPHJrOClHMKeEo8/hsDEhYCKvn7/RfLBEbeBYwMqxhF UwuSC4qT0nMN9YoTc4tL89L1kvNzNzGCI+GZ1A7GlQ0WhxgFOBiVeHgbds4NFWJNLCuuzD3E KMHBrCTCe7l/XqgQb0piZVVqUX58UWlOavEhRmkOFiVx3pP5PqFCAumJJanZqakFqUUwWSYO TqkGRqnT6hknNnzwOdk7vbaVZ9WP1No84W8pvwUZRTmCNdSXF8/m+uaqb/1/w6cDL/1ffFOa uvtfRmZsWHay7a0nb//mLRdddPvgHIGJJ/IPLd/ftJx1xbPfZ953fSu+me2yqujjtDMdj45F TEsMFTEQeVQbmhc3/cnf1Dij5kjXqlK9PX1FN5iEPiixFGckGmoxFxUnAgA261+ngAIAAA== 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.2 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 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 4015ec3..0c74e90 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 @@ -224,6 +225,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" }, { .compatible = "samsung,exynos5250", .data = "cpufreq-dt" }, @@ -235,6 +242,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 9ab6388c1..5f5a15a 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm @@ -49,7 +49,7 @@ config ARM_EXYNOS4X12_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 71d8891..89d252e 100644 --- a/drivers/cpufreq/exynos-cpufreq.c +++ b/drivers/cpufreq/exynos-cpufreq.c @@ -150,9 +150,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