From mboxrd@z Thu Jan 1 00:00:00 1970 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 E1519EB64D7 for ; Fri, 30 Jun 2023 08:28:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232195AbjF3I2Q (ORCPT ); Fri, 30 Jun 2023 04:28:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232520AbjF3I2E (ORCPT ); Fri, 30 Jun 2023 04:28:04 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 007BF1FE3 for ; Fri, 30 Jun 2023 01:27:48 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id ACE651F8C8; Fri, 30 Jun 2023 08:27:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688113667; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=c+W8aKfkXpZKK+uj0tHa1zrRij5dJeSXQ7E45G9hHSA=; b=I/tF7TsWTN74LgFy/ViXDWQ/t/1yu7hDCwnb+F1xRLdaOgPQjFvFyDErItEvMZFpZOrdG4 6D2fkrr76rQN0C8fg5rqwSTYLRfQjDs+pqONg0R0SVcTTDemkMKhdGngSS9k9DzibTahnS eRnSFCgmIj4BRcO875Fgaa8ZMJG0h+o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688113667; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=c+W8aKfkXpZKK+uj0tHa1zrRij5dJeSXQ7E45G9hHSA=; b=hmAfoe+eHfDyfmPi1tvHW6G1cYl8EElIueAcNajFfKyj3DWF0pWWmbaX6AL0dmkQS4Ih6/ g86f3kluVHVF67Ag== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 785BF138F8; Fri, 30 Jun 2023 08:27:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id jZ4GHAOSnmTETgAAMHmgww (envelope-from ); Fri, 30 Jun 2023 08:27:47 +0000 Date: Fri, 30 Jun 2023 10:27:47 +0200 Message-ID: <87ilb5cq2k.wl-tiwai@suse.de> From: Takashi Iwai To: dengxiang Cc: tiwai@suse.com, yangyingliang@huawei.com, perex@perex.cz, linux-kernel@vger.kernel.org, kernel test robot Subject: Re: [PATCH v2] ALSA: hda/realtek: Add quirks for Unis H3C Desktop B760 & Q760 In-Reply-To: <20230630041243.2309665-1-dengxiang@nfschina.com> References: <20230630041243.2309665-1-dengxiang@nfschina.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 30 Jun 2023 06:12:43 +0200, dengxiang wrote: > > 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, If it's only about verbs, it can be embedded here like: [ALC897_FIXUP_UNIS_H3C_X500s] = { .type = HDA_FIXUP_FUNC, .v.verbs = (const struct hda_verb[]) { { 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 }, {} }, }, Also, try to keep the capital letters for ALC_* enums. thanks, Takashi