From patchwork Mon Aug 12 17:48:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19024 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D15B6246B8 for ; Mon, 12 Aug 2013 17:51:13 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id 6sf8760319qeb.5 for ; Mon, 12 Aug 2013 10:51:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=Vo73i1x0od5XUVX5tlP6EyY9WhdNNUfSPtrS3bF32zg=; b=LEjY1d9Lr7kgx6S2ChB3oA15OOEGtDBKSoVcPz7+3pHkaBflfr7N4Hs1nwv4JdHVQ5 tMuqrIKclxHB+7RLJS1E967K8NTbJeUrCc7EwxiHANXwUwXEDVsTZmtMyzoSrh3/9HVR aXvnz2H3hcOV2Mts++9mnMiOQ1RNBtoB1QcNd3mj3aRz9q5ZvkdKB70X6L8FgwfezzgR gg1lXQ0kjWjyT9JYLhF7GNuR4GJu3Dp+GbUKb37Wa5ywpNKRBGkagE80Lj0ftC6hdzCt 6U14VqRHgkc8iFyhtlWsm9/jHUnFjjQhRo218ArSNPJD8z1Ej6JlOFUqBIs4xLIWw7Zz fG1A== X-Received: by 10.236.113.197 with SMTP id a45mr70850yhh.14.1376329873675; Mon, 12 Aug 2013 10:51:13 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.49.196 with SMTP id w4ls2391786qen.71.gmail; Mon, 12 Aug 2013 10:51:13 -0700 (PDT) X-Received: by 10.52.165.194 with SMTP id za2mr121145vdb.64.1376329873550; Mon, 12 Aug 2013 10:51:13 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id wd10si8585553vcb.101.2013.08.12.10.51.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:51:13 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id pb11so5901165veb.11 for ; Mon, 12 Aug 2013 10:51:13 -0700 (PDT) X-Gm-Message-State: ALoCoQkrrlqpaBKqxKVXMuIa7U3+o9SEQ2h0cW2uRR+79K5MjBpIK4duu9r14nty7v+jxupZvQ9A X-Received: by 10.52.165.239 with SMTP id zb15mr125507vdb.44.1376329873476; Mon, 12 Aug 2013 10:51:13 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp108226vcz; Mon, 12 Aug 2013 10:51:13 -0700 (PDT) X-Received: by 10.68.143.131 with SMTP id se3mr250072pbb.39.1376329872639; Mon, 12 Aug 2013 10:51:12 -0700 (PDT) Received: from mail-pb0-f42.google.com (mail-pb0-f42.google.com [209.85.160.42]) by mx.google.com with ESMTPS id ph3si22195701pbc.74.2013.08.12.10.51.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:51:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.42 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.42; Received: by mail-pb0-f42.google.com with SMTP id un15so7030766pbc.29 for ; Mon, 12 Aug 2013 10:51:12 -0700 (PDT) X-Received: by 10.68.52.200 with SMTP id v8mr250716pbo.48.1376329872211; Mon, 12 Aug 2013 10:51:12 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id il4sm38579333pbb.36.2013.08.12.10.51.08 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:51:11 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar , Shawn Guo Subject: [PATCH 14/31] cpufreq: imx6q: Covert to light weight ->target() routine Date: Mon, 12 Aug 2013 23:18:50 +0530 Message-Id: <0de81d2f94cd90c8b4c35c0d4bb2483fc35a1e87.1376329128.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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch converts existing .target_old() to newly defined light weight .target() 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 d6e3e7e..f416066 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_old = imx6q_set_target, + .target = imx6q_set_target, .get = imx6q_get_speed, .init = imx6q_cpufreq_init, .exit = cpufreq_generic_exit,