From patchwork Fri Aug 23 15:50:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19480 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2B3A7248E6 for ; Fri, 23 Aug 2013 15:52:27 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id z20sf596156yhz.1 for ; Fri, 23 Aug 2013 08:52:27 -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=RpCQj6QhkM2Ge5HMma8vN7Uh2nnaj/Xe/FbVXtIMC6I=; b=FkWIFaQ+IannmQ4ragm1LUA8p3iVDXTJotLCC7ZChD7DeMwtJsGqfAuBupOvzu2Cx7 F6Kz0SmSqCGhlCGyE3XHQbs3mT8QGmaQsmk+zUt1fjbcWG/oYpa/syz2pbQVjOQnbq3d 6UYDA5iFPMLFGIHM436lqfzbY/aLp+z/ubaHiyWT3D9lEcuOupiSl6xxoppgONRF5RqF 5I3UohWDyaHM6cFJvlNJJCpRziv/Tld7K8F9vUXgMQpblj79mSrMThfBeBjE4zwsHiNX tSXAzIljNIgUkohF71FI5N1Iqo2KS6phcwn763Z5zV8y9H0VDWh+OF0UBx9mhEFn2St1 TKWw== X-Received: by 10.224.36.198 with SMTP id u6mr7110125qad.6.1377273146956; Fri, 23 Aug 2013 08:52:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.94.165 with SMTP id dd5ls1682015qeb.87.gmail; Fri, 23 Aug 2013 08:52:26 -0700 (PDT) X-Received: by 10.58.118.130 with SMTP id km2mr168832veb.0.1377273146858; Fri, 23 Aug 2013 08:52:26 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id o5si128383vcj.65.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Aug 2013 08:52:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 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.179; Received: by mail-vc0-f179.google.com with SMTP id ht10so530901vcb.24 for ; Fri, 23 Aug 2013 08:52:26 -0700 (PDT) X-Gm-Message-State: ALoCoQmL6At1q9BwYlnxjgE/GTsB3FqeJFI9c/iK8BkJSSk38SscPOhGPAVz2+JjCrPGLnrREx6D X-Received: by 10.58.246.8 with SMTP id xs8mr165428vec.9.1377273146766; Fri, 23 Aug 2013 08:52:26 -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 u4csp100642vcz; Fri, 23 Aug 2013 08:52:26 -0700 (PDT) X-Received: by 10.66.146.66 with SMTP id ta2mr21927638pab.11.1377273145807; Fri, 23 Aug 2013 08:52:25 -0700 (PDT) Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) by mx.google.com with ESMTPS id co1si245075pbc.108.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Aug 2013 08:52:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.46 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.46; Received: by mail-pb0-f46.google.com with SMTP id rq2so822864pbb.19 for ; Fri, 23 Aug 2013 08:52:25 -0700 (PDT) X-Received: by 10.68.136.104 with SMTP id pz8mr290434pbb.172.1377273145320; Fri, 23 Aug 2013 08:52:25 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id wp8sm526704pbc.26.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 23 Aug 2013 08:52:24 -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 , Shawn Guo Subject: [PATCH 04/16] cpufreq: cpu0: use cpufreq_generic_get() routine Date: Fri, 23 Aug 2013 21:20:39 +0530 Message-Id: <6ae0de783646c5356717d761903502f354abfe84.1377272740.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.220.179 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: Shawn Guo Signed-off-by: Viresh Kumar Acked-by: Shawn Guo --- drivers/cpufreq/cpufreq-cpu0.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index 7273bfc..62e52e3 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c @@ -29,11 +29,6 @@ static struct clk *cpu_clk; static struct regulator *cpu_reg; static struct cpufreq_frequency_table *freq_table; -static unsigned int cpu0_get_speed(unsigned int cpu) -{ - return clk_get_rate(cpu_clk) / 1000; -} - static int cpu0_set_target(struct cpufreq_policy *policy, unsigned int index) { struct opp *opp; @@ -99,6 +94,7 @@ static int cpu0_set_target(struct cpufreq_policy *policy, unsigned int index) static int cpu0_cpufreq_init(struct cpufreq_policy *policy) { + policy->clk = cpu_clk; return cpufreq_generic_init(policy, freq_table, transition_latency); } @@ -106,7 +102,7 @@ static struct cpufreq_driver cpu0_cpufreq_driver = { .flags = CPUFREQ_STICKY, .verify = cpufreq_generic_frequency_table_verify, .target_index = cpu0_set_target, - .get = cpu0_get_speed, + .get = cpufreq_generic_get, .init = cpu0_cpufreq_init, .exit = cpufreq_generic_exit, .name = "generic_cpu0",