From patchwork Mon Aug 12 17:48:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19017 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f69.google.com (mail-qe0-f69.google.com [209.85.128.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B6E55246B8 for ; Mon, 12 Aug 2013 17:50:24 +0000 (UTC) Received: by mail-qe0-f69.google.com with SMTP id 1sf8758519qec.4 for ; Mon, 12 Aug 2013 10:50: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=0/zlMunyKi/lTw4Y7ALFA/8weMK0D0jDpFBJSWSrrjc=; b=J7kbRIrOtEL+PKjYUqWXk78b3fch7BY1rfIMIo2LamqVePNkbbqMRLVe0llLxZdHC0 bJDEOZETX1P/mMPgHNOOmXLLnw2Pm/8Q5bzkbDaq8qGOVoOhoGxauMKu+9xYktJyIdCQ 8HFNDa60RTr2RY5GnLkMWwV6lmJCpqmaeehMdG2zMV3mtU4usQR/q9qCzJS14cbnCpoG X444DJF0AZz75tVbWCWpHpecP2z3IecAyf5I6Bgu/nSEtUpkUT1Y3odQIVLEZAeFJPQE kWjfbbyKONinaLpGxAzBLRb0+SyFX8BD4f5daCysiPSVj0WrK2JP6DjjjSoM8FpoUQuM kIQg== X-Received: by 10.58.229.65 with SMTP id so1mr23280vec.33.1376329824517; Mon, 12 Aug 2013 10:50:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.26.234 with SMTP id o10ls2219126qeg.27.gmail; Mon, 12 Aug 2013 10:50:24 -0700 (PDT) X-Received: by 10.52.117.174 with SMTP id kf14mr126761vdb.26.1376329824330; Mon, 12 Aug 2013 10:50:24 -0700 (PDT) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by mx.google.com with ESMTPS id jf10si8590411vdb.24.2013.08.12.10.50.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.45 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.45; Received: by mail-vb0-f45.google.com with SMTP id e15so5903049vbg.4 for ; Mon, 12 Aug 2013 10:50:24 -0700 (PDT) X-Gm-Message-State: ALoCoQmN/lbdzTduuI7lTC2AXcgC4oU2KONR7hfaKDT3fA/gCsE0Wnemr7gxVrjpu3z9mlmvF6MZ X-Received: by 10.52.24.79 with SMTP id s15mr122977vdf.57.1376329824238; Mon, 12 Aug 2013 10:50:24 -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 u4csp108165vcz; Mon, 12 Aug 2013 10:50:23 -0700 (PDT) X-Received: by 10.69.0.168 with SMTP id az8mr250179pbd.51.1376329823256; Mon, 12 Aug 2013 10:50:23 -0700 (PDT) Received: from mail-pd0-f169.google.com (mail-pd0-f169.google.com [209.85.192.169]) by mx.google.com with ESMTPS id tb9si22128206pbc.339.2013.08.12.10.50.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.169 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.169; Received: by mail-pd0-f169.google.com with SMTP id r10so3750082pdi.0 for ; Mon, 12 Aug 2013 10:50:22 -0700 (PDT) X-Received: by 10.66.234.131 with SMTP id ue3mr245141pac.35.1376329822839; Mon, 12 Aug 2013 10:50:22 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id w8sm41388971paj.4.2013.08.12.10.50.18 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:22 -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, Viresh Kumar , Jesper Nilsson , Mikael Starvik , linux-cris-kernel@axis.com Subject: [PATCH 07/31] cpufreq: cris: Covert to light weight ->target() routine Date: Mon, 12 Aug 2013 23:18:43 +0530 Message-Id: <4a274cb4afbf12640b2ee36dc2304575b18ba13e.1376329128.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.45 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_old() to newly defined light weight .target() 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 --- 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 e205939..2d722e2 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; } @@ -82,7 +68,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_old = cris_freq_target, + .target = 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 32e9faf..0243951 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; } @@ -80,7 +67,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_old = cris_freq_target, + .target = cris_freq_target, .init = cris_freq_cpu_init, .exit = cpufreq_generic_exit, .name = "cris_freq",