From patchwork Thu Aug 8 13:48:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18851 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 8B4A4246A4 for ; Thu, 8 Aug 2013 13:49:09 +0000 (UTC) Received: by mail-vb0-f70.google.com with SMTP id h10sf625784vbh.5 for ; Thu, 08 Aug 2013 06:49: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=pDrtDYe3iia50efEmwCkhiQouKDkQY946yEhufAsgh8=; b=NKxs+xrjgAAezAt/IJV5vOSaHz4151rIJ6ACEBjnvqD+RjqAC8626EY+NMCBaSNojJ gK30nUB7cKZKeJtsz20MPelhIFRfIkbFt793266jxnQEKjQc8OlboYQudMGbw/sUCW4O Pigb+C7ZKT4Ds2lu/HBv+XzAHRpwP40skVDO1k8kT2+M0PXNA1cZLtoL5vaNgbzWXrm8 6q+LKCFO3DEi9W4ebhdhxYmqMJfAC1KBHnH1XIFRko0IIS+2nr+EBgWzQ6igqfwABGcL HA+looThvvWP0ogKOeSzBqvB+JoHGUctKAR0dwI9ptnZpthvn0tLN3IL2gapvTrixhPv UBog== X-Received: by 10.236.139.3 with SMTP id b3mr3414770yhj.3.1375969749163; Thu, 08 Aug 2013 06:49:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.104.177 with SMTP id gf17ls1064443qeb.4.gmail; Thu, 08 Aug 2013 06:49:09 -0700 (PDT) X-Received: by 10.58.6.210 with SMTP id d18mr3028840vea.96.1375969749048; Thu, 08 Aug 2013 06:49:09 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id dj3si3088657vcb.119.2013.08.08.06.49.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 Aug 2013 06:49:09 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 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.172; Received: by mail-vc0-f172.google.com with SMTP id m17so118391vca.3 for ; Thu, 08 Aug 2013 06:49:09 -0700 (PDT) X-Gm-Message-State: ALoCoQl8tV+ZAgeA7OmjF8l3ut951fLA4W4exiqeCckIdoR7Rm+9FA9QVpfDA3ojce1l1fc/ye7b X-Received: by 10.58.134.84 with SMTP id pi20mr1438598veb.55.1375969748913; Thu, 08 Aug 2013 06:49: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 u4csp16681vcz; Thu, 8 Aug 2013 06:49:08 -0700 (PDT) X-Received: by 10.68.162.194 with SMTP id yc2mr678353pbb.141.1375969747999; Thu, 08 Aug 2013 06:49:07 -0700 (PDT) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by mx.google.com with ESMTPS id yt8si7884870pab.32.2013.08.08.06.49.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 Aug 2013 06:49:07 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.53 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.53; Received: by mail-pa0-f53.google.com with SMTP id lb1so3506397pab.12 for ; Thu, 08 Aug 2013 06:49:07 -0700 (PDT) X-Received: by 10.68.203.105 with SMTP id kp9mr6292710pbc.78.1375969747585; Thu, 08 Aug 2013 06:49:07 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id xe9sm16718844pab.0.2013.08.08.06.49.03 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 08 Aug 2013 06:49: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, linux-arm-kernel@lists.infradead.org, Viresh Kumar , Eric Miao Subject: [PATCH 02/35] cpufreq: pxa: call cpufreq_frequency_table_get_attr() Date: Thu, 8 Aug 2013 19:18:04 +0530 Message-Id: <9b7c9159120d0423a65365414448ceed38621d29.1375964117.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.172 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: , This exposes frequency table of driver to cpufreq core and is required for core to guess what the index for a target frequency is, when it calls cpufreq_frequency_table_target(). And so this driver needs to expose it. Cc: Eric Miao Signed-off-by: Viresh Kumar --- drivers/cpufreq/pxa2xx-cpufreq.c | 6 +++++- drivers/cpufreq/pxa3xx-cpufreq.c | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c index fb3981a..c7ea005 100644 --- a/drivers/cpufreq/pxa2xx-cpufreq.c +++ b/drivers/cpufreq/pxa2xx-cpufreq.c @@ -453,10 +453,14 @@ static int pxa_cpufreq_init(struct cpufreq_policy *policy) find_freq_tables(&pxa255_freq_table, &pxa255_freqs); pr_info("PXA255 cpufreq using %s frequency table\n", pxa255_turbo_table ? "turbo" : "run"); + cpufreq_frequency_table_cpuinfo(policy, pxa255_freq_table); + cpufreq_frequency_table_get_attr(pxa255_freq_table, policy->cpu); } - else if (cpu_is_pxa27x()) + else if (cpu_is_pxa27x()) { cpufreq_frequency_table_cpuinfo(policy, pxa27x_freq_table); + cpufreq_frequency_table_get_attr(pxa27x_freq_table, policy->cpu); + } printk(KERN_INFO "PXA CPU frequency change support initialized\n"); diff --git a/drivers/cpufreq/pxa3xx-cpufreq.c b/drivers/cpufreq/pxa3xx-cpufreq.c index 9c92ef0..f53f28d6 100644 --- a/drivers/cpufreq/pxa3xx-cpufreq.c +++ b/drivers/cpufreq/pxa3xx-cpufreq.c @@ -91,7 +91,7 @@ static int setup_freqs_table(struct cpufreq_policy *policy, struct pxa3xx_freq_info *freqs, int num) { struct cpufreq_frequency_table *table; - int i; + int i, ret; table = kzalloc((num + 1) * sizeof(*table), GFP_KERNEL); if (table == NULL) @@ -108,7 +108,11 @@ static int setup_freqs_table(struct cpufreq_policy *policy, pxa3xx_freqs_num = num; pxa3xx_freqs_table = table; - return cpufreq_frequency_table_cpuinfo(policy, table); + ret = cpufreq_frequency_table_cpuinfo(policy, table); + if (!ret) + cpufreq_frequency_table_get_attr(table, policy->cpu); + + return ret; } static void __update_core_freq(struct pxa3xx_freq_info *info)