From patchwork Mon Jan 9 23:58:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luka Guzenko X-Patchwork-Id: 13094815 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 42B75C46467 for ; Tue, 10 Jan 2023 08:37:40 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0F9909EC0; Tue, 10 Jan 2023 09:36:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0F9909EC0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1673339858; bh=FMcjA51wpzoraSDLjxsaLpmF0naPwUP70E0dsefK2kE=; h=From:To:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=P+uHX6WiW1O90TJBTUVaEfANrsWPkbnsmTg3nxyfDUyjvHZfdy47nGqBkFWdBE9Ro EUj0fwzOADIH+A78PWm1u3YRf3Le6BekGrGYCKQHvonsCkkQiI8xwuiQ+GBKvQQIxq K57Hllvhb8CSiAx2R9nnA0uhhoYGEMOKobk/qfXA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6A879F805BF; Tue, 10 Jan 2023 09:32:48 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B78FDF802BE; Tue, 10 Jan 2023 00:59:07 +0100 (CET) Received: from mout.web.de (mout.web.de [212.227.15.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 52E63F800C7 for ; Tue, 10 Jan 2023 00:59:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 52E63F800C7 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, secure) header.d=web.de header.i=@web.de header.a=rsa-sha256 header.s=s29768273 header.b=NbrIC3v4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1673308738; bh=FMcjA51wpzoraSDLjxsaLpmF0naPwUP70E0dsefK2kE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=NbrIC3v4a9JK1+VGa/iF+OJMNNgwwbr5/9+6WqgaTSYBnndWJ1QraPOFr/KNPucw8 WSqa6XlXlQfJ/Ozs2j0YXBWn43rpSeUVtotji1s3bVcvvvg91wvH1PdHoZEoDO3YoQ UBJ/QiBjEefElAcJuLUYfWHRVEXZOWrrdxNOEtQ+NLcjze47U69VnleNzn9qcy496c kTQmSQ1y48qinlUfm98mQGGh2Kzd1D9oO1Xy1Mr4cHg0vF1qFDRGl3Q5rh0J7HUI8b lTkHDMuvUg4vLcHPxtSxBhFILeNHBjtRY1EARUnXjNayua7CwALxfpPB4DzquYMxwn 9WJ3hWfwHmLVg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from luka-spectre.fritz.box ([77.180.184.175]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MxYXF-1or3992FVh-00xcIG; Tue, 10 Jan 2023 00:58:58 +0100 From: Luka Guzenko To: tiwai@suse.com Subject: [PATCH] ALSA: hda/realtek: Enable mute/micmute LEDs on HP Spectre x360 13-aw0xxx Date: Tue, 10 Jan 2023 00:58:40 +0100 Message-Id: <20230109235840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YHd1GdEx9Kg LJHfmC3+xSx5x3B1L9wBYxfmFvu8LW1l6Y2SED9dGb2d8FzrTkrolmj4M/t1dsHKmlWcKW78R Cj5qx2u8SUKE6adH1Wa6ioHGto8ub1f/BajikPw3doz7gY0UFPB8zxPhojIvFMCbuLM/txjyH 2IEmsAKp802hXHbdjOkpr2P799t4jSXWf0ygJgdAaahktYlDIW0NHKpMnZvHwze2BNo5/xoR6 /dpydtvozCZ2VYXchV9ykvLq9ZQ= X-Mailman-Approved-At: Tue, 10 Jan 2023 09:32:36 +0100 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Luka Guzenko , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The HP Spectre x360 13-aw0xxx devices use the ALC285 codec with GPIO 0x04 controlling the micmute LED and COEF 0x0b index 8 controlling the mute LED. A quirk was added to make these work as well as a fixup entry. Signed-off-by: Luka Guzenko --- sound/pci/hda/patch_realtek.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) -- 2.39.0 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 3794b522c222..6a76a2eddd3c 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -4644,6 +4644,16 @@ static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec, } } +static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec, + const struct hda_fixup *fix, int action) +{ + struct alc_spec *spec = codec->spec; + + if (action != HDA_FIXUP_ACT_PRE_PROBE) + spec->micmute_led_polarity = 1; + alc_fixup_hp_gpio_led(codec, action, 0, 0x04); +} + static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec, const struct hda_fixup *fix, int action) { @@ -4665,6 +4675,13 @@ static void alc285_fixup_hp_mute_led(struct hda_codec *codec, alc285_fixup_hp_coef_micmute_led(codec, fix, action); } +static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec, + const struct hda_fixup *fix, int action) +{ + alc285_fixup_hp_mute_led_coefbit(codec, fix, action); + alc285_fixup_hp_gpio_micmute_led(codec, fix, action); +} + static void alc236_fixup_hp_mute_led(struct hda_codec *codec, const struct hda_fixup *fix, int action) { @@ -7106,6 +7123,7 @@ enum { ALC285_FIXUP_ASUS_G533Z_PINS, ALC285_FIXUP_HP_GPIO_LED, ALC285_FIXUP_HP_MUTE_LED, + ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED, ALC236_FIXUP_HP_GPIO_LED, ALC236_FIXUP_HP_MUTE_LED, ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, @@ -8486,6 +8504,10 @@ static const struct hda_fixup alc269_fixups[] = { .type = HDA_FIXUP_FUNC, .v.func = alc285_fixup_hp_mute_led, }, + [ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc285_fixup_hp_spectre_x360_mute_led, + }, [ALC236_FIXUP_HP_GPIO_LED] = { .type = HDA_FIXUP_FUNC, .v.func = alc236_fixup_hp_gpio_led, @@ -9327,6 +9349,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO), SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), + SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED), SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),