[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201026111049.54835-9-tony@atomide.com>
Date: Mon, 26 Oct 2020 13:10:48 +0200
From: Tony Lindgren <tony@...mide.com>
To: linux-omap@...r.kernel.org
Cc: "Andrew F . Davis" <afd@...com>, Dave Gerlach <d-gerlach@...com>,
Faiz Abbas <faiz_abbas@...com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Grygorii Strashko <grygorii.strashko@...com>,
Keerthy <j-keerthy@...com>, Nishanth Menon <nm@...com>,
Peter Ujfalusi <peter.ujfalusi@...com>,
Roger Quadros <rogerq@...com>, Suman Anna <s-anna@...com>,
Tero Kristo <t-kristo@...com>, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Santosh Shilimkar <ssantosh@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Michael Turquette <mturquette@...libre.com>,
Philipp Zabel <p.zabel@...gutronix.de>,
Stephen Boyd <sboyd@...nel.org>, linux-clk@...r.kernel.org,
linux-remoteproc@...r.kernel.org
Subject: [PATCH 8/9] soc: ti: pm33xx: Enable basic PM runtime support for genpd
To prepare for moving to use genpd, let's enable basic PM
runtime support.
Cc: Dave Gerlach <d-gerlach@...com>
Cc: Santosh Shilimkar <ssantosh@...nel.org>
Cc: Suman Anna <s-anna@...com>
Signed-off-by: Tony Lindgren <tony@...mide.com>
---
drivers/soc/ti/pm33xx.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/ti/pm33xx.c b/drivers/soc/ti/pm33xx.c
--- a/drivers/soc/ti/pm33xx.c
+++ b/drivers/soc/ti/pm33xx.c
@@ -19,6 +19,7 @@
#include <linux/of_address.h>
#include <linux/platform_data/pm33xx.h>
#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
#include <linux/rtc.h>
#include <linux/rtc/rtc-omap.h>
#include <linux/sizes.h>
@@ -555,16 +556,26 @@ static int am33xx_pm_probe(struct platform_device *pdev)
suspend_wfi_flags |= WFI_FLAG_WAKE_M3;
#endif /* CONFIG_SUSPEND */
+ pm_runtime_enable(dev);
+ ret = pm_runtime_get_sync(dev);
+ if (ret < 0) {
+ pm_runtime_put_noidle(dev);
+ goto err_pm_runtime_disable;
+ }
+
ret = pm_ops->init(am33xx_do_sram_idle);
if (ret) {
dev_err(dev, "Unable to call core pm init!\n");
ret = -ENODEV;
- goto err_put_wkup_m3_ipc;
+ goto err_pm_runtime_put;
}
return 0;
-err_put_wkup_m3_ipc:
+err_pm_runtime_put:
+ pm_runtime_put_sync(dev);
+err_pm_runtime_disable:
+ pm_runtime_disable(dev);
wkup_m3_ipc_put(m3_ipc);
err_free_sram:
am33xx_pm_free_sram();
@@ -574,6 +585,8 @@ static int am33xx_pm_probe(struct platform_device *pdev)
static int am33xx_pm_remove(struct platform_device *pdev)
{
+ pm_runtime_put_sync(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
if (pm_ops->deinit)
pm_ops->deinit();
suspend_set_ops(NULL);
--
2.29.1
Powered by blists - more mailing lists