From patchwork Sat Aug 10 06:44:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18943 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1459E246EB for ; Sat, 10 Aug 2013 06:49:03 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id ha11sf635238vcb.0 for ; Fri, 09 Aug 2013 23:49:02 -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=DpUV2dI/Zy+a57gVQ2EK2wu2h3pWFl0chKBNtZwo4Y8=; b=O1b9mkRTdBb4r0rfY9QUeARBTunhyKWJkZZrzrrHQZ0IQCqBQphbyNCC05daECoF0r U6VUv2VJwPSkrlnsFHRoi9nruVo9mK7OvUctDAdmXPqNf0biHEiEEX/RzQOVyJsjd2IX pu20E9sYFBpgIgS3jptfb5f2cBC5q0XSl1qVzENICYpMWpbLUoII0fS9TbQ8musY00Cw OAhudIlI282no80O1C4wKstqUA07N3MUpsiicJx4pxFTh7/IWxriZDWAmgt42AwmOzuQ Ug85RdXooJLNtVqIlbKQOQrv+ZNQObmmoUwwaVGoxTj+vR97A6GEaXBhmpCFjynqlgmW IprA== X-Received: by 10.236.109.199 with SMTP id s47mr7167995yhg.2.1376117342790; Fri, 09 Aug 2013 23:49:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.24.171 with SMTP id v11ls1069414qef.13.gmail; Fri, 09 Aug 2013 23:49:02 -0700 (PDT) X-Received: by 10.58.40.16 with SMTP id t16mr2282999vek.64.1376117342669; Fri, 09 Aug 2013 23:49:02 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id gq10si5678895vdc.69.2013.08.09.23.49.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:49:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.171 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.171; Received: by mail-ve0-f171.google.com with SMTP id pa12so4546160veb.16 for ; Fri, 09 Aug 2013 23:49:02 -0700 (PDT) X-Gm-Message-State: ALoCoQlX/v29yNKyJC1zbAci0Ok8p9fMIvZF68l9Ez2fHyUp/bY6XF24s/FZer0z8lVq3LkrbO8G X-Received: by 10.220.164.202 with SMTP id f10mr8472159vcy.25.1376117342562; Fri, 09 Aug 2013 23:49:02 -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 u4csp114vcz; Fri, 9 Aug 2013 23:49:02 -0700 (PDT) X-Received: by 10.66.233.37 with SMTP id tt5mr4143212pac.95.1376117341680; Fri, 09 Aug 2013 23:49:01 -0700 (PDT) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by mx.google.com with ESMTPS id ql10si14657488pbb.70.2013.08.09.23.49.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:49:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.46 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.46; Received: by mail-pa0-f46.google.com with SMTP id fa1so3783548pad.5 for ; Fri, 09 Aug 2013 23:49:01 -0700 (PDT) X-Received: by 10.66.175.133 with SMTP id ca5mr4338360pac.40.1376117341308; Fri, 09 Aug 2013 23:49:01 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ef10sm26673929pac.1.2013.08.09.23.48.57 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:49:00 -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 Subject: [PATCH 10/44] cpufreq: arm_big_little: Use generic cpufreq routines Date: Sat, 10 Aug 2013 12:14:06 +0530 Message-Id: <1ee0af3a4739da8db8af8918fb6459943abc8bda.1376116345.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.171 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 --- drivers/cpufreq/arm_big_little.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c index 9acfb82..7e92586 100644 --- a/drivers/cpufreq/arm_big_little.c +++ b/drivers/cpufreq/arm_big_little.c @@ -47,14 +47,6 @@ static unsigned int bL_cpufreq_get(unsigned int cpu) return clk_get_rate(clk[cur_cluster]) / 1000; } -/* Validate policy frequency range */ -static int bL_cpufreq_verify_policy(struct cpufreq_policy *policy) -{ - u32 cur_cluster = cpu_to_cluster(policy->cpu); - - return cpufreq_frequency_table_verify(policy, freq_table[cur_cluster]); -} - /* Set clock frequency */ static int bL_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) @@ -205,22 +197,16 @@ static int bL_cpufreq_exit(struct cpufreq_policy *policy) return 0; } -/* Export freq_table to sysfs */ -static struct freq_attr *bL_cpufreq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver bL_cpufreq_driver = { .name = "arm-big-little", .flags = CPUFREQ_STICKY, - .verify = bL_cpufreq_verify_policy, + .verify = cpufreq_generic_frequency_table_verify, .target = bL_cpufreq_set_target, .get = bL_cpufreq_get, .init = bL_cpufreq_init, .exit = bL_cpufreq_exit, .have_governor_per_policy = true, - .attr = bL_cpufreq_attr, + .attr = cpufreq_generic_attr, }; int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)