diff options
author | Chaithrika U S <chaithrika@ti.com> | 2009-12-03 08:26:56 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-12-04 05:49:45 -0500 |
commit | a47979b5aa2117848b742828c98abe7eea42a9ff (patch) | |
tree | c9e36705b30e4fc9808739f05dc0bfbe42a6f8b2 /sound/soc/davinci/davinci-mcasp.c | |
parent | 71f6e0645be42f93c0f90dfcc93b9d2d277c2ee6 (diff) |
ASoC: DaVinci: Update suspend/resume support for McASP driver
Add clock enable and disable calls to resume and suspend respectively.
Also add a member to the audio device data structure which tracks the clock
status.
Tested on DA850/OMAP-L138 EVM. For the purpose of testing, the patches[1] which
add suspend-to-RAM support to DA850/OMAP-L138 SoC were applied.
[1] http://linux.davincidsp.com/pipermail/davinci-linux-open-source/
2009-November/016958.html
Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/davinci/davinci-mcasp.c')
-rw-r--r-- | sound/soc/davinci/davinci-mcasp.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index 0a302e1080d9..a613bbb0bc91 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c | |||
@@ -767,14 +767,27 @@ static int davinci_mcasp_trigger(struct snd_pcm_substream *substream, | |||
767 | int ret = 0; | 767 | int ret = 0; |
768 | 768 | ||
769 | switch (cmd) { | 769 | switch (cmd) { |
770 | case SNDRV_PCM_TRIGGER_START: | ||
771 | case SNDRV_PCM_TRIGGER_RESUME: | 770 | case SNDRV_PCM_TRIGGER_RESUME: |
771 | if (!dev->clk_active) { | ||
772 | clk_enable(dev->clk); | ||
773 | dev->clk_active = 1; | ||
774 | } | ||
775 | /* Fall through */ | ||
776 | case SNDRV_PCM_TRIGGER_START: | ||
772 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 777 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
773 | davinci_mcasp_start(dev, substream->stream); | 778 | davinci_mcasp_start(dev, substream->stream); |
774 | break; | 779 | break; |
775 | 780 | ||
776 | case SNDRV_PCM_TRIGGER_STOP: | ||
777 | case SNDRV_PCM_TRIGGER_SUSPEND: | 781 | case SNDRV_PCM_TRIGGER_SUSPEND: |
782 | davinci_mcasp_stop(dev, substream->stream); | ||
783 | if (dev->clk_active) { | ||
784 | clk_disable(dev->clk); | ||
785 | dev->clk_active = 0; | ||
786 | } | ||
787 | |||
788 | break; | ||
789 | |||
790 | case SNDRV_PCM_TRIGGER_STOP: | ||
778 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 791 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
779 | davinci_mcasp_stop(dev, substream->stream); | 792 | davinci_mcasp_stop(dev, substream->stream); |
780 | break; | 793 | break; |
@@ -866,6 +879,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
866 | } | 879 | } |
867 | 880 | ||
868 | clk_enable(dev->clk); | 881 | clk_enable(dev->clk); |
882 | dev->clk_active = 1; | ||
869 | 883 | ||
870 | dev->base = (void __iomem *)IO_ADDRESS(mem->start); | 884 | dev->base = (void __iomem *)IO_ADDRESS(mem->start); |
871 | dev->op_mode = pdata->op_mode; | 885 | dev->op_mode = pdata->op_mode; |