From nobody Mon Feb 9 03:17:03 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 A4529EB64D9 for ; Fri, 30 Jun 2023 01:27:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230034AbjF3B1V (ORCPT ); Thu, 29 Jun 2023 21:27:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbjF3B1S (ORCPT ); Thu, 29 Jun 2023 21:27:18 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 8CAB610E7 for ; Thu, 29 Jun 2023 18:27:15 -0700 (PDT) Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id C459F606EE6F5; Fri, 30 Jun 2023 09:27:02 +0800 (CST) X-MD-Sfrom: dengxiang@nfschina.com X-MD-SrcIP: 180.167.10.98 From: dengxiang To: tiwai@suse.com, yangyingliang@huawei.com, perex@perex.cz Cc: linux-kernel@vger.kernel.org, dengxiang@nfschina.com Subject: [PATCH] ALSA: hda/realtek: Add quirks for Unis H3C Desktop B760 & Q760 Date: Fri, 30 Jun 2023 09:26:54 +0800 Message-Id: <20230630012654.2283715-1-dengxiang@nfschina.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: =E9=82=93=E6=B9=98 These models use NSIWAY amplifiers for internal speaker, but cannot put sound outside from these amplifiers. So eapd verbs are needed to initialize the amplifiers. They can be added during boot to get working sound out of internal speaker. Signed-off-by: =E9=82=93=E6=B9=98 --- sound/pci/hda/patch_realtek.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index afe8253f9a4f..82f53af2d08a 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -11201,6 +11201,20 @@ static void alc897_fixup_lenovo_headset_mode(struc= t hda_codec *codec, } } =20 +static const struct hda_verb alc897_unis_h3c_x500s_eapd_verbs[] =3D { + {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, + { } +}; + +static void alc897_fixup_unis_h3c_x500s(struct hda_codec *codec, + const struct hda_fixup *fix, int action) +{ + if (action !=3D HDA_FIXUP_ACT_PRE_PROBE) + return; + + snd_hda_add_verbs(codec, alc897_unis_h3c_x500s_eapd_verbs); +} + static const struct coef_fw alc668_coefs[] =3D { WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0= x0), WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f= 80), @@ -11286,6 +11300,7 @@ enum { ALC897_FIXUP_HP_HSMIC_VERB, ALC897_FIXUP_LENOVO_HEADSET_MODE, ALC897_FIXUP_HEADSET_MIC_PIN2, + ALC897_FIXUP_UNIS_H3C_X500s, }; =20 static const struct hda_fixup alc662_fixups[] =3D { @@ -11725,6 +11740,10 @@ static const struct hda_fixup alc662_fixups[] =3D { .chained =3D true, .chain_id =3D ALC897_FIXUP_LENOVO_HEADSET_MODE }, + [ALC897_FIXUP_UNIS_H3C_X500s] =3D { + .type =3D HDA_FIXUP_FUNC, + .v.func =3D alc897_fixup_unis_h3c_x500s, + }, }; =20 static const struct snd_pci_quirk alc662_fixup_tbl[] =3D { @@ -11792,6 +11811,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[= ] =3D { SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26), SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_V= ERB), + SND_PCI_QUIRK(0x10ec, 0x0897, "UNIS H3C X500s", ALC897_FIXUP_UNIS_H3C_X50= 0s), =20 #if 0 /* Below is a quirk table taken from the old code. @@ -11886,6 +11906,7 @@ static const struct hda_model_fixup alc662_fixup_mo= dels[] =3D { {.id =3D ALC662_FIXUP_USI_HEADSET_MODE, .name =3D "usi-headset"}, {.id =3D ALC662_FIXUP_LENOVO_MULTI_CODECS, .name =3D "dual-codecs"}, {.id =3D ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name =3D "aspire-ethos"}, + {.id =3D ALC897_FIXUP_UNIS_H3C_X500s, .name =3D "unis-h3c-x500s"}, {} }; =20 --=20 2.30.2