From patchwork Mon Aug 12 17:49:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19036 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E1914246B8 for ; Mon, 12 Aug 2013 17:52:37 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id bq6sf3071295qab.10 for ; Mon, 12 Aug 2013 10:52:37 -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=un8qG7t9Ci9Qt1oTbhfzMc0JIr3SAbIucYhczSma3UI=; b=X6iUGRkrY7L1Zf9IljhgzRImEar7+MoMqPnGKIDJQ3I7uGyhmKhAUn+JM5Lketi2UI Fuj0mqzIDnVTBEpFchwfUte5MZ6niXbflmewAQ8aJt6LkgXkpE21YbqDDSej5ZO6vbZr fH7pTdf8R6mm8tiON0CvqOD7gQk62FuUslIyVFSD0hySY6D7MgBfSSo1lQuhb8ikgyZ5 uCX2EwgMVC3j0oz1r3aAdbXyWi7XQVmaIcOujcSoG3BldFG5mwQx6u9CX3jrTw1wcSri 8gOKpHZTo0XqzyVnnHtkAHdXSEGoFoKNqU3f6JURWtn0063pTiltwG84Ej3GRrOFS8zz aguw== X-Received: by 10.236.137.210 with SMTP id y58mr73235yhi.28.1376329957716; Mon, 12 Aug 2013 10:52:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.94.131 with SMTP id dc3ls2522740qeb.58.gmail; Mon, 12 Aug 2013 10:52:37 -0700 (PDT) X-Received: by 10.59.8.232 with SMTP id dn8mr162595ved.8.1376329957608; Mon, 12 Aug 2013 10:52:37 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id y4si8591096vcn.59.2013.08.12.10.52.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:52:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 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.170; Received: by mail-ve0-f170.google.com with SMTP id 15so5932975vea.29 for ; Mon, 12 Aug 2013 10:52:37 -0700 (PDT) X-Gm-Message-State: ALoCoQl7QEyyVC9G/QjZuwb9Q41qZj1c0eBFcBBupoDxhO4v4hXYJlPebketJapfo7t81xcgVquV X-Received: by 10.58.73.202 with SMTP id n10mr163444vev.7.1376329957513; Mon, 12 Aug 2013 10:52:37 -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 u4csp108309vcz; Mon, 12 Aug 2013 10:52:37 -0700 (PDT) X-Received: by 10.68.101.194 with SMTP id fi2mr248391pbb.109.1376329956679; Mon, 12 Aug 2013 10:52:36 -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 dz4si22181994pbc.149.2013.08.12.10.52.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:52:36 -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 lf1so5008270pab.10 for ; Mon, 12 Aug 2013 10:52:36 -0700 (PDT) X-Received: by 10.68.133.71 with SMTP id pa7mr238981pbb.133.1376329956277; Mon, 12 Aug 2013 10:52:36 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ib9sm38573228pbc.43.2013.08.12.10.52.32 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:52:35 -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 26/31] cpufreq: s3c64xx: Covert to light weight ->target() routine Date: Mon, 12 Aug 2013 23:19:02 +0530 Message-Id: <4ba314e6256948a120fbc59c3b442747cd8bb0af.1376329128.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.170 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/s3c64xx-cpufreq.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/cpufreq/s3c64xx-cpufreq.c b/drivers/cpufreq/s3c64xx-cpufreq.c index 14f8c98..4b31d9b 100644 --- a/drivers/cpufreq/s3c64xx-cpufreq.c +++ b/drivers/cpufreq/s3c64xx-cpufreq.c @@ -63,26 +63,16 @@ static unsigned int s3c64xx_cpufreq_get_speed(unsigned int cpu) } static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) + unsigned int index) { int ret; - unsigned int i; struct cpufreq_freqs freqs; struct s3c64xx_dvfs *dvfs; - ret = cpufreq_frequency_table_target(policy, s3c64xx_freq_table, - target_freq, relation, &i); - if (ret != 0) - return ret; - freqs.old = clk_get_rate(armclk) / 1000; - freqs.new = s3c64xx_freq_table[i].frequency; + freqs.new = s3c64xx_freq_table[index].frequency; freqs.flags = 0; - dvfs = &s3c64xx_dvfs_table[s3c64xx_freq_table[i].driver_data]; - - if (freqs.old == freqs.new) - return 0; + dvfs = &s3c64xx_dvfs_table[s3c64xx_freq_table[index].driver_data]; pr_debug("Transition %d-%dkHz\n", freqs.old, freqs.new); @@ -257,7 +247,7 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy) static struct cpufreq_driver s3c64xx_cpufreq_driver = { .flags = 0, .verify = cpufreq_generic_frequency_table_verify, - .target_old = s3c64xx_cpufreq_set_target, + .target = s3c64xx_cpufreq_set_target, .get = s3c64xx_cpufreq_get_speed, .init = s3c64xx_cpufreq_driver_init, .name = "s3c",