diff options
-rw-r--r-- | sound/soc/soc-pcm.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 49aa71e0d7e6..8aa7cec6eab2 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
22 | #include <linux/pm_runtime.h> | ||
22 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
23 | #include <linux/workqueue.h> | 24 | #include <linux/workqueue.h> |
24 | #include <sound/core.h> | 25 | #include <sound/core.h> |
@@ -77,6 +78,10 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) | |||
77 | struct snd_soc_dai_driver *codec_dai_drv = codec_dai->driver; | 78 | struct snd_soc_dai_driver *codec_dai_drv = codec_dai->driver; |
78 | int ret = 0; | 79 | int ret = 0; |
79 | 80 | ||
81 | pm_runtime_get_sync(cpu_dai->dev); | ||
82 | pm_runtime_get_sync(codec_dai->dev); | ||
83 | pm_runtime_get_sync(platform->dev); | ||
84 | |||
80 | mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass); | 85 | mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass); |
81 | 86 | ||
82 | /* startup the audio subsystem */ | 87 | /* startup the audio subsystem */ |
@@ -233,6 +238,11 @@ platform_err: | |||
233 | cpu_dai->driver->ops->shutdown(substream, cpu_dai); | 238 | cpu_dai->driver->ops->shutdown(substream, cpu_dai); |
234 | out: | 239 | out: |
235 | mutex_unlock(&rtd->pcm_mutex); | 240 | mutex_unlock(&rtd->pcm_mutex); |
241 | |||
242 | pm_runtime_put(platform->dev); | ||
243 | pm_runtime_put(codec_dai->dev); | ||
244 | pm_runtime_put(cpu_dai->dev); | ||
245 | |||
236 | return ret; | 246 | return ret; |
237 | } | 247 | } |
238 | 248 | ||
@@ -339,6 +349,11 @@ static int soc_pcm_close(struct snd_pcm_substream *substream) | |||
339 | } | 349 | } |
340 | 350 | ||
341 | mutex_unlock(&rtd->pcm_mutex); | 351 | mutex_unlock(&rtd->pcm_mutex); |
352 | |||
353 | pm_runtime_put(platform->dev); | ||
354 | pm_runtime_put(codec_dai->dev); | ||
355 | pm_runtime_put(cpu_dai->dev); | ||
356 | |||
342 | return 0; | 357 | return 0; |
343 | } | 358 | } |
344 | 359 | ||