Commit c5cf4dbc authored by Mark Brown's avatar Mark Brown

ASoC: Add trivial pm_runtime usage to Samsung DAI drivers

Currently this won't actually do anything but using this will help the
core SoC code track when the system is idle.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 8270ba0c
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pm_runtime.h>
#include <sound/soc.h> #include <sound/soc.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
...@@ -1095,6 +1096,8 @@ static __devinit int samsung_i2s_probe(struct platform_device *pdev) ...@@ -1095,6 +1096,8 @@ static __devinit int samsung_i2s_probe(struct platform_device *pdev)
snd_soc_register_dai(&pri_dai->pdev->dev, &pri_dai->i2s_dai_drv); snd_soc_register_dai(&pri_dai->pdev->dev, &pri_dai->i2s_dai_drv);
pm_runtime_enable(&pdev->dev);
return 0; return 0;
err: err:
release_mem_region(regs_base, resource_size(res)); release_mem_region(regs_base, resource_size(res));
...@@ -1105,6 +1108,7 @@ static __devinit int samsung_i2s_probe(struct platform_device *pdev) ...@@ -1105,6 +1108,7 @@ static __devinit int samsung_i2s_probe(struct platform_device *pdev)
static __devexit int samsung_i2s_remove(struct platform_device *pdev) static __devexit int samsung_i2s_remove(struct platform_device *pdev)
{ {
struct i2s_dai *i2s, *other; struct i2s_dai *i2s, *other;
struct resource *res;
i2s = dev_get_drvdata(&pdev->dev); i2s = dev_get_drvdata(&pdev->dev);
other = i2s->pri_dai ? : i2s->sec_dai; other = i2s->pri_dai ? : i2s->sec_dai;
...@@ -1113,7 +1117,7 @@ static __devexit int samsung_i2s_remove(struct platform_device *pdev) ...@@ -1113,7 +1117,7 @@ static __devexit int samsung_i2s_remove(struct platform_device *pdev)
other->pri_dai = NULL; other->pri_dai = NULL;
other->sec_dai = NULL; other->sec_dai = NULL;
} else { } else {
struct resource *res; pm_runtime_disable(&pdev->dev);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res) if (res)
release_mem_region(res->start, resource_size(res)); release_mem_region(res->start, resource_size(res));
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pm_runtime.h>
#include <sound/soc.h> #include <sound/soc.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
...@@ -580,6 +581,8 @@ static __devinit int s3c_pcm_dev_probe(struct platform_device *pdev) ...@@ -580,6 +581,8 @@ static __devinit int s3c_pcm_dev_probe(struct platform_device *pdev)
pcm->dma_capture = &s3c_pcm_stereo_in[pdev->id]; pcm->dma_capture = &s3c_pcm_stereo_in[pdev->id];
pcm->dma_playback = &s3c_pcm_stereo_out[pdev->id]; pcm->dma_playback = &s3c_pcm_stereo_out[pdev->id];
pm_runtime_enable(&pdev->dev);
ret = snd_soc_register_dai(&pdev->dev, &s3c_pcm_dai[pdev->id]); ret = snd_soc_register_dai(&pdev->dev, &s3c_pcm_dai[pdev->id]);
if (ret != 0) { if (ret != 0) {
dev_err(&pdev->dev, "failed to get register DAI: %d\n", ret); dev_err(&pdev->dev, "failed to get register DAI: %d\n", ret);
...@@ -609,6 +612,8 @@ static __devexit int s3c_pcm_dev_remove(struct platform_device *pdev) ...@@ -609,6 +612,8 @@ static __devexit int s3c_pcm_dev_remove(struct platform_device *pdev)
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_dai(&pdev->dev);
pm_runtime_disable(&pdev->dev);
iounmap(pcm->regs); iounmap(pcm->regs);
mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
......
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