From patchwork Wed Apr 30 06:28:35 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: 4091651 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 947319F271 for ; Wed, 30 Apr 2014 06:29:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C49A5201D5 for ; Wed, 30 Apr 2014 06:29:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BDE97201CE for ; Wed, 30 Apr 2014 06:29:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750816AbaD3G2u (ORCPT ); Wed, 30 Apr 2014 02:28:50 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:24049 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752171AbaD3G2h (ORCPT ); Wed, 30 Apr 2014 02:28:37 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N4T008R8ZBOAE30@mailout3.samsung.com>; Wed, 30 Apr 2014 15:28:36 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.48]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 8C.0C.11496.31890635; Wed, 30 Apr 2014 15:28:35 +0900 (KST) X-AuditID: cbfee691-b7f3e6d000002ce8-2b-53609813e6f2 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id AD.D2.27725.31890635; Wed, 30 Apr 2014 15:28:35 +0900 (KST) Received: from DOJHBIRDCHO03 ([12.36.166.127]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N4T00G58ZBNRR70@mmp2.samsung.com>; Wed, 30 Apr 2014 15:28:35 +0900 (KST) From: Jonghwan Choi To: "'open list:CPU FREQUENCY DRI...'" , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: "'Rafael J. Wysocki'" , 'Viresh Kumar' , 'Kukjin Kim' Subject: [PATCH 2/3] cpufreq: Removed exynos_sort_descend_freq_table funtion Date: Wed, 30 Apr 2014 15:28:35 +0900 Message-id: <000101cf643d$6a36c270$3ea44750$@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: Ac9kPVKBFaiasMjKTVi2uQvGI0dSzQ== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKIsWRmVeSWpSXmKPExsVy+t8zA13hGQnBBnvXGlk8bfrBbtG74Cqb xabH11gtZpzfx2Rx5vQlVouNXz0c2DzuXNvD5rF5Sb3HlqvtLB59W1YxenzeJBfAGsVlk5Ka k1mWWqRvl8CV0XP9BktBv0DF4ZcnmRsYV/J2MXJySAiYSHSem8UEYYtJXLi3nq2LkYtDSGAZ o8S6FV2sMEVbXr+FSkxnlJj4ZTMLhPOPUeL1w+VgVWwCuhLH1m9hBUmICHQzSkxeu4QFJMEs UC9xunMTWJGwgI/E4YsH2EBsFgFViX0LZ4DZvAKWEv3tD5khbEGJH5PvQfVqSazfeZwJwpaX 2LzmLTPESQoSO86+ZgSxRQT0JA6+PMUKUSMise/FO0aQIyQEjrFLnL/YzAyxTEDi2+RDQEM5 gBKyEpsOQM2RlDi44gbLBEaxWUhWz0KyehaS1bOQrFjAyLKKUTS1ILmgOCm9yFSvODG3uDQv XS85P3cTI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eNBJ3QZ9hkU+sipPG9tanj7/YymxYQlc7V9DTRb ukvPnTxSllm4emZTxqXp1ybWnLh6aMHUMztYe8Pv9Hya535FzdHwjPiOEz8Zjs8TkpwSfOjT 6lVFbXvXbrmxWmmHEktxRqKhFnNRcSIAA4d5qDUDAAA= 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 After applying "PM / OPP: Add support for descending order for cpufreq table" ,to make the table descending we can use OPP_TABLE_ORDER_DESCEND flag. Signed-off-by: Jonghwan Choi --- drivers/cpufreq/exynos5440-cpufreq.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy) { policy->clk = dvfs_info->cpu_clk; @@ -367,14 +348,13 @@ static int exynos_cpufreq_probe(struct platform_device *pdev) } ret = dev_pm_opp_init_cpufreq_table(dvfs_info->dev, - &dvfs_info->freq_table); + &dvfs_info->freq_table, OPP_TABLE_ORDER_DESCEND); if (ret) { dev_err(dvfs_info->dev, "failed to init cpufreq table: %d\n", ret); goto err_put_node; } dvfs_info->freq_count = dev_pm_opp_get_opp_count(dvfs_info->dev); - exynos_sort_descend_freq_table(); if (of_property_read_u32(np, "clock-latency", &dvfs_info->latency)) dvfs_info->latency = DEF_TRANS_LATENCY; diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c index a6b8214..fc19beb 100644 --- a/drivers/cpufreq/exynos5440-cpufreq.c +++ b/drivers/cpufreq/exynos5440-cpufreq.c @@ -279,25 +279,6 @@ static irqreturn_t exynos_cpufreq_irq(int irq, void *id) return IRQ_HANDLED; } -static void exynos_sort_descend_freq_table(void) -{ - struct cpufreq_frequency_table *freq_tbl = dvfs_info->freq_table; - int i = 0, index; - unsigned int tmp_freq; - /* - * Exynos5440 clock controller state logic expects the cpufreq table to - * be in descending order. But the OPP library constructs the table in - * ascending order. So to make the table descending we just need to - * swap the i element with the N - i element. - */ - for (i = 0; i < dvfs_info->freq_count / 2; i++) { - index = dvfs_info->freq_count - i - 1; - tmp_freq = freq_tbl[i].frequency; - freq_tbl[i].frequency = freq_tbl[index].frequency; - freq_tbl[index].frequency = tmp_freq; - } -} -