[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220719144753.252231-1-kai.heng.feng@canonical.com>
Date: Tue, 19 Jul 2022 22:47:52 +0800
From: Kai-Heng Feng <kai.heng.feng@...onical.com>
To: tiwai@...e.com
Cc: Kai-Heng Feng <kai.heng.feng@...onical.com>,
Jaroslav Kysela <perex@...ex.cz>,
Bard Liao <yung-chuan.liao@...ux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: [PATCH] ALSA: hda: Skip creating captures in SOF context
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@...ex.cz>
Cc: Bard Liao <yung-chuan.liao@...ux.intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@...onical.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
Powered by blists - more mailing lists