From patchwork Tue Jul 18 16:12:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luka Guzenko X-Patchwork-Id: 13317434 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 57203EB64DC for ; Tue, 18 Jul 2023 16:15:19 +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 163391F6; Tue, 18 Jul 2023 18:14:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 163391F6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1689696917; bh=VjNdHOZe3GALSSGYevbzgHCx2G8OebZvwIUZOt1cIKo=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=reNkUFmzwh3FDz27L5hnyYxyhF8uqvUOvMKoLR3EiwG/Th7jWYpcc5ASA+/iVZqNs ZbXcKVMGC2ajwy/u3p0ThNJZxLfkvILWPOrY0liQ06wN4KM7+R5LxTD7lcOMrt0YpT L7vAlot/5pq7zjFie/YKZmwmNsjoied+jbrEgoOU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 50806F80520; Tue, 18 Jul 2023 18:14:00 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id C2D4AF8007E; Tue, 18 Jul 2023 18:13:59 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 18649F8032D; Tue, 18 Jul 2023 18:13:56 +0200 (CEST) Received: from mout.web.de (mout.web.de [212.227.17.12]) (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 35169F8007E for ; Tue, 18 Jul 2023 18:13:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 35169F8007E Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=web.de header.i=l.guzenko@web.de header.a=rsa-sha256 header.s=s29768273 header.b=QrnuwjkJ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1689696825; x=1690301625; i=l.guzenko@web.de; bh=VjNdHOZe3GALSSGYevbzgHCx2G8OebZvwIUZOt1cIKo=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=QrnuwjkJtZL9oKy6aTlPjqB+N92UpeRs0M9bz41oTRCyDUsWAEdlIe/OSDRbV0agG+Dcm3B TrsiLKYkiJVCTSrw9a4UtfDzmeFbcvN7Lt1aD56AxLPr8IXH7e6BkxoVe6CaxD2NMd+LNTKH7 22lpR5V+ytPZWFwz/W1ciX3lN2L0zaIg47jiUB35UwyoYpJE2NRrPaMZ62V8pzOo/KPhTQgIl 7+bZQiAqSNpashm8ag8DUqKgBSttuvmvpO9NP/C2598XmA5qMGkMcV4nVJakLLp7DvKBKdWao lutX5+VvJJxpc9TwBqFqxjOkfqZwVVfU0fE/WlHgHEn+KSjmz0Ig== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from localhost.localdomain ([77.182.132.112]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MNwjS-1qbEkD3G4u-00OSQN; Tue, 18 Jul 2023 18:13:45 +0200 From: Luka Guzenko To: tiwai@suse.com Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Luka Guzenko Subject: [PATCH] ALSA: hda/realtek: Enable Mute LED on HP Laptop 15s-eq2xxx Date: Tue, 18 Jul 2023 18:12:41 +0200 Message-ID: <20230718161241.393181-1-l.guzenko@web.de> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:DGklsXVs+hixHTI07SfvyepRZoxqPQu3mj/6ZVw59n5r+JYqcwN PHeG9uYF3ri+EsPs5HzC1mG/uFM9dJdZLc7U7fdT2TXJcd7+zFVhNKkSyD3OZNit/Pu6JRH FaoLQrJrSsOO+m1lkueCSGgJwlUOSuhoG5hMr09AzBeOTjqPAPXtigyrqprDt5t6wCieaWg I3zNkfl0lkchgG5yWIQuA== UI-OutboundReport: notjunk:1;M01:P0:XY1iF2gQqOA=;UDz1uFUaA/++FFpQaq3dQ6N1MSn Hda6CvHbZGKVUviVdd85Q6IuKfJ/3LK2oxzR13s+ANnmkby4vKkTgbo1S744oguJTxX+qc2lB zX1Nz4Dx/1L5+IcFosKgsDiRbeMJwyH8K60dFDPePLu6TXoKxJofKKf+STXQQZyFuOOhwyNWh yKeHAlHi/k+rwiubFiFnZpvpomxcpqfie3DCAMwYyDgE7gJ7shfJYOGI05176e/yDizSy/kos +Qy9Q/xtk5DZkNxorzjxlcK2Apu+bTuRCOsERHEj+lMrDvEBBY1EltvOFQgivlLEgsFOpZWnW iQRaO7iPEWE4GDYsfwwdFp1SFhHD1FhiIPAVZmi7i53IWdwppdb6xii/uaKGyTmNJofXLMxDK Vms95Vn33YJI0OYNFjiXWIZYnF+2NTOzYqBrXfMTZ49HoAR17f+yt5FVLjiVrFEqwH+xeJHMN wVpcIoJ/SbPBFCWIgIz9P0YH/OsYTE02EfSvYYsB47nfp8HOeZ1mhNcnUUNAURPBLua5iukno mai6m+Z2iOhSgucrJ0hdcRai/1UrGvPhgzHOkd44KtzcCeiqZK/0bHS918GM74jFcJSbdt/b+ VUDUGWG5gDjyKe8t0DIkaHOYJ2yoNm2J5erKritOleK3s7BM2C11n1FCWIkAFIsa8ZB9ArqsN XjZeC1FzoYGaRab3ghj6/6pyf6kWLTeHMFpk3OUZ1WnH3S8KonDcR/y9qbf9L+v62/EHNzTK+ OXGta7SVnunxzjQPyp0j8iJOZFq+JRqXJA7FUrobR+Htpf+ZD+Jk3tIEHZ5L77RIRciiewZTq Sv8MW1n8b3RAkdkf24s/Pn1wADoT71tBRT0pvPT0dYgcdpb6XlDHllkNQPONn0MvfymCfCxNa fl+MC98urgjbBz3UmP1PcU9zI+XXuT/qdfJrtDqsoe6BCY6LImBmJmkKtPcueZCeH0gIqBNIp Pv+1jpUjH6sT1JW+jV8I8LkgHHs= Message-ID-Hash: ZE2GIWJFD6INIW27TDI2DQBIZ776YZOX X-Message-ID-Hash: ZE2GIWJFD6INIW27TDI2DQBIZ776YZOX X-MailFrom: l.guzenko@web.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The HP Laptop 15s-eq2xxx uses ALC236 codec and controls the mute LED using COEF 0x07 index 1. No existing quirk covers this configuration. Adds a new quirk and enables it for the device. Signed-off-by: Luka Guzenko --- sound/pci/hda/patch_realtek.c | 23 ++++++++++++++++++++++- 1 file changed, 20 insertions(+) -- 2.41.0 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 308ec7034cc9..e8a836596bfb 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -4623,6 +4623,21 @@ static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec, } } +static void alc236_fixup_hp_mute_led_coefbit2(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->mute_led_polarity = 0; + spec->mute_led_coef.idx = 0x07; + spec->mute_led_coef.mask = 1; + spec->mute_led_coef.on = 1; + spec->mute_led_coef.off = 0; + snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); + } +} + /* turn on/off mic-mute LED per capture hook by coef bit */ static int coef_micmute_led_set(struct led_classdev *led_cdev, enum led_brightness brightness) @@ -7133,6 +7148,7 @@ enum { ALC285_FIXUP_HP_GPIO_LED, ALC285_FIXUP_HP_MUTE_LED, ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED, + ALC236_FIXUP_HP_MUTE_LED_COEFBIT2, ALC236_FIXUP_HP_GPIO_LED, ALC236_FIXUP_HP_MUTE_LED, ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, @@ -8556,6 +8572,10 @@ static const struct hda_fixup alc269_fixups[] = { .type = HDA_FIXUP_FUNC, .v.func = alc285_fixup_hp_spectre_x360_mute_led, }, + [ALC236_FIXUP_HP_MUTE_LED_COEFBIT2] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc236_fixup_hp_mute_led_coefbit2, + }, [ALC236_FIXUP_HP_GPIO_LED] = { .type = HDA_FIXUP_FUNC, .v.func = alc236_fixup_hp_gpio_led, @@ -9440,6 +9460,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), + SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED), SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),