From patchwork Fri Sep 13 13:01:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20207 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 3018420358 for ; Fri, 13 Sep 2013 13:21:06 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id b4sf1223713qen.9 for ; Fri, 13 Sep 2013 06:21:06 -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=8a3YS15bqJx0sHpXi/k+crbQK+RolOs0Lq5Q6eqkHtw=; b=P0pSdB4DGumte8+ziBQ9xI85EmBRe1zWO66+s7s4s5U879N45jvAdxPNJjn858HiDh jGJc3K+IoIYj+WQfXtd7LGK4atuq7af5WQ+0uRZbKI1+D2KdUDE7X/nRqScckp/Mh7UD +eHDBvXNrECLmO3QepnmJtHRsrlXR41rMFc4FIBXbq2yUoYdTGGsa8IVh12sauiybT6l G+NIw2cAhwZbH+Otzfe4Pp/QWD2Rf1xBpKCK3H36oxSnnbfcsAMSfsZivjtp7WH+xKQk SeyVmqHLMNRe2SF16NGIgGj1hhy2tdLiaWHVVUwlLmfmBW5ezjqWb3+4V61SkNnAbpWd oPOw== X-Gm-Message-State: ALoCoQnsI0geoA3MP6b2zNO4oH89e2C6eBJgkPMowUqws9InE9DjOw2/t1zUChJ229h96fUSmD5Q X-Received: by 10.236.52.228 with SMTP id e64mr4830418yhc.45.1379078466001; Fri, 13 Sep 2013 06:21:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.104.111 with SMTP id gd15ls1135717qeb.68.gmail; Fri, 13 Sep 2013 06:21:05 -0700 (PDT) X-Received: by 10.58.73.202 with SMTP id n10mr12073998vev.7.1379078465794; Fri, 13 Sep 2013 06:21:05 -0700 (PDT) Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by mx.google.com with ESMTPS id tm8si3095061vdc.137.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:21:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.49 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.49; Received: by mail-vb0-f49.google.com with SMTP id w16so882590vbb.8 for ; Fri, 13 Sep 2013 06:21:05 -0700 (PDT) X-Received: by 10.58.208.130 with SMTP id me2mr11928651vec.13.1379078465684; Fri, 13 Sep 2013 06:21:05 -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 u4csp80380vcz; Fri, 13 Sep 2013 06:21:05 -0700 (PDT) X-Received: by 10.68.211.233 with SMTP id nf9mr13663044pbc.26.1379078464815; Fri, 13 Sep 2013 06:21:04 -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 gl2si7446928pbc.198.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:21:04 -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 w10so1243843pde.37 for ; Fri, 13 Sep 2013 06:21:04 -0700 (PDT) X-Received: by 10.66.27.43 with SMTP id q11mr14995715pag.97.1379078464410; Fri, 13 Sep 2013 06:21:04 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id bt1sm11761039pbb.2.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:21:03 -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 , Jesper Nilsson , Mikael Starvik , linux-cris-kernel@axis.com Subject: [PATCH 153/228] cpufreq: cris: Convert to light weight ->target_index() routine Date: Fri, 13 Sep 2013 18:31:39 +0530 Message-Id: <73fe150773b41450f222c179e4a7ea84884a119e.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.212.49 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: Jesper Nilsson Cc: Mikael Starvik Cc: linux-cris-kernel@axis.com Signed-off-by: Viresh Kumar Acked-by: Jesper Nilsson --- drivers/cpufreq/cris-artpec3-cpufreq.c | 18 ++---------------- drivers/cpufreq/cris-etraxfs-cpufreq.c | 17 ++--------------- 2 files changed, 4 insertions(+), 31 deletions(-) diff --git a/drivers/cpufreq/cris-artpec3-cpufreq.c b/drivers/cpufreq/cris-artpec3-cpufreq.c index 05fdc7e..841857c 100644 --- a/drivers/cpufreq/cris-artpec3-cpufreq.c +++ b/drivers/cpufreq/cris-artpec3-cpufreq.c @@ -27,8 +27,7 @@ static unsigned int cris_freq_get_cpu_frequency(unsigned int cpu) return clk_ctrl.pll ? 200000 : 6000; } -static void cris_freq_set_cpu_state(struct cpufreq_policy *policy, - unsigned int state) +static int cris_freq_target(struct cpufreq_policy *policy, unsigned int state) { struct cpufreq_freqs freqs; reg_clkgen_rw_clk_ctrl clk_ctrl; @@ -52,19 +51,6 @@ static void cris_freq_set_cpu_state(struct cpufreq_policy *policy, local_irq_enable(); cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); -}; - -static int cris_freq_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) -{ - unsigned int newstate = 0; - - if (cpufreq_frequency_table_target(policy, cris_freq_table, - target_freq, relation, &newstate)) - return -EINVAL; - - cris_freq_set_cpu_state(policy, newstate); return 0; } @@ -77,7 +63,7 @@ static int cris_freq_cpu_init(struct cpufreq_policy *policy) static struct cpufreq_driver cris_freq_driver = { .get = cris_freq_get_cpu_frequency, .verify = cpufreq_generic_frequency_table_verify, - .target = cris_freq_target, + .target_index = cris_freq_target, .init = cris_freq_cpu_init, .exit = cpufreq_generic_exit, .name = "cris_freq", diff --git a/drivers/cpufreq/cris-etraxfs-cpufreq.c b/drivers/cpufreq/cris-etraxfs-cpufreq.c index fac2b26..c58811a 100644 --- a/drivers/cpufreq/cris-etraxfs-cpufreq.c +++ b/drivers/cpufreq/cris-etraxfs-cpufreq.c @@ -27,8 +27,7 @@ static unsigned int cris_freq_get_cpu_frequency(unsigned int cpu) return clk_ctrl.pll ? 200000 : 6000; } -static void cris_freq_set_cpu_state(struct cpufreq_policy *policy, - unsigned int state) +static int cris_freq_target(struct cpufreq_policy *policy, unsigned int state) { struct cpufreq_freqs freqs; reg_config_rw_clk_ctrl clk_ctrl; @@ -52,18 +51,6 @@ static void cris_freq_set_cpu_state(struct cpufreq_policy *policy, local_irq_enable(); cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); -}; - -static int cris_freq_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) -{ - unsigned int newstate = 0; - - if (cpufreq_frequency_table_target - (policy, cris_freq_table, target_freq, relation, &newstate)) - return -EINVAL; - - cris_freq_set_cpu_state(policy, newstate); return 0; } @@ -76,7 +63,7 @@ static int cris_freq_cpu_init(struct cpufreq_policy *policy) static struct cpufreq_driver cris_freq_driver = { .get = cris_freq_get_cpu_frequency, .verify = cpufreq_generic_frequency_table_verify, - .target = cris_freq_target, + .target_index = cris_freq_target, .init = cris_freq_cpu_init, .exit = cpufreq_generic_exit, .name = "cris_freq",