From patchwork Mon Apr 29 13:24:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2500251 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id DA2383FD1A for ; Mon, 29 Apr 2013 13:27:55 +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 1UWo6I-0003OA-Lh; Mon, 29 Apr 2013 13:26:39 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UWo5o-0001N8-R1; Mon, 29 Apr 2013 13:26:08 +0000 Received: from mail-pd0-f179.google.com ([209.85.192.179]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UWo5Q-0001K2-J4 for linux-arm-kernel@lists.infradead.org; Mon, 29 Apr 2013 13:25:45 +0000 Received: by mail-pd0-f179.google.com with SMTP id y10so454695pdj.38 for ; Mon, 29 Apr 2013 06:25:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references:x-gm-message-state; bh=sWMmmEpTc4B3URc8y612CmqWvSfm5+w8S0UpRfZscFc=; b=AdE8GPfdPO0XnYCVp+/vd7A657IXgiCN/FROe8B3GaMYKvwd/QQGNkrBtTync0YNUP zX6sX39tbKPNB+glgE9bgYH6JW5y2GPyO37q9gWMAsq0E6bOh4V/hVeQiwFSanU2SLjS Dsk7iRbweRj/h4jqk4HhIDJwoqA5LLZ8SbFZDZCzglFo584SOoPE9NAm6cZ0PD7P5QnC 3i1E6W58pqIDCA8asuAp2Lmqk4a2O6L+8Rs+aH5RHY3I3EZ04dT/fZzR39gbEbffMsQR nbzE3NqO9ChL4nKNRY5QMvcOcm+fYVsWXzeLcI9ZZW3ruvTSyaEUGvFZ3yTfeV9dpvtG SJcA== X-Received: by 10.68.247.68 with SMTP id yc4mr7173155pbc.54.1367241942261; Mon, 29 Apr 2013 06:25:42 -0700 (PDT) Received: from localhost ([122.172.192.131]) by mx.google.com with ESMTPSA id al2sm24076451pbc.25.2013.04.29.06.25.37 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 29 Apr 2013 06:25:41 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Subject: [PATCH 4/5] cpufreq: ARM big LITTLE: Move cpu_to_cluster() to arm_big_little.h Date: Mon, 29 Apr 2013 18:54:47 +0530 Message-Id: <8dd9ca3f1848c74e25d8279dfd6e113b0f537b24.1367241503.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-Gm-Message-State: ALoCoQlTbGJajW54wUjPF+0XRLrebFsXKy8XOB6SaqZr93fU1hCXbWpmP+KFDuJgLSbpXGnRLVz3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130429_092544_781774_65B9BE2E X-CRM114-Status: GOOD ( 11.51 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.192.179 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: robin.randhawa@arm.com, linux-pm@vger.kernel.org, Viresh Kumar , patches@linaro.org, Liviu.Dudau@arm.com, linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, linaro-kernel@lists.linaro.org, Steve.Bannister@arm.com, arvind.chauhan@arm.com, linux-arm-kernel@lists.infradead.org, charles.garcia-tobin@arm.com 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 This routine can be used by glue drivers and so better to keep it in arm_big_little.h file. Signed-off-by: Viresh Kumar --- drivers/cpufreq/arm_big_little.c | 5 ----- drivers/cpufreq/arm_big_little.h | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c index dbdf677..fd7beed 100644 --- a/drivers/cpufreq/arm_big_little.c +++ b/drivers/cpufreq/arm_big_little.c @@ -40,11 +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 int cpu_to_cluster(int cpu) -{ - return topology_physical_package_id(cpu); -} - static unsigned int bL_cpufreq_get(unsigned int cpu) { u32 cur_cluster = cpu_to_cluster(cpu); diff --git a/drivers/cpufreq/arm_big_little.h b/drivers/cpufreq/arm_big_little.h index 70f18fc..79b2ce1 100644 --- a/drivers/cpufreq/arm_big_little.h +++ b/drivers/cpufreq/arm_big_little.h @@ -34,6 +34,11 @@ struct cpufreq_arm_bL_ops { int (*init_opp_table)(struct device *cpu_dev); }; +static inline int cpu_to_cluster(int cpu) +{ + return topology_physical_package_id(cpu); +} + int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops); void bL_cpufreq_unregister(struct cpufreq_arm_bL_ops *ops);