From patchwork Fri Aug 23 15:50:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19481 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0B36D248E6 for ; Fri, 23 Aug 2013 15:52:39 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id a41sf670646yho.4 for ; Fri, 23 Aug 2013 08:52:38 -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=+Ygb9pok03YYfZjEpvfYr5z4orBEqVI4rOBxaBAMOcE=; b=g/pA32vcbuMX1NcMjS80XNeqIsN3YHxPSDiyd8pojKlxG8X79X6nig6FwA2JEFIts/ k5g3YcETV7t14s0Mdq0YUVIF47tZCQ53kqrPSeUooxx1oh0GCYXDNaEakCQSWKkZCEmg rKTKU7r56IGSZVJFZePgEwQotsmQK486P3m7J2ZYyIDeOt/CJSLOg+tG4HmoEPuscVsh Z/ooZkJC+WxUrXceCZY4t2+Eec8srFCtgPiQhqvC8G0YU6exgI+10UvcpdCLXZ+cqz9C kr7OGwadSjuL4kf4CKts+gRvwQa39nq5CxTJB8syXb9I/8YcauVaQwFL+vDplsNrUu5P KxDg== X-Received: by 10.224.137.68 with SMTP id v4mr17212515qat.1.1377273158807; Fri, 23 Aug 2013 08:52:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.58.70 with SMTP id o6ls1631846qeq.58.gmail; Fri, 23 Aug 2013 08:52:38 -0700 (PDT) X-Received: by 10.220.184.137 with SMTP id ck9mr122097vcb.56.1377273158704; Fri, 23 Aug 2013 08:52:38 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id o7si129556vcl.60.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Aug 2013 08:52:38 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.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.220.180; Received: by mail-vc0-f180.google.com with SMTP id gf11so557187vcb.11 for ; Fri, 23 Aug 2013 08:52:38 -0700 (PDT) X-Gm-Message-State: ALoCoQk9XZTWlUFTnq+GsKtknqRl26FVwYfHLSjprhJ143HKNXncQa34gvKJWBM0MZul7bkAgyet X-Received: by 10.220.74.69 with SMTP id t5mr157227vcj.18.1377273158501; Fri, 23 Aug 2013 08:52:38 -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 u4csp100649vcz; Fri, 23 Aug 2013 08:52:38 -0700 (PDT) X-Received: by 10.68.244.73 with SMTP id xe9mr367968pbc.119.1377273157577; Fri, 23 Aug 2013 08:52:37 -0700 (PDT) Received: from mail-pb0-f47.google.com (mail-pb0-f47.google.com [209.85.160.47]) by mx.google.com with ESMTPS id if6si216525pbc.253.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Aug 2013 08:52:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.47 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.47; Received: by mail-pb0-f47.google.com with SMTP id rr4so826887pbb.34 for ; Fri, 23 Aug 2013 08:52:37 -0700 (PDT) X-Received: by 10.66.227.194 with SMTP id sc2mr21913754pac.41.1377273157094; Fri, 23 Aug 2013 08:52:37 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ts6sm548220pbc.12.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 23 Aug 2013 08:52:36 -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 , Sekhar Nori Subject: [PATCH 05/16] cpufreq: davinci: use cpufreq_generic_get() routine Date: Fri, 23 Aug 2013 21:20:40 +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.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: , We have common infrastructure available with us for getting a CPUs clk rate. Lets use it for this driver. Cc: Sekhar Nori Signed-off-by: Viresh Kumar --- drivers/cpufreq/davinci-cpufreq.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/cpufreq/davinci-cpufreq.c b/drivers/cpufreq/davinci-cpufreq.c index 7fcae0c..c07883f 100644 --- a/drivers/cpufreq/davinci-cpufreq.c +++ b/drivers/cpufreq/davinci-cpufreq.c @@ -60,14 +60,6 @@ static int davinci_verify_speed(struct cpufreq_policy *policy) return 0; } -static unsigned int davinci_getspeed(unsigned int cpu) -{ - if (cpu) - return 0; - - return clk_get_rate(cpufreq.armclk) / 1000; -} - static int davinci_target(struct cpufreq_policy *policy, unsigned int idx) { struct davinci_cpufreq_config *pdata = cpufreq.dev->platform_data; @@ -75,7 +67,7 @@ static int davinci_target(struct cpufreq_policy *policy, unsigned int idx) unsigned int old_freq, new_freq; int ret = 0; - old_freq = davinci_getspeed(0); + old_freq = policy->cur; new_freq = pdata->freq_table[idx].frequency; /* if moving to higher frequency, up the voltage beforehand */ @@ -132,6 +124,7 @@ static int davinci_cpu_init(struct cpufreq_policy *policy) * to pre/post change notification list. */ policy->cpuinfo.transition_latency = 2000 * 1000; + policy->clk = cpufreq.armclk; return 0; } @@ -139,7 +132,7 @@ static struct cpufreq_driver davinci_driver = { .flags = CPUFREQ_STICKY, .verify = davinci_verify_speed, .target_index = davinci_target, - .get = davinci_getspeed, + .get = cpufreq_generic_get, .init = davinci_cpu_init, .exit = cpufreq_generic_exit, .name = "davinci",