From 32a956a1fadfd7d3924ab8ada2b7754054375903 Mon Sep 17 00:00:00 2001 From: Olivier Moysan Date: Fri, 19 Nov 2021 11:47:50 +0100 Subject: [PATCH 1/3] ASoC: stm32: i2s: add pm_runtime support Enable support of pm_runtime on STM32 I2S driver to allow I2S power state monitoring. Signed-off-by: Olivier Moysan Link: https://lore.kernel.org/r/20211119104752.13564-2-olivier.moysan@foss.st.com Signed-off-by: Mark Brown --- sound/soc/stm/stm32_i2s.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c index 6254bacad6eb..68c5de040df8 100644 --- a/sound/soc/stm/stm32_i2s.c +++ b/sound/soc/stm/stm32_i2s.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -1113,6 +1114,7 @@ static int stm32_i2s_remove(struct platform_device *pdev) { snd_dmaengine_pcm_unregister(&pdev->dev); snd_soc_unregister_component(&pdev->dev); + pm_runtime_disable(&pdev->dev); return 0; } @@ -1150,6 +1152,8 @@ static int stm32_i2s_probe(struct platform_device *pdev) return PTR_ERR(i2s->regmap); } + pm_runtime_enable(&pdev->dev); + ret = snd_dmaengine_pcm_register(&pdev->dev, &stm32_i2s_pcm_config, 0); if (ret) { if (ret != -EPROBE_DEFER) From 98e500a12f934531b0d44eac6bc53c3d4b66aa74 Mon Sep 17 00:00:00 2001 From: Olivier Moysan Date: Fri, 19 Nov 2021 11:47:51 +0100 Subject: [PATCH 2/3] ASoC: stm32: dfsdm: add pm_runtime support for audio Enable support of pm_runtime on STM32 DFSDM audio driver to allow power state monitoring. Signed-off-by: Olivier Moysan Link: https://lore.kernel.org/r/20211119104752.13564-3-olivier.moysan@foss.st.com Signed-off-by: Mark Brown --- sound/soc/stm/stm32_adfsdm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/stm/stm32_adfsdm.c b/sound/soc/stm/stm32_adfsdm.c index e6078f50e508..6ee714542b84 100644 --- a/sound/soc/stm/stm32_adfsdm.c +++ b/sound/soc/stm/stm32_adfsdm.c @@ -12,7 +12,7 @@ #include #include #include - +#include #include #include #include @@ -334,6 +334,8 @@ static int stm32_adfsdm_probe(struct platform_device *pdev) dev_set_drvdata(&pdev->dev, priv); + pm_runtime_enable(&pdev->dev); + ret = devm_snd_soc_register_component(&pdev->dev, &stm32_adfsdm_dai_component, &priv->dai_drv, 1); @@ -373,6 +375,7 @@ static int stm32_adfsdm_probe(struct platform_device *pdev) static int stm32_adfsdm_remove(struct platform_device *pdev) { snd_soc_unregister_component(&pdev->dev); + pm_runtime_disable(&pdev->dev); return 0; } From ac5e3efd55868d8c12a178123b24616a22db274d Mon Sep 17 00:00:00 2001 From: Olivier Moysan Date: Fri, 19 Nov 2021 11:47:52 +0100 Subject: [PATCH 3/3] ASoC: stm32: spdifrx: add pm_runtime support Enable support of pm_runtime on STM32 SPDIFRX driver to allow SPDIFRX power state monitoring. Signed-off-by: Olivier Moysan Link: https://lore.kernel.org/r/20211119104752.13564-4-olivier.moysan@foss.st.com Signed-off-by: Mark Brown --- sound/soc/stm/stm32_spdifrx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/stm/stm32_spdifrx.c b/sound/soc/stm/stm32_spdifrx.c index 48145f553588..a9ccdc2c5867 100644 --- a/sound/soc/stm/stm32_spdifrx.c +++ b/sound/soc/stm/stm32_spdifrx.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -955,6 +956,7 @@ static int stm32_spdifrx_remove(struct platform_device *pdev) snd_dmaengine_pcm_unregister(&pdev->dev); snd_soc_unregister_component(&pdev->dev); + pm_runtime_disable(&pdev->dev); return 0; } @@ -1010,6 +1012,8 @@ static int stm32_spdifrx_probe(struct platform_device *pdev) udelay(2); reset_control_deassert(rst); + pm_runtime_enable(&pdev->dev); + pcm_config = &stm32_spdifrx_pcm_config; ret = snd_dmaengine_pcm_register(&pdev->dev, pcm_config, 0); if (ret) {