From patchwork Thu Dec 19 20:35:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Tobias X-Patchwork-Id: 3384311 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AB218C0D4A for ; Thu, 19 Dec 2013 20:44:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D13C3206BF for ; Thu, 19 Dec 2013 20:44:37 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ACC48206B9 for ; Thu, 19 Dec 2013 20:44:36 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VtkS1-0005MY-E5; Thu, 19 Dec 2013 20:44:09 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VtkRu-0005bZ-BN; Thu, 19 Dec 2013 20:44:02 +0000 Received: from mail-pb0-x22e.google.com ([2607:f8b0:400e:c01::22e]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VtkRg-0005Zd-SE for linux-arm-kernel@lists.infradead.org; Thu, 19 Dec 2013 20:43:49 +0000 Received: by mail-pb0-f46.google.com with SMTP id md12so1653689pbc.33 for ; Thu, 19 Dec 2013 12:43:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cJSjCb1ujm4ELupDAl/BtGf6n8Ic+qSRMZTkpE8HPyU=; b=v3eVMVttbjG/FvjcyN+HOUae9lnVSUglDHt+RjyMUwxG4uhZHQneJLyxjyAlNqyHyy pEGu7AEpznQWpnsiU8TzalqQASgzV2ZvuBvZ0Es2gzl07EVXTGpnKcX+heYOSWhf2+Jl 6uW0sxqJ4+UQg0jfeWoFd8zRhR2tp+XISevgVoeTnR1Rc39sDfmjERdO+Jf9aLrY34e4 VHvSUauBqLffJS75TpOF6O7RwNBFuCbCjnPPTon3w/Ydn0YeN07RKzkcitTduaKC1pAE XxzY8FEoXgy12iVa2Mu/TkYD+SRT/Xv+OJ3molWntPl6mQlWc8KAHKIOVgzKnVd4JyAz RI2g== X-Received: by 10.68.204.136 with SMTP id ky8mr4062043pbc.33.1387485806441; Thu, 19 Dec 2013 12:43:26 -0800 (PST) Received: from localhost.localdomain (morse-p.static.monkeybrains.net. [208.90.214.40]) by mx.google.com with ESMTPSA id lh13sm12188561pab.4.2013.12.19.12.43.25 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Dec 2013 12:43:25 -0800 (PST) From: John Tobias To: linux-arm-kernel@lists.infradead.org, shawn.guo@linaro.org, festevam@gmail.com, b20788@freescale.com Subject: [PATCH v2 3/3] cpufreq: imx6q: add of_init_opp_table Date: Thu, 19 Dec 2013 12:35:38 -0800 Message-Id: <1387485338-21225-3-git-send-email-john.tobias.ph@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1387485338-21225-1-git-send-email-john.tobias.ph@gmail.com> References: <1387485338-21225-1-git-send-email-john.tobias.ph@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131219_154348_982776_EDA34093 X-CRM114-Status: GOOD ( 12.72 ) X-Spam-Score: -2.0 (--) Cc: John Tobias X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a routine check to see if the platform supplied the OPP table. Incase there's no OPP table exist, it will try to initialise it. It's been tested on iMX6SL board where the platform doesn't have an OPP table. Signed-off-by: John Tobias --- drivers/cpufreq/imx6q-cpufreq.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index 4b3f18e..8c56898 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -166,6 +166,17 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) return -ENOENT; } + /* Get the OPP table, if the platform did not supply 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\n"); + ret = -ENODEV; + goto put_node; + } + } + arm_clk = devm_clk_get(cpu_dev, "arm"); pll1_sys_clk = devm_clk_get(cpu_dev, "pll1_sys"); pll1_sw_clk = devm_clk_get(cpu_dev, "pll1_sw");