From patchwork Sat Aug 10 06:44:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18967 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7A78C246EB for ; Sat, 10 Aug 2013 06:51:57 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id s1sf6012980qcw.8 for ; Fri, 09 Aug 2013 23:51:57 -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=BApht9SJMZcVrEO1Wq3OxcRsblm8vD/b3uxF42bjqjU=; b=XfM9tDIu7Ts1Mi0xiZxHroAzZEA6GSb9S3HFvWdztTyBlEnd5onffqTbWOCFQRFIHQ YMl5wwyKofjWZJcfHBDgyz1Xobb1L3COjF+GrMpxK4i5dWgTsDc0qBK2+ApryuZNTZbi ErC43hUfDAcVrLJ6R2Dg1XNje/Lh/HCKgXgfcB8JXBvQwMZvNszDkDWfImlfK8vHBKKJ Id1i3cLZ82AZ0Gd7Mgt+Y6GBZwTLLr0FJILgA+b6BaQzErwbS5Hh/31puW79aj+jX0w2 MJpZm6xwARuz+eucHmSfUwY9rB2C36bG8+gm3JexsUQVSDei+wu2xhlsxe26s/chjF9T 0hRQ== X-Received: by 10.236.126.244 with SMTP id b80mr6945212yhi.31.1376117517210; Fri, 09 Aug 2013 23:51:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.73.193 with SMTP id n1ls1792827qev.50.gmail; Fri, 09 Aug 2013 23:51:57 -0700 (PDT) X-Received: by 10.220.249.67 with SMTP id mj3mr8515047vcb.23.1376117517065; Fri, 09 Aug 2013 23:51:57 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id se5si5670856vdc.153.2013.08.09.23.51.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:51:57 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id hf12so1599473vcb.41 for ; Fri, 09 Aug 2013 23:51:57 -0700 (PDT) X-Gm-Message-State: ALoCoQkiuTWxMw4rUSuGd2wa88trtALsQ6dNmGvHCoSsi+Ak6j5lw1/zkMuFU9Sd+8eUwrXo1aEB X-Received: by 10.52.164.16 with SMTP id ym16mr1851590vdb.32.1376117516965; Fri, 09 Aug 2013 23:51:56 -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 u4csp228vcz; Fri, 9 Aug 2013 23:51:56 -0700 (PDT) X-Received: by 10.68.189.194 with SMTP id gk2mr745843pbc.194.1376117516204; Fri, 09 Aug 2013 23:51:56 -0700 (PDT) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by mx.google.com with ESMTPS id ua7si15799747pac.30.2013.08.09.23.51.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:51:56 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.51 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.51; Received: by mail-pa0-f51.google.com with SMTP id lf1so2859998pab.38 for ; Fri, 09 Aug 2013 23:51:55 -0700 (PDT) X-Received: by 10.68.164.33 with SMTP id yn1mr15017870pbb.102.1376117515823; Fri, 09 Aug 2013 23:51:55 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id e7sm24185840pbc.11.2013.08.09.23.51.52 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:51:55 -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 , Eric Miao Subject: [PATCH 34/44] cpufreq: pxa: Use generic cpufreq routines Date: Sat, 10 Aug 2013 12:14:30 +0530 Message-Id: <0f9db0a191b809194e0dc928ce2ff7976766dccd.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.220.182 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. Cc: Eric Miao Signed-off-by: Viresh Kumar --- drivers/cpufreq/pxa2xx-cpufreq.c | 26 ++------------------------ drivers/cpufreq/pxa3xx-cpufreq.c | 14 ++------------ 2 files changed, 4 insertions(+), 36 deletions(-) diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c index 06af29c..5a72bf3 100644 --- a/drivers/cpufreq/pxa2xx-cpufreq.c +++ b/drivers/cpufreq/pxa2xx-cpufreq.c @@ -262,23 +262,6 @@ static u32 mdrefr_dri(unsigned int freq) return (interval - (cpu_is_pxa27x() ? 31 : 0)) / 32; } -/* find a valid frequency point */ -static int pxa_verify_policy(struct cpufreq_policy *policy) -{ - struct cpufreq_frequency_table *pxa_freqs_table; - pxa_freqs_t *pxa_freqs; - int ret; - - find_freq_tables(&pxa_freqs_table, &pxa_freqs); - ret = cpufreq_frequency_table_verify(policy, pxa_freqs_table); - - if (freq_debug) - pr_debug("Verified CPU policy: %dKhz min to %dKhz max\n", - policy->min, policy->max); - - return ret; -} - static unsigned int pxa_cpufreq_get(unsigned int cpu) { return get_clk_frequency_khz(0); @@ -465,16 +448,11 @@ static int pxa_cpufreq_init(struct cpufreq_policy *policy) return 0; } -static int pxa_cpufreq_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); -} - static struct cpufreq_driver pxa_cpufreq_driver = { - .verify = pxa_verify_policy, + .verify = cpufreq_generic_frequency_table_verify, .target = pxa_set_target, .init = pxa_cpufreq_init, - .exit = pxa_cpufreq_exit, + .exit = cpufreq_generic_exit, .get = pxa_cpufreq_get, .name = "PXA2xx", }; diff --git a/drivers/cpufreq/pxa3xx-cpufreq.c b/drivers/cpufreq/pxa3xx-cpufreq.c index 1cc145a..2837fd6 100644 --- a/drivers/cpufreq/pxa3xx-cpufreq.c +++ b/drivers/cpufreq/pxa3xx-cpufreq.c @@ -150,11 +150,6 @@ static void __update_bus_freq(struct pxa3xx_freq_info *info) cpu_relax(); } -static int pxa3xx_cpufreq_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, pxa3xx_freqs_table); -} - static unsigned int pxa3xx_cpufreq_get(unsigned int cpu) { return pxa3xx_get_clk_frequency_khz(0); @@ -227,16 +222,11 @@ static int pxa3xx_cpufreq_init(struct cpufreq_policy *policy) return 0; } -static int pxa3xx_cpufreq_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); -} - static struct cpufreq_driver pxa3xx_cpufreq_driver = { - .verify = pxa3xx_cpufreq_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = pxa3xx_cpufreq_set, .init = pxa3xx_cpufreq_init, - .exit = pxa3xx_cpufreq_exit, + .exit = cpufreq_generic_exit, .get = pxa3xx_cpufreq_get, .name = "pxa3xx-cpufreq", };