diff options
author | Karl Beldan <karl.beldan@gmail.com> | 2009-05-13 16:16:46 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-05-14 15:35:23 -0400 |
commit | 34555c1077ac8f4854e0db9ad11b989a6908d210 (patch) | |
tree | 6e4a296cf42939ffb1805d23a21815491542f606 /sound/soc/pxa/pxa2xx-i2s.c | |
parent | b243b77c708665d7af8c5e42611c27c89f918788 (diff) |
ASoC: pxa2xx-i2s: Handle SACR1_DRPL and SACR1_DREC separately
- hw_params enables both RPL and REC functions each time : Enable the
appropriate function in pxa2xx_i2s_trigger.
- pxa2xx_i2s_shutdown disables i2s anytime one of RPL or REC function is
off : Turn it off only when both functions are off.
Signed-off-by: Karl Beldan <karl.beldan@mobile-devices.fr>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/pxa/pxa2xx-i2s.c')
-rw-r--r-- | sound/soc/pxa/pxa2xx-i2s.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c index bb8630b6dc8d..115b471b2def 100644 --- a/sound/soc/pxa/pxa2xx-i2s.c +++ b/sound/soc/pxa/pxa2xx-i2s.c | |||
@@ -176,9 +176,7 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream, | |||
176 | 176 | ||
177 | /* is port used by another stream */ | 177 | /* is port used by another stream */ |
178 | if (!(SACR0 & SACR0_ENB)) { | 178 | if (!(SACR0 & SACR0_ENB)) { |
179 | |||
180 | SACR0 = 0; | 179 | SACR0 = 0; |
181 | SACR1 = 0; | ||
182 | if (pxa_i2s.master) | 180 | if (pxa_i2s.master) |
183 | SACR0 |= SACR0_BCKD; | 181 | SACR0 |= SACR0_BCKD; |
184 | 182 | ||
@@ -224,6 +222,10 @@ static int pxa2xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd, | |||
224 | 222 | ||
225 | switch (cmd) { | 223 | switch (cmd) { |
226 | case SNDRV_PCM_TRIGGER_START: | 224 | case SNDRV_PCM_TRIGGER_START: |
225 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | ||
226 | SACR1 &= ~SACR1_DRPL; | ||
227 | else | ||
228 | SACR1 &= ~SACR1_DREC; | ||
227 | SACR0 |= SACR0_ENB; | 229 | SACR0 |= SACR0_ENB; |
228 | break; | 230 | break; |
229 | case SNDRV_PCM_TRIGGER_RESUME: | 231 | case SNDRV_PCM_TRIGGER_RESUME: |
@@ -250,7 +252,7 @@ static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream, | |||
250 | SAIMR &= ~SAIMR_RFS; | 252 | SAIMR &= ~SAIMR_RFS; |
251 | } | 253 | } |
252 | 254 | ||
253 | if (SACR1 & (SACR1_DREC | SACR1_DRPL)) { | 255 | if ((SACR1 & (SACR1_DREC | SACR1_DRPL)) == (SACR1_DREC | SACR1_DRPL)) { |
254 | SACR0 &= ~SACR0_ENB; | 256 | SACR0 &= ~SACR0_ENB; |
255 | pxa_i2s_wait(); | 257 | pxa_i2s_wait(); |
256 | clk_disable(clk_i2s); | 258 | clk_disable(clk_i2s); |