From patchwork Tue Aug 13 13:32:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19065 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C2E48246B8 for ; Tue, 13 Aug 2013 13:34:24 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id w15sf3069339iea.2 for ; Tue, 13 Aug 2013 06:34:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=l9awPe7raFVp9LK6vTKvKMqnDRur6Mja4B4lae+xwFo=; b=QD28QaO6qavUvep+r+Ly4mS8chFzWFFwCmhZqHFuppBTltOLIPq+2zPKua2TuU2YNe eu7ig3v31HzKKkPoE/MP1myTKrMAeU68qT+2zFASraoRPNvlcltyurYSNoZTt6bTH9XR lAQ+faJxuwfqpIfOXQexqa96j/KmL87ziJz9wGjWabGyAEbNjF244TxsUTtB2iUY3ode W3UGlN4aAT53WNx8tyckEu5/OMd5QSK0h7NLLUEHf4F+iJfAF0EKZh2aR9ApJeX9x6hw sWzZwncPLGWPsYYkrIrJC6NxpGNJbG7Mazv3QWuI5b8Uddf56VrIlsWENM9+3E07aPhf IR+Q== X-Received: by 10.182.196.4 with SMTP id ii4mr4845933obc.12.1376400864044; Tue, 13 Aug 2013 06:34:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.39.165 with SMTP id q5ls2867756qek.22.gmail; Tue, 13 Aug 2013 06:34:23 -0700 (PDT) X-Received: by 10.220.98.70 with SMTP id p6mr102400vcn.59.1376400863773; Tue, 13 Aug 2013 06:34:23 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id wd10si9743903vcb.101.2013.08.13.06.34.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:34:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id ha11so2846142vcb.7 for ; Tue, 13 Aug 2013 06:34:23 -0700 (PDT) X-Gm-Message-State: ALoCoQkQy0fP2q7DCPthyvT9NTyf6zJMLezldr+9FcPIvUx8GlelCAB9kjVFKRntICeJH4+PZjTl X-Received: by 10.220.91.78 with SMTP id l14mr780436vcm.39.1376400863688; Tue, 13 Aug 2013 06:34:23 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp154175vcz; Tue, 13 Aug 2013 06:34:23 -0700 (PDT) X-Received: by 10.66.253.100 with SMTP id zz4mr4549499pac.48.1376400863049; Tue, 13 Aug 2013 06:34:23 -0700 (PDT) Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by mx.google.com with ESMTPS id tg10si25090557pbc.267.2013.08.13.06.34.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:34:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.178 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.178; Received: by mail-pd0-f178.google.com with SMTP id w10so4929421pde.37 for ; Tue, 13 Aug 2013 06:34:22 -0700 (PDT) X-Received: by 10.67.11.103 with SMTP id eh7mr4655397pad.153.1376400862636; Tue, 13 Aug 2013 06:34:22 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id z14sm44024382pbt.0.2013.08.13.06.34.18 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:34: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 , Linus Walleij Subject: [PATCH V2 10/35] cpufreq: dbx500: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:23 +0530 Message-Id: <79809d6e1f6f78cec69aa44103c09a81839301e8.1376392602.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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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. Cc: Linus Walleij Signed-off-by: Viresh Kumar --- drivers/cpufreq/dbx500-cpufreq.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c index 7e2f9c0..28deaf0 100644 --- a/drivers/cpufreq/dbx500-cpufreq.c +++ b/drivers/cpufreq/dbx500-cpufreq.c @@ -20,23 +20,13 @@ static struct cpufreq_frequency_table *freq_table; static struct clk *armss_clk; static int dbx500_cpufreq_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) + unsigned int index) { struct cpufreq_freqs freqs; - unsigned int idx; int ret; - /* Lookup the next frequency */ - if (cpufreq_frequency_table_target(policy, freq_table, target_freq, - relation, &idx)) - return -EINVAL; - freqs.old = policy->cur; - freqs.new = freq_table[idx].frequency; - - if (freqs.old == freqs.new) - return 0; + freqs.new = freq_table[index].frequency; /* pre-change notification */ cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); @@ -104,7 +94,7 @@ static int dbx500_cpufreq_init(struct cpufreq_policy *policy) static struct cpufreq_driver dbx500_cpufreq_driver = { .flags = CPUFREQ_STICKY | CPUFREQ_CONST_LOOPS, .verify = cpufreq_generic_frequency_table_verify, - .target = dbx500_cpufreq_target, + .target_index = dbx500_cpufreq_target, .get = dbx500_cpufreq_getspeed, .init = dbx500_cpufreq_init, .name = "DBX500",