From patchwork Thu Aug 6 13:41:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 6959071 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 633A6C05AC for ; Thu, 6 Aug 2015 13:45:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 582BC206FB for ; Thu, 6 Aug 2015 13:45:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6AC6D20634 for ; Thu, 6 Aug 2015 13:45:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754100AbbHFNnT (ORCPT ); Thu, 6 Aug 2015 09:43:19 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:60466 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753668AbbHFNnQ (ORCPT ); Thu, 6 Aug 2015 09:43:16 -0400 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NSN007ZOY3L6T00@mailout4.samsung.com>; Thu, 06 Aug 2015 22:43:14 +0900 (KST) X-AuditID: cbfee61a-f79a06d000005c6f-7e-55c36472125a Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 13.EE.23663.27463C55; Thu, 6 Aug 2015 22:43:14 +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 <0NSN00CWLY3I7030@mmp2.samsung.com>; Thu, 06 Aug 2015 22:43:14 +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, Javier Martinez Canillas Subject: [PATCH v4 1/6] cpufreq: make scaling_boost_freqs sysfs attr available when boost is enabled Date: Thu, 06 Aug 2015 15:41:49 +0200 Message-id: <1438868514-8814-2-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1438868514-8814-1-git-send-email-b.zolnierkie@samsung.com> References: <1438868514-8814-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNLMWRmVeSWpSXmKPExsVy+t9jQd2ilMOhBp8fK1psnLGe1eL6l+es Fv8fvWa1uPZ7BpvFm7drmCxevzC06F1wlc2i//FrZouvh1cwWrx5uJnRYtPja6wWH3vusVpc 3jWHzeJz7xFGixnn9zFZrNt4i93i4ilXi8Nv2lktOpYxWrSt/sBqsWrXH0aLjV89HMQ83t9o Zff4O7uV2WPnrLvsHptWdbJ53Lm2h81j85J6j3/H2D229AOF+7asYvTYfm0es8fnTXIB3FFc NimpOZllqUX6dglcGZ+mnWYseCZS8XH6JNYGxi+CXYycHBICJhLX9/WwQdhiEhfurQeyuTiE BGYxShycMZMFwvnFKHGlfSUzSBWbgJXExPZVjCAJEYEVTBLTn+xjB3GYBXawSHw5f5m1i5GD Q1ggTWLuRhuQBhYBVYmna26wgti8Au4Sh7edZYdYJydx8thksDingIfEzG/nwOJCQDUH7x1g nMDIu4CRYRWjRGpBckFxUnquYV5quV5xYm5xaV66XnJ+7iZGcJQ8k9rBeHCX+yFGAQ5GJR7e B2sOhQqxJpYVV+YeYpTgYFYS4X2ofzhUiDclsbIqtSg/vqg0J7X4EKM0B4uSOK/shs2hQgLp iSWp2ampBalFMFkmDk6pBsatbjO8hROeRrG/OnnqgZfCw4UCJrN+cb6cq7Ha8JLRuui3sRkG JwLF//Mx8m61eWjltC8qle3+2SLHc/zCb9a9iSg3NjyTxvC02rhXW2NZ7ftD75zvBmeKP9vz vPRecdDWmzvFl0X2Gh+/lWqwObxnzb4Nuinle1h3tk+1O/nY7/rnasEHbXpKLMUZiYZazEXF iQDPFPJEjgIAAA== 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.0 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 Add cpufreq_boost_enabled_generic_attr table and use it in cpufreq-dt driver instead of cpufreq_generic_attr one when boost support is enabled. As a result scaling_boost_freqs sysfs attribute is available when cpufreq-dt driver is used and boost support is enabled. Cc: Viresh Kumar Cc: Thomas Abraham Cc: Javier Martinez Canillas Cc: Krzysztof Kozlowski Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/cpufreq/cpufreq-dt.c | 3 +++ drivers/cpufreq/freq_table.c | 7 +++++++ include/linux/cpufreq.h | 1 + 3 files changed, 11 insertions(+) diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index b9259ab..7b091c0 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -182,6 +182,8 @@ try_again: return ret; } +static struct cpufreq_driver dt_cpufreq_driver; + static int cpufreq_init(struct cpufreq_policy *policy) { struct cpufreq_frequency_table *freq_table; @@ -336,6 +338,7 @@ static int cpufreq_init(struct cpufreq_policy *policy) ret = cpufreq_enable_boost_support(); if (ret) goto out_free_cpufreq_table; + dt_cpufreq_driver.attr = cpufreq_boost_enabled_generic_attr; } policy->cpuinfo.transition_latency = transition_latency; diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c index a8f1daf..5a00a09 100644 --- a/drivers/cpufreq/freq_table.c +++ b/drivers/cpufreq/freq_table.c @@ -300,6 +300,13 @@ struct freq_attr *cpufreq_generic_attr[] = { }; EXPORT_SYMBOL_GPL(cpufreq_generic_attr); +struct freq_attr *cpufreq_boost_enabled_generic_attr[] = { + &cpufreq_freq_attr_scaling_available_freqs, + &cpufreq_freq_attr_scaling_boost_freqs, + NULL, +}; +EXPORT_SYMBOL_GPL(cpufreq_boost_enabled_generic_attr); + int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, struct cpufreq_frequency_table *table) { diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 95f0186..25937ff 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -610,6 +610,7 @@ struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); /* the following are really really optional */ extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; extern struct freq_attr *cpufreq_generic_attr[]; +extern struct freq_attr *cpufreq_boost_enabled_generic_attr[]; int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, struct cpufreq_frequency_table *table);