From patchwork Tue Aug 13 13:32:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2843680 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 6FAB89F271 for ; Tue, 13 Aug 2013 13:38:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 38D8E204FB for ; Tue, 13 Aug 2013 13:38:07 +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 C627520501 for ; Tue, 13 Aug 2013 13:38:01 +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 1V9EnF-0000Me-Iv; Tue, 13 Aug 2013 13:37:49 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9EnA-0008H1-DS; Tue, 13 Aug 2013 13:37:44 +0000 Received: from mail-pd0-f175.google.com ([209.85.192.175]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9Eks-0007r4-Vx for linux-arm-kernel@lists.infradead.org; Tue, 13 Aug 2013 13:35:24 +0000 Received: by mail-pd0-f175.google.com with SMTP id q10so4861614pdj.20 for ; Tue, 13 Aug 2013 06:35:02 -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=IxdBXIUsGHR2+cKy1C1hpqSmsi1a7J3iwHOcEeOQwmU=; b=SjALZDbAG8DvhlJ+zfoww9F9fIBHdtT1S74C7x+OrO8F5SwaureQT5E/W8/vIodQNZ cAsDSTYC5sigEJT0W8XSaXvOoUR7t8Lg7zKOoVF3ODyuHGX/Aoa7z8MILdMjem7OTsmo 64o6a7thiJzDic54IqHfXJ0mup26xuwaCiEtfVRqWPaqc3cC1s01VbaKBdPzzMAo5+gL kv/GjYeCF53yersSmIQDvXj9NLZtnoXBvmt8B5soBAX23F0bg4sg2O2djz0g5plat2UJ 2clP2m8lcMPOKKsGXWzhQ15GOOD1/BPc1g1k73JWUINhm+n8mweQBQre/5Qn+CjsvYOt soCA== X-Gm-Message-State: ALoCoQlhUWkXZMe/YX32F0rugdZmBfCLcsu6j6917J/8dqs/gdRrHyx84O6vWGxP4CXjkLf5F4Vz X-Received: by 10.67.5.132 with SMTP id cm4mr1825743pad.186.1376400901952; Tue, 13 Aug 2013 06:35:01 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id qh10sm43977843pbb.33.2013.08.13.06.34.58 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:35:01 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Subject: [PATCH V2 15/35] cpufreq: imx6q: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:28 +0530 Message-Id: <217701887d98cb7b71b91a095c9ca30cb35d95b4.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_093523_207619_E04ED74E X-CRM114-Status: GOOD ( 11.27 ) X-Spam-Score: -1.9 (-) 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, Shawn Guo , 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: Shawn Guo Signed-off-by: Viresh Kumar --- drivers/cpufreq/imx6q-cpufreq.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index 81d1727..f6f877c 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -39,30 +39,17 @@ static unsigned int imx6q_get_speed(unsigned int cpu) return clk_get_rate(arm_clk) / 1000; } -static int imx6q_set_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) +static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index) { struct cpufreq_freqs freqs; struct opp *opp; unsigned long freq_hz, volt, volt_old; - unsigned int index; int ret; - ret = cpufreq_frequency_table_target(policy, freq_table, target_freq, - relation, &index); - if (ret) { - dev_err(cpu_dev, "failed to match target frequency %d: %d\n", - target_freq, ret); - return ret; - } - freqs.new = freq_table[index].frequency; freq_hz = freqs.new * 1000; freqs.old = clk_get_rate(arm_clk) / 1000; - if (freqs.old == freqs.new) - return 0; - rcu_read_lock(); opp = opp_find_freq_ceil(cpu_dev, &freq_hz); if (IS_ERR(opp)) { @@ -187,7 +174,7 @@ static int imx6q_cpufreq_init(struct cpufreq_policy *policy) static struct cpufreq_driver imx6q_cpufreq_driver = { .verify = cpufreq_generic_frequency_table_verify, - .target = imx6q_set_target, + .target_index = imx6q_set_target, .get = imx6q_get_speed, .init = imx6q_cpufreq_init, .exit = cpufreq_generic_exit,