提交 dfe4c936 编写于 作者: A arnaud.patard@rtp-net.org 提交者: Mark Brown

ASoC: Fix kirkwood i2s mono playback

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: NArnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 ccad7b44
......@@ -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);
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册