aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorarnaud.patard@rtp-net.org <arnaud.patard@rtp-net.org>2010-07-11 17:28:32 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-07-13 07:37:09 -0400
commitb424ec953344e0ea612a8cc2d8e59742a0273ac1 (patch)
treed2226c98e83c647e4b0c5a92e41e7779e1118553 /sound
parentdfe4c93627c4a1a7fb7e30b15e31f4ccf3ca60f5 (diff)
ASoC: kirkwood-i2s: Handle mute/unmute playback/record
The controller has mute/unmute capability and some bootloader may mute them at boot. If it's not handled, all things will seem to be working but no sound will come out of the speaker/headphone. Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/kirkwood/kirkwood-i2s.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c
index d80ea1ff7b0..981ffc2a13c 100644
--- a/sound/soc/kirkwood/kirkwood-i2s.c
+++ b/sound/soc/kirkwood/kirkwood-i2s.c
@@ -193,7 +193,8 @@ static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream,
193 /* configure audio & enable i2s playback */ 193 /* configure audio & enable i2s playback */
194 value = readl(priv->io + KIRKWOOD_PLAYCTL); 194 value = readl(priv->io + KIRKWOOD_PLAYCTL);
195 value &= ~KIRKWOOD_PLAYCTL_BURST_MASK; 195 value &= ~KIRKWOOD_PLAYCTL_BURST_MASK;
196 value &= ~(KIRKWOOD_PLAYCTL_PAUSE|KIRKWOOD_PLAYCTL_SPDIF_EN); 196 value &= ~(KIRKWOOD_PLAYCTL_PAUSE | KIRKWOOD_PLAYCTL_I2S_MUTE
197 | KIRKWOOD_PLAYCTL_SPDIF_EN);
197 198
198 if (priv->burst == 32) 199 if (priv->burst == 32)
199 value |= KIRKWOOD_PLAYCTL_BURST_32; 200 value |= KIRKWOOD_PLAYCTL_BURST_32;
@@ -206,7 +207,7 @@ static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream,
206 case SNDRV_PCM_TRIGGER_STOP: 207 case SNDRV_PCM_TRIGGER_STOP:
207 /* stop audio, disable interrupts */ 208 /* stop audio, disable interrupts */
208 value = readl(priv->io + KIRKWOOD_PLAYCTL); 209 value = readl(priv->io + KIRKWOOD_PLAYCTL);
209 value |= KIRKWOOD_PLAYCTL_PAUSE; 210 value |= KIRKWOOD_PLAYCTL_PAUSE | KIRKWOOD_PLAYCTL_I2S_MUTE;
210 writel(value, priv->io + KIRKWOOD_PLAYCTL); 211 writel(value, priv->io + KIRKWOOD_PLAYCTL);
211 212
212 value = readl(priv->io + KIRKWOOD_INT_MASK); 213 value = readl(priv->io + KIRKWOOD_INT_MASK);
@@ -222,14 +223,14 @@ static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream,
222 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 223 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
223 case SNDRV_PCM_TRIGGER_SUSPEND: 224 case SNDRV_PCM_TRIGGER_SUSPEND:
224 value = readl(priv->io + KIRKWOOD_PLAYCTL); 225 value = readl(priv->io + KIRKWOOD_PLAYCTL);
225 value |= KIRKWOOD_PLAYCTL_PAUSE; 226 value |= KIRKWOOD_PLAYCTL_PAUSE | KIRKWOOD_PLAYCTL_I2S_MUTE;
226 writel(value, priv->io + KIRKWOOD_PLAYCTL); 227 writel(value, priv->io + KIRKWOOD_PLAYCTL);
227 break; 228 break;
228 229
229 case SNDRV_PCM_TRIGGER_RESUME: 230 case SNDRV_PCM_TRIGGER_RESUME:
230 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 231 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
231 value = readl(priv->io + KIRKWOOD_PLAYCTL); 232 value = readl(priv->io + KIRKWOOD_PLAYCTL);
232 value &= ~KIRKWOOD_PLAYCTL_PAUSE; 233 value &= ~(KIRKWOOD_PLAYCTL_PAUSE | KIRKWOOD_PLAYCTL_I2S_MUTE);
233 writel(value, priv->io + KIRKWOOD_PLAYCTL); 234 writel(value, priv->io + KIRKWOOD_PLAYCTL);
234 break; 235 break;
235 236
@@ -262,7 +263,8 @@ static int kirkwood_i2s_rec_trigger(struct snd_pcm_substream *substream,
262 value = readl(priv->io + KIRKWOOD_RECCTL); 263 value = readl(priv->io + KIRKWOOD_RECCTL);
263 value &= ~KIRKWOOD_RECCTL_BURST_MASK; 264 value &= ~KIRKWOOD_RECCTL_BURST_MASK;
264 value &= ~KIRKWOOD_RECCTL_MONO; 265 value &= ~KIRKWOOD_RECCTL_MONO;
265 value &= ~(KIRKWOOD_RECCTL_PAUSE | KIRKWOOD_RECCTL_SPDIF_EN); 266 value &= ~(KIRKWOOD_RECCTL_PAUSE | KIRKWOOD_RECCTL_MUTE
267 | KIRKWOOD_RECCTL_SPDIF_EN);
266 268
267 if (priv->burst == 32) 269 if (priv->burst == 32)
268 value |= KIRKWOOD_RECCTL_BURST_32; 270 value |= KIRKWOOD_RECCTL_BURST_32;
@@ -276,7 +278,7 @@ static int kirkwood_i2s_rec_trigger(struct snd_pcm_substream *substream,
276 case SNDRV_PCM_TRIGGER_STOP: 278 case SNDRV_PCM_TRIGGER_STOP:
277 /* stop audio, disable interrupts */ 279 /* stop audio, disable interrupts */
278 value = readl(priv->io + KIRKWOOD_RECCTL); 280 value = readl(priv->io + KIRKWOOD_RECCTL);
279 value |= KIRKWOOD_RECCTL_PAUSE; 281 value |= KIRKWOOD_RECCTL_PAUSE | KIRKWOOD_RECCTL_MUTE;
280 writel(value, priv->io + KIRKWOOD_RECCTL); 282 writel(value, priv->io + KIRKWOOD_RECCTL);
281 283
282 value = readl(priv->io + KIRKWOOD_INT_MASK); 284 value = readl(priv->io + KIRKWOOD_INT_MASK);
@@ -292,14 +294,14 @@ static int kirkwood_i2s_rec_trigger(struct snd_pcm_substream *substream,
292 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 294 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
293 case SNDRV_PCM_TRIGGER_SUSPEND: 295 case SNDRV_PCM_TRIGGER_SUSPEND:
294 value = readl(priv->io + KIRKWOOD_RECCTL); 296 value = readl(priv->io + KIRKWOOD_RECCTL);
295 value |= KIRKWOOD_RECCTL_PAUSE; 297 value |= KIRKWOOD_RECCTL_PAUSE | KIRKWOOD_RECCTL_MUTE;
296 writel(value, priv->io + KIRKWOOD_RECCTL); 298 writel(value, priv->io + KIRKWOOD_RECCTL);
297 break; 299 break;
298 300
299 case SNDRV_PCM_TRIGGER_RESUME: 301 case SNDRV_PCM_TRIGGER_RESUME:
300 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 302 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
301 value = readl(priv->io + KIRKWOOD_RECCTL); 303 value = readl(priv->io + KIRKWOOD_RECCTL);
302 value &= ~KIRKWOOD_RECCTL_PAUSE; 304 value &= ~(KIRKWOOD_RECCTL_PAUSE | KIRKWOOD_RECCTL_MUTE);
303 writel(value, priv->io + KIRKWOOD_RECCTL); 305 writel(value, priv->io + KIRKWOOD_RECCTL);
304 break; 306 break;
305 307