From nobody Sat Apr 18 02:47:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97EC9C43334 for ; Tue, 19 Jul 2022 14:48:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238752AbiGSOsr (ORCPT ); Tue, 19 Jul 2022 10:48:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235040AbiGSOsp (ORCPT ); Tue, 19 Jul 2022 10:48:45 -0400 Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82BBCEAC for ; Tue, 19 Jul 2022 07:48:44 -0700 (PDT) Received: from localhost.localdomain (unknown [10.101.196.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 600193F3BD; Tue, 19 Jul 2022 14:48:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1658242122; bh=AvYcZcToBAAnfmFM45alM5FvVGJ3gSm105Dq6wUqcmw=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=M4LBTZOIWTCzLkUwctVzsSbya8Nmf+Nic/k9snJH1tKr8hXrbajBgCf4e/GDxL2BZ YQdiyZ6ce2YAY9N9ToM5sWMqPsfXP93sDzGImIP+u4erSCxL/evPkfO9UHGfPfnm08 9vJc9C93fZHH9SW2oCoT+XitJVQRnI9s9n+bYwHx5iz1Pm9kDxYqV2teZmygxf7389 z7bmtF/hum06CSaqay9jFHFBIOiCK+hsAFKE7xGC8IUs4YRYbfN363mwYus/5q52zI w8MZRXbI9vti0BJ+nojXYWRfcti5II6ws4mlLIEUpZP8vUbeljxSPfL+z8dwHD4kjH Xqz3AOh8ahnpA== From: Kai-Heng Feng To: tiwai@suse.com Cc: Kai-Heng Feng , Jaroslav Kysela , Bard Liao , Pierre-Louis Bossart , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] ALSA: hda: Skip creating captures in SOF context Date: Tue, 19 Jul 2022 22:47:52 +0800 Message-Id: <20220719144753.252231-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Cc: Bard Liao Cc: Pierre-Louis Bossart Signed-off-by: Kai-Heng Feng --- 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; } =20 - - err =3D 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 !=3D HDA_DEV_ASOC) { + err =3D create_capture_mixers(codec); + if (err < 0) + return err; + } =20 err =3D parse_mic_boost(codec); if (err < 0) --=20 2.36.1