From patchwork Fri Oct 18 13:59:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 21158 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 46698202FF for ; Fri, 18 Oct 2013 14:03:40 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id 8sf4624367qea.9 for ; Fri, 18 Oct 2013 07:03:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; 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=2mGZysqRUwiObHcwtF4JXsJWNqLaJnz3k3fSSBpA9J4=; b=DJSwaw2afrMR3Da++EqWsi1+iUfzZMGxwGrLZJ8vATqKbL/PAVdTG93hhDfAcZ780B i2flPmjoJAvOEkpMb5rgfCEyJrzAiN0ShjEC3Rnh4b9VLzvzCbI5NA/1rQzyQgObOIQZ 0g/qcQgErFjEBR8OISRmm5oZ1J+X2gxl1XSA12ZdH0tDBJJMFWgYbhE5EOE22dneuTKc R+fvbSK+X0GgjS04bfWhSopF4dZv+Jo6mq0TfCSA11ChhlLNjxLt8tGcqXiwMxISom8s 3lfRXvtz7a8MG1pi7VdYexdAOPYAMasu8T03N26hQyRJ4TbMvNXCYvwcW8ACGpxximGp Nvew== X-Received: by 10.58.221.193 with SMTP id qg1mr1054388vec.5.1382105020097; Fri, 18 Oct 2013 07:03:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.35.170 with SMTP id i10ls1284937qej.74.gmail; Fri, 18 Oct 2013 07:03:40 -0700 (PDT) X-Received: by 10.58.254.200 with SMTP id ak8mr2258772ved.12.1382105019953; Fri, 18 Oct 2013 07:03:39 -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 ph5si331885veb.90.2013.10.18.07.03.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:03:39 -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 db12so2122273veb.1 for ; Fri, 18 Oct 2013 07:03:39 -0700 (PDT) X-Gm-Message-State: ALoCoQlv3fcdr0QvHpEZUIz7hvARgLKwXce1aFEANRFw6k0oTNQocrY3uK26WmHLS539Tmqs/QFG X-Received: by 10.58.217.130 with SMTP id oy2mr516200vec.24.1382105019874; Fri, 18 Oct 2013 07:03:39 -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 u4csp38144vcz; Fri, 18 Oct 2013 07:03:39 -0700 (PDT) X-Received: by 10.66.25.6 with SMTP id y6mr2545870paf.180.1382105018826; Fri, 18 Oct 2013 07:03:38 -0700 (PDT) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by mx.google.com with ESMTPS id gv2si975525pbb.281.2013.10.18.07.03.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:03:38 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.176 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.176; Received: by mail-pd0-f176.google.com with SMTP id g10so3704454pdj.7 for ; Fri, 18 Oct 2013 07:03:38 -0700 (PDT) X-Received: by 10.66.150.41 with SMTP id uf9mr3754934pab.108.1382105018353; Fri, 18 Oct 2013 07:03:38 -0700 (PDT) Received: from localhost ([120.56.197.189]) by mx.google.com with ESMTPSA id og5sm2655400pbb.10.2013.10.18.07.03.34 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:03:37 -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 V2 Resend 27/34] cpufreq: s3c64xx: Convert to light weight ->target_index() routine Date: Fri, 18 Oct 2013 19:29:50 +0530 Message-Id: <5aee7290ead2f319d523ecdc99912b1ce99890c9.1382104515.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() to newly defined light weight .target_index() 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 4616173..8bdcf32 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); @@ -254,7 +244,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 = s3c64xx_cpufreq_set_target, + .target_index = s3c64xx_cpufreq_set_target, .get = s3c64xx_cpufreq_get_speed, .init = s3c64xx_cpufreq_driver_init, .name = "s3c",