Commit 6d86bdb3 authored by Mark Brown's avatar Mark Brown

ASoC: stm32: add pm runtime support

Merge series from Olivier Moysan <olivier.moysan@foss.st.com>:

	Enable support of pm runtime on STM32 SPDIFRX, I2S and DFSDM drivers
	to allow power state monitoring.
parents 21b15926 ac5e3efd
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/pm_runtime.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/iio/consumer.h> #include <linux/iio/consumer.h>
#include <linux/iio/adc/stm32-dfsdm-adc.h> #include <linux/iio/adc/stm32-dfsdm-adc.h>
...@@ -334,6 +334,8 @@ static int stm32_adfsdm_probe(struct platform_device *pdev) ...@@ -334,6 +334,8 @@ static int stm32_adfsdm_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, priv); dev_set_drvdata(&pdev->dev, priv);
pm_runtime_enable(&pdev->dev);
ret = devm_snd_soc_register_component(&pdev->dev, ret = devm_snd_soc_register_component(&pdev->dev,
&stm32_adfsdm_dai_component, &stm32_adfsdm_dai_component,
&priv->dai_drv, 1); &priv->dai_drv, 1);
...@@ -373,6 +375,7 @@ static int stm32_adfsdm_probe(struct platform_device *pdev) ...@@ -373,6 +375,7 @@ static int stm32_adfsdm_probe(struct platform_device *pdev)
static int stm32_adfsdm_remove(struct platform_device *pdev) static int stm32_adfsdm_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_component(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return 0; return 0;
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_irq.h> #include <linux/of_irq.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/reset.h> #include <linux/reset.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
...@@ -1113,6 +1114,7 @@ static int stm32_i2s_remove(struct platform_device *pdev) ...@@ -1113,6 +1114,7 @@ static int stm32_i2s_remove(struct platform_device *pdev)
{ {
snd_dmaengine_pcm_unregister(&pdev->dev); snd_dmaengine_pcm_unregister(&pdev->dev);
snd_soc_unregister_component(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return 0; return 0;
} }
...@@ -1150,6 +1152,8 @@ static int stm32_i2s_probe(struct platform_device *pdev) ...@@ -1150,6 +1152,8 @@ static int stm32_i2s_probe(struct platform_device *pdev)
return PTR_ERR(i2s->regmap); return PTR_ERR(i2s->regmap);
} }
pm_runtime_enable(&pdev->dev);
ret = snd_dmaengine_pcm_register(&pdev->dev, &stm32_i2s_pcm_config, 0); ret = snd_dmaengine_pcm_register(&pdev->dev, &stm32_i2s_pcm_config, 0);
if (ret) { if (ret) {
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/reset.h> #include <linux/reset.h>
...@@ -955,6 +956,7 @@ static int stm32_spdifrx_remove(struct platform_device *pdev) ...@@ -955,6 +956,7 @@ static int stm32_spdifrx_remove(struct platform_device *pdev)
snd_dmaengine_pcm_unregister(&pdev->dev); snd_dmaengine_pcm_unregister(&pdev->dev);
snd_soc_unregister_component(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return 0; return 0;
} }
...@@ -1010,6 +1012,8 @@ static int stm32_spdifrx_probe(struct platform_device *pdev) ...@@ -1010,6 +1012,8 @@ static int stm32_spdifrx_probe(struct platform_device *pdev)
udelay(2); udelay(2);
reset_control_deassert(rst); reset_control_deassert(rst);
pm_runtime_enable(&pdev->dev);
pcm_config = &stm32_spdifrx_pcm_config; pcm_config = &stm32_spdifrx_pcm_config;
ret = snd_dmaengine_pcm_register(&pdev->dev, pcm_config, 0); ret = snd_dmaengine_pcm_register(&pdev->dev, pcm_config, 0);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment