提交 541423dd 编写于 作者: L Liam Girdwood 提交者: Mark Brown

ASoC: max98090: Make sure we configure BCLK in one place

BCL is being configured in two places producing a warning message.
Make sure we only configure BCLK once and when we are master.
Signed-off-by: NLiam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 70f29d38
...@@ -1674,6 +1674,7 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai, ...@@ -1674,6 +1674,7 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai,
M98090_REG_CLOCK_RATIO_NI_LSB, 0x00); M98090_REG_CLOCK_RATIO_NI_LSB, 0x00);
snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE, snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE,
M98090_USE_M1_MASK, 0); M98090_USE_M1_MASK, 0);
max98090->master = false;
break; break;
case SND_SOC_DAIFMT_CBM_CFM: case SND_SOC_DAIFMT_CBM_CFM:
/* Set to master mode */ /* Set to master mode */
...@@ -1690,6 +1691,7 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai, ...@@ -1690,6 +1691,7 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai,
regval |= M98090_MAS_MASK | regval |= M98090_MAS_MASK |
M98090_BSEL_32; M98090_BSEL_32;
} }
max98090->master = true;
break; break;
case SND_SOC_DAIFMT_CBS_CFM: case SND_SOC_DAIFMT_CBS_CFM:
case SND_SOC_DAIFMT_CBM_CFS: case SND_SOC_DAIFMT_CBM_CFS:
...@@ -1873,7 +1875,8 @@ static int max98090_dai_hw_params(struct snd_pcm_substream *substream, ...@@ -1873,7 +1875,8 @@ static int max98090_dai_hw_params(struct snd_pcm_substream *substream,
return -EINVAL; return -EINVAL;
} }
max98090_configure_bclk(codec); if (max98090->master)
max98090_configure_bclk(codec);
cdata->rate = max98090->lrclk; cdata->rate = max98090->lrclk;
...@@ -1952,8 +1955,6 @@ static int max98090_dai_set_sysclk(struct snd_soc_dai *dai, ...@@ -1952,8 +1955,6 @@ static int max98090_dai_set_sysclk(struct snd_soc_dai *dai,
max98090->sysclk = freq; max98090->sysclk = freq;
max98090_configure_bclk(codec);
return 0; return 0;
} }
...@@ -2225,6 +2226,7 @@ static int max98090_probe(struct snd_soc_codec *codec) ...@@ -2225,6 +2226,7 @@ static int max98090_probe(struct snd_soc_codec *codec)
/* Initialize private data */ /* Initialize private data */
max98090->sysclk = (unsigned)-1; max98090->sysclk = (unsigned)-1;
max98090->master = false;
cdata = &max98090->dai[0]; cdata = &max98090->dai[0];
cdata->rate = (unsigned)-1; cdata->rate = (unsigned)-1;
......
...@@ -1540,6 +1540,7 @@ struct max98090_priv { ...@@ -1540,6 +1540,7 @@ struct max98090_priv {
unsigned int pa2en; unsigned int pa2en;
unsigned int extmic_mux; unsigned int extmic_mux;
unsigned int sidetone; unsigned int sidetone;
bool master;
}; };
int max98090_mic_detect(struct snd_soc_codec *codec, int max98090_mic_detect(struct snd_soc_codec *codec,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册