All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Mediatek: MT8183: enable dev runtime suspend and resume
@ 2019-05-22 14:52 Jiaxin Yu
  2019-05-22 15:31 ` Mark Brown
  2019-05-23 13:48 ` Applied "ASoC: Mediatek: MT8183: enable dev runtime suspend and resume" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Jiaxin Yu @ 2019-05-22 14:52 UTC (permalink / raw)
  To: broonie
  Cc: alsa-devel, wsd_upstream, srv_heupstream, garlic.tseng,
	Jiaxin Yu, tzungbi, linux-mediatek, kaichieh.chuang

System suspend will power off audio, so we need regcache sync when
system resume.

Remove pm_runtime_get_sync in dev probe and pm_runtime_put_sync in
dev remove.So that audio dev can triggle runitme suspend and resume.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
---
Hi,
	This patch is based on for-next and test passed.
---
 sound/soc/mediatek/mt8183/mt8183-afe-pcm.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c b/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
index 56c3732..4a31106 100644
--- a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
+++ b/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
@@ -1142,8 +1142,6 @@ static int mt8183_afe_pcm_dev_probe(struct platform_device *pdev)
 	regcache_cache_only(afe->regmap, true);
 	regcache_mark_dirty(afe->regmap);
 
-	pm_runtime_get_sync(&pdev->dev);
-
 	/* init memif */
 	afe->memif_size = MT8183_MEMIF_NUM;
 	afe->memif = devm_kcalloc(dev, afe->memif_size, sizeof(*afe->memif),
@@ -1235,11 +1233,10 @@ static int mt8183_afe_pcm_dev_probe(struct platform_device *pdev)
 
 static int mt8183_afe_pcm_dev_remove(struct platform_device *pdev)
 {
-	pm_runtime_put_sync(&pdev->dev);
-
 	pm_runtime_disable(&pdev->dev);
 	if (!pm_runtime_status_suspended(&pdev->dev))
 		mt8183_afe_runtime_suspend(&pdev->dev);
+
 	return 0;
 }
 
-- 
1.8.1.1.dirty

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: Mediatek: MT8183: enable dev runtime suspend and resume
  2019-05-22 14:52 [PATCH] ASoC: Mediatek: MT8183: enable dev runtime suspend and resume Jiaxin Yu
@ 2019-05-22 15:31 ` Mark Brown
  2019-05-23 13:48 ` Applied "ASoC: Mediatek: MT8183: enable dev runtime suspend and resume" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2019-05-22 15:31 UTC (permalink / raw)
  To: Jiaxin Yu
  Cc: alsa-devel, wsd_upstream, srv_heupstream, garlic.tseng, tzungbi,
	linux-mediatek, kaichieh.chuang


[-- Attachment #1.1: Type: text/plain, Size: 546 bytes --]

On Wed, May 22, 2019 at 10:52:04PM +0800, Jiaxin Yu wrote:
> System suspend will power off audio, so we need regcache sync when
> system resume.
> 
> Remove pm_runtime_get_sync in dev probe and pm_runtime_put_sync in
> dev remove.So that audio dev can triggle runitme suspend and resume.

While allowing runtime PM to run is good it'd be better to have a
standard system power management resume function as well that ensures
everything is restored after suspend to avoid unfortunate interactions
with user configuration of runtime PM.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Applied "ASoC: Mediatek: MT8183: enable dev runtime suspend and resume" to the asoc tree
  2019-05-22 14:52 [PATCH] ASoC: Mediatek: MT8183: enable dev runtime suspend and resume Jiaxin Yu
  2019-05-22 15:31 ` Mark Brown
@ 2019-05-23 13:48 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2019-05-23 13:48 UTC (permalink / raw)
  To: Jiaxin Yu
  Cc: alsa-devel, wsd_upstream, srv_heupstream, garlic.tseng, tzungbi,
	Mark Brown, linux-mediatek, kaichieh.chuang

The patch

   ASoC: Mediatek: MT8183: enable dev runtime suspend and resume

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.3

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 5463eb5c2f758069d1db21ed2cf23339431c9481 Mon Sep 17 00:00:00 2001
From: Jiaxin Yu <jiaxin.yu@mediatek.com>
Date: Wed, 22 May 2019 22:52:04 +0800
Subject: [PATCH] ASoC: Mediatek: MT8183: enable dev runtime suspend and resume

System suspend will power off audio, so we need regcache sync when
system resume.

Remove pm_runtime_get_sync in dev probe and pm_runtime_put_sync in
dev remove.So that audio dev can triggle runitme suspend and resume.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/mediatek/mt8183/mt8183-afe-pcm.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c b/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
index 56c37323bc13..4a31106d3471 100644
--- a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
+++ b/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
@@ -1142,8 +1142,6 @@ static int mt8183_afe_pcm_dev_probe(struct platform_device *pdev)
 	regcache_cache_only(afe->regmap, true);
 	regcache_mark_dirty(afe->regmap);
 
-	pm_runtime_get_sync(&pdev->dev);
-
 	/* init memif */
 	afe->memif_size = MT8183_MEMIF_NUM;
 	afe->memif = devm_kcalloc(dev, afe->memif_size, sizeof(*afe->memif),
@@ -1235,11 +1233,10 @@ static int mt8183_afe_pcm_dev_probe(struct platform_device *pdev)
 
 static int mt8183_afe_pcm_dev_remove(struct platform_device *pdev)
 {
-	pm_runtime_put_sync(&pdev->dev);
-
 	pm_runtime_disable(&pdev->dev);
 	if (!pm_runtime_status_suspended(&pdev->dev))
 		mt8183_afe_runtime_suspend(&pdev->dev);
+
 	return 0;
 }
 
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-23 13:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22 14:52 [PATCH] ASoC: Mediatek: MT8183: enable dev runtime suspend and resume Jiaxin Yu
2019-05-22 15:31 ` Mark Brown
2019-05-23 13:48 ` Applied "ASoC: Mediatek: MT8183: enable dev runtime suspend and resume" to the asoc tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.