From patchwork Tue May 27 11:50:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 30965 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A4EEA203C3 for ; Tue, 27 May 2014 11:53:34 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id m1sf48118664oag.6 for ; Tue, 27 May 2014 04:53:34 -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 :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=lp89wZV6Rf5NkEANu27ykFi4+5MFl5adoWELL/erKJ8=; b=EEpAGtbw/0RLlZBGkZc/y3OtbY5pFMHBhjOZ9I9iaE4PNcWsKKxWqiYd4EDplwiFu7 NykADBvNHfsS++GL6CY344F2WS2kAO/kZdMONuj9YQkxp0bJ2FvCJk9I/Rd7pmtnlFOY 8Yq8pvjyhaEAaCY/XB8zYBBGUx4CMY+U0pAM01roqofQIVvZHuXEZ+8+lig1Obk+hmJw AE3oHagljS2c977xiiZwZ1OODj65kvnl+bQ9E//MdBVszZNeK+WK3p0azpXRbQZSLtEP P+bNJeRIg2K7xFrvtOC7RoeI7c+ldedGOOHVHIviNxyElzxBnbsdcL2M4oPBLVjMPVsn cFuA== X-Gm-Message-State: ALoCoQklx4FfMm3Zm+UErL9SjqTaK1bzTZe6TfowK/cEwWX5AwJovLeQGMk+uWmubCLH9P7OL+Ag X-Received: by 10.51.17.10 with SMTP id ga10mr12500790igd.4.1401191614164; Tue, 27 May 2014 04:53:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.16.173 with SMTP id 42ls3069778qgb.62.gmail; Tue, 27 May 2014 04:53:34 -0700 (PDT) X-Received: by 10.221.44.73 with SMTP id uf9mr26659512vcb.9.1401191614003; Tue, 27 May 2014 04:53:34 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id ev1si7932320vdb.21.2014.05.27.04.53.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 May 2014 04:53:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lf12so10544629vcb.1 for ; Tue, 27 May 2014 04:53:33 -0700 (PDT) X-Received: by 10.52.153.229 with SMTP id vj5mr22081821vdb.34.1401191613901; Tue, 27 May 2014 04:53:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp112608vcb; Tue, 27 May 2014 04:53:33 -0700 (PDT) X-Received: by 10.66.187.38 with SMTP id fp6mr35627842pac.95.1401191613061; Tue, 27 May 2014 04:53:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id iy1si18395848pbb.115.2014.05.27.04.53.32 for ; Tue, 27 May 2014 04:53:32 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752463AbaE0LxU (ORCPT + 27 others); Tue, 27 May 2014 07:53:20 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:57718 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752434AbaE0LxR (ORCPT ); Tue, 27 May 2014 07:53:17 -0400 Received: by mail-pb0-f44.google.com with SMTP id rq2so9134317pbb.17 for ; Tue, 27 May 2014 04:53:16 -0700 (PDT) X-Received: by 10.68.171.229 with SMTP id ax5mr35566356pbc.125.1401191596668; Tue, 27 May 2014 04:53:16 -0700 (PDT) Received: from localhost ([223.227.245.64]) by mx.google.com with ESMTPSA id no9sm22973509pbc.83.2014.05.27.04.53.10 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 27 May 2014 04:53:16 -0700 (PDT) From: Viresh Kumar To: rjw@rjwysocki.net Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, arvind.chauhan@arm.com, inderpal.s@samsung.com, nm@ti.com, chander.kashyap@linaro.org, pavel@ucw.cz, len.brown@intel.com, sudeep.holla@arm.com, Viresh Kumar Subject: [PATCH V4 6/8] cpufreq: imx6q: don't initialize opp table Date: Tue, 27 May 2014 17:20:55 +0530 Message-Id: <65d800de10bded80443852af0b36959e1d9ddf33.1401191054.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.0.0.rc2 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , CPU OPP tables are already initialized by CPU core and we don't need to reinitialize them from imx6q specific code. Acked-by: Shawn Guo Signed-off-by: Viresh Kumar --- arch/arm/mach-imx/mach-imx6q.c | 36 ++++++++---------------------------- drivers/cpufreq/imx6q-cpufreq.c | 20 +------------------- 2 files changed, 9 insertions(+), 47 deletions(-) diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index e60456d..03819e7 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -290,12 +290,18 @@ static void __init imx6q_init_machine(void) #define OCOTP_CFG3_SPEED_996MHZ 0x2 #define OCOTP_CFG3_SPEED_852MHZ 0x1 -static void __init imx6q_opp_check_speed_grading(struct device *cpu_dev) +static void __init imx6q_opp_check_speed_grading(void) { + struct device *cpu_dev = get_cpu_device(0); struct device_node *np; void __iomem *base; u32 val; + if (!cpu_dev) { + pr_warn("failed to get cpu0 device\n"); + return; + } + np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-ocotp"); if (!np) { pr_warn("failed to find ocotp node\n"); @@ -336,32 +342,6 @@ put_node: of_node_put(np); } -static void __init imx6q_opp_init(void) -{ - struct device_node *np; - struct device *cpu_dev = get_cpu_device(0); - - if (!cpu_dev) { - pr_warn("failed to get cpu0 device\n"); - return; - } - np = of_node_get(cpu_dev->of_node); - if (!np) { - pr_warn("failed to find cpu0 node\n"); - return; - } - - if (of_init_opp_table(cpu_dev)) { - pr_warn("failed to init OPP table\n"); - goto put_node; - } - - imx6q_opp_check_speed_grading(cpu_dev); - -put_node: - of_node_put(np); -} - static struct platform_device imx6q_cpufreq_pdev = { .name = "imx6q-cpufreq", }; @@ -376,7 +356,7 @@ static void __init imx6q_init_late(void) imx6q_cpuidle_init(); if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) { - imx6q_opp_init(); + imx6q_opp_check_speed_grading(); platform_device_register(&imx6q_cpufreq_pdev); } } diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index af366c2..b72e94f 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -190,26 +190,8 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) goto put_reg; } - /* - * We expect an OPP table supplied by platform. - * Just, incase the platform did not supply the OPP - * table, it will try to get it. - */ num = dev_pm_opp_get_opp_count(cpu_dev); - if (num < 0) { - ret = of_init_opp_table(cpu_dev); - if (ret < 0) { - dev_err(cpu_dev, "failed to init OPP table: %d\n", ret); - goto put_reg; - } - - num = dev_pm_opp_get_opp_count(cpu_dev); - if (num < 0) { - ret = num; - dev_err(cpu_dev, "no OPP table is found: %d\n", ret); - goto put_reg; - } - } + WARN_ON(num < 0); ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); if (ret) {