* [v3,2/2] dmaengine: tegra210-adma: update system sleep callbacks
@ 2019-03-13 11:32 Sameer Pujar
0 siblings, 0 replies; 2+ messages in thread
From: Sameer Pujar @ 2019-03-13 11:32 UTC (permalink / raw)
To: dan.j.williams, vkoul
Cc: treding, jonathanh, dmaengine, linux-tegra, linux-kernel,
Sameer Pujar
If the driver is active till late suspend, where runtime PM cannot run,
force suspend is essential in such case to put the device in low power
state. Thus pm_runtime_force_suspend and pm_runtime_force_resume are
used as system sleep callbacks during system wide PM transitions.
Late system sleep callbacks are used to ensure, for instance, that the
sound core has suspended any on-going activity, including stopping the
ADMA if active, before we attempt to suspend the ADMA.
Suggested-by: Jonathan Hunter <jonathanh@nvidia.com>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
---
drivers/dma/tegra210-adma.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
index 650cd9c..253d312 100644
--- a/drivers/dma/tegra210-adma.c
+++ b/drivers/dma/tegra210-adma.c
@@ -796,17 +796,11 @@ static int tegra_adma_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
-static int tegra_adma_pm_suspend(struct device *dev)
-{
- return pm_runtime_suspended(dev) == false;
-}
-#endif
-
static const struct dev_pm_ops tegra_adma_dev_pm_ops = {
SET_RUNTIME_PM_OPS(tegra_adma_runtime_suspend,
tegra_adma_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(tegra_adma_pm_suspend, NULL)
+ SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+ pm_runtime_force_resume)
};
static struct platform_driver tegra_admac_driver = {
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [v3,2/2] dmaengine: tegra210-adma: update system sleep callbacks
@ 2019-03-13 12:11 Jon Hunter
0 siblings, 0 replies; 2+ messages in thread
From: Jon Hunter @ 2019-03-13 12:11 UTC (permalink / raw)
To: Sameer Pujar, dan.j.williams, vkoul
Cc: treding, dmaengine, linux-tegra, linux-kernel
On 13/03/2019 11:32, Sameer Pujar wrote:
> If the driver is active till late suspend, where runtime PM cannot run,
> force suspend is essential in such case to put the device in low power
> state. Thus pm_runtime_force_suspend and pm_runtime_force_resume are
> used as system sleep callbacks during system wide PM transitions.
> Late system sleep callbacks are used to ensure, for instance, that the
> sound core has suspended any on-going activity, including stopping the
> ADMA if active, before we attempt to suspend the ADMA.
>
> Suggested-by: Jonathan Hunter <jonathanh@nvidia.com>
> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
> ---
> drivers/dma/tegra210-adma.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
> index 650cd9c..253d312 100644
> --- a/drivers/dma/tegra210-adma.c
> +++ b/drivers/dma/tegra210-adma.c
> @@ -796,17 +796,11 @@ static int tegra_adma_remove(struct platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM_SLEEP
> -static int tegra_adma_pm_suspend(struct device *dev)
> -{
> - return pm_runtime_suspended(dev) == false;
> -}
> -#endif
> -
> static const struct dev_pm_ops tegra_adma_dev_pm_ops = {
> SET_RUNTIME_PM_OPS(tegra_adma_runtime_suspend,
> tegra_adma_runtime_resume, NULL)
> - SET_SYSTEM_SLEEP_PM_OPS(tegra_adma_pm_suspend, NULL)
> + SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
> + pm_runtime_force_resume)
> };
>
> static struct platform_driver tegra_admac_driver = {
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Cheers
Jon
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-13 12:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-13 11:32 [v3,2/2] dmaengine: tegra210-adma: update system sleep callbacks Sameer Pujar
-- strict thread matches above, loose matches on Subject: below --
2019-03-13 12:11 Jon Hunter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).