From patchwork Tue Aug 13 13:32:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19083 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C23FE246B8 for ; Tue, 13 Aug 2013 13:36:39 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id s1sf5260808qcw.0 for ; Tue, 13 Aug 2013 06:36:39 -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=1Nx/UFKRauOs13pbCqnqMQ7URDUfXaRPo/HeCjDlq5Q=; b=GtAoO4Y7I1J8+jhoXvqOccQ6LoSWCn5rZoRT6ERQCCuzWsRJUG4gwc73Z+SHeKBqEF T/jmA+QfJ1TgrDhVZKJe67tenjxL8208B5jG+HWEMwObTBZMZs9dIsSaZwiOlVF7kORm xRv5ZoXEfUpJb18UK/+Lst24Y1JARh9AISipGH1dfvKLizPEk48eO7ydpP9YqHe8cVuj U3fVQbhYW1/RwArYPNb0x+4IWOGQCcbE6uPlxuTSVr6esAw86VXCcezBoX2WFdpOII8N t+Hys2rpH/ILN5fM8rfnyOMmhUAfqKwBQtt4YRRw7m7fHrXKiwsXcPe0r+hYbL3cEvbE 7gSA== X-Received: by 10.236.88.231 with SMTP id a67mr1591773yhf.39.1376400999472; Tue, 13 Aug 2013 06:36:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.24.233 with SMTP id x9ls2558534qef.46.gmail; Tue, 13 Aug 2013 06:36:39 -0700 (PDT) X-Received: by 10.52.34.74 with SMTP id x10mr3748743vdi.13.1376400999115; Tue, 13 Aug 2013 06:36:39 -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 o7si7357177vcl.60.2013.08.13.06.36.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:36:39 -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 jz10so6554874veb.40 for ; Tue, 13 Aug 2013 06:36:39 -0700 (PDT) X-Gm-Message-State: ALoCoQkm4aEcNMzykF6/A4Ix2sI0B9fTaksoAubkxV2lrb8OaqSx4CO+X3VR/L9plQ6j2WIzm+6x X-Received: by 10.58.214.105 with SMTP id nz9mr105141vec.58.1376400999019; Tue, 13 Aug 2013 06:36: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 u4csp154287vcz; Tue, 13 Aug 2013 06:36:38 -0700 (PDT) X-Received: by 10.66.233.195 with SMTP id ty3mr4690558pac.70.1376400998187; Tue, 13 Aug 2013 06:36:38 -0700 (PDT) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx.google.com with ESMTPS id bk3si25095478pbd.268.2013.08.13.06.36.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:36:38 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.52; Received: by mail-pa0-f52.google.com with SMTP id kq13so8852500pab.25 for ; Tue, 13 Aug 2013 06:36:37 -0700 (PDT) X-Received: by 10.67.21.226 with SMTP id hn2mr4700115pad.69.1376400997778; Tue, 13 Aug 2013 06:36:37 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id dg3sm44001338pbc.24.2013.08.13.06.36.33 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:36: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, linux-arm-kernel@lists.infradead.org, Viresh Kumar , Kukjin Kim Subject: [PATCH V2 28/35] cpufreq: s3c64xx: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:41 +0530 Message-Id: <1d6e581b39e323b5b868cddba622e1fe371a8faf.1376392602.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.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: , 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 99fbc49..72f733b 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 = s3c64xx_cpufreq_set_target, + .target_index = s3c64xx_cpufreq_set_target, .get = s3c64xx_cpufreq_get_speed, .init = s3c64xx_cpufreq_driver_init, .name = "s3c",