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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39580C433EF for ; Fri, 12 Nov 2021 10:07:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 19D9A60231 for ; Fri, 12 Nov 2021 10:07:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234898AbhKLKKO (ORCPT ); Fri, 12 Nov 2021 05:10:14 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:34776 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234656AbhKLKKM (ORCPT ); Fri, 12 Nov 2021 05:10:12 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id F208E2198A; Fri, 12 Nov 2021 10:07:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1636711640; 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=joEFNSbRO/ShgxxO2z0AOoaVmuanQ8nbmf9/dfMHod4=; b=DMYUhJZOjaEM/Vs7pqmL2XVivUOeKXpkjS8i3hBn3Hjk5D+jw8PdwGsFLxX2zwklohL6U1 2+0v2tXrddA36kAhAWPYHKdhR3MBiwpmWxPQW0dUKt9fKm+lIMTVvOEvEJUmtorx8R02uw YuP9OvpMTzE7WPKkQnNLucNrhrzu+Z4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1636711640; 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=joEFNSbRO/ShgxxO2z0AOoaVmuanQ8nbmf9/dfMHod4=; b=Uik7+9d+Lv6PrYaAnmC1OkuirIGChPVVABnsFD73+TrFLkiSlmZpEOZNWrkDPn9ZEXbdCH BM7sSjM96bervfAA== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id DB11FA3B88; Fri, 12 Nov 2021 10:07:20 +0000 (UTC) Date: Fri, 12 Nov 2021 11:07:20 +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: Add quirk for ASRock NUC Box 1100 In-Reply-To: <20211112094711.963474-1-wse@tuxedocomputers.com> References: <20211112094711.963474-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 Fri, 12 Nov 2021 10:47:11 +0100, Werner Sembach wrote: > > This applies a SND_PCI_QUIRK(...) to the ASRock NUC Box 1100 series. This > fixes the issue of the headphone jack not being detected unless warm > rebooted from a certain other OS. > > When booting a certain other OS some coeff settings are changed that enable > the audio jack. These settings are preserved on a warm reboot and can be > easily dumped. > > The relevant indexes and values where gathered by naively diff-ing and > reading a working and a non-working coeff dump. > > Signed-off-by: Werner Sembach > Cc: Thanks, the change looks almost good but in some small details: > +static void alc233_fixup_asrock_nuc_box_1100_no_audio_jack(struct hda_codec *codec, > + const struct hda_fixup *fix, > + int action) The function name could be a bit shorter? It might be possible that the fixup could be re-used by others, too. > +{ > + /* > + * The audio jack input and output is not detected on the ASRock NUC Box 1100 series when > + * cold booting without this fix. Warm rebooting from a certain other OS makes the audio > + * functional, as COEF settings are preserved in this case. This fix sets these altered > + * COEF values as the default. Fitting in 80 columns is still preferred, to align with other code. > + alc_write_coef_idx(codec, 0x1a, 0x9003); > + alc_write_coef_idx(codec, 0x1b, 0x0e2b); > + alc_write_coef_idx(codec, 0x37, 0xfe06); > + alc_write_coef_idx(codec, 0x38, 0x4981); > + alc_write_coef_idx(codec, 0x45, 0xd489); > + alc_write_coef_idx(codec, 0x46, 0x0074); > + alc_write_coef_idx(codec, 0x49, 0x0149); Can be put in the coef_fw table and processed via alc_process_coef_fw() instead? thanks, Takashi