From patchwork Thu May 22 05:37:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 30562 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4DDDD20675 for ; Thu, 22 May 2014 05:38:51 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id id10sf1375370vcb.4 for ; Wed, 21 May 2014 22:38:51 -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=cenBMzJ4kc/pwQQMXjVdfHeyBRKQVSJjmqMcl23YhU8G36SbtDOjg8ZRgDgEEoQ0ll m8f0Uk2njwzmBZkD5fY6GuMvjDbxIGzYz/IfV5AtOzg9vwZqHhe/W/fpaOzqNxIbIg1s c5XHaaBudEpOig2UvgoggDOqsxmtYYqF41o6w6xcSnFhjE27wdePtToUR2GlkQU1Mydu IGzAayqwCEHB5aWgWJK+C7h+lRh+RNzfHe3GK7cFDdyOLxUwo/qtL906YZn2AkGcNB8s AQNAyyei0UBEehfW8KjueGB1IQJulwzkE6xxYa+NMRpEscFbkbxR4aCuGaEQOOuRYVGW FXmQ== X-Gm-Message-State: ALoCoQlivGRLFTeDWGNDrPiUuQwsmGawR1njnSlGcXYf65WRpTGgbx8XYThmS5M29fUTe68bPJaS X-Received: by 10.58.225.197 with SMTP id rm5mr24088571vec.5.1400737131114; Wed, 21 May 2014 22:38:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.24.181 with SMTP id 50ls1070624qgr.92.gmail; Wed, 21 May 2014 22:38:51 -0700 (PDT) X-Received: by 10.220.81.194 with SMTP id y2mr13912802vck.29.1400737131024; Wed, 21 May 2014 22:38:51 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id fe3si1993677vec.43.2014.05.21.22.38.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 May 2014 22:38:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id il7so3762057vcb.4 for ; Wed, 21 May 2014 22:38:50 -0700 (PDT) X-Received: by 10.58.186.207 with SMTP id fm15mr47232750vec.4.1400737130958; Wed, 21 May 2014 22:38:50 -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 ib8csp169781vcb; Wed, 21 May 2014 22:38:50 -0700 (PDT) X-Received: by 10.68.164.67 with SMTP id yo3mr65071097pbb.104.1400737130173; Wed, 21 May 2014 22:38:50 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ip7si9075965pbc.246.2014.05.21.22.38.49; Wed, 21 May 2014 22:38:49 -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 S1753841AbaEVFie (ORCPT + 27 others); Thu, 22 May 2014 01:38:34 -0400 Received: from mail-qc0-f180.google.com ([209.85.216.180]:49910 "EHLO mail-qc0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753795AbaEVFia (ORCPT ); Thu, 22 May 2014 01:38:30 -0400 Received: by mail-qc0-f180.google.com with SMTP id i17so4782379qcy.25 for ; Wed, 21 May 2014 22:38:30 -0700 (PDT) X-Received: by 10.140.43.100 with SMTP id d91mr73992024qga.11.1400737109946; Wed, 21 May 2014 22:38:29 -0700 (PDT) Received: from localhost (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id r79sm2108398qgd.14.2014.05.21.22.38.24 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 21 May 2014 22:38:29 -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 V3 6/8] cpufreq: imx6q: don't initialize opp table Date: Thu, 22 May 2014 11:07:30 +0530 Message-Id: <29f3ea9689749ac65c468d65d46f0d5eea2fdf27.1400736536.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.173 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) {