aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMac Chiang <mac.chiang@intel.com>2018-05-31 13:18:32 -0400
committerMark Brown <broonie@kernel.org>2018-06-01 06:27:30 -0400
commit56c3a95385df558a471f7fcedba73c9ed836a906 (patch)
tree842ad860d7c12924a104b41b8a3ec65fe165ddc4
parente9be4ffd4f40fcb18209dc5120233f2d11a24b6a (diff)
ASoC: Intel: kbl: Move codec sysclk config to codec_init function
On APL, commit fd0f237572ad ("ASoC: Intel: bxt: Move codec sysclk config to codec_init function") fixed an issue related to jack detection. The MCLK for DA7219 does not change in this platform, but is currently being configured everytime as part of the platform_clock event handler for DAPM. The upshot of this is that we have unnecessary calls to this function, and it also means that if a stream hasn't yet been started, DA7219 driver does not have the correct MCLK rates programmed and so the HP detection feature does not operate as expected. The same fix is needed on KBL. This patch rectifies this issue by moving the sysclk call to codec_init function so it's only called once at initialisation. Signed-off-by: Mac Chiang <mac.chiang@intel.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/intel/boards/kbl_da7219_max98357a.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sound/soc/intel/boards/kbl_da7219_max98357a.c b/sound/soc/intel/boards/kbl_da7219_max98357a.c
index 60e739f3d6f3..94294c27d1db 100644
--- a/sound/soc/intel/boards/kbl_da7219_max98357a.c
+++ b/sound/soc/intel/boards/kbl_da7219_max98357a.c
@@ -65,14 +65,6 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w,
65 return -EIO; 65 return -EIO;
66 } 66 }
67 67
68 /* Configure sysclk for codec */
69 ret = snd_soc_dai_set_sysclk(codec_dai, DA7219_CLKSRC_MCLK, 24576000,
70 SND_SOC_CLOCK_IN);
71 if (ret) {
72 dev_err(card->dev, "can't set codec sysclk configuration\n");
73 return ret;
74 }
75
76 if (SND_SOC_DAPM_EVENT_OFF(event)) { 68 if (SND_SOC_DAPM_EVENT_OFF(event)) {
77 ret = snd_soc_dai_set_pll(codec_dai, 0, 69 ret = snd_soc_dai_set_pll(codec_dai, 0,
78 DA7219_SYSCLK_MCLK, 0, 0); 70 DA7219_SYSCLK_MCLK, 0, 0);
@@ -169,9 +161,18 @@ static int kabylake_da7219_codec_init(struct snd_soc_pcm_runtime *rtd)
169{ 161{
170 struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(rtd->card); 162 struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(rtd->card);
171 struct snd_soc_component *component = rtd->codec_dai->component; 163 struct snd_soc_component *component = rtd->codec_dai->component;
164 struct snd_soc_dai *codec_dai = rtd->codec_dai;
172 struct snd_soc_jack *jack; 165 struct snd_soc_jack *jack;
173 int ret; 166 int ret;
174 167
168 /* Configure sysclk for codec */
169 ret = snd_soc_dai_set_sysclk(codec_dai, DA7219_CLKSRC_MCLK, 24576000,
170 SND_SOC_CLOCK_IN);
171 if (ret) {
172 dev_err(rtd->dev, "can't set codec sysclk configuration\n");
173 return ret;
174 }
175
175 /* 176 /*
176 * Headset buttons map to the google Reference headset. 177 * Headset buttons map to the google Reference headset.
177 * These can be configured by userspace. 178 * These can be configured by userspace.