From patchwork Tue Aug 13 13:32:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19090 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f198.google.com (mail-gh0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 38895246B8 for ; Tue, 13 Aug 2013 13:37:34 +0000 (UTC) Received: by mail-gh0-f198.google.com with SMTP id r13sf2338403ghr.1 for ; Tue, 13 Aug 2013 06:37:34 -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=8WOD65/3WRCuVYPHiI22AvJoDJuCi5/ZMoW8CTbH2CA=; b=EpYQ14ZCW3kqVov/R4qPXzgM6IYhTH7k8pcluWR2R9hlEUZUN1y08axoEu4PBUj0Jn vDwbUrLqx0dfEkMIc68YCT309Y+67TzwNh7kswM1aJtXjmR6L0qYl3rE3YuW4VWsQgdI 2vN+OKmvQxS4QW23b25G765z2bfQPHc8Nz89aeEK/lSXNMvpsz+W8/1tOzdyYkdMtQ3h vxaE3aasxxbUzf4E7NE6fs3SW0elOgD/s+mBL878u1fHWk4JDwdLWa5ow93acgJNwglf NPU3iXIACblCFHc1KyAlROm/0IgewtF1On2fKsGSQTG9D9z/NFaKrL17fJt4oNCHOm3k +mAg== X-Received: by 10.236.149.170 with SMTP id x30mr1644520yhj.20.1376401053912; Tue, 13 Aug 2013 06:37:33 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.105.3 with SMTP id gi3ls2414563qeb.81.gmail; Tue, 13 Aug 2013 06:37:33 -0700 (PDT) X-Received: by 10.58.46.48 with SMTP id s16mr336353vem.52.1376401053796; Tue, 13 Aug 2013 06:37:33 -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 xu8si9749618vcb.80.2013.08.13.06.37.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:37:33 -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 pb11so6599285veb.25 for ; Tue, 13 Aug 2013 06:37:33 -0700 (PDT) X-Gm-Message-State: ALoCoQn4FBjNMPL4zrCW5FiNC+rkoPxg9n+9ZMjr5+/uFb6lhkYXwMDC1yfUIEwq702fXgVOuf6N X-Received: by 10.220.183.2 with SMTP id ce2mr110766vcb.58.1376401053712; Tue, 13 Aug 2013 06:37:33 -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 u4csp154329vcz; Tue, 13 Aug 2013 06:37:33 -0700 (PDT) X-Received: by 10.66.250.47 with SMTP id yz15mr4691126pac.154.1376401052643; Tue, 13 Aug 2013 06:37:32 -0700 (PDT) Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) by mx.google.com with ESMTPS id mu18si26257934pab.147.2013.08.13.06.37.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:37:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.49 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.49; Received: by mail-pb0-f49.google.com with SMTP id xb4so8012546pbc.22 for ; Tue, 13 Aug 2013 06:37:31 -0700 (PDT) X-Received: by 10.68.251.234 with SMTP id zn10mr1823463pbc.188.1376401051887; Tue, 13 Aug 2013 06:37:31 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ht5sm43997513pbb.29.2013.08.13.06.37.27 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:37:31 -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, linux-arm-kernel@lists.infradead.org, Viresh Kumar , Stephen Warren Subject: [PATCH V2 35/35] cpufreq: tegra: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:48 +0530 Message-Id: <8becd7a6b5383426e35e89d108dbc9bb8ee17655.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-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() 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: Stephen Warren Signed-off-by: Viresh Kumar --- drivers/cpufreq/tegra-cpufreq.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c index affb294..ee2cf8f3 100644 --- a/drivers/cpufreq/tegra-cpufreq.c +++ b/drivers/cpufreq/tegra-cpufreq.c @@ -150,11 +150,8 @@ static unsigned long tegra_cpu_highest_speed(void) return rate; } -static int tegra_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) +static int tegra_target(struct cpufreq_policy *policy, unsigned int index) { - unsigned int idx; unsigned int freq; int ret = 0; @@ -165,10 +162,7 @@ static int tegra_target(struct cpufreq_policy *policy, goto out; } - cpufreq_frequency_table_target(policy, freq_table, target_freq, - relation, &idx); - - freq = freq_table[idx].frequency; + freq = freq_table[index].frequency; target_cpu_speed[policy->cpu] = freq; @@ -234,7 +228,7 @@ static int tegra_cpu_exit(struct cpufreq_policy *policy) static struct cpufreq_driver tegra_cpufreq_driver = { .verify = cpufreq_generic_frequency_table_verify, - .target = tegra_target, + .target_index = tegra_target, .get = tegra_getspeed, .init = tegra_cpu_init, .exit = tegra_cpu_exit,