Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp21708468rwd; Thu, 29 Jun 2023 21:30:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlGyjYMViKqrH8ZsY9unvqXJkIR0RjdIHDcmUFPLLblTx4Ab1hzv25YpbpPUOUlclUeJ8ehD X-Received: by 2002:a05:6359:201:b0:134:f326:e819 with SMTP id ej1-20020a056359020100b00134f326e819mr1508188rwb.29.1688099400339; Thu, 29 Jun 2023 21:30:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688099400; cv=none; d=google.com; s=arc-20160816; b=YhNsuWlPdyF5JE/GDdGMGN1BKIe6XyWaV6noyCyXhFYlf1zOxIAdNqJNZ0kGFNTCuP UCqn/ZCEyYImi8fg1WgSXCXHAxtpKfwMNMECdDRq/0o3DiMRHwX5KxVzZF0C8OjMDSV0 aX93v2cMJC0glVS4Y3Kl4Uz4KSVv4Fvy+5o3/8DgUF7gnZDg00mmhONMvqiIEMJ5dKIE BwhHemupFK2MFMQH+uX+dAzfxRla09Olw7vxUGCO4J0T76VAkwCkx1wc8/yCuc19eRBc bOkZ1gnB7AKGaXemjped1aFeOPaYtnqKhDy5n7wSqjsyluNhTzbOJwJ2KhkjXXqg9Dcz 5rpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=eUbqm3AWWV6QXNgpd6G4UcM9x5mxvl167rB/JwAhHOY=; fh=PLuxp0F0b1aBrDaOzraNkSnElYt7LVwOLuqkEdgGv58=; b=CFBqULGTUAm3GYWkp76H06wzlHgsTczpQlGsDwr6culJd+MdZ37NZT6/zR6M8Io78r 47TvBsV2cgRb0g/dQ/Upi3Y8aQWoOAIbArn51QVyTc2hHkRCmNRRFGKTTA4pwqLG5pNA pLxFZ6drwoo9d/FX/Mqx/HkUk7Boma2WZxKqrHzDqMNFnWLzvcghuF2RJGZxP7erW1R7 S9E7hiBQlxHoIQ6c2NPToazras+T+uM/pvdGajVTRM8kuurdpjr3Ldg0bgdLNMheMzcK 8fYKcJc08NO9PemyMh14IAZ3v3GlnOI3NNyBJJjI2UGiBeQhvHVrB/bCMRapVeyZvUuh 2rmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x71-20020a63864a000000b00553859c59c1si12194264pgd.695.2023.06.29.21.29.46; Thu, 29 Jun 2023 21:30:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230009AbjF3ENB (ORCPT + 99 others); Fri, 30 Jun 2023 00:13:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbjF3ENA (ORCPT ); Fri, 30 Jun 2023 00:13:00 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id E6B701FD7 for ; Thu, 29 Jun 2023 21:12:58 -0700 (PDT) Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 2B3F060765845; Fri, 30 Jun 2023 12:12:52 +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, kernel test robot Subject: [PATCH v2] ALSA: hda/realtek: Add quirks for Unis H3C Desktop B760 & Q760 Date: Fri, 30 Jun 2023 12:12:43 +0800 Message-Id: <20230630041243.2309665-1-dengxiang@nfschina.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306291229.5w2tIZjA-lkp@xxxxxxxxx/ --- v2: - remove warning about unused variable 'spec' as belows: Signed-off-by: dengxiang --- 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(struct hda_codec *codec, } } +static const struct hda_verb alc897_unis_h3c_x500s_eapd_verbs[] = { + {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 != HDA_FIXUP_ACT_PRE_PROBE) + return; + + snd_hda_add_verbs(codec, alc897_unis_h3c_x500s_eapd_verbs); +} + static const struct coef_fw alc668_coefs[] = { WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80), @@ -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, }; static const struct hda_fixup alc662_fixups[] = { @@ -11725,6 +11740,10 @@ static const struct hda_fixup alc662_fixups[] = { .chained = true, .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE }, + [ALC897_FIXUP_UNIS_H3C_X500s] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc897_fixup_unis_h3c_x500s, + }, }; static const struct snd_pci_quirk alc662_fixup_tbl[] = { @@ -11792,6 +11811,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { 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_VERB), + SND_PCI_QUIRK(0x10ec, 0x0897, "UNIS H3C X500s", ALC897_FIXUP_UNIS_H3C_X500s), #if 0 /* Below is a quirk table taken from the old code. @@ -11886,6 +11906,7 @@ static const struct hda_model_fixup alc662_fixup_models[] = { {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"}, {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"}, + {.id = ALC897_FIXUP_UNIS_H3C_X500s, .name = "unis-h3c-x500s"}, {} }; -- 2.30.2