From nobody Fri Nov 29 00:55:32 2024 Received: from mail-m118115.qiye.163.com (mail-m118115.qiye.163.com [115.236.118.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23AD9171675; Thu, 26 Sep 2024 11:17:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.236.118.115 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727349480; cv=none; b=nowfI3613YTZc6Vhkck5NU+eckl8e7vDVFxyabH6hspI8uNGv58/8cZIENr+/vIK+RGQ5A1ygWee+lyO3Uhkl8LnYjlkLB1jfYdTnU6+ayei70ADNxnDCHzE+wAsgnopZIQMuz6TnZ1mbWr9QDamigyeKKZt4WNKbtfoE9eM1jg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727349480; c=relaxed/simple; bh=7+DOtoutFds+ShUKf1onXNvwcnmuB08COLWt5VmhY6A=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=eHoXkpRcyG1IlVkHNEjPzIzM12AH6xvjBn/d+B0el5qg8BVUB2vb1gNq7tzZAut3mL6I3Tjm82AUa5HSw3lEl5/nQm2G/J7zQACaWUKG9/PhGwepB2hP9ZZy1ZBWyP/Y5/my6LHEL4ajh2hGnk1tMcgZ9tNIJv5TtkuNVv1iWCA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=senarytech.com; spf=pass smtp.mailfrom=senarytech.com; arc=none smtp.client-ip=115.236.118.115 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=senarytech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=senarytech.com Received: from book-ThinkStation-P328.. (unknown [61.183.143.78]) by smtp.qiye.163.com (Hmail) with ESMTPA id 9F942940883; Thu, 26 Sep 2024 18:01:39 +0800 (CST) From: bo liu To: perex@perex.cz, tiwai@suse.com Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, cs@tuxedo.de, songxiebing@kylinos.cn, wse@tuxedocomputers.com, bo liu Subject: [PATCH] ALSA: hda/conexant: fix Z60MR100 startup pop issue Date: Thu, 26 Sep 2024 18:01:35 +0800 Message-Id: <20240926100135.36499-1-bo.liu@senarytech.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVkaS0tLVh4ZS05ISRkaSx1OGFYVFAkWGhdVEwETFh oSFyQUDg9ZV1kYEgtZQVlNSlVKQ0hVSk9IVUxDWVdZFhoPEhUdFFlBWU9LSFVKS0lPT09IVUpLS1 VKQktLWQY+ X-HM-Tid: 0a922dc776f309d1kunm9f942940883 X-HM-MType: 1 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Nj46Kxw5NzIfEDFKFBozE0Ir QgwaFDJVSlVKTElMSE9PQktLTk9MVTMWGhIXVRkUVRcSDjsIHhUaCQIPHhgTVRgUFkVZV1kSC1lB WU1KVUpDSFVKT0hVTENZV1kIAVlBSE9CSDcG Content-Type: text/plain; charset="utf-8" When Z60MR100 startup, speaker will output a pop. To fix this issue, we mute codec in bios when startup, and use GPIO1 to unmute codec in codec driver. Signed-off-by: bo liu --- sound/pci/hda/patch_conexant.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index e851785ff058..27758822377f 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -308,6 +308,7 @@ enum { CXT_FIXUP_HP_MIC_NO_PRESENCE, CXT_PINCFG_SWS_JS201D, CXT_PINCFG_TOP_SPEAKER, + CXT_FIXUP_HP_A_U, }; =20 /* for hda_fixup_thinkpad_acpi() */ @@ -776,6 +777,18 @@ static void cxt_fixup_hp_zbook_mute_led(struct hda_cod= ec *codec, cxt_setup_mute_led(codec, 0x10, 0x20); } =20 +static void cxt_fixup_hp_a_u(struct hda_codec *codec, + const struct hda_fixup *fix, int action) +{ + if (action =3D=3D HDA_FIXUP_ACT_INIT) { + snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 0); + snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_MASK, 2); + snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DIRECTION, 2); + snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_STICKY_MASK, 0); + } + +} + /* ThinkPad X200 & co with cxt5051 */ static const struct hda_pintbl cxt_pincfg_lenovo_x200[] =3D { { 0x16, 0x042140ff }, /* HP (seq# overridden) */ @@ -982,6 +995,10 @@ static const struct hda_fixup cxt_fixups[] =3D { { } }, }, + [CXT_FIXUP_HP_A_U] =3D { + .type =3D HDA_FIXUP_FUNC, + .v.func =3D cxt_fixup_hp_a_u, + }, }; =20 static const struct snd_pci_quirk cxt5045_fixups[] =3D { @@ -1055,6 +1072,7 @@ static const struct snd_pci_quirk cxt5066_fixups[] = =3D { SND_PCI_QUIRK(0x103c, 0x8457, "HP Z2 G4 mini", CXT_FIXUP_HP_MIC_NO_PRESEN= CE), SND_PCI_QUIRK(0x103c, 0x8458, "HP Z2 G4 mini premium", CXT_FIXUP_HP_MIC_N= O_PRESENCE), SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN), + SND_PCI_QUIRK(0x14f1, 0x0252, "MBX-Z60MR100", CXT_FIXUP_HP_A_U), SND_PCI_QUIRK(0x14f1, 0x0265, "SWS JS201D", CXT_PINCFG_SWS_JS201D), SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT_FIXUP_OLPC_XO), SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410), @@ -1100,6 +1118,7 @@ static const struct hda_model_fixup cxt5066_fixup_mod= els[] =3D { { .id =3D CXT_PINCFG_LENOVO_NOTEBOOK, .name =3D "lenovo-20149" }, { .id =3D CXT_PINCFG_SWS_JS201D, .name =3D "sws-js201d" }, { .id =3D CXT_PINCFG_TOP_SPEAKER, .name =3D "sirius-top-speaker" }, + { .id =3D CXT_FIXUP_HP_A_U, .name =3D "HP-U-support" }, {} }; =20 --=20 2.34.1