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 B7839C43217 for ; Thu, 2 Dec 2021 15:35:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359064AbhLBPjN (ORCPT ); Thu, 2 Dec 2021 10:39:13 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:47710 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359054AbhLBPjM (ORCPT ); Thu, 2 Dec 2021 10:39:12 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 593292177B; Thu, 2 Dec 2021 15:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1638459349; 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=izo9qkPmSRbEFzFGyQNjlsCtzd7BZgLTODYPENGEJ+k=; b=Ky1ZNESJ9OasatXaNDhCPoTMAQwL+tuuvFQZEJhMukt9Q2PnNFz0EbjKoGY8MKMz7JLexe MLMm4Tj3tQyjmSfMcI+lkIv8GdT8VJKIxOyuHT85jyhWPMRB5EUwBpHY3bDn+Y3ZHORjJu QZXETHrmoBObVKWbNQ2ptH5D/HaKzSg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1638459349; 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=izo9qkPmSRbEFzFGyQNjlsCtzd7BZgLTODYPENGEJ+k=; b=VSnx8IlfR4XJTSUHeDeRX4DZs+AKUDd/rtCOnjQXxuuy22yL9QTYmBtifmbzwMQsnSC6N1 6gTd36t0hh1WrzAA== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 4B51FA3B8A; Thu, 2 Dec 2021 15:35:49 +0000 (UTC) Date: Thu, 02 Dec 2021 16:35:49 +0100 Message-ID: From: Takashi Iwai To: Werner Sembach Cc: perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ALSA: hda/realtek: Fix quirk for TongFang PHxTxX1 In-Reply-To: <20211202152843.818617-1-wse@tuxedocomputers.com> References: <20211202152843.818617-1-wse@tuxedocomputers.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 02 Dec 2021 16:28:43 +0100, Werner Sembach wrote: > > This fixes the SND_PCI_QUIRK(...) of the TongFang PHxTxX1 barebone. This > fixes the issue of sound not working after s3 suspend. > > When waking up from s3 suspend the Coef 0x10 is set to 0x0220 instead of > 0x0020. Setting the value manually makes the sound work again. This patch > does this automatically. > > While being on it, I also fixed the comment formatting of the quirk. > > Signed-off-by: Werner Sembach > Cc: Please try to put Fixes tag as this is a fix for the existing change. The code change looks almost good, but just minor nitpicking: > --- > sound/pci/hda/patch_realtek.c | 25 ++++++++++++++----------- > 1 file changed, 14 insertions(+), 11 deletions(-) > > diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c > index 9ce7457533c96..d3a16843c7afd 100644 > --- a/sound/pci/hda/patch_realtek.c > +++ b/sound/pci/hda/patch_realtek.c > @@ -6503,22 +6503,25 @@ static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec, > /* for alc285_fixup_ideapad_s740_coef() */ > #include "ideapad_s740_helper.c" > > +static const struct coef_fw alc256_fixup_tongfang_reset_persistent_settings_coefs[] = { The variable name is unnecessarily too long. Please use a shorter one. > + WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000), WRITE_COEF(0x26, 0x0000), > + WRITE_COEF(0x29, 0x3000), WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089), Try to keep the line in 80 column. It's OK to take a longer if it has to be, but in a case like this, it doesn't need to be that long. thanks, Takashi > + {} > +}; > + > static void alc256_fixup_tongfang_reset_persistent_settings(struct hda_codec *codec, > const struct hda_fixup *fix, > int action) > { > /* > - * A certain other OS sets these coeffs to different values. On at least one TongFang > - * barebone these settings might survive even a cold reboot. So to restore a clean slate the > - * values are explicitly reset to default here. Without this, the external microphone is > - * always in a plugged-in state, while the internal microphone is always in an unplugged > - * state, breaking the ability to use the internal microphone. > - */ > - alc_write_coef_idx(codec, 0x24, 0x0000); > - alc_write_coef_idx(codec, 0x26, 0x0000); > - alc_write_coef_idx(codec, 0x29, 0x3000); > - alc_write_coef_idx(codec, 0x37, 0xfe05); > - alc_write_coef_idx(codec, 0x45, 0x5089); > + * A certain other OS sets these coeffs to different values. On at least > + * one TongFang barebone these settings might survive even a cold > + * reboot. So to restore a clean slate the values are explicitly reset > + * to default here. Without this, the external microphone is always in a > + * plugged-in state, while the internal microphone is always in an > + * unplugged state, breaking the ability to use the internal microphone. > + */ > + alc_process_coef_fw(codec, alc256_fixup_tongfang_reset_persistent_settings_coefs); > } > > static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = { > -- > 2.25.1 >