From patchwork Tue Aug 13 13:32:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2843771 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0C5B6BF546 for ; Tue, 13 Aug 2013 15:37:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6615320454 for ; Tue, 13 Aug 2013 15:37:21 +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 17A0D2044A for ; Tue, 13 Aug 2013 15:37:20 +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 1V9Epu-0002WE-0f; Tue, 13 Aug 2013 13:40:34 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9EpW-0008TO-HO; Tue, 13 Aug 2013 13:40:10 +0000 Received: from mail-pa0-f52.google.com ([209.85.220.52]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9En4-0008Dg-Rk for linux-arm-kernel@lists.infradead.org; Tue, 13 Aug 2013 13:37:40 +0000 Received: by mail-pa0-f52.google.com with SMTP id kq13so8861682pab.11 for ; Tue, 13 Aug 2013 06:37:17 -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=wkAXeio9C6GhwjX7WmXIfVsCWObufMisibRk8epzsrM=; b=Hf98wZ7hP1Rf7FXQAGPboR7ThR1OA1JDyZzl92ub9e9DprnxiiWOSZN5b+/BL8b6xb DKkOBMxjbkZju8jl4lDMDS56jXgFdmiQ4wiBQsw/zo6BBqzmOt9EW/8lofiFpX+2JgNi IpZr9rUJvAdys1YcxTJYqL2ICgdLID2ZcziQLXTUJOz+USBLDV0eQYwCyBKwGO9h/Vxn pxfuP7PPU8ZC4/D592+T4ZerL8H/HT/9EwJpJHB81EZbZoHri0qOOH2dbcUgXOWKSFKE UEAV8dFnD3Howui7cAdvjSG8g2EgN/xd/tkc9yatIDOnVDmBsMloyopm0a0sgaU+5+lU NApw== X-Gm-Message-State: ALoCoQlxmbitwieFf0dX5gtOXL55o4GPzTvYje5ajNqV+w8t+fpUbJ9fDj+hUkR9doApcMK4UHno X-Received: by 10.68.226.234 with SMTP id rv10mr4685162pbc.1.1376401037088; Tue, 13 Aug 2013 06:37:17 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id qh10sm43988927pbb.33.2013.08.13.06.37.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:37:16 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Subject: [PATCH V2 33/35] cpufreq: SPEAr: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:46 +0530 Message-Id: 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-20130813_093739_020816_48AFB4C9 X-CRM114-Status: GOOD ( 10.97 ) 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, 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=-7.0 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 patch converts existing .target() to newly defined light weight .target_index() routine for this driver. CPUFreq core will call cpufreq_frequency_table_target() before calling this routine and will pass index to it. Signed-off-by: Viresh Kumar --- drivers/cpufreq/spear-cpufreq.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c index d31accc..88aa5cf 100644 --- a/drivers/cpufreq/spear-cpufreq.c +++ b/drivers/cpufreq/spear-cpufreq.c @@ -105,20 +105,16 @@ static int spear1340_set_cpu_rate(struct clk *sys_pclk, unsigned long newfreq) } static int spear_cpufreq_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) + unsigned int index) { struct cpufreq_freqs freqs; unsigned long newfreq; struct clk *srcclk; - int index, ret, mult = 1; - - if (cpufreq_frequency_table_target(policy, spear_cpufreq.freq_tbl, - target_freq, relation, &index)) - return -EINVAL; + int ret, mult = 1; freqs.old = spear_cpufreq_get(0); - newfreq = spear_cpufreq.freq_tbl[index].frequency * 1000; + if (of_machine_is_compatible("st,spear1340")) { /* * SPEAr1340 is special in the sense that due to the possibility @@ -191,7 +187,7 @@ static struct cpufreq_driver spear_cpufreq_driver = { .name = "cpufreq-spear", .flags = CPUFREQ_STICKY, .verify = cpufreq_generic_frequency_table_verify, - .target = spear_cpufreq_target, + .target_index = spear_cpufreq_target, .get = spear_cpufreq_get, .init = spear_cpufreq_init, .exit = cpufreq_generic_exit,