Skip to content

Commit

Permalink
ASoC: Fix kirkwood i2s mono playback
Browse files Browse the repository at this point in the history
Kirkwood controller needs to be informed if the audio stream is mono
or not. Failing to do so will result in playing at the wrong speed.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
arnaud.patard@rtp-net.org authored and Mark Brown committed Jul 13, 2010
1 parent ccad7b4 commit dfe4c93
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sound/soc/kirkwood/kirkwood-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@ static int kirkwood_i2s_hw_params(struct snd_pcm_substream *substream,
default:
return -EINVAL;
}

if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
value &= ~KIRKWOOD_PLAYCTL_MONO_MASK;
if (params_channels(params) == 1)
value |= KIRKWOOD_PLAYCTL_MONO_BOTH;
else
value |= KIRKWOOD_PLAYCTL_MONO_OFF;
}

writel(i2s_value, priv->io+i2s_reg);
writel(value, priv->io+reg);

Expand Down
3 changes: 3 additions & 0 deletions sound/soc/kirkwood/kirkwood.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
#define KIRKWOOD_PLAYCTL_BURST_32 (1<<11)
#define KIRKWOOD_PLAYCTL_PAUSE (1<<9)
#define KIRKWOOD_PLAYCTL_SPDIF_MUTE (1<<8)
#define KIRKWOOD_PLAYCTL_MONO_MASK (3<<5)
#define KIRKWOOD_PLAYCTL_MONO_BOTH (3<<5)
#define KIRKWOOD_PLAYCTL_MONO_OFF (0<<5)
#define KIRKWOOD_PLAYCTL_I2S_MUTE (1<<7)
#define KIRKWOOD_PLAYCTL_SPDIF_EN (1<<4)
#define KIRKWOOD_PLAYCTL_I2S_EN (1<<3)
Expand Down

0 comments on commit dfe4c93

Please sign in to comment.