From patchwork Fri Sep 13 13:02:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20271 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6089620358 for ; Fri, 13 Sep 2013 13:28:52 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id b4sf1239046qen.5 for ; Fri, 13 Sep 2013 06:28:52 -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=kgke9NSVAccnm+g5/uE5WRc7GOYLkcCqDktCy1RGt4c=; b=hcrv0TJdmk0Sri9BuZsNtFPqR+ayrbR/ncwgq7yuDaNPwZpc0aqHfzKgfbT6dpbNzS CYtG2xR/EhuVZnJmoN8LVO8VIfJx+S6cPQtSDsW3UHDMe56tlGaB4tllCZu4jOdaPqwF WmIdR/qLhwV8Yt61fK8TMb1ATEsxpR1aueoC8GqH0fkmkKBOMbuTmWVTCtPKDTWx4tXA W4bQpMVze0KdgY9HhWvEMr2KbuaOCSxleamLcci1aOavv3hdGrnHfAlQl3ULHbIm2G4w UXZdSCuYvK8WNkznoDHeZgzG9fFiujMz0hfF49zn+prcvaTljsoygLgvbjsH8mXtRllH pdcg== X-Gm-Message-State: ALoCoQkNCt/EYmcbOBmNVDzSoHMzksrPWOiPjrvDaQiBL9WklqoN7q4aZdFRKUKhmD6/MQb3igCI X-Received: by 10.236.167.138 with SMTP id i10mr5443051yhl.9.1379078932190; Fri, 13 Sep 2013 06:28:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.117.129 with SMTP id ke1ls1151382qeb.88.gmail; Fri, 13 Sep 2013 06:28:52 -0700 (PDT) X-Received: by 10.58.97.138 with SMTP id ea10mr21148veb.38.1379078931977; Fri, 13 Sep 2013 06:28:51 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id ee5si3125830vec.78.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:28:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.173 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.173; Received: by mail-ve0-f173.google.com with SMTP id cz12so944208veb.18 for ; Fri, 13 Sep 2013 06:28:51 -0700 (PDT) X-Received: by 10.52.163.234 with SMTP id yl10mr623vdb.47.1379078931897; Fri, 13 Sep 2013 06:28:51 -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 u4csp80784vcz; Fri, 13 Sep 2013 06:28:51 -0700 (PDT) X-Received: by 10.66.218.198 with SMTP id pi6mr15506206pac.107.1379078930931; Fri, 13 Sep 2013 06:28:50 -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 mj9si11187532pab.306.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:28:50 -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 rr4so1235480pbb.6 for ; Fri, 13 Sep 2013 06:28:50 -0700 (PDT) X-Received: by 10.68.242.99 with SMTP id wp3mr13551893pbc.1.1379078930527; Fri, 13 Sep 2013 06:28:50 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id ry4sm18141382pab.4.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:28:50 -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 , Sekhar Nori Subject: [PATCH 217/228] cpufreq: davinci: use cpufreq_generic_get() routine Date: Fri, 13 Sep 2013 18:32:43 +0530 Message-Id: <9306a1c54e69d9fc30afe77c023d0780c84592d7.1379063063.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.173 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 | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/cpufreq/davinci-cpufreq.c b/drivers/cpufreq/davinci-cpufreq.c index 5e8a854..cd7fb6e 100644 --- a/drivers/cpufreq/davinci-cpufreq.c +++ b/drivers/cpufreq/davinci-cpufreq.c @@ -58,14 +58,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; @@ -73,7 +65,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 */ @@ -116,6 +108,8 @@ static int davinci_cpu_init(struct cpufreq_policy *policy) return result; } + policy->clk = cpufreq.armclk; + /* * Time measurement across the target() function yields ~1500-1800us * time taken with no drivers on notification list. @@ -129,7 +123,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",