diff options
-rw-r--r-- | sound/soc/davinci/davinci-mcasp.c | 18 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-mcasp.h | 1 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-pcm.c | 2 |
3 files changed, 18 insertions, 3 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; |
diff --git a/sound/soc/davinci/davinci-mcasp.h b/sound/soc/davinci/davinci-mcasp.h index 582c9249ef09..e755b5121ec7 100644 --- a/sound/soc/davinci/davinci-mcasp.h +++ b/sound/soc/davinci/davinci-mcasp.h | |||
@@ -44,6 +44,7 @@ struct davinci_audio_dev { | |||
44 | int sample_rate; | 44 | int sample_rate; |
45 | struct clk *clk; | 45 | struct clk *clk; |
46 | unsigned int codec_fmt; | 46 | unsigned int codec_fmt; |
47 | u8 clk_active; | ||
47 | 48 | ||
48 | /* McASP specific data */ | 49 | /* McASP specific data */ |
49 | int tdm_slots; | 50 | int tdm_slots; |
diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c index ad4d7f47a86b..80c7fdf2f521 100644 --- a/sound/soc/davinci/davinci-pcm.c +++ b/sound/soc/davinci/davinci-pcm.c | |||
@@ -49,7 +49,7 @@ static void print_buf_info(int slot, char *name) | |||
49 | static struct snd_pcm_hardware pcm_hardware_playback = { | 49 | static struct snd_pcm_hardware pcm_hardware_playback = { |
50 | .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 50 | .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
51 | SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | | 51 | SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | |
52 | SNDRV_PCM_INFO_PAUSE), | 52 | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME), |
53 | .formats = (SNDRV_PCM_FMTBIT_S16_LE), | 53 | .formats = (SNDRV_PCM_FMTBIT_S16_LE), |
54 | .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | | 54 | .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | |
55 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | | 55 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | |