From patchwork Fri Oct 18 13:59:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 21163 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DCE7E202FF for ; Fri, 18 Oct 2013 14:04:18 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id uy5sf5302289obc.3 for ; Fri, 18 Oct 2013 07:04:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; 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=4IhJHlknju6skqIMk9ScV3wN3tWw+o0hNBHplcBth7o=; b=C1yyC59l9NEafHAFOQo30hg+mu0cSxjDvMEIDISOXAPmC3hueYYLjPNTH78g8PErTV nj7lbNTwYowTFj6DLrFE367QxzCpiLMYBr5YYIU4HXd51BznBy3vB+XMGLV5pLXQ0REL V1suwBF+SK3+YmCDoDbtiPaaqcpNVWXUA9BRe6BzBcHR6lfKENxD4nHLuT3DgujKD817 h+UJaSsn4FqlAnrO/ZYBTWBwp8duJjl30/ziVLpAkz2IMssl6l0LPnPopFUDkojP1ngq Uhk06kp6OZ+r9hUe+w3opwECUEbbubnVerBUwh8C62jNLKxHmnTKH8GkLo2iEnuntSL9 4H/Q== X-Received: by 10.182.66.137 with SMTP id f9mr1151400obt.3.1382105058425; Fri, 18 Oct 2013 07:04:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.76.100 with SMTP id j4ls1361122qew.29.gmail; Fri, 18 Oct 2013 07:04:18 -0700 (PDT) X-Received: by 10.58.133.77 with SMTP id pa13mr659441veb.21.1382105058310; Fri, 18 Oct 2013 07:04:18 -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 fx15si334567vec.72.2013.10.18.07.04.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:04:18 -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 lc6so443931vcb.15 for ; Fri, 18 Oct 2013 07:04:18 -0700 (PDT) X-Gm-Message-State: ALoCoQnZpSHW0fpIa6vx4mlxYxt7TMCgYZE44L+0o1ipj6t9fofAsUrhW0nVXIyyrtQoExq9L1Kw X-Received: by 10.52.26.69 with SMTP id j5mr1301121vdg.21.1382105058236; Fri, 18 Oct 2013 07:04:18 -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 u4csp38199vcz; Fri, 18 Oct 2013 07:04:17 -0700 (PDT) X-Received: by 10.67.3.34 with SMTP id bt2mr3723922pad.3.1382105057362; Fri, 18 Oct 2013 07:04:17 -0700 (PDT) Received: from mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by mx.google.com with ESMTPS id dl5si1016170pbd.56.2013.10.18.07.04.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:04:17 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.44 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.44; Received: by mail-pb0-f44.google.com with SMTP id xa7so3868799pbc.3 for ; Fri, 18 Oct 2013 07:04:17 -0700 (PDT) X-Received: by 10.68.175.33 with SMTP id bx1mr3241182pbc.21.1382105056966; Fri, 18 Oct 2013 07:04:16 -0700 (PDT) Received: from localhost ([120.56.197.189]) by mx.google.com with ESMTPSA id sb9sm2674018pbb.0.2013.10.18.07.04.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:04:16 -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 Subject: [PATCH V2 Resend 32/34] cpufreq: SPEAr: Convert to light weight ->target_index() routine Date: Fri, 18 Oct 2013 19:29:55 +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 8841366..11a65be 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; 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,