From patchwork Tue Jan 10 20:25:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luka Guzenko X-Patchwork-Id: 13095648 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 EA444C54EBC for ; Tue, 10 Jan 2023 20:26:43 +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 CEF657F73; Tue, 10 Jan 2023 21:25:50 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CEF657F73 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1673382400; bh=MEejYbw8dcDa3DUGUZRzzPL8AkL59tjy8R6jRGsfjOY=; h=From:To:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=OfG6cbGy+IDGyaUa30mfa6p5goDuj0F7Ap4qAXFC6dnSc4mdocceiQc5g3yz/4YlJ PzEBRVUTVwuFpnac1VLxNEb8MPu4f6xGKrse7KZDGm4TuLw1jxvsxf3mI0uESSNGwU zV3ktgKBOPpg2LkaDaFUiuh2A2wCFzaf3Yvwgk9o= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8802DF804BD; Tue, 10 Jan 2023 21:25:50 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id ADD9FF804C1; Tue, 10 Jan 2023 21:25:48 +0100 (CET) Received: from mout.web.de (mout.web.de [212.227.15.3]) (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 AF382F8019B for ; Tue, 10 Jan 2023 21:25:44 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AF382F8019B 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=EUhpdUXY DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1673382343; bh=MEejYbw8dcDa3DUGUZRzzPL8AkL59tjy8R6jRGsfjOY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=EUhpdUXYDazSY+d+DIKtCqy+wnMJ4gNOh1emncoOsx8/B+KBabBVClaxt23kkLnIg b1kE9FdIwHcVQO2xDQ33ZKLmbozQs8IqPs/BrX7KkCxL1IAjwiIsi73Kq/HUggsKxO Kb0IZQFz5P5aUNyu1vd6cq+yqptDYNg7YsadJXD+rurmMQv/SQI/tV+jR/tpb/aqLa r4zY03204gEtGiqEaSUgoDUJePoBPsfijK92lVE0zeDyJdJJJnJ7z3MgMKaAlu6rqN 5sq6kh/33qnX2OHMzE4vLjTEoNI3M++5ZxYmXYG7aCOhJWbztyupMvXgalXNMOL8e3 OAr8Rz8FEU0cw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from luka-spectre.fritz.box ([93.129.44.167]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MVJRb-1pNHnc0G4l-00SRYv; Tue, 10 Jan 2023 21:25:43 +0100 From: Luka Guzenko To: tiwai@suse.com Subject: [PATCH v2] ALSA: hda/realtek: Enable mute/micmute LEDs on HP Spectre x360 13-aw0xxx Date: Tue, 10 Jan 2023 21:25:14 +0100 Message-Id: <20230110202514.2792-1-l.guzenko@web.de> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:/szKTTJvCAPwW11ClrWP49WM+KH1T+Wcs9r+r+84lKyxX0LdTXO 90IyXQGm0GYJeqnkDxdxpxozHnsD7+xNQzqndUF01e/WtN/qjDpbEAwESEOOW32GCcXUTeV 31cOopdhgcwya7/U4cSjqR2YcML2grX5HXcMO0Kxqp5xXW2fEH4KP9iNcV2W0RP+qeozqrw 4yhGmPQnD4ami7787DqnQ== UI-OutboundReport: notjunk:1;M01:P0:r4LwyxPvEaU=;WOmxJuurha2cxYvUQGQnyWuEmyK QuHDXk2NstbLqJdFrPHZBoW/xdpyhdMmJwNMRDpYlWTX0E8pSM+AI/in6YwdeIzeB0aLk/LO5 hayymnhDDF1G5PFJSTqiLobVt8zSCf0YGv8L8lvlx7761Hd89LNmpayQXFh+X+N7z6sLf1Ds7 hGHuFG5mAnrr3fO4zm2Fje/Pl+YloryxmK3nyv+JxnmBJB6RCS4KjNyVqkUBa0MAf3Y9PwfEq eULxkA1LaCmCGoWTyKEuH2douqptTreo+bVJj5bsTUcrQqWTHISU4ALZdwZa455+bDir+/oOK Ro1C6vOsRNHliwJlAUramQ+usvXSKNCtf16AI3EFDNA+k/R5AmwQi1iSbYabHZRT11V0x3nd3 5rXr0+fJ5F1bQTZmTj65eVtf1WY2sls1v/A/Ty8cCT3qWvWSK26Dxi9OQkYybZIvGyWFsxi4R do097hl3p47GUrdD3yWTrFN4eXsD2GtL//6TA88Qs6pB3RZJuc+m5nX8cDlncyiRyJUUU8cef AZCiSSztMETX9s5inKm1h6TuohsUSAeysPW7trCjFQXq5/pwgSzYPrdRIYdroHVDLdfApry/T ctkiAvbRYLBqpUk7jksXPqfAN7wpgWqhU3NGl6t/RHXwp9fCOd7JUseylcGZz1nK6aYfbsNoA cwSYMDwnfI3oz4IaIy6GFRLPswF8Be2KfAa+BHUe88CBsIFHbEHXq4SvWBO6XGlQui3KbiwQB TsrzOOs4+xRW4dVBrdxvx1eRuml3D+7nS2BBDaLKbkrj7gJAuG6ODS4sO2kJzmYVIJ0aYu0hI F+70opmPkJ4mup3mX8E4QCCwvhOSV8/r/lTeSdPmJVHF93XVFabvx3ywTmhCGtbmyR378Tp+O s6r1O5q3Qy8mgLTXbYhGie2I1vwAolyfRXbM8y609tjElCiF8XVAJhlvN66T286+fguAn1PwY l3GDOg== 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. Signed-off-by: Luka Guzenko --- V1 -> V2: Inverted the conditional statement in alc285_fixup_hp_gpio_micmute_led as suggested by Takashi Iwai 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..dc4b07a0c240 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),