From patchwork Wed Dec 18 23:50:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Tobias X-Patchwork-Id: 3374401 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A65F09F344 for ; Wed, 18 Dec 2013 23:53:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C8C87205DF for ; Wed, 18 Dec 2013 23:53:20 +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 74493205AA for ; Wed, 18 Dec 2013 23:53:16 +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 1VtQuI-0006DY-47; Wed, 18 Dec 2013 23:52:03 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VtQtz-0007e1-UN; Wed, 18 Dec 2013 23:51:43 +0000 Received: from mail-pa0-x22d.google.com ([2607:f8b0:400e:c03::22d]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VtQtU-0007aq-48 for linux-arm-kernel@lists.infradead.org; Wed, 18 Dec 2013 23:51:13 +0000 Received: by mail-pa0-f45.google.com with SMTP id fb1so353896pad.18 for ; Wed, 18 Dec 2013 15:50:50 -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=M/HsRo36vbuyPMnf+cq4sdG3oAisXMXkkaMQ+/hdsxo=; b=dZhu6vjj7MKaJxNyfFgTy7SakQlytFe40QDU33g82kBrM4avVGXqZUQDcNHz0lRlqj pSV9nxe1Tu/DDi4oEX5poo77mAcT8yIohnDRAcIpsonEIy/ibzopeCTG8tqkiJTzU7eZ MBBmIe2An00lZs7pdEbGK+f1XZ8M/8L8XUYPrRl4ja/tdT+3Ghwz7JN27SlUoUf8xHy/ fsioGORGNWc9PrxWWBeHzFurx9Dtqf8H3SQa4fPIA0tqawF0dW01ko982NLzoqVgqGug MYoa2Tg8+m4kw9RTkLcBf15vKzPRD9Jycs1mCdwvK0pxDSz7hwgco85G4/PKEDqWGLLa yJbg== X-Received: by 10.66.8.66 with SMTP id p2mr36793750paa.129.1387410650401; Wed, 18 Dec 2013 15:50:50 -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.49 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Dec 2013 15:50:49 -0800 (PST) From: John Tobias To: linux-arm-kernel@lists.infradead.org, shawn.guo@linaro.org, festevam@gmail.com, gregkh@linuxfoundation.org Subject: [PATCH 4/4] PM / OPP: export symbol find_device_opp Date: Wed, 18 Dec 2013 15:50:56 -0800 Message-Id: <1387410656-36053-4-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_185112_329015_98568305 X-CRM114-Status: GOOD ( 11.27 ) 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 imx6q-cpufreq.c need to have access to find_device_opp function, in order to verify if the platform supplied an OPP table or not. As an example here are the imx6q and imx6sl. imx6q supplied the opp table due to some board specific requirement. While, imx6sl doesn't have an opp table defined. Signed-off-by: John Tobias --- drivers/base/power/opp.c | 3 ++- include/linux/pm_opp.h | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index fa41874..d758e42 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c @@ -116,7 +116,7 @@ static DEFINE_MUTEX(dev_opp_list_lock); * is a RCU protected pointer. This means that device_opp is valid as long * as we are under RCU lock. */ -static struct device_opp *find_device_opp(struct device *dev) +struct device_opp *find_device_opp(struct device *dev) { struct device_opp *tmp_dev_opp, *dev_opp = ERR_PTR(-ENODEV); @@ -134,6 +134,7 @@ static struct device_opp *find_device_opp(struct device *dev) return dev_opp; } +EXPORT_SYMBOL_GPL(find_device_opp); /** * dev_pm_opp_get_voltage() - Gets the voltage corresponding to an available opp diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 5151b00..cd13385 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -27,6 +27,8 @@ enum dev_pm_opp_event { #if defined(CONFIG_PM_OPP) +struct device_opp *find_device_opp(struct device *dev); + unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp); unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp); @@ -52,6 +54,11 @@ int dev_pm_opp_disable(struct device *dev, unsigned long freq); struct srcu_notifier_head *dev_pm_opp_get_notifier(struct device *dev); #else +static inline struct device_opp *find_device_opp(struct device *dev) +{ + return ERR_PTR(-EINVAL); +} + static inline unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp) { return 0;