]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ASoC: stm32: spdifrx: add pm_runtime support
authorOlivier Moysan <olivier.moysan@foss.st.com>
Fri, 19 Nov 2021 10:47:52 +0000 (11:47 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 22 Nov 2021 15:40:29 +0000 (15:40 +0000)
Enable support of pm_runtime on STM32 SPDIFRX driver to allow
SPDIFRX power state monitoring.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://lore.kernel.org/r/20211119104752.13564-4-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/stm/stm32_spdifrx.c

index 48145f5535880267b7eb4177903a3ab16ef2d187..a9ccdc2c58673fccb526dc4df4943778233a657b 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/of_platform.h>
+#include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 #include <linux/reset.h>
 
@@ -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) {