From patchwork Fri Sep 13 13:02:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20230 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9DE0320358 for ; Fri, 13 Sep 2013 13:23:59 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id b4sf1233678qen.1 for ; Fri, 13 Sep 2013 06:23:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version: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=afMuNPCtF7hw3TbQj2LSptShu48oYduWexV3iafS0Cc=; b=j6fNAPhP5utlyiTuv+omTGqdvBLzl0MowcgBxqEh6T0eyZavevW6WJG/uWlFGuOUbZ VE/G9EpZg+0N9Twl5wk5LDfj+p6i+TAmGxXaC5efvKbr1pxKG90pT/yQMmpkBrUDguYn MEWbjO8MdS8PxQxPjgYIFzMOBHq4ofVbaump7DTPz9RyofbUXjHNBmkt7c8xjmeiD9GR bnueWui/J1CbBwU5lljHSF/U/ub9kWfcixCNBSy1rrjtUCC07ighbPi0ll6czNWF8pHZ l4GgRhcZrcDDc34bH6hrZ2dPPIqibAS3aDZlCkjSODmrdNEPK7AgQtSfVdOdhMZf+IUV 9sbg== X-Gm-Message-State: ALoCoQm1VZn2RJQHekDfHCkdDEgwV+wiR2uvq0yqGF7uBKnM0cmufKrbB61r2mmxvk9ViFBCdrQ+ X-Received: by 10.236.66.244 with SMTP id h80mr5137183yhd.30.1379078639427; Fri, 13 Sep 2013 06:23:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.116.228 with SMTP id jz4ls1190093qeb.51.gmail; Fri, 13 Sep 2013 06:23:59 -0700 (PDT) X-Received: by 10.52.116.74 with SMTP id ju10mr10040828vdb.20.1379078639179; Fri, 13 Sep 2013 06:23:59 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id lr1si3133177vcb.19.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:23:59 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 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.174; Received: by mail-vc0-f174.google.com with SMTP id gd11so905042vcb.19 for ; Fri, 13 Sep 2013 06:23:59 -0700 (PDT) X-Received: by 10.58.168.205 with SMTP id zy13mr10065901veb.19.1379078639095; Fri, 13 Sep 2013 06:23:59 -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 u4csp80539vcz; Fri, 13 Sep 2013 06:23:58 -0700 (PDT) X-Received: by 10.68.218.6 with SMTP id pc6mr2050889pbc.187.1379078638171; Fri, 13 Sep 2013 06:23:58 -0700 (PDT) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by mx.google.com with ESMTPS id fl1si11271916pab.25.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:23:58 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.173 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.173; Received: by mail-pd0-f173.google.com with SMTP id p10so1244621pdj.18 for ; Fri, 13 Sep 2013 06:23:57 -0700 (PDT) X-Received: by 10.66.180.200 with SMTP id dq8mr15562572pac.104.1379078637765; Fri, 13 Sep 2013 06:23:57 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id sz3sm11771489pbc.5.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:23:57 -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 Subject: [PATCH 176/228] cpufreq: sc520: Convert to light weight ->target_index() routine Date: Fri, 13 Sep 2013 18:32:02 +0530 Message-Id: <7919f0077e23bcc483596063bb795d8bb0956564.1379063063.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.174 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. Signed-off-by: Viresh Kumar --- drivers/cpufreq/sc520_freq.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/cpufreq/sc520_freq.c b/drivers/cpufreq/sc520_freq.c index 9047ab1..6c86452 100644 --- a/drivers/cpufreq/sc520_freq.c +++ b/drivers/cpufreq/sc520_freq.c @@ -53,8 +53,7 @@ static unsigned int sc520_freq_get_cpu_frequency(unsigned int cpu) } } -static void sc520_freq_set_cpu_state(struct cpufreq_policy *policy, - unsigned int state) +static int sc520_freq_target(struct cpufreq_policy *policy, unsigned int state) { struct cpufreq_freqs freqs; @@ -76,24 +75,10 @@ static void sc520_freq_set_cpu_state(struct cpufreq_policy *policy, local_irq_enable(); cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); -}; - -static int sc520_freq_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) -{ - unsigned int newstate = 0; - - if (cpufreq_frequency_table_target(policy, sc520_freq_table, - target_freq, relation, &newstate)) - return -EINVAL; - - sc520_freq_set_cpu_state(policy, newstate); return 0; } - /* * Module init and exit code */ @@ -117,7 +102,7 @@ static int sc520_freq_cpu_init(struct cpufreq_policy *policy) static struct cpufreq_driver sc520_freq_driver = { .get = sc520_freq_get_cpu_frequency, .verify = cpufreq_generic_frequency_table_verify, - .target = sc520_freq_target, + .target_index = sc520_freq_target, .init = sc520_freq_cpu_init, .exit = cpufreq_generic_exit, .name = "sc520_freq",