From patchwork Wed Oct 30 22:52:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 21279 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 EE560244A4 for ; Wed, 30 Oct 2013 22:52:22 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id 8sf4412407qea.5 for ; Wed, 30 Oct 2013 15:52:22 -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=uV6IM1Cpth+DuEQ09LVJUc5dxbpZa5DNV5gFhXidCxo=; b=WHoQ/NDCtIKZjeIVZ1YnpDG1TqC33rLEcUDvVyrGTF0DGwcE62qB4aoF+NNVQ8tTTb RnxWaIrsvAQx45QDgtAnen310+VGlwzJT3Mp/KVDyK5ey98rWFnIHI9s2t0R9rAEcbEv dRNRecm7veZpJSeFbDcZc1nPY6cgy/ohf71uUeWVv/Sq/UAlEwPbIEc8395OqZT4X29V +hQwa2pE7fUah8idyV5QMZrHsiN4pGDtTqvvwrNvZ6ANVYKIO1FIU0fExx0uDdzJTFQ6 mkuTNmL2lrICP4a+SB2xJoRj4c+WcQ8YqTF32epuRoJoH8oyhGVxeLHQKIrlOHH98zdr 7ehw== X-Gm-Message-State: ALoCoQkNzbZtsbDvOInNSZJMi4wdG4l2q3+HxftrcHXm9tuEMjPdcDIHam9wFvBKhvdtYUgKsv0o X-Received: by 10.236.52.7 with SMTP id d7mr134300yhc.32.1383173542817; Wed, 30 Oct 2013 15:52:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.37.72 with SMTP id w8ls688935qej.59.gmail; Wed, 30 Oct 2013 15:52:22 -0700 (PDT) X-Received: by 10.58.128.163 with SMTP id np3mr44515veb.62.1383173542722; Wed, 30 Oct 2013 15:52:22 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id pv1si76715veb.94.2013.10.30.15.52.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Oct 2013 15:52:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.172 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.172; Received: by mail-ve0-f172.google.com with SMTP id cz12so1522294veb.31 for ; Wed, 30 Oct 2013 15:52:22 -0700 (PDT) X-Received: by 10.58.34.129 with SMTP id z1mr32678vei.96.1383173542617; Wed, 30 Oct 2013 15:52:22 -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 u4csp316042vcz; Wed, 30 Oct 2013 15:52:22 -0700 (PDT) X-Received: by 10.60.179.52 with SMTP id dd20mr53633oec.23.1383173541902; Wed, 30 Oct 2013 15:52:21 -0700 (PDT) Received: from mail-ob0-f173.google.com (mail-ob0-f173.google.com [209.85.214.173]) by mx.google.com with ESMTPS id i3si124927obz.68.2013.10.30.15.52.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Oct 2013 15:52:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.214.173 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.214.173; Received: by mail-ob0-f173.google.com with SMTP id gq1so2224114obb.32 for ; Wed, 30 Oct 2013 15:52:21 -0700 (PDT) X-Received: by 10.60.62.172 with SMTP id z12mr137359oer.4.1383173541654; Wed, 30 Oct 2013 15:52:21 -0700 (PDT) Received: from localhost (sccc-66-78-236-243.smartcity.com. [66.78.236.243]) by mx.google.com with ESMTPSA id z5sm575919obg.13.2013.10.30.15.52.21 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 30 Oct 2013 15:52:21 -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@linaro.org Subject: [PATCH V2 Resend 03/16] cpufreq: cpu0: use cpufreq_generic_get() routine Date: Thu, 31 Oct 2013 04:22:01 +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.128.172 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. Acked-by: Shawn Guo Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq-cpu0.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index d4585ce..73f5485 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c @@ -30,11 +30,6 @@ static struct clk *cpu_clk; static struct regulator *cpu_reg; static struct cpufreq_frequency_table *freq_table; -static unsigned int cpu0_get_speed(unsigned int cpu) -{ - return clk_get_rate(cpu_clk) / 1000; -} - static int cpu0_set_target(struct cpufreq_policy *policy, unsigned int index) { struct dev_pm_opp *opp; @@ -100,6 +95,7 @@ static int cpu0_set_target(struct cpufreq_policy *policy, unsigned int index) static int cpu0_cpufreq_init(struct cpufreq_policy *policy) { + policy->clk = cpu_clk; return cpufreq_generic_init(policy, freq_table, transition_latency); } @@ -107,7 +103,7 @@ static struct cpufreq_driver cpu0_cpufreq_driver = { .flags = CPUFREQ_STICKY, .verify = cpufreq_generic_frequency_table_verify, .target_index = cpu0_set_target, - .get = cpu0_get_speed, + .get = cpufreq_generic_get, .init = cpu0_cpufreq_init, .exit = cpufreq_generic_exit, .name = "generic_cpu0",