From patchwork Fri Aug 23 15:50:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19478 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f72.google.com (mail-qe0-f72.google.com [209.85.128.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7753C248E6 for ; Fri, 23 Aug 2013 15:52:09 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id b4sf609562qen.11 for ; Fri, 23 Aug 2013 08:52:09 -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=D4oDe1J5LbQbKqWbp5lorWO5BblE41Hkibrw3ujKdTM=; b=Q2br5lr9NfGz8PwmHj1dZVsyZpFmjWU3J4sJ6mJr6wTqBy76hb12z2V2MHgHaqhyg6 QfeHfUQUPJXOAzBXTneDGDQwysI+oted8XyIdi1N2DP+KbjanYFgDrgTL8a7A1mVdQ3p ptRcpdsKw28lFwv5UIn8EQOx/fwdMI9eWutzR6muMld7swijE1l/oLgXevCHbox9+rLB AAMUzZdKMm4pyZUPNXeVAlDy1WOqEDtIIsP6bspIWm8YGotkEohKo4399YLi939PdfwV siMYr36MoOgRCoWcbhXYHQRg79VvGH90FStqhCHQxiOHTCmitv7daaFJ4ihICsZI6Bj0 7FgA== X-Received: by 10.236.55.137 with SMTP id k9mr94855yhc.39.1377273129194; Fri, 23 Aug 2013 08:52:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.26.70 with SMTP id j6ls1679766qeg.94.gmail; Fri, 23 Aug 2013 08:52:09 -0700 (PDT) X-Received: by 10.59.3.106 with SMTP id bv10mr117309ved.64.1377273129003; Fri, 23 Aug 2013 08:52:09 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id l1si112290vcl.139.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Aug 2013 08:52:09 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 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.175; Received: by mail-vc0-f175.google.com with SMTP id ia10so542352vcb.34 for ; Fri, 23 Aug 2013 08:52:08 -0700 (PDT) X-Gm-Message-State: ALoCoQmC+UUqXJR+W67qASxDE4rsm8OkwuHcqOHjH/ciOo0zvCT/ZvUNOMlFiD7XPk6qKNWiZfOq X-Received: by 10.52.166.71 with SMTP id ze7mr108674vdb.50.1377273128929; Fri, 23 Aug 2013 08:52:08 -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 u4csp100617vcz; Fri, 23 Aug 2013 08:52:08 -0700 (PDT) X-Received: by 10.67.21.130 with SMTP id hk2mr21311429pad.76.1377273127875; Fri, 23 Aug 2013 08:52:07 -0700 (PDT) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by mx.google.com with ESMTPS id ei3si247488pbb.97.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Aug 2013 08:52:07 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.51 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.51; Received: by mail-pa0-f51.google.com with SMTP id lf1so831577pab.24 for ; Fri, 23 Aug 2013 08:52:07 -0700 (PDT) X-Received: by 10.68.189.5 with SMTP id ge5mr480421pbc.42.1377273127357; Fri, 23 Aug 2013 08:52:07 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ai6sm1840828pad.15.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 23 Aug 2013 08:52:06 -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 Subject: [PATCH 02/16] cpufreq: arm_big_little: use cpufreq_generic_get() routine Date: Fri, 23 Aug 2013 21:20:37 +0530 Message-Id: <82b4537e5d949f81c565057e7738068ecb819b43.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.175 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. Signed-off-by: Viresh Kumar --- drivers/cpufreq/arm_big_little.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c index e3e8f25..f48430b 100644 --- a/drivers/cpufreq/arm_big_little.c +++ b/drivers/cpufreq/arm_big_little.c @@ -40,13 +40,6 @@ static struct clk *clk[MAX_CLUSTERS]; static struct cpufreq_frequency_table *freq_table[MAX_CLUSTERS]; static atomic_t cluster_usage[MAX_CLUSTERS] = {ATOMIC_INIT(0), ATOMIC_INIT(0)}; -static unsigned int bL_cpufreq_get(unsigned int cpu) -{ - u32 cur_cluster = cpu_to_cluster(cpu); - - return clk_get_rate(clk[cur_cluster]) / 1000; -} - /* Set clock frequency */ static int bL_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index) @@ -145,6 +138,7 @@ static int bL_cpufreq_init(struct cpufreq_policy *policy) else policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; + policy->clk = clk[cur_cluster]; cpumask_copy(policy->cpus, topology_core_cpumask(policy->cpu)); dev_info(cpu_dev, "%s: CPU %d initialized\n", __func__, policy->cpu); @@ -174,7 +168,7 @@ static struct cpufreq_driver bL_cpufreq_driver = { .flags = CPUFREQ_STICKY, .verify = cpufreq_generic_frequency_table_verify, .target_index = bL_cpufreq_set_target, - .get = bL_cpufreq_get, + .get = cpufreq_generic_get, .init = bL_cpufreq_init, .exit = bL_cpufreq_exit, .have_governor_per_policy = true,