From patchwork Fri Sep 13 13:02:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20281 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f72.google.com (mail-qe0-f72.google.com [209.85.128.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 33DDE20358 for ; Fri, 13 Sep 2013 13:30:03 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id 6sf1241831qea.3 for ; Fri, 13 Sep 2013 06:30:02 -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=ZeWREtmB1vF5cjo4y9Es6SuqP39+wHQCS5Awy6Fzt3A=; b=Z7iIqbWBVOpiv6rRpmc+pBtaiREXW2FWKfwoqPtlauPg0Z3iLGdrao4gw5NDcaIocA /1bmFcr27FqM4KhuiOFxTx/q7IhbS7DsjcQDs5d/7R+mUCx2kOgdlsKEGZrPSLcfDKDq BqYpQiVoXJ2EfsEMnueGh0TeG6Dz3BZculAmWZN7V81ykKMpLI4JAU7NczfvTouM3a36 DpFUpdyHnpLSQzm4FkPEH+AnjSrro0ra7tItXIHlQ99H8HG0uJH3U2OUDZeevhh8ujjG 4Y+PehCGrANg8DI6US/nn1q1Z0sO/A45Ct1TPdQYshX4vdalWoTQd4uhUiZY2jDoQ0Nn dejg== X-Gm-Message-State: ALoCoQmh4J8CSMbH9ctHwcYGazpWTVxHvzBcqVhwaLyIadHnYcmWTnlEUXGTsTs3ShxR9dU7smPi X-Received: by 10.236.45.102 with SMTP id o66mr5110588yhb.47.1379079002446; Fri, 13 Sep 2013 06:30:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.119.9 with SMTP id kq9ls1162581qeb.48.gmail; Fri, 13 Sep 2013 06:30:02 -0700 (PDT) X-Received: by 10.58.100.234 with SMTP id fb10mr12172303veb.5.1379079002225; Fri, 13 Sep 2013 06:30:02 -0700 (PDT) Received: from mail-vb0-f48.google.com (mail-vb0-f48.google.com [209.85.212.48]) by mx.google.com with ESMTPS id x9si3145012vec.4.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:30:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.48 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.48; Received: by mail-vb0-f48.google.com with SMTP id w16so904482vbf.35 for ; Fri, 13 Sep 2013 06:30:02 -0700 (PDT) X-Received: by 10.220.46.72 with SMTP id i8mr12218574vcf.10.1379079002139; Fri, 13 Sep 2013 06:30:02 -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 u4csp80836vcz; Fri, 13 Sep 2013 06:30:01 -0700 (PDT) X-Received: by 10.66.155.102 with SMTP id vv6mr15479796pab.89.1379079001216; Fri, 13 Sep 2013 06:30:01 -0700 (PDT) Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) by mx.google.com with ESMTPS id xn6si7453770pbc.302.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:30:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.179 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.179; Received: by mail-pd0-f179.google.com with SMTP id v10so1249161pde.24 for ; Fri, 13 Sep 2013 06:30:00 -0700 (PDT) X-Received: by 10.66.249.231 with SMTP id yx7mr15510093pac.116.1379079000816; Fri, 13 Sep 2013 06:30:00 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id py4sm11796512pbc.14.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:30:00 -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 , Stephen Warren Subject: [PATCH 227/228] cpufreq: tegra: use cpufreq_generic_get() routine Date: Fri, 13 Sep 2013 18:32:53 +0530 Message-Id: <4c538174b86604a7d9e5b9e0d2521b881704005e.1379063063.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.212.48 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: , We have common infrastructure available with us for getting a CPUs clk rate. Lets use it for this driver. Cc: Stephen Warren Signed-off-by: Viresh Kumar --- drivers/cpufreq/tegra-cpufreq.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c index 7d36b54..360d1a7 100644 --- a/drivers/cpufreq/tegra-cpufreq.c +++ b/drivers/cpufreq/tegra-cpufreq.c @@ -50,17 +50,6 @@ static struct clk *emc_clk; static DEFINE_MUTEX(tegra_cpu_lock); static bool is_suspended; -static unsigned int tegra_getspeed(unsigned int cpu) -{ - unsigned long rate; - - if (cpu >= NUM_CPUS) - return 0; - - rate = clk_get_rate(cpu_clk) / 1000; - return rate; -} - static int tegra_cpu_clk_set_rate(unsigned long rate) { int ret; @@ -144,7 +133,7 @@ static int tegra_pm_notify(struct notifier_block *nb, unsigned long event, is_suspended = true; pr_info("Tegra cpufreq suspend: setting frequency to %d kHz\n", freq_table[0].frequency); - if (tegra_getspeed(0) != freq_table[0].frequency) + if (clk_get_rate(cpu_clk) / 1000 != freq_table[0].frequency) tegra_update_cpu_speed(policy, freq_table[0].frequency); cpufreq_cpu_put(policy); } else if (event == PM_POST_SUSPEND) { @@ -180,6 +169,7 @@ static int tegra_cpu_init(struct cpufreq_policy *policy) if (policy->cpu == 0) register_pm_notifier(&tegra_cpu_pm_notifier); + policy->clk = cpu_clk; return 0; } @@ -194,7 +184,7 @@ static int tegra_cpu_exit(struct cpufreq_policy *policy) static struct cpufreq_driver tegra_cpufreq_driver = { .verify = cpufreq_generic_frequency_table_verify, .target_index = tegra_target, - .get = tegra_getspeed, + .get = cpufreq_generic_get, .init = tegra_cpu_init, .exit = tegra_cpu_exit, .name = "tegra",