From patchwork Mon Aug 12 17:49:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19039 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f199.google.com (mail-ye0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CE01C246B8 for ; Mon, 12 Aug 2013 17:52:58 +0000 (UTC) Received: by mail-ye0-f199.google.com with SMTP id l12sf4254782yen.10 for ; Mon, 12 Aug 2013 10:52:58 -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=QuqrsI6ic73CJpPpTXU/iWw1vqBO6HNP2gcvy+gCXNg=; b=lgrT2BL987Y8aI0KxhN+GBW8tb/rzMiORXLvumSXNBGz9QZ5/EC4Hc0RgCRCejuCai qGb6Cm1TSKVFA7yvLMSRfmVxRG0JgtnzPzvSXUBwyzEoukoR6Z4yFF55Ln1ASusRNCA4 oVIvpeg0zxePSgJ5u7cysREDy/xriXgihNgsqrf+bq3Th6ivE7S3wA3EdrBGl+s3LWLB 5ZpFNB7lFf43S649hF1X2brhw6Ae5FAqXiaPaFpMJhQevz6eKKWqjgCfPtH/ImA3abCF jjK90yT2/g1XzmUEJh+yVlH3TJIaInjMmaAFn2H4KqYWw3qsGVhQhgCC9jDiwq3FUdu4 pJVw== X-Received: by 10.236.163.166 with SMTP id a26mr75889yhl.22.1376329978544; Mon, 12 Aug 2013 10:52:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.4.231 with SMTP id n7ls2308500qen.14.gmail; Mon, 12 Aug 2013 10:52:58 -0700 (PDT) X-Received: by 10.220.199.5 with SMTP id eq5mr159298vcb.16.1376329978411; Mon, 12 Aug 2013 10:52:58 -0700 (PDT) Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by mx.google.com with ESMTPS id x7si8589095vdo.74.2013.08.12.10.52.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:52:58 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.49 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.49; Received: by mail-vb0-f49.google.com with SMTP id w16so5895119vbb.22 for ; Mon, 12 Aug 2013 10:52:58 -0700 (PDT) X-Gm-Message-State: ALoCoQnOicQAMjdXN57zQdbhNC/0pkaNaJGZjf2WzuHr18fvpbijkN0Kz6d58rGosLssEAHxoDR7 X-Received: by 10.58.233.204 with SMTP id ty12mr149071vec.61.1376329978313; Mon, 12 Aug 2013 10:52:58 -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 u4csp108333vcz; Mon, 12 Aug 2013 10:52:57 -0700 (PDT) X-Received: by 10.67.8.98 with SMTP id dj2mr256336pad.47.1376329977486; Mon, 12 Aug 2013 10:52:57 -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 hk5si1456367pac.270.2013.08.12.10.52.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:52:57 -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 fz6so3365772pac.17 for ; Mon, 12 Aug 2013 10:52:57 -0700 (PDT) X-Received: by 10.68.182.131 with SMTP id ee3mr256949pbc.71.1376329977111; Mon, 12 Aug 2013 10:52:57 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ll5sm41367463pab.19.2013.08.12.10.52.53 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:52:56 -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 29/31] cpufreq: SPEAr: Covert to light weight ->target() routine Date: Mon, 12 Aug 2013 23:19:05 +0530 Message-Id: <48a7161dba289f6f98820d6129d82b639f12f3c6.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.212.49 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. 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 31af347..1049917 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 @@ -191,7 +187,7 @@ static struct cpufreq_driver spear_cpufreq_driver = { .name = "cpufreq-spear", .flags = CPUFREQ_STICKY, .verify = cpufreq_generic_frequency_table_verify, - .target_old = spear_cpufreq_target, + .target = spear_cpufreq_target, .get = spear_cpufreq_get, .init = spear_cpufreq_init, .exit = cpufreq_generic_exit,