From patchwork Fri Sep 13 13:02:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20270 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f70.google.com (mail-vb0-f70.google.com [209.85.212.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 75BD520358 for ; Fri, 13 Sep 2013 13:28:45 +0000 (UTC) Received: by mail-vb0-f70.google.com with SMTP id h10sf1215057vbh.1 for ; Fri, 13 Sep 2013 06:28:45 -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=/sJFLGZqQPP+XZ3DkIbg4qrnDqeU9po6H1JKsEAnHAs=; b=RtDM5NoBccS4zTeMIkrpvaE9Wxnse/o1tMMqPdZq1wses2rg4qs881m6NrbcnRGnhf AvFGnBizuJIjF41VXUyBIII12Dik1haM7sQLkFyNJCiFPw2fV/CbCqK7ZHouO1AhK4dE odnD6ZgUiEkA8vv8UDLU7WYYHPxCfKXkMQYDOTKqjh1ytfvzmPxf9wLlqjdUXKcGgwPI c1cOKsSrqFFfj6nzawi7kGUlNsSdwAs8gtPlMui/QH4kWE5uvjZzcgYxHJYQ6/xwzlcl n/BSk7hZbtupe7FuJ3vY5CX88wcDsR/WJTxzP8WinIyAepQqL1FufExT3TadRmEej9PK iuFQ== X-Gm-Message-State: ALoCoQkH6FNBY+ISwvLZo+XNXgunHSwzkOtfuc7UpJo++NYQU+LLSJQTuEI1uYl+NBs3HtA+pSu/ X-Received: by 10.236.13.36 with SMTP id a24mr697913yha.50.1379078925243; Fri, 13 Sep 2013 06:28:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.99.72 with SMTP id eo8ls1121385qeb.41.gmail; Fri, 13 Sep 2013 06:28:45 -0700 (PDT) X-Received: by 10.52.34.109 with SMTP id y13mr10322402vdi.8.1379078925039; Fri, 13 Sep 2013 06:28:45 -0700 (PDT) Received: from mail-vb0-f51.google.com (mail-vb0-f51.google.com [209.85.212.51]) by mx.google.com with ESMTPS id f8si3124375vec.85.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:28:45 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.51 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.51; Received: by mail-vb0-f51.google.com with SMTP id x16so927331vbf.10 for ; Fri, 13 Sep 2013 06:28:45 -0700 (PDT) X-Received: by 10.220.145.75 with SMTP id c11mr334725vcv.30.1379078924956; Fri, 13 Sep 2013 06:28:44 -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 u4csp80780vcz; Fri, 13 Sep 2013 06:28:44 -0700 (PDT) X-Received: by 10.67.5.132 with SMTP id cm4mr1694675pad.186.1379078924025; Fri, 13 Sep 2013 06:28:44 -0700 (PDT) Received: from mail-pb0-f41.google.com (mail-pb0-f41.google.com [209.85.160.41]) by mx.google.com with ESMTPS id rt3si7477641pbc.173.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:28:44 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.41 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.41; Received: by mail-pb0-f41.google.com with SMTP id rp2so1240080pbb.14 for ; Fri, 13 Sep 2013 06:28:43 -0700 (PDT) X-Received: by 10.68.252.33 with SMTP id zp1mr13527850pbc.95.1379078923633; Fri, 13 Sep 2013 06:28:43 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id ry4sm18140084pab.4.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:28:43 -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 Subject: [PATCH 216/228] cpufreq: cpu0: use cpufreq_generic_get() routine Date: Fri, 13 Sep 2013 18:32:42 +0530 Message-Id: <602b3897e17ec61cab6a0f6c7a22aef25463a787.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.212.51 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. Acked-by: Shawn Guo Signed-off-by: Viresh Kumar --- 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 7b5547f..536ac8c 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",