From patchwork Tue Aug 13 13:31:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19055 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 968D9246B8 for ; Tue, 13 Aug 2013 13:31:47 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id g17sf9416287vbg.6 for ; Tue, 13 Aug 2013 06:31:47 -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=3C8reJWp+66mJWgMJzvXUOaesJrZe9BYAG6kZy0uXVc=; b=UM9y3hWZr//FqNOXVMJ7pLwHLpHJZji2gJZ55G6tis8NOXwllzbeYOsEBupUJSoCmm Oa59drBWNwSemuxacsTn6cJLCgj7dJHti4BlJDlQlgyMYqEownn+/bKVuJB3zemuEnZA /Iee2l39enV4jq391wvLoqYJOHybeyVAQw0f1XRbOr0DlDCYBR4GetF6EfRKqrjvuNeC SO+APXPjll68LqqVDoNt9lzCNsYonmH6a7HXdZ+JAj3lS7ziNkwVOrAcXFXdKdwmBPPu J3mt9s5zjdC/gXXbKGkrJJSyzm6HZpLu63GX/okZzrKo6c2sz0Mwfry+vyZEnqFbyw2i 3H/w== X-Received: by 10.236.137.35 with SMTP id x23mr1730583yhi.7.1376400707297; Tue, 13 Aug 2013 06:31:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.41 with SMTP id 9ls2706482qeb.15.gmail; Tue, 13 Aug 2013 06:31:47 -0700 (PDT) X-Received: by 10.220.80.132 with SMTP id t4mr95291vck.57.1376400707165; Tue, 13 Aug 2013 06:31:47 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id xb6si9742803vdb.68.2013.08.13.06.31.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:31:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id 15so6691433vea.15 for ; Tue, 13 Aug 2013 06:31:47 -0700 (PDT) X-Gm-Message-State: ALoCoQnUVxHH61+ysPh7OnVqpiw/01QpXqCtwP45eamfMXXD20KCdnAb/E4rzY/sICYhqHJ4EI0N X-Received: by 10.58.241.169 with SMTP id wj9mr76847vec.69.1376400707055; Tue, 13 Aug 2013 06:31:47 -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 u4csp154029vcz; Tue, 13 Aug 2013 06:31:46 -0700 (PDT) X-Received: by 10.66.179.143 with SMTP id dg15mr4634374pac.52.1376400706041; Tue, 13 Aug 2013 06:31:46 -0700 (PDT) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by mx.google.com with ESMTPS id ua7si26244449pac.146.2013.08.13.06.31.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:31:46 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.53 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.53; Received: by mail-pa0-f53.google.com with SMTP id lb1so8888655pab.26 for ; Tue, 13 Aug 2013 06:31:45 -0700 (PDT) X-Received: by 10.66.218.98 with SMTP id pf2mr4623986pac.120.1376400705644; Tue, 13 Aug 2013 06:31:45 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id kd1sm46829552pab.20.2013.08.13.06.31.41 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:31:44 -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.linux.org.uk, linux-arm-kernel@lists.infradead.org, Viresh Kumar Subject: [PATCH 3/3] cpufreq: sa11x0: Use generic cpufreq routines Date: Tue, 13 Aug 2013 19:01:07 +0530 Message-Id: <5b91eb45e3ee5517565d819ed2aa69f97b0fe351.1376392060.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.128.170 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 CPUFreq drivers do similar things in .exit() and .verify() routines and .attr. So its better if we have generic routines for them which can be used by cpufreq drivers then. This patch uses these generic routines for this driver. Signed-off-by: Viresh Kumar --- arch/arm/mach-sa1100/generic.c | 22 ---------------------- arch/arm/mach-sa1100/generic.h | 1 - drivers/cpufreq/sa1100-cpufreq.c | 2 +- drivers/cpufreq/sa1110-cpufreq.c | 2 +- 4 files changed, 2 insertions(+), 25 deletions(-) diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c index 5c8167b..cb4b2ca 100644 --- a/arch/arm/mach-sa1100/generic.c +++ b/arch/arm/mach-sa1100/generic.c @@ -82,28 +82,6 @@ unsigned int sa11x0_ppcr_to_freq(unsigned int idx) return freq; } - -/* make sure that only the "userspace" governor is run -- anything else wouldn't make sense on - * this platform, anyway. - */ -int sa11x0_verify_speed(struct cpufreq_policy *policy) -{ - unsigned int tmp; - if (policy->cpu) - return -EINVAL; - - cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, policy->cpuinfo.max_freq); - - /* make sure that at least one frequency is within the policy */ - tmp = sa11x0_freq_table[sa11x0_freq_to_ppcr(policy->min)].frequency; - if (tmp > policy->max) - policy->max = tmp; - - cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, policy->cpuinfo.max_freq); - - return 0; -} - unsigned int sa11x0_getspeed(unsigned int cpu) { if (cpu) diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h index f5214ce..39d56a67 100644 --- a/arch/arm/mach-sa1100/generic.h +++ b/arch/arm/mach-sa1100/generic.h @@ -23,7 +23,6 @@ struct cpufreq_policy; extern struct cpufreq_frequency_table sa11x0_freq_table[]; extern unsigned int sa11x0_freq_to_ppcr(unsigned int khz); -extern int sa11x0_verify_speed(struct cpufreq_policy *policy); extern unsigned int sa11x0_getspeed(unsigned int cpu); extern unsigned int sa11x0_ppcr_to_freq(unsigned int idx); diff --git a/drivers/cpufreq/sa1100-cpufreq.c b/drivers/cpufreq/sa1100-cpufreq.c index 235500c..02fe8b2 100644 --- a/drivers/cpufreq/sa1100-cpufreq.c +++ b/drivers/cpufreq/sa1100-cpufreq.c @@ -228,7 +228,7 @@ static int __init sa1100_cpu_init(struct cpufreq_policy *policy) static struct cpufreq_driver sa1100_driver __refdata = { .flags = CPUFREQ_STICKY, - .verify = sa11x0_verify_speed, + .verify = cpufreq_generic_frequency_table_verify, .target = sa1100_target, .get = sa11x0_getspeed, .init = sa1100_cpu_init, diff --git a/drivers/cpufreq/sa1110-cpufreq.c b/drivers/cpufreq/sa1110-cpufreq.c index 13760fc..a38d904 100644 --- a/drivers/cpufreq/sa1110-cpufreq.c +++ b/drivers/cpufreq/sa1110-cpufreq.c @@ -344,7 +344,7 @@ static int __init sa1110_cpu_init(struct cpufreq_policy *policy) * it with cpufreq_register_driver() */ static struct cpufreq_driver sa1110_driver __refdata = { .flags = CPUFREQ_STICKY, - .verify = sa11x0_verify_speed, + .verify = cpufreq_generic_frequency_table_verify, .target = sa1110_target, .get = sa11x0_getspeed, .init = sa1110_cpu_init,