* [PATCH] ALSA: hda/conexant: Simplify headset plugin type handling
@ 2026-08-20 7:37 Zhang Heng
2026-08-20 8:56 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Zhang Heng @ 2026-08-20 7:37 UTC (permalink / raw)
To: tiwai; +Cc: linux-sound, linux-kernel, Zhang Heng
Both the CTIA and OMTP branches of cx_process_headset_plugin() write the
same value to the headset-mic pin, differing only in the debug message.
Merge the two branches into a single one, leaving the codec write
unchanged.
No functional change.
Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
---
sound/hda/codecs/conexant.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/sound/hda/codecs/conexant.c b/sound/hda/codecs/conexant.c
index c517334b56fd..8e950c796209 100644
--- a/sound/hda/codecs/conexant.c
+++ b/sound/hda/codecs/conexant.c
@@ -223,11 +223,9 @@ static void cx_process_headset_plugin(struct hda_codec *codec)
count++;
} while (count < 3);
val = snd_hda_codec_read(codec, 0x1c, 0, 0xcb0, 0x0);
- if (val & 0x800) {
- codec_dbg(codec, "headset plugin, type is CTIA\n");
- snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24);
- } else if (val & 0x400) {
- codec_dbg(codec, "headset plugin, type is OMTP\n");
+ if (val & 0xc00) {
+ codec_dbg(codec, "headset plugin, type is %s\n",
+ val & 0x800 ? "CTIA" : "OMTP");
snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24);
} else {
codec_dbg(codec, "headphone plugin\n");
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: hda/conexant: Simplify headset plugin type handling
2026-08-20 7:37 [PATCH] ALSA: hda/conexant: Simplify headset plugin type handling Zhang Heng
@ 2026-08-20 8:56 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2026-08-20 8:56 UTC (permalink / raw)
To: Zhang Heng; +Cc: tiwai, linux-sound, linux-kernel
On Thu, 20 Aug 2026 09:37:44 +0200,
Zhang Heng wrote:
>
> Both the CTIA and OMTP branches of cx_process_headset_plugin() write the
> same value to the headset-mic pin, differing only in the debug message.
> Merge the two branches into a single one, leaving the codec write
> unchanged.
>
> No functional change.
>
> Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
Applied now. Thanks.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-20 8:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20 7:37 [PATCH] ALSA: hda/conexant: Simplify headset plugin type handling Zhang Heng
2026-08-20 8:56 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox