From patchwork Mon Aug 12 17:48:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19022 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f69.google.com (mail-qe0-f69.google.com [209.85.128.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2B86A246B8 for ; Mon, 12 Aug 2013 17:51:00 +0000 (UTC) Received: by mail-qe0-f69.google.com with SMTP id 1sf8758626qec.8 for ; Mon, 12 Aug 2013 10:51:00 -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=gh2iJxQS22k850+MAFRGilLxEQ42+a1PrZCW1ihK/sU=; b=SegOOYgu7UNCQoId0S+LMBQzplOgI+HdmN/FaVRfTNzBhAk9vewGtv6EgzWzEbMDdb NVjx0z1C2slvMXfdhc8vUGJufKeg6G2UIAyKxaaFT0Wot5Ube/TLhCGuD3w0fk6rqKPE neTF1HCPjYDMsu2eGfM+ahg3XELVsAHpqqpL2CPC1CNGNPJP880kL0v/kxrZ8M5HqM+5 slnP184C45wrQ8s1ykNQnjr9od6/xdUUJFCoaSSZx4C9Zj+XUJPOeGbtF0WoPioRBwpE npBbsXRZiEO4R4FOzAEhKOM+WMADqZ/RPQIHyojh4xSVvrmEpej6mlm2Y3xNVFy54OB1 9B8Q== X-Received: by 10.236.150.203 with SMTP id z51mr67465yhj.23.1376329859964; Mon, 12 Aug 2013 10:50:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.70.228 with SMTP id p4ls2454908qeu.43.gmail; Mon, 12 Aug 2013 10:50:59 -0700 (PDT) X-Received: by 10.58.217.167 with SMTP id oz7mr153474vec.15.1376329859850; Mon, 12 Aug 2013 10:50:59 -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 x9si8587484vec.80.2013.08.12.10.50.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:59 -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 p13so5962362vbe.19 for ; Mon, 12 Aug 2013 10:50:59 -0700 (PDT) X-Gm-Message-State: ALoCoQl6QzrSeOSGYavHF/KfQSvSSw0iwnYFGfnCoKVc9E2mlwvSTon6vBiRjo4CsL+uQddsOCYt X-Received: by 10.58.249.236 with SMTP id yx12mr151190vec.25.1376329859703; Mon, 12 Aug 2013 10:50:59 -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 u4csp108208vcz; Mon, 12 Aug 2013 10:50:59 -0700 (PDT) X-Received: by 10.68.19.162 with SMTP id g2mr230295pbe.140.1376329858478; Mon, 12 Aug 2013 10:50:58 -0700 (PDT) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx.google.com with ESMTPS id pq9si22124894pbc.352.2013.08.12.10.50.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:58 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.54 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.54; Received: by mail-pa0-f54.google.com with SMTP id kx10so2318609pab.41 for ; Mon, 12 Aug 2013 10:50:57 -0700 (PDT) X-Received: by 10.68.212.37 with SMTP id nh5mr259970pbc.16.1376329857877; Mon, 12 Aug 2013 10:50:57 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id vu5sm41379723pab.10.2013.08.12.10.50.54 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:57 -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 12/31] cpufreq: exynos: Covert to light weight ->target() routine Date: Mon, 12 Aug 2013 23:18:48 +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.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: , This patch converts existing .target_old() to newly defined light weight .target() routine for this driver. CPUFreq core will call cpufreq_frequency_table_target() before calling this routine and will pass index to it. Cc: Kukjin Kim Signed-off-by: Viresh Kumar --- drivers/cpufreq/exynos-cpufreq.c | 21 +++------------------ drivers/cpufreq/exynos5440-cpufreq.c | 13 +++---------- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c index 2be2136..475bb40 100644 --- a/drivers/cpufreq/exynos-cpufreq.c +++ b/drivers/cpufreq/exynos-cpufreq.c @@ -65,9 +65,6 @@ static int exynos_cpufreq_scale(unsigned int target_freq) freqs.old = policy->cur; freqs.new = target_freq; - if (freqs.new == freqs.old) - goto out; - /* * The policy max have been changed so that we cannot get proper * old_index with cpufreq_frequency_table_target(). Thus, ignore @@ -151,13 +148,9 @@ out: return ret; } -static int exynos_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) +static int exynos_target(struct cpufreq_policy *policy, unsigned int index) { struct cpufreq_frequency_table *freq_table = exynos_info->freq_table; - unsigned int index; - unsigned int new_freq; int ret = 0; mutex_lock(&cpufreq_lock); @@ -165,15 +158,7 @@ static int exynos_target(struct cpufreq_policy *policy, if (frequency_locked) goto out; - if (cpufreq_frequency_table_target(policy, freq_table, - target_freq, relation, &index)) { - ret = -EINVAL; - goto out; - } - - new_freq = freq_table[index].frequency; - - ret = exynos_cpufreq_scale(new_freq); + ret = exynos_cpufreq_scale(freq_table[index].frequency); out: mutex_unlock(&cpufreq_lock); @@ -254,7 +239,7 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy) static struct cpufreq_driver exynos_driver = { .flags = CPUFREQ_STICKY, .verify = cpufreq_generic_frequency_table_verify, - .target_old = exynos_target, + .target = exynos_target, .get = exynos_getspeed, .init = exynos_cpufreq_cpu_init, .exit = cpufreq_generic_exit, diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c index 7ad813f..872b146 100644 --- a/drivers/cpufreq/exynos5440-cpufreq.c +++ b/drivers/cpufreq/exynos5440-cpufreq.c @@ -214,21 +214,14 @@ static unsigned int exynos_getspeed(unsigned int cpu) return dvfs_info->cur_frequency; } -static int exynos_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) +static int exynos_target(struct cpufreq_policy *policy, unsigned int index) { - unsigned int index, tmp; + unsigned int tmp; int ret = 0, i; struct cpufreq_frequency_table *freq_table = dvfs_info->freq_table; mutex_lock(&cpufreq_lock); - ret = cpufreq_frequency_table_target(policy, freq_table, - target_freq, relation, &index); - if (ret) - goto out; - freqs.old = dvfs_info->cur_frequency; freqs.new = freq_table[index].frequency; @@ -333,7 +326,7 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy) static struct cpufreq_driver exynos_driver = { .flags = CPUFREQ_STICKY, .verify = cpufreq_generic_frequency_table_verify, - .target_old = exynos_target, + .target = exynos_target, .get = exynos_getspeed, .init = exynos_cpufreq_cpu_init, .exit = cpufreq_generic_exit,