Commit 76bf969e authored by Mark Brown's avatar Mark Brown

ASoC: arizona: Ensure we clock two channels for I2S mode

I2S requires stereo clocking even for mono data.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 3f341f74
...@@ -818,7 +818,7 @@ static int arizona_hw_params(struct snd_pcm_substream *substream, ...@@ -818,7 +818,7 @@ static int arizona_hw_params(struct snd_pcm_substream *substream,
struct arizona *arizona = priv->arizona; struct arizona *arizona = priv->arizona;
int base = dai->driver->base; int base = dai->driver->base;
const int *rates; const int *rates;
int i, ret; int i, ret, val;
int chan_limit = arizona->pdata.max_channels_clocked[dai->id - 1]; int chan_limit = arizona->pdata.max_channels_clocked[dai->id - 1];
int bclk, lrclk, wl, frame, bclk_target; int bclk, lrclk, wl, frame, bclk_target;
...@@ -834,6 +834,13 @@ static int arizona_hw_params(struct snd_pcm_substream *substream, ...@@ -834,6 +834,13 @@ static int arizona_hw_params(struct snd_pcm_substream *substream,
bclk_target *= chan_limit; 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++) { for (i = 0; i < ARRAY_SIZE(arizona_44k1_bclk_rates); i++) {
if (rates[i] >= bclk_target && if (rates[i] >= bclk_target &&
rates[i] % params_rate(params) == 0) { rates[i] % params_rate(params) == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment