summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-06-26 18:23:05 +0400
committerMark Brown <broonie@linaro.org>2014-06-28 16:18:28 +0400
commit2fbc38219c0af91afbeb3c9d97c62e1c7c74df61 (patch)
tree951221af0dd9632eb3c3c2be92102e21d3885cbd /sound/soc
parent6772190632ebce6c5c6010d2bc77d5de866831b6 (diff)
downloadlinux-2fbc38219c0af91afbeb3c9d97c62e1c7c74df61.tar.xz
ASoC: kirkwood-i2s: fix mute handling
The spec requires that the mute bits must be set while the channel is disabled. Ensure that this is the case by providing a helper which ensures that the appropriate mute bit is set while the enable bit is clear. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Tested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/kirkwood/kirkwood-i2s.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c
index ef1a164d8703..b601ad680d7b 100644
--- a/sound/soc/kirkwood/kirkwood-i2s.c
+++ b/sound/soc/kirkwood/kirkwood-i2s.c
@@ -222,6 +222,15 @@ static int kirkwood_i2s_hw_params(struct snd_pcm_substream *substream,
return 0;
}
+static unsigned kirkwood_i2s_play_mute(unsigned ctl)
+{
+ if (!(ctl & KIRKWOOD_PLAYCTL_I2S_EN))
+ ctl |= KIRKWOOD_PLAYCTL_I2S_MUTE;
+ if (!(ctl & KIRKWOOD_PLAYCTL_SPDIF_EN))
+ ctl |= KIRKWOOD_PLAYCTL_SPDIF_MUTE;
+ return ctl;
+}
+
static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
{
@@ -257,7 +266,7 @@ static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream,
ctl &= ~KIRKWOOD_PLAYCTL_SPDIF_EN; /* i2s */
else
ctl &= ~KIRKWOOD_PLAYCTL_I2S_EN; /* spdif */
-
+ ctl = kirkwood_i2s_play_mute(ctl);
value = ctl & ~KIRKWOOD_PLAYCTL_ENABLE_MASK;
writel(value, priv->io + KIRKWOOD_PLAYCTL);
@@ -296,6 +305,7 @@ static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream,
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
ctl &= ~(KIRKWOOD_PLAYCTL_PAUSE | KIRKWOOD_PLAYCTL_I2S_MUTE |
KIRKWOOD_PLAYCTL_SPDIF_MUTE);
+ ctl = kirkwood_i2s_play_mute(ctl);
writel(ctl, priv->io + KIRKWOOD_PLAYCTL);
break;