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: 2841122 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4D3E39F271 for ; Thu, 8 Aug 2013 13:51:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3451C20438 for ; Thu, 8 Aug 2013 13:51:22 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E24AB2043E for ; Thu, 8 Aug 2013 13:51:16 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V7Qbn-0002zZ-EI; Thu, 08 Aug 2013 13:50:32 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V7QbP-0004Dk-LQ; Thu, 08 Aug 2013 13:50:07 +0000 Received: from mail-pa0-f41.google.com ([209.85.220.41]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V7Qb2-00045m-1V for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2013 13:49:46 +0000 Received: by mail-pa0-f41.google.com with SMTP id bj1so3501200pad.0 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=K6jKU//3ZjsSgo/jrBTVO3rw2GimotPYxugSVk+Y31CobJj6umlQ3G8LsulSumccZw yZrNvQ0yOcs9pm+HWO/j9J+xB4E890IjZ5ZUYeMm6kz2ttlGRFF5bVb2mz729sayoh+9 GJs1ZhypYY9oO994Ly4iPvyv0BAVLxEBU27F+5ApiJjysj08G5uIWxRYguQs7Cb9YZYB yMiFil2650BejX4jfMQrwalN7gFYl7ic/EwcWPclbOSUlyiFkxICR/t8+KY6xyjUxqOj idwL/BOHvkGRDZxEHZz25K1MeHl9DqssxUdkAo2psCjaAW3xBTQvqK9OlarsLh+82pQ+ XIwg== X-Gm-Message-State: ALoCoQnTHUsqbxcYQb7/mfEW9jgAcrNCy/2fVdei21QQDMES3rRN4aN3Yi47OUENWvGuSFWdGKk7 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 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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130808_094944_240541_09D9D305 X-CRM114-Status: GOOD ( 12.82 ) X-Spam-Score: -2.6 (--) Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar , patches@linaro.org, linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, sparclinux@vger.kernel.org, "David S. Miller" , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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)