From patchwork Fri Sep 13 13:01:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20200 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4597C20358 for ; Fri, 13 Sep 2013 13:20:17 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id gf11sf1203891vcb.2 for ; Fri, 13 Sep 2013 06:20:16 -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=3L2dIGHnqFGSRarAs6lKdX6OtAiimEBhjWnBc9SyhEc=; b=UgsZihxlHidGpKoy5v10cmF34ndHCyMB1XAlQTjTmQlMovDARys11CKFAuZZzfffXp /W/TXYrN4cZLJYAogwh+ISugFoWrnQNHx9Olp7RJM6oC+Qoc2dfrDgl3GVXJbIrdarf7 FkMII51qWqG01si7gBh+pbAZVta6khVA2xVAEKD4elrFP4jSJUZv7hxTNQVrwJlDyU49 yMO+SYtdMNY23FMnN6OOTqnpxM6ddkeQlGPPlaLxFPIxNlZvFytaZI03MmWMv/3p5MY/ BMz4oniOGYEHLSXz4F9Y3EEb4IpyW12Jp2ww7lVQv3Of8tUO8aaGgwjW4UTb9aleq41F zedg== X-Gm-Message-State: ALoCoQmkTaH7LxlyW/KWn/UcKWQzkQYNlUCaYtpJjJPFOggF/4REs/PR5/+HoWFzLFbqINoNYl1o X-Received: by 10.236.54.68 with SMTP id h44mr4971611yhc.21.1379078416574; Fri, 13 Sep 2013 06:20:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.47.82 with SMTP id b18ls1133530qen.53.gmail; Fri, 13 Sep 2013 06:20:16 -0700 (PDT) X-Received: by 10.221.64.17 with SMTP id xg17mr11957166vcb.5.1379078416360; Fri, 13 Sep 2013 06:20:16 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id vv9si3120423vec.43.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:20:16 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.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.220.181; Received: by mail-vc0-f181.google.com with SMTP id hz10so894242vcb.26 for ; Fri, 13 Sep 2013 06:20:16 -0700 (PDT) X-Received: by 10.58.208.130 with SMTP id me2mr11925510vec.13.1379078416273; Fri, 13 Sep 2013 06:20:16 -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 u4csp80319vcz; Fri, 13 Sep 2013 06:20:15 -0700 (PDT) X-Received: by 10.66.118.233 with SMTP id kp9mr2063717pab.182.1379078415193; Fri, 13 Sep 2013 06:20:15 -0700 (PDT) Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by mx.google.com with ESMTPS id rt3si7474301pbc.53.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:20:15 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.171 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.171; Received: by mail-pd0-f171.google.com with SMTP id g10so1240470pdj.2 for ; Fri, 13 Sep 2013 06:20:14 -0700 (PDT) X-Received: by 10.66.142.132 with SMTP id rw4mr12912279pab.6.1379078414677; Fri, 13 Sep 2013 06:20:14 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id yg3sm18057924pab.16.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:20:13 -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 Subject: [PATCH 146/228] cpufreq: tegra: use cpufreq_generic_init() routine Date: Fri, 13 Sep 2013 18:31:32 +0530 Message-Id: <14e1986c6418227f8c3c47ab9853eb7a65fad2f1.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.220.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: , Use generic cpufreq_generic_init() routine instead of replicating the same code here. Signed-off-by: Viresh Kumar --- drivers/cpufreq/tegra-cpufreq.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c index 9c32b23..32483ef 100644 --- a/drivers/cpufreq/tegra-cpufreq.c +++ b/drivers/cpufreq/tegra-cpufreq.c @@ -204,19 +204,23 @@ static struct notifier_block tegra_cpu_pm_notifier = { static int tegra_cpu_init(struct cpufreq_policy *policy) { + int ret; + if (policy->cpu >= NUM_CPUS) return -EINVAL; clk_prepare_enable(emc_clk); clk_prepare_enable(cpu_clk); - cpufreq_table_validate_and_show(policy, freq_table); target_cpu_speed[policy->cpu] = tegra_getspeed(policy->cpu); /* FIXME: what's the actual transition time? */ - policy->cpuinfo.transition_latency = 300 * 1000; - - cpumask_copy(policy->cpus, cpu_possible_mask); + ret = cpufreq_generic_init(policy, freq_table, 300 * 1000); + if (ret) { + clk_disable_unprepare(cpu_clk); + clk_disable_unprepare(emc_clk); + return ret; + } if (policy->cpu == 0) register_pm_notifier(&tegra_cpu_pm_notifier); @@ -227,6 +231,7 @@ static int tegra_cpu_init(struct cpufreq_policy *policy) static int tegra_cpu_exit(struct cpufreq_policy *policy) { cpufreq_frequency_table_put_attr(policy->cpu); + clk_disable_unprepare(cpu_clk); clk_disable_unprepare(emc_clk); return 0; }