From patchwork Fri Sep 13 13:01:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20227 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1F80E20358 for ; Fri, 13 Sep 2013 13:23:37 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id db12sf1236364veb.10 for ; Fri, 13 Sep 2013 06:23:36 -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=92LscreW7fML09qNBdLGdb3qELx4WTOY46///zDbwko=; b=TRqSo2BsHiz1LqzI746p7FWi1XE4LVRFnGytANkyIB2sxfDUte8dTEWvrErNtrCsyz K8dX3tfiX92WYWaJsNHugzb+5PbHZrMjh1TZz1KfMQPZTHCK1GpoLbTKUmbdi/XuIwDy cCKDIrqh7wnZBOIK74w1e7K+Fi84mRjixQzLGU1RnrxE/IRvBVRCyvQ2e38HgvCC86Ht pyDBzmrfE6LWDbkmgLcN1rQwXX+7OCj/IkLZ0hI0r8o73oQyBXKAk+c4OODXK3a9rfCd 7deULXK7B2R6NXtVKahIE3zyJF+QSJE02GelWixgRpXruIQBNRxMr8hGx/oaONzaQeXA 4+Yg== X-Gm-Message-State: ALoCoQkg0hvafB/H0Tsl+GE4QmtpHaDLT9oP2v6lhLdyrgbsDY1EOe236otlnbHkU24C8H4noboW X-Received: by 10.236.186.101 with SMTP id v65mr4794952yhm.12.1379078616883; Fri, 13 Sep 2013 06:23:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.24.144 with SMTP id u16ls1125668qef.84.gmail; Fri, 13 Sep 2013 06:23:36 -0700 (PDT) X-Received: by 10.52.113.99 with SMTP id ix3mr6248827vdb.22.1379078616651; Fri, 13 Sep 2013 06:23:36 -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 dt10si3106728vdb.99.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:23:36 -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 p13so886998vbe.19 for ; Fri, 13 Sep 2013 06:23:36 -0700 (PDT) X-Received: by 10.52.119.228 with SMTP id kx4mr10065474vdb.12.1379078616464; Fri, 13 Sep 2013 06:23:36 -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 u4csp80519vcz; Fri, 13 Sep 2013 06:23:35 -0700 (PDT) X-Received: by 10.68.212.106 with SMTP id nj10mr13511220pbc.74.1379078615606; Fri, 13 Sep 2013 06:23:35 -0700 (PDT) Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by mx.google.com with ESMTPS id sl4si11163962pac.329.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:23:35 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.181 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.181; Received: by mail-pd0-f181.google.com with SMTP id g10so1236560pdj.40 for ; Fri, 13 Sep 2013 06:23:35 -0700 (PDT) X-Received: by 10.66.136.71 with SMTP id py7mr15417966pab.2.1379078615206; Fri, 13 Sep 2013 06:23:35 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id om2sm11740428pbc.30.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:23:34 -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 173/228] cpufreq: s3c64xx: Convert to light weight ->target_index() routine Date: Fri, 13 Sep 2013 18:31:59 +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() 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 16dc315..34ae66b 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",