diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-05 07:17:47 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-13 20:03:17 +0100 |
commit | 76bf969e6f86e5de788dd943ff2d4340bac71822 (patch) | |
tree | 86290cb8b9d9958d66b1178cd19d9d9f20e363b5 /sound/soc/codecs/arizona.c | |
parent | ASoC: arizona: Provide defines for the clock rates (diff) | |
download | linux-76bf969e6f86e5de788dd943ff2d4340bac71822.tar.xz linux-76bf969e6f86e5de788dd943ff2d4340bac71822.zip |
ASoC: arizona: Ensure we clock two channels for I2S mode
I2S requires stereo clocking even for mono data.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/arizona.c')
-rw-r--r-- | sound/soc/codecs/arizona.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index 0c70d503fd32..2b0803ec8234 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c @@ -818,7 +818,7 @@ static int arizona_hw_params(struct snd_pcm_substream *substream, struct arizona *arizona = priv->arizona; int base = dai->driver->base; const int *rates; - int i, ret; + int i, ret, val; int chan_limit = arizona->pdata.max_channels_clocked[dai->id - 1]; int bclk, lrclk, wl, frame, bclk_target; @@ -834,6 +834,13 @@ static int arizona_hw_params(struct snd_pcm_substream *substream, bclk_target *= chan_limit; } + /* Force stereo for I2S mode */ + val = snd_soc_read(codec, base + ARIZONA_AIF_FORMAT); + if (params_channels(params) == 1 && (val & ARIZONA_AIF1_FMT_MASK)) { + arizona_aif_dbg(dai, "Forcing stereo mode\n"); + bclk_target *= 2; + } + for (i = 0; i < ARRAY_SIZE(arizona_44k1_bclk_rates); i++) { if (rates[i] >= bclk_target && rates[i] % params_rate(params) == 0) { |