From patchwork Fri Sep 13 13:02:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20232 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7CDD320358 for ; Fri, 13 Sep 2013 13:24:14 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id oy12sf1235557veb.11 for ; Fri, 13 Sep 2013 06:24:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version: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=0G8ttP67XpMefgRY+dXZt12CT8UsDLr9FRE+G+BvcvU=; b=S8/qiuajJQ17s5vsoJ2XlTCM01IoQMN9wjwjPKX38jYvZXNZYzTLKDTl4Z4IUK3CCm pAehzo2t0cYA+kbcFiG+SwU+yRZ1OkPFZeXKJn+LXNZhV/q5PhB9VBI4SxlWwdzIo9At emAcM3v372mrs0xVATwsgpCPNmf5y9gmXE2eBqFYJKT6wGaeC75JnlDD10dHQWuapRNr OuUeKP1mdpDIhkpGKi168J+p2cOcqge5NQf9ROZZ++QDxjJtXmKmnQ/qhNMmAQN3nY4V kkEWbpHhJtJXJBwmHjychiy30A/u0exHNOZaHLrS3QMIorAsKttJhHXRVLeMHANQw3Kj sm7Q== X-Gm-Message-State: ALoCoQml+GadeHDqh5MKD594AM2a+kKvAfQjYGj9Q3gXdC3kOpOmJLDZ471C+95tJjNmesRJMtrm X-Received: by 10.236.36.39 with SMTP id v27mr5176019yha.5.1379078654032; Fri, 13 Sep 2013 06:24:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.35.244 with SMTP id l20ls1125368qej.98.gmail; Fri, 13 Sep 2013 06:24:13 -0700 (PDT) X-Received: by 10.220.88.13 with SMTP id y13mr12234215vcl.20.1379078653810; Fri, 13 Sep 2013 06:24:13 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id sc5si3113542vdc.74.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:24:13 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 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.170; Received: by mail-vc0-f170.google.com with SMTP id kw10so950231vcb.1 for ; Fri, 13 Sep 2013 06:24:13 -0700 (PDT) X-Received: by 10.58.161.116 with SMTP id xr20mr11992038veb.2.1379078653722; Fri, 13 Sep 2013 06:24: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 u4csp80551vcz; Fri, 13 Sep 2013 06:24:13 -0700 (PDT) X-Received: by 10.68.211.65 with SMTP id na1mr1675169pbc.191.1379078652779; Fri, 13 Sep 2013 06:24:12 -0700 (PDT) Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by mx.google.com with ESMTPS id fa1si11252726pab.71.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:24:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.44 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.44; Received: by mail-pa0-f44.google.com with SMTP id fz6so2510329pac.17 for ; Fri, 13 Sep 2013 06:24:12 -0700 (PDT) X-Received: by 10.66.242.17 with SMTP id wm17mr15575144pac.102.1379078652377; Fri, 13 Sep 2013 06:24:12 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id bt1sm11778137pbb.2.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:24: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, linux-arm-kernel@lists.infradead.org, Viresh Kumar Subject: [PATCH 178/228] cpufreq: SPEAr: Convert to light weight ->target_index() routine Date: Fri, 13 Sep 2013 18:32:04 +0530 Message-Id: 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.170 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. Signed-off-by: Viresh Kumar --- drivers/cpufreq/spear-cpufreq.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c index 2a03158..0326040 100644 --- a/drivers/cpufreq/spear-cpufreq.c +++ b/drivers/cpufreq/spear-cpufreq.c @@ -105,20 +105,16 @@ static int spear1340_set_cpu_rate(struct clk *sys_pclk, unsigned long newfreq) } static int spear_cpufreq_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) + unsigned int index) { struct cpufreq_freqs freqs; unsigned long newfreq; struct clk *srcclk; - int index, ret, mult = 1; - - if (cpufreq_frequency_table_target(policy, spear_cpufreq.freq_tbl, - target_freq, relation, &index)) - return -EINVAL; + int ret, mult = 1; freqs.old = spear_cpufreq_get(0); - newfreq = spear_cpufreq.freq_tbl[index].frequency * 1000; + if (of_machine_is_compatible("st,spear1340")) { /* * SPEAr1340 is special in the sense that due to the possibility @@ -179,7 +175,7 @@ static struct cpufreq_driver spear_cpufreq_driver = { .name = "cpufreq-spear", .flags = CPUFREQ_STICKY, .verify = cpufreq_generic_frequency_table_verify, - .target = spear_cpufreq_target, + .target_index = spear_cpufreq_target, .get = spear_cpufreq_get, .init = spear_cpufreq_init, .exit = cpufreq_generic_exit,