kirkwood-i2s.c (4d2097e51795b760c392d3fbc6ca6b6f77c83419) kirkwood-i2s.c (920ec4e595faf89f7db022a068a4729a4d2c48ae)
1/*
2 * kirkwood-i2s.c
3 *
4 * (c) 2010 Arnaud Patard <apatard@mandriva.com>
5 * (c) 2010 Arnaud Patard <arnaud.patard@rtp-net.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the

--- 220 unchanged lines hidden (view full) ---

229 if (!(ctl & KIRKWOOD_PLAYCTL_SPDIF_EN))
230 ctl |= KIRKWOOD_PLAYCTL_SPDIF_MUTE;
231 return ctl;
232}
233
234static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream,
235 int cmd, struct snd_soc_dai *dai)
236{
1/*
2 * kirkwood-i2s.c
3 *
4 * (c) 2010 Arnaud Patard <apatard@mandriva.com>
5 * (c) 2010 Arnaud Patard <arnaud.patard@rtp-net.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the

--- 220 unchanged lines hidden (view full) ---

229 if (!(ctl & KIRKWOOD_PLAYCTL_SPDIF_EN))
230 ctl |= KIRKWOOD_PLAYCTL_SPDIF_MUTE;
231 return ctl;
232}
233
234static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream,
235 int cmd, struct snd_soc_dai *dai)
236{
237 struct snd_pcm_runtime *runtime = substream->runtime;
237 struct kirkwood_dma_data *priv = snd_soc_dai_get_drvdata(dai);
238 uint32_t ctl, value;
239
240 ctl = readl(priv->io + KIRKWOOD_PLAYCTL);
241 if ((ctl & KIRKWOOD_PLAYCTL_ENABLE_MASK) == 0) {
242 unsigned timeout = 5000;
243 /*
244 * The Armada510 spec says that if we enter pause mode, the

--- 21 unchanged lines hidden (view full) ---

266 ctl &= ~KIRKWOOD_PLAYCTL_SPDIF_EN; /* i2s */
267 else
268 ctl &= ~KIRKWOOD_PLAYCTL_I2S_EN; /* spdif */
269 ctl = kirkwood_i2s_play_mute(ctl);
270 value = ctl & ~KIRKWOOD_PLAYCTL_ENABLE_MASK;
271 writel(value, priv->io + KIRKWOOD_PLAYCTL);
272
273 /* enable interrupts */
238 struct kirkwood_dma_data *priv = snd_soc_dai_get_drvdata(dai);
239 uint32_t ctl, value;
240
241 ctl = readl(priv->io + KIRKWOOD_PLAYCTL);
242 if ((ctl & KIRKWOOD_PLAYCTL_ENABLE_MASK) == 0) {
243 unsigned timeout = 5000;
244 /*
245 * The Armada510 spec says that if we enter pause mode, the

--- 21 unchanged lines hidden (view full) ---

267 ctl &= ~KIRKWOOD_PLAYCTL_SPDIF_EN; /* i2s */
268 else
269 ctl &= ~KIRKWOOD_PLAYCTL_I2S_EN; /* spdif */
270 ctl = kirkwood_i2s_play_mute(ctl);
271 value = ctl & ~KIRKWOOD_PLAYCTL_ENABLE_MASK;
272 writel(value, priv->io + KIRKWOOD_PLAYCTL);
273
274 /* enable interrupts */
274 value = readl(priv->io + KIRKWOOD_INT_MASK);
275 value |= KIRKWOOD_INT_CAUSE_PLAY_BYTES;
276 writel(value, priv->io + KIRKWOOD_INT_MASK);
275 if (!runtime->no_period_wakeup) {
276 value = readl(priv->io + KIRKWOOD_INT_MASK);
277 value |= KIRKWOOD_INT_CAUSE_PLAY_BYTES;
278 writel(value, priv->io + KIRKWOOD_INT_MASK);
279 }
277
278 /* enable playback */
279 writel(ctl, priv->io + KIRKWOOD_PLAYCTL);
280 break;
281
282 case SNDRV_PCM_TRIGGER_STOP:
283 /* stop audio, disable interrupts */
284 ctl |= KIRKWOOD_PLAYCTL_PAUSE | KIRKWOOD_PLAYCTL_I2S_MUTE |

--- 384 unchanged lines hidden ---
280
281 /* enable playback */
282 writel(ctl, priv->io + KIRKWOOD_PLAYCTL);
283 break;
284
285 case SNDRV_PCM_TRIGGER_STOP:
286 /* stop audio, disable interrupts */
287 ctl |= KIRKWOOD_PLAYCTL_PAUSE | KIRKWOOD_PLAYCTL_I2S_MUTE |

--- 384 unchanged lines hidden ---