From patchwork Thu Aug 8 13:48:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 265740 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 CC3D82C007A for ; Fri, 9 Aug 2013 00:10:51 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757882Ab3HHNta (ORCPT ); Thu, 8 Aug 2013 09:49:30 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:64690 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757852Ab3HHNtX (ORCPT ); Thu, 8 Aug 2013 09:49:23 -0400 Received: by mail-pa0-f44.google.com with SMTP id fz6so696011pac.3 for ; Thu, 08 Aug 2013 06:49:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; 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=GUvTVJVJxkvfKV6BQwokMGsb1UOVGDDmDOoRMlGq3pyD36hLSnhGtUnpj7NR7Uv1L5 XgrP/CkNhNPXrG3WzIZFHyb2Vu9BNH7R15JjyneaczYcfeyLp4EjXzLWRWWBtolIybuH PVMvLKByvDaZwdQHmdmEFnIHfyuLYtXGDJmAeicjHIYpDBpLT9DnqU3BgHlDNkYJKqWd COfGAJ2ucenbEAt6HuiUTgBCadzjoswmUhfyY52tgrOZybrppNon18hLti/935bkHHal LEUISgzkSr5ZS/h2HuqNQ2L0arjrIfX+KlrOgu5TiREkhFA0mdTTtvfPkICAJE5VG/5+ BBig== X-Gm-Message-State: ALoCoQn9M9CzwD1IsSrPka95cPtNhv3h2wgyaBTkiKEG6hJ4hVTXg01TJ/iMBNWvuA/RNCo8W3lO X-Received: by 10.68.189.72 with SMTP id gg8mr6032761pbc.201.1375969762296; Thu, 08 Aug 2013 06:49:22 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id e7sm14403993pbc.11.2013.08.08.06.49.18 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 08 Aug 2013 06:49:21 -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 04/35] cpufreq: sparc: call cpufreq_frequency_table_get_attr() Date: Thu, 8 Aug 2013 19:18:06 +0530 Message-Id: <2a23a50adec189d064cb934e7f3568ab0367d3c4.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: 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)