From: Bard Liao <bardliao@realtek.com>
To: broonie@kernel.org, lgirdwood@gmail.com
Cc: oder_chiou@realtek.com, jack.yu@realtek.com,
alsa-devel@alsa-project.org, lars@metafoo.de,
puneethx.prabhu@intel.com, shumingf@realtek.com,
Bard Liao <bardliao@realtek.com>,
flove@realtek.com
Subject: [PATCH] ASoC: rt286: don't turn off HV and VREF if headset is detected
Date: Mon, 19 Mar 2018 18:07:12 +0800 [thread overview]
Message-ID: <1521454032-32387-1-git-send-email-bardliao@realtek.com> (raw)
"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/rt286.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c
index e164357..0b0f748 100644
--- a/sound/soc/codecs/rt286.c
+++ b/sound/soc/codecs/rt286.c
@@ -275,9 +275,10 @@ static int rt286_jack_detect(struct rt286_priv *rt286, bool *hp, bool *mic)
regmap_read(rt286->regmap, RT286_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
next reply other threads:[~2018-03-19 10:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-19 10:07 Bard Liao [this message]
2018-03-20 1:06 ` Applied "ASoC: rt286: don't turn off HV and VREF if headset is detected" to the asoc tree Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1521454032-32387-1-git-send-email-bardliao@realtek.com \
--to=bardliao@realtek.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=flove@realtek.com \
--cc=jack.yu@realtek.com \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=oder_chiou@realtek.com \
--cc=puneethx.prabhu@intel.com \
--cc=shumingf@realtek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).