From patchwork Tue Aug 13 13:32:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2843727 Return-Path: X-Original-To: patchwork-linux-arm@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 700B89F239 for ; Tue, 13 Aug 2013 14:29:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3AF14201EC for ; Tue, 13 Aug 2013 14:29:46 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A5E98201BF for ; Tue, 13 Aug 2013 14:29:44 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9EpG-0001fR-GA; Tue, 13 Aug 2013 13:39:55 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9EoV-0008PF-F3; Tue, 13 Aug 2013 13:39:07 +0000 Received: from mail-pa0-f53.google.com ([209.85.220.53]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9EmQ-00087p-U4 for linux-arm-kernel@lists.infradead.org; Tue, 13 Aug 2013 13:37:00 +0000 Received: by mail-pa0-f53.google.com with SMTP id lb1so8894098pab.26 for ; Tue, 13 Aug 2013 06:36:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=1Nx/UFKRauOs13pbCqnqMQ7URDUfXaRPo/HeCjDlq5Q=; b=TGu+791/jc4FuueKKFUQJlTQjX7mr9EStjavcC4Iht6isKj7uEMUre3hSzVma/7OY3 6praz4g+8r1kBpcFjkn1AdfEAtcAsHs9P9yRYVYDl7IAMk2d98fy0aenz0aSZsz5+x1M M2hDOG/2Bn0zuInAQem9b3aY+TmJVizrP84WYTX94OhQWEM8A2WiaZkzn0xaQsadq183 8GXfBxZKMxUK3xY1gdflU/JshmGmPDrb63NGvWPm8PfinuXlPHtAxJW9ANtWTSl1+bUc Bl7tFF5kQUuB6NskZ+R7zKIynLswdqXiN51z/Fm64402umzqNsSaqeX//LqejhBOGhhT Wevw== X-Gm-Message-State: ALoCoQnAogOda0rDMzkbDBaO/Q390uxxNMa2bIFUm28iFOIaq3xpNVQXKPizGBY+/6x7NoeCQpq4 X-Received: by 10.67.21.226 with SMTP id hn2mr4700115pad.69.1376400997778; Tue, 13 Aug 2013 06:36:37 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id dg3sm44001338pbc.24.2013.08.13.06.36.33 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:36:37 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Subject: [PATCH V2 28/35] cpufreq: s3c64xx: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:41 +0530 Message-Id: <1d6e581b39e323b5b868cddba622e1fe371a8faf.1376392602.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130813_093659_093032_436CDF94 X-CRM114-Status: GOOD ( 10.62 ) X-Spam-Score: -2.6 (--) Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar , patches@linaro.org, linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, Kukjin Kim , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 This patch converts existing .target() to newly defined light weight .target_index() routine for this driver. CPUFreq core will call cpufreq_frequency_table_target() before calling this routine and will pass index to it. Cc: Kukjin Kim Signed-off-by: Viresh Kumar --- drivers/cpufreq/s3c64xx-cpufreq.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/cpufreq/s3c64xx-cpufreq.c b/drivers/cpufreq/s3c64xx-cpufreq.c index 99fbc49..72f733b 100644 --- a/drivers/cpufreq/s3c64xx-cpufreq.c +++ b/drivers/cpufreq/s3c64xx-cpufreq.c @@ -63,26 +63,16 @@ static unsigned int s3c64xx_cpufreq_get_speed(unsigned int cpu) } static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) + unsigned int index) { int ret; - unsigned int i; struct cpufreq_freqs freqs; struct s3c64xx_dvfs *dvfs; - ret = cpufreq_frequency_table_target(policy, s3c64xx_freq_table, - target_freq, relation, &i); - if (ret != 0) - return ret; - freqs.old = clk_get_rate(armclk) / 1000; - freqs.new = s3c64xx_freq_table[i].frequency; + freqs.new = s3c64xx_freq_table[index].frequency; freqs.flags = 0; - dvfs = &s3c64xx_dvfs_table[s3c64xx_freq_table[i].driver_data]; - - if (freqs.old == freqs.new) - return 0; + dvfs = &s3c64xx_dvfs_table[s3c64xx_freq_table[index].driver_data]; pr_debug("Transition %d-%dkHz\n", freqs.old, freqs.new); @@ -257,7 +247,7 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy) static struct cpufreq_driver s3c64xx_cpufreq_driver = { .flags = 0, .verify = cpufreq_generic_frequency_table_verify, - .target = s3c64xx_cpufreq_set_target, + .target_index = s3c64xx_cpufreq_set_target, .get = s3c64xx_cpufreq_get_speed, .init = s3c64xx_cpufreq_driver_init, .name = "s3c",