diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-06-26 10:23:05 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-06-28 08:18:28 -0400 |
commit | 2fbc38219c0af91afbeb3c9d97c62e1c7c74df61 (patch) | |
tree | 951221af0dd9632eb3c3c2be92102e21d3885cbd | |
parent | 6772190632ebce6c5c6010d2bc77d5de866831b6 (diff) |
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>
-rw-r--r-- | sound/soc/kirkwood/kirkwood-i2s.c | 12 |
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, | |||
222 | return 0; | 222 | return 0; |
223 | } | 223 | } |
224 | 224 | ||
225 | static unsigned kirkwood_i2s_play_mute(unsigned ctl) | ||
226 | { | ||
227 | if (!(ctl & KIRKWOOD_PLAYCTL_I2S_EN)) | ||
228 | ctl |= KIRKWOOD_PLAYCTL_I2S_MUTE; | ||
229 | if (!(ctl & KIRKWOOD_PLAYCTL_SPDIF_EN)) | ||
230 | ctl |= KIRKWOOD_PLAYCTL_SPDIF_MUTE; | ||
231 | return ctl; | ||
232 | } | ||
233 | |||
225 | static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream, | 234 | static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream, |
226 | int cmd, struct snd_soc_dai *dai) | 235 | int cmd, struct snd_soc_dai *dai) |
227 | { | 236 | { |
@@ -257,7 +266,7 @@ static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream, | |||
257 | ctl &= ~KIRKWOOD_PLAYCTL_SPDIF_EN; /* i2s */ | 266 | ctl &= ~KIRKWOOD_PLAYCTL_SPDIF_EN; /* i2s */ |
258 | else | 267 | else |
259 | ctl &= ~KIRKWOOD_PLAYCTL_I2S_EN; /* spdif */ | 268 | ctl &= ~KIRKWOOD_PLAYCTL_I2S_EN; /* spdif */ |
260 | 269 | ctl = kirkwood_i2s_play_mute(ctl); | |
261 | value = ctl & ~KIRKWOOD_PLAYCTL_ENABLE_MASK; | 270 | value = ctl & ~KIRKWOOD_PLAYCTL_ENABLE_MASK; |
262 | writel(value, priv->io + KIRKWOOD_PLAYCTL); | 271 | writel(value, priv->io + KIRKWOOD_PLAYCTL); |
263 | 272 | ||
@@ -296,6 +305,7 @@ static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream, | |||
296 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 305 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
297 | ctl &= ~(KIRKWOOD_PLAYCTL_PAUSE | KIRKWOOD_PLAYCTL_I2S_MUTE | | 306 | ctl &= ~(KIRKWOOD_PLAYCTL_PAUSE | KIRKWOOD_PLAYCTL_I2S_MUTE | |
298 | KIRKWOOD_PLAYCTL_SPDIF_MUTE); | 307 | KIRKWOOD_PLAYCTL_SPDIF_MUTE); |
308 | ctl = kirkwood_i2s_play_mute(ctl); | ||
299 | writel(ctl, priv->io + KIRKWOOD_PLAYCTL); | 309 | writel(ctl, priv->io + KIRKWOOD_PLAYCTL); |
300 | break; | 310 | break; |
301 | 311 | ||