From patchwork Sat Aug 10 06:44:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18952 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7D3F2246EB for ; Sat, 10 Aug 2013 06:50:13 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id oz10sf5671445veb.11 for ; Fri, 09 Aug 2013 23:50:13 -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=STZHxRQp7t9N44RffcMNnK1HBLnHO0yWqaK62cWBlyU=; b=EGllB5lZHjHFpn0CcUFQwSGFcdjxQl+Us5QeElPK6jUjZGZT+JMjPfDeo8bY/NKMiu to/vEBHFcp83MoN9WU/QiarSqn78wIpawqiRBuBismsKI7m/jWc2PdVv0XNT+0BfoFkq 9nu21XcTyskql9cT0k/CAqyHWYwGCGVt8rwu8Fiw9o+SZCAxbcxMk1TdCWs1fu7tfA2L HOqysHfc5wRoPMhd4CXCLwgJh3n5mZx37h5c9i6mM7ofEJiXtZikcGay3fi6JjdeKSpH +CqoCeNB/0Q59Cu4UVLhAVyq8sxTHCVN9iOZrLcebF13JLFj00uGmDW/ZhnHdzuvbCBG y2CA== X-Received: by 10.236.129.178 with SMTP id h38mr6378437yhi.12.1376117413184; Fri, 09 Aug 2013 23:50:13 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.74.198 with SMTP id w6ls1671284qev.9.gmail; Fri, 09 Aug 2013 23:50:13 -0700 (PDT) X-Received: by 10.52.108.98 with SMTP id hj2mr1899758vdb.56.1376117413055; Fri, 09 Aug 2013 23:50:13 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id pa20si5674433veb.128.2013.08.09.23.50.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:13 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.181 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.181; Received: by mail-ve0-f181.google.com with SMTP id jz10so4407440veb.40 for ; Fri, 09 Aug 2013 23:50:13 -0700 (PDT) X-Gm-Message-State: ALoCoQnJLjuhmY0uY8og0hLt1LXPJ1TPCe3tJDqGi9aZLjUrGRQQc2b/EUoaYF64bikH8UvYvRXy X-Received: by 10.58.134.84 with SMTP id pi20mr5957986veb.55.1376117412962; Fri, 09 Aug 2013 23:50:12 -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 u4csp161vcz; Fri, 9 Aug 2013 23:50:12 -0700 (PDT) X-Received: by 10.66.229.106 with SMTP id sp10mr15092117pac.117.1376117412115; Fri, 09 Aug 2013 23:50:12 -0700 (PDT) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by mx.google.com with ESMTPS id qh6si15745995pac.308.2013.08.09.23.50.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.43 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.43; Received: by mail-pa0-f43.google.com with SMTP id hz10so5687253pad.2 for ; Fri, 09 Aug 2013 23:50:11 -0700 (PDT) X-Received: by 10.66.122.99 with SMTP id lr3mr14918457pab.187.1376117411666; Fri, 09 Aug 2013 23:50:11 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id qp10sm26651874pab.13.2013.08.09.23.50.07 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:11 -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 , Kukjin Kim Subject: [PATCH 19/44] cpufreq: exynos: Use generic cpufreq routines Date: Sat, 10 Aug 2013 12:14:15 +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.128.181 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: Kukjin Kim Signed-off-by: Viresh Kumar Acked-By: Amit Daniel Kachhap Acked-by: Kukjin Kim --- drivers/cpufreq/exynos-cpufreq.c | 23 +++-------------------- drivers/cpufreq/exynos5440-cpufreq.c | 15 ++------------- 2 files changed, 5 insertions(+), 33 deletions(-) diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c index 71c4926..7663a96 100644 --- a/drivers/cpufreq/exynos-cpufreq.c +++ b/drivers/cpufreq/exynos-cpufreq.c @@ -31,12 +31,6 @@ static unsigned int locking_frequency; static bool frequency_locked; static DEFINE_MUTEX(cpufreq_lock); -static int exynos_verify_speed(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, - exynos_info->freq_table); -} - static unsigned int exynos_getspeed(unsigned int cpu) { return clk_get_rate(exynos_info->cpu_clk) / 1000; @@ -257,26 +251,15 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy) return cpufreq_table_validate_and_show(policy, exynos_info->freq_table); } -static int exynos_cpufreq_cpu_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - return 0; -} - -static struct freq_attr *exynos_cpufreq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver exynos_driver = { .flags = CPUFREQ_STICKY, - .verify = exynos_verify_speed, + .verify = cpufreq_generic_frequency_table_verify, .target = exynos_target, .get = exynos_getspeed, .init = exynos_cpufreq_cpu_init, - .exit = exynos_cpufreq_cpu_exit, + .exit = cpufreq_generic_exit, .name = "exynos_cpufreq", - .attr = exynos_cpufreq_attr, + .attr = cpufreq_generic_attr, #ifdef CONFIG_PM .suspend = exynos_cpufreq_suspend, .resume = exynos_cpufreq_resume, diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c index b9dfc91..f139b3b 100644 --- a/drivers/cpufreq/exynos5440-cpufreq.c +++ b/drivers/cpufreq/exynos5440-cpufreq.c @@ -209,12 +209,6 @@ static void exynos_enable_dvfs(void) dvfs_info->base + XMU_DVFS_CTRL); } -static int exynos_verify_speed(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, - dvfs_info->freq_table); -} - static unsigned int exynos_getspeed(unsigned int cpu) { return dvfs_info->cur_frequency; @@ -336,18 +330,13 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy) return 0; } -static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); -} - static struct cpufreq_driver exynos_driver = { .flags = CPUFREQ_STICKY, - .verify = exynos_verify_speed, + .verify = cpufreq_generic_frequency_table_verify, .target = exynos_target, .get = exynos_getspeed, .init = exynos_cpufreq_cpu_init, - .exit = exynos_cpufreq_cpu_exit, + .exit = cpufreq_generic_exit, .name = CPUFREQ_NAME, };