From patchwork Fri Sep 13 13:00:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20120 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 876D020358 for ; Fri, 13 Sep 2013 13:10:52 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id i72sf1236337yha.5 for ; Fri, 13 Sep 2013 06:10:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version: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=MU8Ci9Sk5Nk/V8zDFl81l959MjBfQBKaqyqcF0dWHa8=; b=LdssGaS7DNeQz0hwmFlPiZvjJWRycqf7iRqX8YhgWellG5SHRUMs1cXAO0pkcsBhLU +sOq5szntktjDS0f5j9b722DWZn1bqfXNsgS+TmqomS6NFonFuBn3w/gcPIaimLWfpEe kyFbB8YBhkqld49AtTqqCO4sttndCS+upPKXdV//Ls8ZMz5z3BEN0Y7GLyT/0m065oP3 9POPgP8M/XmaIuPg+kvX3tX9qkNWpdaw6dDy3tMrx+M49f1dFxox5uR1haKPHj1L/QMk 4olfdM7njEmjAVPekHD4JwFKMYV4ykILcCJGLfppk50WeS97YG1wh+2V2s95RxnlM4Ai eN/A== X-Gm-Message-State: ALoCoQkl/ytuMmkgQttAo/PFI7q4j17dBEtoWN5SAv/pDtOUxm65XtrOUpdhY4esqOB1m2eON98v X-Received: by 10.236.69.35 with SMTP id m23mr5137607yhd.6.1379077852228; Fri, 13 Sep 2013 06:10:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.49.42 with SMTP id r10ls1177779qen.86.gmail; Fri, 13 Sep 2013 06:10:52 -0700 (PDT) X-Received: by 10.58.67.101 with SMTP id m5mr744211vet.29.1379077852011; Fri, 13 Sep 2013 06:10:52 -0700 (PDT) Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by mx.google.com with ESMTPS id vr9si3108481vcb.51.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:10:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.46 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.46; Received: by mail-vb0-f46.google.com with SMTP id p13so873702vbe.19 for ; Fri, 13 Sep 2013 06:10:51 -0700 (PDT) X-Received: by 10.220.144.68 with SMTP id y4mr752333vcu.28.1379077851903; Fri, 13 Sep 2013 06:10:51 -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 u4csp79841vcz; Fri, 13 Sep 2013 06:10:51 -0700 (PDT) X-Received: by 10.66.49.68 with SMTP id s4mr15147749pan.98.1379077851024; Fri, 13 Sep 2013 06:10:51 -0700 (PDT) Received: from mail-pb0-f51.google.com (mail-pb0-f51.google.com [209.85.160.51]) by mx.google.com with ESMTPS id se2si7438980pbc.76.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:10:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.51 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.51; Received: by mail-pb0-f51.google.com with SMTP id jt11so1207200pbb.38 for ; Fri, 13 Sep 2013 06:10:50 -0700 (PDT) X-Received: by 10.68.52.200 with SMTP id v8mr13570056pbo.48.1379077850615; Fri, 13 Sep 2013 06:10:50 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id b4sm11683443pbc.22.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:10:50 -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 Subject: [PATCH 066/228] cpufreq: exynos: Use generic cpufreq routines Date: Fri, 13 Sep 2013 18:30:12 +0530 Message-Id: <887030b562a276d7674cc381f4bbd979c23910b9.1379063063.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.212.46 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. Acked-By: Amit Daniel Kachhap Acked-by: Kukjin Kim Signed-off-by: Viresh Kumar --- 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 954baed..08338d4 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 e041f5e..e33896f 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; @@ -342,18 +336,13 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy) return 0; } -static int exynos_cpufreq_cpu_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); -} - static struct cpufreq_driver exynos_driver = { .flags = CPUFREQ_STICKY | CPUFREQ_ASYNC_NOTIFICATION, - .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, };