From patchwork Fri Sep 13 13:02:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20268 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7B95E20358 for ; Fri, 13 Sep 2013 13:28:32 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id g17sf1207242vbg.6 for ; Fri, 13 Sep 2013 06:28:32 -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=umIIve3sB5rY3dCl2Zqi7WOXu/3yKl4qgTeXelzuEok=; b=W9VAsAF+MWlUPXIIxN4ukCtlSJ305Uvoe2mo+APHMH8tF3vmhDgDPB3HZH0h3cvVIL mhAhwNru+nv36s32Dijl0isoALco3f9Wo9LiUDzBd49GJUsNe0abXjPY0ZUcCIpjjcUf pN6jSFFwfQJ8q9huKJqTfIkGZy/LUJyhcGCEn+7zMIyeuioqiNlyYMKv3QnQb0FXzqdK sQjn/6/3rUJj8cTBMaKy2vcvG8ZAyRatzkUMwxcCkdPRZnVCCCJ5HfIU0fqtPk0I0Ex3 rv6Cu8cgr36LWB8W9FSu+MHXteb6duho8TvGB2IOuFRO9yXmorLDjYgYNqZB76n56lGs iubg== X-Gm-Message-State: ALoCoQnpJApn82Rjt0sDLsgIKJ3FLq2MxjgRqIvxR6b00Rm3QN4kA3RWuh5Ihgn8/sSdz3WXOKFP X-Received: by 10.236.103.199 with SMTP id f47mr511771yhg.54.1379078912263; Fri, 13 Sep 2013 06:28:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.1.102 with SMTP id 6ls1072350qel.40.gmail; Fri, 13 Sep 2013 06:28:32 -0700 (PDT) X-Received: by 10.221.64.17 with SMTP id xg17mr11992074vcb.5.1379078912054; Fri, 13 Sep 2013 06:28:32 -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 ee8si3128603vdc.41.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:28:32 -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 ia10so898331vcb.20 for ; Fri, 13 Sep 2013 06:28:32 -0700 (PDT) X-Received: by 10.221.40.10 with SMTP id to10mr6983810vcb.22.1379078911837; Fri, 13 Sep 2013 06:28:31 -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 u4csp80770vcz; Fri, 13 Sep 2013 06:28:31 -0700 (PDT) X-Received: by 10.66.132.69 with SMTP id os5mr15102554pab.114.1379078910674; Fri, 13 Sep 2013 06:28:30 -0700 (PDT) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx.google.com with ESMTPS id gx9si11290125pac.11.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:28:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.52; Received: by mail-pa0-f52.google.com with SMTP id kq13so2514107pab.39 for ; Fri, 13 Sep 2013 06:28:30 -0700 (PDT) X-Received: by 10.66.121.68 with SMTP id li4mr15170774pab.33.1379078910301; Fri, 13 Sep 2013 06:28:30 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id sy10sm18106020pac.15.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:28:29 -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 214/228] cpufreq: arm_big_little: use cpufreq_generic_get() routine Date: Fri, 13 Sep 2013 18:32:40 +0530 Message-Id: <8c58f016642470a2203997ca8619107da7872f06.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.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 69cae42..5b745f9 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); @@ -175,7 +169,7 @@ static struct cpufreq_driver bL_cpufreq_driver = { CPUFREQ_HAVE_GOVERNOR_PER_POLICY, .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, .attr = cpufreq_generic_attr,