From patchwork Wed Dec 18 23:50:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Tobias X-Patchwork-Id: 3374391 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 492E6C0D4A for ; Wed, 18 Dec 2013 23:52:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6E831205AA for ; Wed, 18 Dec 2013 23:52:35 +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 751F0205DE for ; Wed, 18 Dec 2013 23:52:34 +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 1VtQu1-00066Q-9c; Wed, 18 Dec 2013 23:51:45 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VtQtr-0007dc-AJ; Wed, 18 Dec 2013 23:51:35 +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 1VtQtS-0007ap-RX for linux-arm-kernel@lists.infradead.org; Wed, 18 Dec 2013 23:51:11 +0000 Received: by mail-pb0-f46.google.com with SMTP id md12so347190pbc.19 for ; Wed, 18 Dec 2013 15:50:49 -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=JpflvUg2WRcOmnRmWiDvKh7n5lgDNo35DRBSZM55mSA=; b=I9iw46O1XUR+pa+xy87aMgCsm+ETsoB8mjgBLhfLkDiI4LT7q5zSe1opNrYwQc4gYp 5VaZKtbp1fOCNV9M2aaRuWjKv2TVvcP5YJSCwyykm3EhOkfdmE1S90rbjY6McIiYHpeO txdNEC4hl6XUdpsjd2bvdfqXbz8HO42qFGCpWcymHVCkwTj9qTrc361E9fs4TRkKStFh pqmveWzzMkAPRssEFY5LazzWa8EmG5DwpsrYQVUVvnNMi+3Y74+TrX7Fz0WnS+xoyo8x Erora9++CBqduHjww7cSG2EkB9xr8bGGGShPQFh54X6Pv6sJmfwjm9B0+YSaXepsRZTN 54Bw== X-Received: by 10.68.254.164 with SMTP id aj4mr23939197pbd.161.1387410649421; Wed, 18 Dec 2013 15:50:49 -0800 (PST) Received: from localhost.localdomain (morse-p.static.monkeybrains.net. [208.90.214.40]) by mx.google.com with ESMTPSA id tu6sm2629468pbc.41.2013.12.18.15.50.48 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Dec 2013 15:50:48 -0800 (PST) From: John Tobias To: linux-arm-kernel@lists.infradead.org, shawn.guo@linaro.org, festevam@gmail.com, gregkh@linuxfoundation.org Subject: [PATCH 3/4] cpufreq: imx6q: add of_init_opp_table Date: Wed, 18 Dec 2013 15:50:55 -0800 Message-Id: <1387410656-36053-3-git-send-email-john.tobias.ph@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1387410656-36053-1-git-send-email-john.tobias.ph@gmail.com> References: <1387410656-36053-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-20131218_185110_973777_BB4B17A4 X-CRM114-Status: GOOD ( 11.93 ) 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 the platform supplied the OPP table. Incase there's no OPP table exist, it will try to initialise it. Signed-off-by: John Tobias --- drivers/cpufreq/imx6q-cpufreq.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index 4b3f18e..47dbf3c 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -151,6 +151,7 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) { struct device_node *np; struct dev_pm_opp *opp; + struct device_opp *tmp_dev_opp; unsigned long min_volt, max_volt; int num, ret; @@ -166,6 +167,17 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) return -ENOENT; } + /* Get the OPP table, if the platform did not supply it. */ + tmp_dev_opp = find_device_opp(cpu_dev); + if (IS_ERR(tmp_dev_opp)) { + 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");