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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4468BC433F5 for ; Tue, 28 Sep 2021 10:37:10 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B3C3760F70 for ; Tue, 28 Sep 2021 10:37:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B3C3760F70 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 558A016B8; Tue, 28 Sep 2021 12:36:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 558A016B8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1632825428; bh=Jps0bfSwxiqKScTl21g57Cd6e2qZqmVFPBV1W/T6vmM=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=YWUlxHw1+raOuloJrhDTVcSoxLvIILltX2XfyJ4DQ6FFodkSohglQ4fA6Iz07SZ1/ rlPkNv/68/+9Pn7w2Vi2AG6A3N86nG5ftbxaLND16FpheEb9smdza9cAV4nwWF8DT+ F8yNPow21bzikCVkOYfxl34o7UeVd0CRR5dRFyPk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 46C8AF804D2; Tue, 28 Sep 2021 12:36:16 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B8485F804D2; Tue, 28 Sep 2021 12:36:14 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6D142F804D6 for ; Tue, 28 Sep 2021 12:36:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6D142F804D6 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="YyRa45Cw"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="O+1hkGU6" Received: from relay1.suse.de (relay1.suse.de [149.44.160.133]) by smtp-out1.suse.de (Postfix) with ESMTP id 05BDC223D8; Tue, 28 Sep 2021 10:36:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1632825366; 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=a6aMM5Qg0WuIYHVsxbkReJMMt4CBZTpC0gtc5cKEZek=; b=YyRa45CwLIUdBZijJsbJNezCsnVqMxNHLtlhjV0zJ0cSscbH2bFdILVJvSrNAoqfcfvXxg Hrn5btkakIizHy145KJsCwfKiMMZGfvG3n0j86cJeQ05B8wDWZHyNi2HDm+sg43YgfY0Rt T14sJGl+LAXzVXi6AB9F928KSW5vDFg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1632825366; 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=a6aMM5Qg0WuIYHVsxbkReJMMt4CBZTpC0gtc5cKEZek=; b=O+1hkGU68qk94lC4ZiKL4/HYJKY+J3duJJlHiUc5AUA8BZKbz6qShAH8W6zK2XJIoxoilS XkceXbQkpDXJBaAg== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay1.suse.de (Postfix) with ESMTP id F344B25D63; Tue, 28 Sep 2021 10:36:05 +0000 (UTC) Date: Tue, 28 Sep 2021 12:36:05 +0200 Message-ID: From: Takashi Iwai To: Davide Baldo Subject: Re: [PATCH] Fixes HP Spectre x360 15-eb1xxx speakers In-Reply-To: <20210925194425.9028-1-davide@baldo.me> References: <20210925194425.9028-1-davide@baldo.me> 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 Cc: alsa-devel@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Sat, 25 Sep 2021 21:44:26 +0200, Davide Baldo wrote: > > > First kernel contribution, I only tested this patch myself on a 5.14.7. > There is probably some way to fix the remaining issues, but I need > some guidance on how I could test the different pinouts since > hdajackretask hangs the audio card and I can't test out combinations. > In the meantime this commit fix the most serius problem: silent > speakers. > > In laptop 'HP Spectre x360 Convertible 15-eb1xxx/8811' both front and > rear speakers are silent, this patch fixes that by overriding the pin > layout and by initializing the amplifier which needs a GPIO pin to be > set to 1 then 0, similar to the existing HP Spectre x360 14 model. > > This patch also correctly map the mute LED but since there is no > microphone on/off switch exposed by the alsa subsystem it never turns > on by itself. Note that the recent kernel binds the mute and mic-mute LED with the leds subsystem, which can be controlled via sysfs, /sys/class/leds/*. > There are still known audio issues in this laptop: headset microphone > doesn't work, the button to mute/unmute microphone is not yet mapped, > the LED of the mute/unmute speakers doesn't seems to be exposed via > GPIO and never turns on. > > Signed-off-by: Davide Baldo The changes look almost good, but could you fix the following and resubmit? > --- > sound/pci/hda/patch_realtek.c | 41 ++++++++++++++++++++++++++++++++++- > 1 file changed, 40 insertions(+), 1 deletion(-) > > diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c > index 70516527ebce..90f845976793 100644 > --- a/sound/pci/hda/patch_realtek.c > +++ b/sound/pci/hda/patch_realtek.c > @@ -6414,6 +6414,38 @@ static void alc_fixup_no_int_mic(struct hda_codec *codec, > } > } > > +/* GPIO1 = amplifier on/off > + * GPIO3 = mic mute LED > + */ > +static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec, > + const struct hda_fixup *fix, int action) > +{ > + struct alc_spec *spec = codec->spec; > + static const struct hda_pintbl pincfgs[] = { > + { 0x14, 0x90170110 }, /* front speakers */ > + { } > + }; > + > + //enable micmute led > + alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04); > + spec->micmute_led_polarity = 1; This line should be moved under HDA_FIXUP_ACT_PRE_PROBE. It needs to be set only once at the beginning. > + > + switch (action) { > + case HDA_FIXUP_ACT_PRE_PROBE: > + /* needed for amp of back speakers */ > + spec->gpio_mask |= 0x01; > + spec->gpio_dir |= 0x01; > + snd_hda_apply_pincfgs(codec, pincfgs); > + break; > + case HDA_FIXUP_ACT_INIT: > + /* need to toggle GPIO to enable the amp of back speakers */ > + alc_update_gpio_data(codec, 0x01, true); > + msleep(100); > + alc_update_gpio_data(codec, 0x01, false); > + break; > + } > +} > + > static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec, > const struct hda_fixup *fix, int action) > { > @@ -6534,6 +6566,7 @@ enum { > ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, > ALC280_FIXUP_HP_9480M, > ALC245_FIXUP_HP_X360_AMP, > + ALC285_FIXUP_HP_SPECTRE_X360_EB1, > ALC288_FIXUP_DELL_HEADSET_MODE, > ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, > ALC288_FIXUP_DELL_XPS_13, > @@ -6658,7 +6691,7 @@ enum { > ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, > ALC623_FIXUP_LENOVO_THINKSTATION_P340, > ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, > - ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST, > + ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST This is unnecessary change. It's fine to keep the comma of the last enum entry in Linux kernel coding style. > }; > > static const struct hda_fixup alc269_fixups[] = { > @@ -8222,6 +8255,10 @@ static const struct hda_fixup alc269_fixups[] = { > .type = HDA_FIXUP_FUNC, > .v.func = alc285_fixup_hp_spectre_x360, > }, > + [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = { > + .type = HDA_FIXUP_FUNC, > + .v.func = alc285_fixup_hp_spectre_x360_eb1 > + }, > [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = { > .type = HDA_FIXUP_FUNC, > .v.func = alc285_fixup_ideapad_s740_coef, > @@ -8415,6 +8452,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { > SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN), > SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), > SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360), > + SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), > SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT), > SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED), > SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO), Please insert the entry in PCI SSID order. thanks, Takashi