linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda: Skip creating captures in SOF context
@ 2022-07-19 14:47 Kai-Heng Feng
  2022-07-19 15:41 ` Jaroslav Kysela
  0 siblings, 1 reply; 10+ messages in thread
From: Kai-Heng Feng @ 2022-07-19 14:47 UTC (permalink / raw)
  To: tiwai
  Cc: Kai-Heng Feng, Jaroslav Kysela, Bard Liao, Pierre-Louis Bossart,
	alsa-devel, linux-kernel

On HP laptops that use SOF driver for DMIC, the micmute LED doesn't
light up when mic is muted after commit 9b014266ef8a ("ASoC: SOF:
topology: use new sound control LED layer").

The micmute LED itself is still working via sysfs, but it doesn't follow
mute anymore. That's because unlike vendors like Dell and Lenovo, HP
laptops use HDA codec to control mute LEDs instead of ACPI. So on HP
laptops, both SOF and HDA create captures with
SNDRV_CTL_ELEM_ACCESS_MIC_LED access, snd_ctl_led_set_state() considers
there are two different kcontrols and one of them is not muted.

So skip creating captures for HDA when it's called from SOF, the
captures are already handled by SOF.

Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 sound/pci/hda/hda_generic.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index fc114e5224806..2a6c1a77c49ac 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -5075,10 +5075,14 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec,
 			return err;
 	}
 
-
-	err = create_capture_mixers(codec);
-	if (err < 0)
-		return err;
+	/* Skip creating capture on SOF which creates captures based on
+	 * topology file.
+	 */
+	if (codec->core.type != HDA_DEV_ASOC) {
+		err = create_capture_mixers(codec);
+		if (err < 0)
+			return err;
+	}
 
 	err = parse_mic_boost(codec);
 	if (err < 0)
-- 
2.36.1


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

end of thread, other threads:[~2023-01-06  5:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19 14:47 [PATCH] ALSA: hda: Skip creating captures in SOF context Kai-Heng Feng
2022-07-19 15:41 ` Jaroslav Kysela
2022-07-20  1:45   ` Kai-Heng Feng
2022-07-20  6:29     ` Takashi Iwai
2022-07-20  7:52     ` Jaroslav Kysela
2022-07-20 13:31       ` Pierre-Louis Bossart
2022-08-15  7:55         ` Kai-Heng Feng
2023-01-05 12:36           ` Kai-Heng Feng
2023-01-05 12:43             ` Jaroslav Kysela
2023-01-06  5:00               ` Kai-Heng Feng

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).