diff options
author | Liam Girdwood <liam.r.girdwood@linux.intel.com> | 2014-05-16 09:55:23 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-05-16 14:59:25 -0400 |
commit | 541423dde415e9cecdb0bf17657b3bd7e1666dd2 (patch) | |
tree | 4fa1280a5afb4024f71e719a8b66208ebdbf6954 | |
parent | 70f29d388915723ce03eee74a649f170e4c9f1e0 (diff) |
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: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/codecs/max98090.c | 8 | ||||
-rw-r--r-- | sound/soc/codecs/max98090.h | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index aba6ed24c82e..d36cd154db55 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c | |||
@@ -1674,6 +1674,7 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai, | |||
1674 | M98090_REG_CLOCK_RATIO_NI_LSB, 0x00); | 1674 | M98090_REG_CLOCK_RATIO_NI_LSB, 0x00); |
1675 | snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE, | 1675 | snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE, |
1676 | M98090_USE_M1_MASK, 0); | 1676 | M98090_USE_M1_MASK, 0); |
1677 | max98090->master = false; | ||
1677 | break; | 1678 | break; |
1678 | case SND_SOC_DAIFMT_CBM_CFM: | 1679 | case SND_SOC_DAIFMT_CBM_CFM: |
1679 | /* Set to master mode */ | 1680 | /* Set to master mode */ |
@@ -1690,6 +1691,7 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai, | |||
1690 | regval |= M98090_MAS_MASK | | 1691 | regval |= M98090_MAS_MASK | |
1691 | M98090_BSEL_32; | 1692 | M98090_BSEL_32; |
1692 | } | 1693 | } |
1694 | max98090->master = true; | ||
1693 | break; | 1695 | break; |
1694 | case SND_SOC_DAIFMT_CBS_CFM: | 1696 | case SND_SOC_DAIFMT_CBS_CFM: |
1695 | case SND_SOC_DAIFMT_CBM_CFS: | 1697 | case SND_SOC_DAIFMT_CBM_CFS: |
@@ -1873,7 +1875,8 @@ static int max98090_dai_hw_params(struct snd_pcm_substream *substream, | |||
1873 | return -EINVAL; | 1875 | return -EINVAL; |
1874 | } | 1876 | } |
1875 | 1877 | ||
1876 | max98090_configure_bclk(codec); | 1878 | if (max98090->master) |
1879 | max98090_configure_bclk(codec); | ||
1877 | 1880 | ||
1878 | cdata->rate = max98090->lrclk; | 1881 | cdata->rate = max98090->lrclk; |
1879 | 1882 | ||
@@ -1952,8 +1955,6 @@ static int max98090_dai_set_sysclk(struct snd_soc_dai *dai, | |||
1952 | 1955 | ||
1953 | max98090->sysclk = freq; | 1956 | max98090->sysclk = freq; |
1954 | 1957 | ||
1955 | max98090_configure_bclk(codec); | ||
1956 | |||
1957 | return 0; | 1958 | return 0; |
1958 | } | 1959 | } |
1959 | 1960 | ||
@@ -2225,6 +2226,7 @@ static int max98090_probe(struct snd_soc_codec *codec) | |||
2225 | /* Initialize private data */ | 2226 | /* Initialize private data */ |
2226 | 2227 | ||
2227 | max98090->sysclk = (unsigned)-1; | 2228 | max98090->sysclk = (unsigned)-1; |
2229 | max98090->master = false; | ||
2228 | 2230 | ||
2229 | cdata = &max98090->dai[0]; | 2231 | cdata = &max98090->dai[0]; |
2230 | cdata->rate = (unsigned)-1; | 2232 | cdata->rate = (unsigned)-1; |
diff --git a/sound/soc/codecs/max98090.h b/sound/soc/codecs/max98090.h index 1a4e2334a7b2..5a3c8d0613cb 100644 --- a/sound/soc/codecs/max98090.h +++ b/sound/soc/codecs/max98090.h | |||
@@ -1540,6 +1540,7 @@ struct max98090_priv { | |||
1540 | unsigned int pa2en; | 1540 | unsigned int pa2en; |
1541 | unsigned int extmic_mux; | 1541 | unsigned int extmic_mux; |
1542 | unsigned int sidetone; | 1542 | unsigned int sidetone; |
1543 | bool master; | ||
1543 | }; | 1544 | }; |
1544 | 1545 | ||
1545 | int max98090_mic_detect(struct snd_soc_codec *codec, | 1546 | int max98090_mic_detect(struct snd_soc_codec *codec, |