The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda/conexant: Fix microphone mute after power-on reboot
@ 2026-07-01  6:55 dengxiang
  2026-07-01  7:37 ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: dengxiang @ 2026-07-01  6:55 UTC (permalink / raw)
  To: tiwai, bo.liu; +Cc: linux-sound, linux-kernel, alsa-devel, dengxiang

Some devices have mute settings in their firmware set by the factory.
This is to stop popping noise when the devices turn on. But this setting
makes the microphones unable to record sound properly. This patch
solves this problem and is compatible with conexant chips.

Signed-off-by: dengxiang <os_dengxiang82@126.com>
---
 sound/hda/codecs/conexant.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/sound/hda/codecs/conexant.c b/sound/hda/codecs/conexant.c
index 3d92262763f6..3229f9ef5969 100644
--- a/sound/hda/codecs/conexant.c
+++ b/sound/hda/codecs/conexant.c
@@ -1184,6 +1184,24 @@ static void add_cx5051_fake_mutes(struct hda_codec *codec)
 	spec->gen.dac_min_mute = true;
 }
 
+static void cxt_fixed_mic_boost(struct hda_codec *codec, hda_nid_t node_id)
+{
+	struct conexant_spec *spec = codec->spec;
+	unsigned int value = 0;
+
+	value = snd_hda_codec_read(codec, node_id, 0, AC_VERB_GET_AMP_GAIN_MUTE, 0);
+	snd_hda_codec_amp_stereo(codec, node_id, HDA_INPUT, 0, HDA_AMP_VOLMASK, value);
+}
+
+static void cxt_capture_hook(struct hda_pcm_stream *hinfo,  struct hda_codec *codec,
+			       struct snd_pcm_substream *substream, int action)
+{
+	struct conexant_spec *spec = codec->spec;
+	hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
+
+	cxt_fixed_mic_boost(codec, mux_pin);
+}
+
 static int cx_probe(struct hda_codec *codec, const struct hda_device_id *id)
 {
 	struct conexant_spec *spec;
@@ -1271,6 +1289,9 @@ static int cx_probe(struct hda_codec *codec, const struct hda_device_id *id)
 	if (err < 0)
 		goto error;
 
+	if (spec->gen.pcm_capture_hook == NULL)
+		spec->gen.pcm_capture_hook = cxt_capture_hook;
+
 	/* Some laptops with Conexant chips show stalls in S3 resume,
 	 * which falls into the single-cmd mode.
 	 * Better to make reset, then.
-- 
2.39.5


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

end of thread, other threads:[~2026-07-01  8:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01  6:55 [PATCH] ALSA: hda/conexant: Fix microphone mute after power-on reboot dengxiang
2026-07-01  7:37 ` Takashi Iwai
     [not found]   ` <235d28fc.65dd.19f1cc1a68d.Coremail.os_dengxiang82@126.com>
2026-07-01  8:30     ` Takashi Iwai
     [not found]       ` <4932c551.6ece.19f1cdd10ba.Coremail.os_dengxiang82@126.com>
2026-07-01  8:50         ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox