From patchwork Wed Oct 30 22:52:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 21280 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 56574244A4 for ; Wed, 30 Oct 2013 22:52:24 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id c14sf4669852vea.1 for ; Wed, 30 Oct 2013 15:52:24 -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=LdUjOBiZxq+CefHD+Op/Qai6dgMsI2h0FcG1VkHSnc+KoMJALibxRRDs0Rqw6Q/WaU 6EFLackA4QcfD1jKQsbY+L0TRz4IgBSbn9pTsfzVGVvlWA3cdr5/RWvfnRIcZhJW2Fpj eRXRz+XWnsPbYKavJYUqWPsFOCBWDRyhSiqD01PTzEB2VO2WLxv/i4AUTdeEikGma6ma zzCa0BenznlEE+fPYPQnZ6irR7uDD9cou5PGuBtm4S0vwOEIVD+TD0Z0quAMAh5Cm8eR dL9lzQXFXi1BDzfD34fAlFSaGuF4zyBcsMKtRjQ0FZmX/CUheFe0z7HRR0Ux0wmaNpHu tIOA== X-Gm-Message-State: ALoCoQkn4Giig8PGZTPK3dQEYFkNFyfbhhh0K+5lthk09NRsmgSO2vbdfFz12Yz7ns5X1vZQbIZb X-Received: by 10.58.230.5 with SMTP id su5mr41532vec.23.1383173544164; Wed, 30 Oct 2013 15:52:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.63.37 with SMTP id d5ls649530qes.17.gmail; Wed, 30 Oct 2013 15:52:24 -0700 (PDT) X-Received: by 10.58.117.7 with SMTP id ka7mr48935veb.44.1383173544053; Wed, 30 Oct 2013 15:52:24 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id es10si79061vdb.76.2013.10.30.15.52.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Oct 2013 15:52:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.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.220.173; Received: by mail-vc0-f173.google.com with SMTP id lh4so1415670vcb.18 for ; Wed, 30 Oct 2013 15:52:24 -0700 (PDT) X-Received: by 10.58.255.233 with SMTP id at9mr60340ved.20.1383173543961; Wed, 30 Oct 2013 15:52:23 -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 u4csp316043vcz; Wed, 30 Oct 2013 15:52:23 -0700 (PDT) X-Received: by 10.60.45.227 with SMTP id q3mr134418oem.10.1383173543470; Wed, 30 Oct 2013 15:52:23 -0700 (PDT) Received: from mail-oa0-f42.google.com (mail-oa0-f42.google.com [209.85.219.42]) by mx.google.com with ESMTPS id h3si106091oej.143.2013.10.30.15.52.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Oct 2013 15:52:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.219.42 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.219.42; Received: by mail-oa0-f42.google.com with SMTP id k14so2261182oag.1 for ; Wed, 30 Oct 2013 15:52:23 -0700 (PDT) X-Received: by 10.182.38.228 with SMTP id j4mr78135obk.94.1383173543138; Wed, 30 Oct 2013 15:52:23 -0700 (PDT) Received: from localhost (sccc-66-78-236-243.smartcity.com. [66.78.236.243]) by mx.google.com with ESMTPSA id bg2sm660827obb.1.2013.10.30.15.52.22 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 30 Oct 2013 15:52:22 -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@linaro.org Subject: [PATCH V2 Resend 04/16] cpufreq: davinci: use cpufreq_generic_get() routine Date: Thu, 31 Oct 2013 04:22:02 +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.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",