From patchwork Mon Jun 6 03:44:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 9157159 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AFF0960572 for ; Mon, 6 Jun 2016 03:47:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B85827C8F for ; Mon, 6 Jun 2016 03:47:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8FB26281D2; Mon, 6 Jun 2016 03:47:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 373D927C8F for ; Mon, 6 Jun 2016 03:47:07 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b9lTr-00033V-Dm; Mon, 06 Jun 2016 03:45:35 +0000 Received: from mail-pf0-x229.google.com ([2607:f8b0:400e:c00::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b9lTo-0002xq-TR for linux-arm-kernel@lists.infradead.org; Mon, 06 Jun 2016 03:45:33 +0000 Received: by mail-pf0-x229.google.com with SMTP id z187so8353924pfz.3 for ; Sun, 05 Jun 2016 20:45:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ALDC/2cdrtGZ6AOnSYqysM9sBet3X0Yf9brljHICKvQ=; b=F/rz6O7oM4VDRPo4WI0jz1SV84uIalu03xDfpKcDNJWwrR7yXuSqbMVyuedNdXlrcK uLhynls7NiSMoYc7K9WbaYmcErXmEw1FTCJuh2PG4OotLRivXAg9T4uYx78WyoVz2xrS MLQ3SE1XdMfcFJ6wYoQ5D9zjgcS+MXNvPSFmo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ALDC/2cdrtGZ6AOnSYqysM9sBet3X0Yf9brljHICKvQ=; b=bs11qconNn+ZuI95NWMsi/egP1Ykvr0c2c3gPXxoFfjmmaq7Og5srsopYPOWl4VidK CGO7t1QzhxhrhmqW4UTJilN7bxZ3XLWssncN7O88YoFvSlQgRezt3BrRUp8G+hNOAILx cg5YFaa+w0+wEVSQoO1bIQwxKI4Eo9JfQnt9t+yXntH+RnmzZNNaLWgk+oCaLlJ2m5o0 tM6b204AL3TQ+qVVvR95/ZYZkCEzs7i98ujH9gMwW12/qR9mgxsEBqkHdelkUoGzdkUy qtOo+fm38/RbZTgE0uYXs0Yy4C895c9Iz6VaCZQnZ7IcGNiSQUoYAtgaKYkJgF1Hr/I+ 7oNg== X-Gm-Message-State: ALyK8tKzeIR1/kWXxIOc9GVbJOIURfFGiQHPiUallYaEZMYtPnHMSN5z2DfunhbvRk3cgcrc X-Received: by 10.98.65.92 with SMTP id o89mr22701109pfa.72.1465184710639; Sun, 05 Jun 2016 20:45:10 -0700 (PDT) Received: from localhost ([122.167.17.193]) by smtp.gmail.com with ESMTPSA id 75sm23249995pfo.82.2016.06.05.20.45.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Jun 2016 20:45:09 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Sekhar Nori , Kevin Hilman Subject: [PATCH V4 1/8] ARM: davinci: Sort frequency table Date: Mon, 6 Jun 2016 09:14:54 +0530 Message-Id: <3a395ec9a3cfec21f227a1ad92df237b1dda9f2d.1465184522.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.7.1.410.g6faf27b In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160605_204533_005704_5C27F640 X-CRM114-Status: GOOD ( 13.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Viresh Kumar , linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This is required for some of the changes in cpufreq core. There was only one function dependent on the order of the table, that is fixed as well. Cc: Sekhar Nori Cc: Kevin Hilman Signed-off-by: Viresh Kumar --- V3->V4: - Fixed an error reported by buildbot, by removing '&' before usage of da850_freq_table. arch/arm/mach-davinci/da850.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 239886299968..a706df3367ee 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -1004,13 +1004,14 @@ static const struct da850_opp da850_opp_96 = { .frequency = freq * 1000, \ } +/* Table sorted in ascending order of frequencies */ static struct cpufreq_frequency_table da850_freq_table[] = { - OPP(456), - OPP(408), - OPP(372), - OPP(300), - OPP(200), OPP(96), + OPP(200), + OPP(300), + OPP(372), + OPP(408), + OPP(456), { .driver_data = 0, .frequency = CPUFREQ_TABLE_END, @@ -1076,8 +1077,9 @@ int da850_register_cpufreq(char *async_clk) clk_add_alias("async", da850_cpufreq_device.name, async_clk, NULL); for (i = 0; i < ARRAY_SIZE(da850_freq_table); i++) { - if (da850_freq_table[i].frequency <= da850_max_speed) { - cpufreq_info.freq_table = &da850_freq_table[i]; + if (da850_freq_table[i].frequency > da850_max_speed) { + da850_freq_table[i].driver_data = 0; + da850_freq_table[i].frequency = CPUFREQ_TABLE_END; break; } }