From patchwork Fri Aug 23 15:50: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: 19491 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EE8F1248E6 for ; Fri, 23 Aug 2013 15:55:30 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id bv4sf618349qab.8 for ; Fri, 23 Aug 2013 08:55:30 -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=9V/M5HkbIpi6EXmXqeNzvpBZ1DGPYnXH6rj257UWlmw=; b=awa8nKawzauIRjaXHF2I4VxYUAYRFtm90rl+oqT0AyKG1bgLz3Q+FxYdlA4Fn0vZ6z kBLtpzzQixxopUlkYcZYn8Ayu0sZv8oMNtZXbG6My0BrQ1f/mwCg1271eaHyuM5wKhH/ aKD9IYYml8ZVdaFR/V3bZnAKbpm0qG7V9gegm8SF/gRaFedoUate95aJBVD2W0jempt5 i/taex/6zAZbvY821zL20Q3QMuZ9sPycWYBTkc2/q44uUVmXsIU9cXd/NIS3EMER9wAS o2hu9hC0AU+r0DbADJWnKmoJPXGTA3Rs43kfV+yIw21XKh5baEuL6QDsLxnjaYnUCmxB YKrw== X-Received: by 10.224.137.68 with SMTP id v4mr17220863qat.1.1377273330823; Fri, 23 Aug 2013 08:55:30 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.121.163 with SMTP id ll3ls1519683qeb.33.gmail; Fri, 23 Aug 2013 08:55:30 -0700 (PDT) X-Received: by 10.52.165.239 with SMTP id zb15mr120397vdb.44.1377273330747; Fri, 23 Aug 2013 08:55:30 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id x3si122022vcn.114.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Aug 2013 08:55:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id ha11so535925vcb.21 for ; Fri, 23 Aug 2013 08:55:30 -0700 (PDT) X-Gm-Message-State: ALoCoQnrsuPRAYA9uUtJou9IeZerA0Qqs0YOgCT0J1zuEkuxhlAlT0l1G4Gkqwt/BsHg4yZIBI31 X-Received: by 10.58.19.162 with SMTP id g2mr167232vee.12.1377273330632; Fri, 23 Aug 2013 08:55:30 -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 u4csp100809vcz; Fri, 23 Aug 2013 08:55:30 -0700 (PDT) X-Received: by 10.68.201.69 with SMTP id jy5mr529253pbc.6.1377273329598; Fri, 23 Aug 2013 08:55:29 -0700 (PDT) Received: from mail-pb0-f41.google.com (mail-pb0-f41.google.com [209.85.160.41]) by mx.google.com with ESMTPS id tb9si217620pbc.279.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Aug 2013 08:55:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.41 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.41; Received: by mail-pb0-f41.google.com with SMTP id rp2so837149pbb.0 for ; Fri, 23 Aug 2013 08:55:28 -0700 (PDT) X-Received: by 10.68.234.73 with SMTP id uc9mr341978pbc.142.1377273328863; Fri, 23 Aug 2013 08:55:28 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ai6sm1857224pad.15.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 23 Aug 2013 08:55:28 -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 , Stephen Warren Subject: [PATCH 15/16] cpufreq: tegra: use cpufreq_generic_get() routine Date: Fri, 23 Aug 2013 21:20:50 +0530 Message-Id: <9fead70ef9d7c37298ff3c00ce31d41483d4e988.1377272740.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.220.176 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 bc7c2a1..b2efad7 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",