From: Oder Chiou <oder_chiou@realtek.com>
To: <broonie@kernel.org>, <lgirdwood@gmail.com>
Cc: Oder Chiou <oder_chiou@realtek.com>,
jack.yu@realtek.com, alsa-devel@alsa-project.org,
cychiang@google.com, albertchen@realtek.com,
derek.fang@realtek.com, shumingf@realtek.com, flove@realtek.com
Subject: [PATCH] ASoC: rt5682: Report the button event in the headset type only
Date: Thu, 16 Jul 2020 11:01:23 +0800 [thread overview]
Message-ID: <20200716030123.27122-1-oder_chiou@realtek.com> (raw)
The irq work will be manipulated by resume function, and it will report
the wrong jack type while the jack type is headphone in the button event.
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
---
sound/soc/codecs/rt5682.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
index b634e582ef7e..d7302f968a75 100644
--- a/sound/soc/codecs/rt5682.c
+++ b/sound/soc/codecs/rt5682.c
@@ -1082,7 +1082,8 @@ void rt5682_jack_detect_handler(struct work_struct *work)
/* jack was out, report jack type */
rt5682->jack_type =
rt5682_headset_detect(rt5682->component, 1);
- } else {
+ } else if ((rt5682->jack_type & SND_JACK_HEADSET) ==
+ SND_JACK_HEADSET) {
/* jack is already in, report button event */
rt5682->jack_type = SND_JACK_HEADSET;
btn_type = rt5682_button_detect(rt5682->component);
--
2.27.0
next reply other threads:[~2020-07-16 4:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-16 3:01 Oder Chiou [this message]
2020-07-16 23:57 ` [PATCH] ASoC: rt5682: Report the button event in the headset type only 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=20200716030123.27122-1-oder_chiou@realtek.com \
--to=oder_chiou@realtek.com \
--cc=albertchen@realtek.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=cychiang@google.com \
--cc=derek.fang@realtek.com \
--cc=flove@realtek.com \
--cc=jack.yu@realtek.com \
--cc=lgirdwood@gmail.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 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.