aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBard Liao <bardliao@realtek.com>2018-03-19 06:07:29 -0400
committerMark Brown <broonie@kernel.org>2018-03-19 21:02:21 -0400
commit40d2677bdadbd221f3e398877586a30d8065140c (patch)
tree454d9f03dd73dec33592039c0a5aa14932537d4a
parent7928b2cbe55b2a410a0f5c1f154610059c57b1b2 (diff)
ASoC: rt298: don't turn off HV and VREF if headset is detected
"HV" and "VREF" will be powered up when jack type detection process is started and will be powered off when jack type detection process is finished. It will generate an unexpected interrupt signal when they are powered up during the capture process. Codec driver will do the jack type detection process and we can't capture properly before the jack detection process is finished. This patch will not power off the "HV" and "VREF" widgets if headset is detected and it will solve the unexpected interrupt issue. As a result, it will also solve the silence data captured at the beginning in headset mic recording issue. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/rt298.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c
index ce963768449f..ff52d0365cfa 100644
--- a/sound/soc/codecs/rt298.c
+++ b/sound/soc/codecs/rt298.c
@@ -290,9 +290,10 @@ static int rt298_jack_detect(struct rt298_priv *rt298, bool *hp, bool *mic)
290 regmap_read(rt298->regmap, RT298_GET_MIC1_SENSE, &buf); 290 regmap_read(rt298->regmap, RT298_GET_MIC1_SENSE, &buf);
291 *mic = buf & 0x80000000; 291 *mic = buf & 0x80000000;
292 } 292 }
293 293 if (!*mic) {
294 snd_soc_dapm_disable_pin(dapm, "HV"); 294 snd_soc_dapm_disable_pin(dapm, "HV");
295 snd_soc_dapm_disable_pin(dapm, "VREF"); 295 snd_soc_dapm_disable_pin(dapm, "VREF");
296 }
296 if (!*hp) 297 if (!*hp)
297 snd_soc_dapm_disable_pin(dapm, "LDO1"); 298 snd_soc_dapm_disable_pin(dapm, "LDO1");
298 snd_soc_dapm_sync(dapm); 299 snd_soc_dapm_sync(dapm);