All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: rt298: don't turn off HV and VREF if headset is detected
@ 2018-03-19 10:07 Bard Liao
  2018-03-20  1:06 ` Applied "ASoC: rt298: don't turn off HV and VREF if headset is detected" to the asoc tree Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Bard Liao @ 2018-03-19 10:07 UTC (permalink / raw)
  To: broonie, lgirdwood
  Cc: oder_chiou, jack.yu, alsa-devel, lars, puneethx.prabhu, shumingf,
	Bard Liao, flove

"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>
---
 sound/soc/codecs/rt298.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c
index 7bf4b31..06cdba4 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)
 		regmap_read(rt298->regmap, RT298_GET_MIC1_SENSE, &buf);
 		*mic = buf & 0x80000000;
 	}
-
-	snd_soc_dapm_disable_pin(dapm, "HV");
-	snd_soc_dapm_disable_pin(dapm, "VREF");
+	if (!*mic) {
+		snd_soc_dapm_disable_pin(dapm, "HV");
+		snd_soc_dapm_disable_pin(dapm, "VREF");
+	}
 	if (!*hp)
 		snd_soc_dapm_disable_pin(dapm, "LDO1");
 	snd_soc_dapm_sync(dapm);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Applied "ASoC: rt298: don't turn off HV and VREF if headset is detected" to the asoc tree
  2018-03-19 10:07 [PATCH] ASoC: rt298: don't turn off HV and VREF if headset is detected Bard Liao
@ 2018-03-20  1:06 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2018-03-20  1:06 UTC (permalink / raw)
  To: Bard Liao
  Cc: oder_chiou, jack.yu, alsa-devel, lars, lgirdwood,
	puneethx.prabhu, broonie, shumingf, flove

The patch

   ASoC: rt298: don't turn off HV and VREF if headset is detected

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 40d2677bdadbd221f3e398877586a30d8065140c Mon Sep 17 00:00:00 2001
From: Bard Liao <bardliao@realtek.com>
Date: Mon, 19 Mar 2018 18:07:29 +0800
Subject: [PATCH] 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>
---
 sound/soc/codecs/rt298.c | 7 ++++---
 1 file 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)
 		regmap_read(rt298->regmap, RT298_GET_MIC1_SENSE, &buf);
 		*mic = buf & 0x80000000;
 	}
-
-	snd_soc_dapm_disable_pin(dapm, "HV");
-	snd_soc_dapm_disable_pin(dapm, "VREF");
+	if (!*mic) {
+		snd_soc_dapm_disable_pin(dapm, "HV");
+		snd_soc_dapm_disable_pin(dapm, "VREF");
+	}
 	if (!*hp)
 		snd_soc_dapm_disable_pin(dapm, "LDO1");
 	snd_soc_dapm_sync(dapm);
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-20  1:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-19 10:07 [PATCH] ASoC: rt298: don't turn off HV and VREF if headset is detected Bard Liao
2018-03-20  1:06 ` Applied "ASoC: rt298: don't turn off HV and VREF if headset is detected" to the asoc tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.