From patchwork Fri Aug 16 02:25:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19202 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 10B752486D for ; Fri, 16 Aug 2013 02:29:30 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id j10sf465377qcx.10 for ; Thu, 15 Aug 2013 19:29:29 -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=YHAVRWywOkauAATC7bp+QOVXHeCBHJTfjdQ1Pfxp/MQ=; b=f/jsrtUaEufo74/67MOno+L30ERcLKlBvj74YsBA0wLBbwWufx/hHVBCDxE9/875Y5 oWPp2GJJhhjKK/J0yOWt4+0QoPRZa8XiIu0GMx/yB79kJHrjjMR8VcQIpS6D0ub0kCZU Dusxpnbu35+Uu9h/7uSiMqr18LQiM7vMdPVW9m1IthbqZ6vENob7OT5tc7ASYJ5NGhhv 7/PcMaQRmpqDisAGBzMUATlqqyzqLwwPrYalkCmVvs16fQZuo3f9gTOme6lfQ9OmhNHU HFTO+I5WOz/++BA5wr9mClBVxMvuIYHyBLtjNHwtxG5SrW9NP/FGMfBRLsBwib92lXDu FNMA== X-Received: by 10.236.207.228 with SMTP id n64mr345487yho.50.1376620169845; Thu, 15 Aug 2013 19:29:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.74.102 with SMTP id s6ls673034qev.17.gmail; Thu, 15 Aug 2013 19:29:29 -0700 (PDT) X-Received: by 10.221.51.206 with SMTP id vj14mr17381162vcb.17.1376620169713; Thu, 15 Aug 2013 19:29:29 -0700 (PDT) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) by mx.google.com with ESMTPS id gw1si647857vcb.137.2013.08.15.19.29.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:29:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.41 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.41; Received: by mail-vb0-f41.google.com with SMTP id g17so1270576vbg.28 for ; Thu, 15 Aug 2013 19:29:29 -0700 (PDT) X-Gm-Message-State: ALoCoQnS86u7ZYBp7EXr3AmkhQ07suhsx1QYV8KkGiQIXwHnPIUtKvjfHSLmTKVENWmhkqtw7BlE X-Received: by 10.220.198.133 with SMTP id eo5mr3470091vcb.24.1376620169632; Thu, 15 Aug 2013 19:29:29 -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 u4csp45269vcz; Thu, 15 Aug 2013 19:29:29 -0700 (PDT) X-Received: by 10.66.250.47 with SMTP id yz15mr567965pac.154.1376620168699; Thu, 15 Aug 2013 19:29:28 -0700 (PDT) Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by mx.google.com with ESMTPS id qb10si65404pac.104.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:29:28 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.171 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.171; Received: by mail-pd0-f171.google.com with SMTP id g10so1591754pdj.30 for ; Thu, 15 Aug 2013 19:29:28 -0700 (PDT) X-Received: by 10.67.1.203 with SMTP id bi11mr577246pad.137.1376620168303; Thu, 15 Aug 2013 19:29:28 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id om2sm2699178pbc.30.2013.08.15.19.29.23 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:29:27 -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 , Russell King Subject: [PATCH 29/34] cpufreq: sa11x0: remove calls to cpufreq_notify_transition() Date: Fri, 16 Aug 2013 07:55:26 +0530 Message-Id: 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.41 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: , Most of the drivers do following in their ->target_index() routines: struct cpufreq_freqs freqs; freqs.old = old freq... freqs.new = new freq... cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); /* Change rate here */ cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); This is replicated over all cpufreq drivers today and there doesn't exists a good enough reason why this shouldn't be moved to cpufreq core instead. Earlier patches have added support in cpufreq core to do cpufreq notification on frequency change, this one removes it from this driver. Some related minor cleanups are also done along with it. Cc: Russell King Signed-off-by: Viresh Kumar --- drivers/cpufreq/sa1100-cpufreq.c | 17 ++++++----------- drivers/cpufreq/sa1110-cpufreq.c | 12 ++---------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/drivers/cpufreq/sa1100-cpufreq.c b/drivers/cpufreq/sa1100-cpufreq.c index aa49a08..a89c47b 100644 --- a/drivers/cpufreq/sa1100-cpufreq.c +++ b/drivers/cpufreq/sa1100-cpufreq.c @@ -180,22 +180,17 @@ static void sa1100_update_dram_timings(int current_speed, int new_speed) static int sa1100_target(struct cpufreq_policy *policy, unsigned int ppcr) { unsigned int cur = sa11x0_getspeed(0); - struct cpufreq_freqs freqs; + unsigned int new_freq; - freqs.old = cur; - freqs.new = sa11x0_freq_table[ppcr].frequency; + new_freq = sa11x0_freq_table[ppcr].frequency; - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - - if (freqs.new > cur) - sa1100_update_dram_timings(cur, freqs.new); + if (new_freq > cur) + sa1100_update_dram_timings(cur, new_freq); PPCR = ppcr; - if (freqs.new < cur) - sa1100_update_dram_timings(cur, freqs.new); - - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); + if (new_freq < cur) + sa1100_update_dram_timings(cur, new_freq); return 0; } diff --git a/drivers/cpufreq/sa1110-cpufreq.c b/drivers/cpufreq/sa1110-cpufreq.c index c00cf2b..0e52e80 100644 --- a/drivers/cpufreq/sa1110-cpufreq.c +++ b/drivers/cpufreq/sa1110-cpufreq.c @@ -232,15 +232,11 @@ sdram_update_refresh(u_int cpu_khz, struct sdram_params *sdram) static int sa1110_target(struct cpufreq_policy *policy, unsigned int ppcr) { struct sdram_params *sdram = &sdram_params; - struct cpufreq_freqs freqs; struct sdram_info sd; unsigned long flags; unsigned int unused; - freqs.old = sa11x0_getspeed(0); - freqs.new = sa11x0_freq_table[ppcr].frequency; - - sdram_calculate_timing(&sd, freqs.new, sdram); + sdram_calculate_timing(&sd, sa11x0_freq_table[ppcr].frequency, sdram); #if 0 /* @@ -259,8 +255,6 @@ static int sa1110_target(struct cpufreq_policy *policy, unsigned int ppcr) sd.mdcas[2] = 0xaaaaaaaa; #endif - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - /* * The clock could be going away for some time. Set the SDRAMs * to refresh rapidly (every 64 memory clock cycles). To get @@ -305,9 +299,7 @@ static int sa1110_target(struct cpufreq_policy *policy, unsigned int ppcr) /* * Now, return the SDRAM refresh back to normal. */ - sdram_update_refresh(freqs.new, sdram); - - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); + sdram_update_refresh(sa11x0_freq_table[ppcr].frequency, sdram); return 0; }