From patchwork Fri Sep 13 12:59:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 274774 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id EACF82C016D for ; Fri, 13 Sep 2013 23:04:52 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932096Ab3IMNE2 (ORCPT ); Fri, 13 Sep 2013 09:04:28 -0400 Received: from mail-pd0-f171.google.com ([209.85.192.171]:47724 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932089Ab3IMNE0 (ORCPT ); Fri, 13 Sep 2013 09:04:26 -0400 Received: by mail-pd0-f171.google.com with SMTP id g10so1223635pdj.16 for ; Fri, 13 Sep 2013 06:04:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=+3yLrxl+FLdsRBEMHmumnwwsQVd/DSy7ni6uz25OCGo=; b=H9mrYUlYzn3jrdtlFq59DwVNJykPbrT+OgxvhhhMnhZcexfYEMiHXYHiw/U8Ez3Cic N9gJGmQJuXot52+Is4wPpkUm/u12UH0vETFgBC0VN3dpxQq8ibYzGANBxTKOsP2CY5yz C7dM6eb37hFMU5X8zkr+7sCOuC8mNoxUWu6hCT8I65mE2ptBhoURNqrFYm5C+mIeO0KE WN3lNKq0sof44CC9aWuDUgFp5Y15EESQtxjfU2tiDmf64Etv9THxM1Ujf79yn3syAjwZ 6T57e7+2nTCsV7gCoYV/KpdGcOmH+UrEkx/6LZAdyp1JV6DeelKplb+h8o5AFTTeCyeB mLog== X-Gm-Message-State: ALoCoQnWtD2BDdEL7y9aH01li3LEQAQySwvtl4YJZBJNMnq/8JTudbHU2tdamEkMB8UK8jFNAcKP X-Received: by 10.68.65.47 with SMTP id u15mr13235520pbs.11.1379077466239; Fri, 13 Sep 2013 06:04:26 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id in2sm11629523pbc.37.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:04:25 -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 , "David S. Miller" , sparclinux@vger.kernel.org Subject: [PATCH 012/228] cpufreq: sparc: call cpufreq_frequency_table_get_attr() Date: Fri, 13 Sep 2013 18:29:18 +0530 Message-Id: <56edbe14da9944ad026497bc1a0dc4aaa283d506.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: Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org 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: David S. Miller Cc: sparclinux@vger.kernel.org Signed-off-by: Viresh Kumar --- drivers/cpufreq/sparc-us2e-cpufreq.c | 6 +++++- drivers/cpufreq/sparc-us3-cpufreq.c | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/sparc-us2e-cpufreq.c b/drivers/cpufreq/sparc-us2e-cpufreq.c index cf5bc2c..80e6d92 100644 --- a/drivers/cpufreq/sparc-us2e-cpufreq.c +++ b/drivers/cpufreq/sparc-us2e-cpufreq.c @@ -307,6 +307,7 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy) unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000; struct cpufreq_frequency_table *table = &us2e_freq_table[cpu].table[0]; + int ret; table[0].driver_data = 0; table[0].frequency = clock_tick / 1; @@ -324,7 +325,10 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = 0; policy->cur = clock_tick; - 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 int us2e_freq_cpu_exit(struct cpufreq_policy *policy) diff --git a/drivers/cpufreq/sparc-us3-cpufreq.c b/drivers/cpufreq/sparc-us3-cpufreq.c index ac76b48..73a90de 100644 --- a/drivers/cpufreq/sparc-us3-cpufreq.c +++ b/drivers/cpufreq/sparc-us3-cpufreq.c @@ -168,6 +168,7 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy) unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000; struct cpufreq_frequency_table *table = &us3_freq_table[cpu].table[0]; + int ret; table[0].driver_data = 0; table[0].frequency = clock_tick / 1; @@ -181,7 +182,11 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = 0; policy->cur = clock_tick; - 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 int us3_freq_cpu_exit(struct cpufreq_policy *policy)