From patchwork Mon Aug 12 17:48:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19016 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 34CB3246B8 for ; Mon, 12 Aug 2013 17:50:17 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id ha11sf4887681vcb.4 for ; Mon, 12 Aug 2013 10:50:17 -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=aMqfoZcrJzV/HSSiM9sVH1lbaCuzNUXZXQ2MU3A73/g=; b=peN8AcIKj9XSshuJ4GQFurf8k9z3XqUwKnfLJw3p/AmuPQddA+Ul6PRpvW4wxCb6RL fAL8NFi5PTZa/fElbiv8vm46+AF0n9067GChJECc4vfBrXVTC9u7AB/ZiHkYy92QvQ4D 4yGnPOuJWlEiLoHqn9auc4CLdaCPaH0w8ytJFUjY4fC6pPNUDFl1h3bx6RsiN+qnQhi0 ndeycsgRHXRyg6/d0yJIgxsAGgMhB9J4klk50qHCeEoZH+ENm6qgC01Dt8LGJwLejML3 HzoXI5AspkrkJ3khPBPJqH17gQ80B9sALiwQByqJMPu5en8guvIzRV7MsrMUkA1WW4T/ rpfA== X-Received: by 10.236.150.203 with SMTP id z51mr66406yhj.23.1376329817002; Mon, 12 Aug 2013 10:50:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.70.228 with SMTP id p4ls2454787qeu.43.gmail; Mon, 12 Aug 2013 10:50:16 -0700 (PDT) X-Received: by 10.58.171.4 with SMTP id aq4mr148237vec.26.1376329816859; Mon, 12 Aug 2013 10:50:16 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id fw17si8579700vec.142.2013.08.12.10.50.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:16 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id ht10so3045995vcb.38 for ; Mon, 12 Aug 2013 10:50:16 -0700 (PDT) X-Gm-Message-State: ALoCoQn3htCMcSc0BJl0hTKLDTOQdp5dLtpBNU2X6MeuWiVtoECMKI7JbPLpA26QZaACuQUpNGco X-Received: by 10.220.109.197 with SMTP id k5mr141866vcp.54.1376329816777; Mon, 12 Aug 2013 10:50:16 -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 u4csp108158vcz; Mon, 12 Aug 2013 10:50:16 -0700 (PDT) X-Received: by 10.68.90.130 with SMTP id bw2mr239674pbb.89.1376329815800; Mon, 12 Aug 2013 10:50:15 -0700 (PDT) Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by mx.google.com with ESMTPS id xq4si23323694pab.57.2013.08.12.10.50.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:15 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.171 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.171; Received: by mail-pd0-f171.google.com with SMTP id g10so3712319pdj.30 for ; Mon, 12 Aug 2013 10:50:15 -0700 (PDT) X-Received: by 10.66.246.133 with SMTP id xw5mr227166pac.114.1376329815257; Mon, 12 Aug 2013 10:50:15 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id nj9sm38611462pbc.13.2013.08.12.10.50.11 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:14 -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 06/31] cpufreq: cpu0: Covert to light weight ->target() routine Date: Mon, 12 Aug 2013 23:18:42 +0530 Message-Id: <95102d862a31eaa0c2dd41ed424ace84e8669b42.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.220.179 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/cpufreq-cpu0.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index b4c25cce..f90cd8c 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c @@ -34,24 +34,14 @@ static unsigned int cpu0_get_speed(unsigned int cpu) return clk_get_rate(cpu_clk) / 1000; } -static int cpu0_set_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) +static int cpu0_set_target(struct cpufreq_policy *policy, unsigned int index) { struct cpufreq_freqs freqs; struct opp *opp; unsigned long volt = 0, volt_old = 0, tol = 0; long freq_Hz, freq_exact; - unsigned int index; int ret; - ret = cpufreq_frequency_table_target(policy, freq_table, target_freq, - relation, &index); - if (ret) { - pr_err("failed to match target freqency %d: %d\n", - target_freq, ret); - return ret; - } - freq_Hz = clk_round_rate(cpu_clk, freq_table[index].frequency * 1000); if (freq_Hz < 0) freq_Hz = freq_table[index].frequency * 1000; @@ -59,9 +49,6 @@ static int cpu0_set_target(struct cpufreq_policy *policy, freqs.new = freq_Hz / 1000; freqs.old = clk_get_rate(cpu_clk) / 1000; - if (freqs.old == freqs.new) - return 0; - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); if (cpu_reg) { @@ -145,7 +132,7 @@ static int cpu0_cpufreq_init(struct cpufreq_policy *policy) static struct cpufreq_driver cpu0_cpufreq_driver = { .flags = CPUFREQ_STICKY, .verify = cpufreq_generic_frequency_table_verify, - .target_old = cpu0_set_target, + .target = cpu0_set_target, .get = cpu0_get_speed, .init = cpu0_cpufreq_init, .exit = cpufreq_generic_exit,