From patchwork Sat Feb 24 16:04:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Willian Wang X-Patchwork-Id: 205906 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1214419dyb; Sat, 24 Feb 2024 08:04:58 -0800 (PST) X-Forwarded-Encrypted: i=4; AJvYcCWCFERvYBOD6hosnCuVjC0kYo9mwOROTxTk9M2dpEdFI2p3WtGt6aZYFImaBfPNmKWgiTVieJ5GY5S157uUBbtJ+aF+Mw== X-Google-Smtp-Source: AGHT+IGR4O7XcFnGc2ZVx6pxNcNcn3w7s0tS2D5q9pENMZCy+HKbFBWqC2Unl9k+FUBpDEOl+4h3 X-Received: by 2002:a17:906:2b88:b0:a3f:b2d5:6812 with SMTP id m8-20020a1709062b8800b00a3fb2d56812mr1535209ejg.40.1708790697867; Sat, 24 Feb 2024 08:04:57 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1708790697; cv=pass; d=google.com; s=arc-20160816; b=eSefpu8Gq+lZ1wR2IYVViFFcmFoQB7RyuroHYEUP8baxDb0H8738iX+JYWrBlCghH8 bzesRs8i0wRp5ADsGY//uwkWMZuar/FgMIDxjwQdGimktyWp0XqtcVaYet5oyIJnbx1j SfO0ewydpmwRQ5Wc1u6PEbGv/94Am7B5J9iqUqVjVTxYTAyN1jmJmPZxDuIUXUWpv4BQ cVO5Jq9ugY8IbRpe1P6g4b/baPqDvGZL9NYjcyS81FGkM1JjQHUt2X6+1clq2w9Clfle 5qmfIz6D/V65EzRvLou6ToCscptb+UdGhtugyp7AaRfICp+nFNLoTykUO1p09mk+H1/o nkNQ== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:cc:to:from:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:subject :dkim-signature; bh=vxEt94OslLQARm0iOm4GJ/410eyItb+v7kq9UDLi6CA=; fh=tWkmBujHFef1X0ATKkSEn9rXdWXIzudVyljfLzMu3/4=; b=tH8lUMZDjKaPAjhmQbcc8ZxGb8yJ2XK+xYr6UvykHmU4zq0FXFjMUh5KAOevc3zQ5H zw1IJqYIrrYCVP5NzKcuVardHyGqWnWpLDtdwJNHZr5dDjt+6FBK3cq2z0YH3YGbeF+J FK+a/YcwlASU8ssWRrrf8IABW1tOVluDQkN7fSTyV/wm4vbHh3peyWSQhsidICqJdfkV WfW8U+CQir50Je+FEIRI/EbqHvHHB5L1DNILLSIYtBY2155wsyouajRxfDD+yEdlGEyB Z6hJbogu2IR14iaq4fP7zEMIXQ0LfuWTKs3DcJsJSwexKfxJJ46wHS46UtPeXRhiOYq1 YDRw==; dara=google.com ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@willian.wang header.s=dkim header.b=QKwpnXoV; arc=pass (i=2 spf=pass spfdomain=willian.wang dkim=pass dkdomain=willian.wang dmarc=pass fromdomain=willian.wang); spf=pass (google.com: domain of linux-kernel+bounces-79732-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79732-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=willian.wang Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ga25-20020a170906b85900b00a3edb96ab21si584455ejb.745.2024.02.24.08.04.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 08:04:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79732-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@willian.wang header.s=dkim header.b=QKwpnXoV; arc=pass (i=2 spf=pass spfdomain=willian.wang dkim=pass dkdomain=willian.wang dmarc=pass fromdomain=willian.wang); spf=pass (google.com: domain of linux-kernel+bounces-79732-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79732-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=willian.wang Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7B00E1F21906 for ; Sat, 24 Feb 2024 16:04:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6A7447F7A; Sat, 24 Feb 2024 16:04:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=willian.wang header.i=@willian.wang header.b="QKwpnXoV" Received: from mail-200166.simplelogin.co (mail-200166.simplelogin.co [176.119.200.166]) (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 CA92C45028 for ; Sat, 24 Feb 2024 16:04:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=176.119.200.166 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708790683; cv=pass; b=sKCUcrWj0Yp3D3nrhgBhIq+mhQavGaCMMQjRprhA78dXcjHir3hc4NpS3g07ebODwMXwX9+mHhYfw55rcyelz06Hu6rT0Uv6/RZOmIWbRKVn+jqdsAN6oBnyZooeXCXvdlTiZjSifB35+1d9V61T1BaeOifWD2tx97bM3wOocCU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708790683; c=relaxed/simple; bh=h0hPeZexorvRjBOVCo9UBs0NdH+7IqeMM4uqu0E9a0k=; h=Subject:Date:MIME-Version:From:To:Cc:Message-ID; b=o2UMM4tcjFzPGC4xPU/MOnEd7irLG90fh1KoArEHhWE+B/pviP8W9A613wJPxqnw7i92sUsx16YV85nHBqQ/zLZGYW2GJkM9PfIdXML7LBL3k434cFajGg/Pd0UfVrjtl1prslzlrjbx/ibR+5fPYYxrgGJun0M6EJV/OsPBlGc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=willian.wang; spf=pass smtp.mailfrom=willian.wang; dkim=pass (1024-bit key) header.d=willian.wang header.i=@willian.wang header.b=QKwpnXoV; arc=pass smtp.client-ip=176.119.200.166 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=willian.wang Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=willian.wang ARC-Seal: i=1; a=rsa-sha256; d=simplelogin.co; s=arc-20230626; t=1708790673; cv=none; b=J4ATsWzi0KVHJAXpXLQ/7cMhSdoiPVUCnw+CXI3/sVDoxMWHBL8TKq6djzhOROoBhcoRaWZLZhPesyF7VO9JsBXklf42hdF57mBNisaLl5Ly5Z5+/SLEvTxKPvxWbk3NAUEYd9g8Lvqem9xNXQ5VQU9nQHPATiidXno5y2d1NAik8x6ai8VVu2oAWMK4K1OAdYYfDIer+oKOhgw22gwjuiuc9MBcY0BU9FfnxDsDXqSIHMYeEwAEsDUr+7FCpOVJ+dGT++lAsaOY02rUhQRcTOwR+Adj6JltHz/M6n7SVMyHXDT4OzvoHKFW+u5jznkzsmgh2FOeQfILUxO67nipiw== ARC-Message-Signature: i=1; a=rsa-sha256; d=simplelogin.co; s=arc-20230626; t=1708790673; c=relaxed/simple; bh=h0hPeZexorvRjBOVCo9UBs0NdH+7IqeMM4uqu0E9a0k=; h=Subject:Date:From:To:Cc; b=rTB3RGWsfCJN2pBfuNrH+9OMZpzcTroz2FSsdZkpWMzYz0rcuPUMIABXZ+JD+zFM8BMG+Rudt2ri8bMjjsUO4bVGY7Avsts6nhpIrm9Mxa4SoJS8rAVaHy/CgLea3O2iKADS6UFdMJALyjhHPZkjWMfgWWYjS9Oi6ZdPadipcwCNJPoP9QLaVt+TbTsqX47UksKv2qH0qFVbgf+/gYuY9stHJ0O7iRvM4v0YOmrvdik20msE13u/XkIPyn2mwtyGhnNga9Ez3mVSzQy8rBPx027hl4Eywu8Rvk5PSvyW3ehsjo+24f8o/HJRRoWvenBt33KymcE6155oll84t/wMNg== ARC-Authentication-Results: i=1; mail.protonmail.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=willian.wang; s=dkim; t=1708790673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=vxEt94OslLQARm0iOm4GJ/410eyItb+v7kq9UDLi6CA=; b=QKwpnXoV2G26NxNtNKR8fujQOwR5HNDzWQF2P3DipZ9D+Qj3Iq5+dAyO+zNJMHh5DZ/TFm Q+gyZ1VI1BQPDRhryTVG+67mA4fuqnIohQLH2YyKO/AkWWLDZoU8JeROiCyLTH0FtjcLTH rUFRkg5fTXMO6Le9vwlD5B8HFRcQvKo= Subject: [PATCH v2] ALSA: hda/realtek: Add special fixup for Lenovo 14IRP8 Date: Sat, 24 Feb 2024 13:04:25 -0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Willian Wang To: linux-sound@vger.kernel.org Cc: linux-kernel@vger.kernel.org,tiwai@suse.com,perex@perex.cz,stable@vger.kernel.org Message-ID: <170879067313.7.13109583407458288321.273807771@willian.wang> X-SimpleLogin-Type: Reply X-SimpleLogin-EmailLog-ID: 273807773 X-SimpleLogin-Want-Signing: yes X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791796914672971341 X-GMAIL-MSGID: 1791796914672971341 Lenovo Slim/Yoga Pro 9 14IRP8 requires a special fixup because there is a collision of its PCI SSID (17aa:3802) with Lenovo Yoga DuetITL 2021 codec SSID. Cc: stable@vger.kernel.org Link: https://bugzilla.kernel.org/show_bug.cgi?id=208555 Link: https://lore.kernel.org/all/d5b42e483566a3815d229270abd668131a0d9f3a.camel@irl.hu Signed-off-by: Willian Wang --- sound/pci/hda/patch_realtek.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 0ec1312bffd5..3f2541b61e8c 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -7444,6 +7444,7 @@ enum { ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE, ALC287_FIXUP_YOGA7_14ITL_SPEAKERS, ALC298_FIXUP_LENOVO_C940_DUET7, + ALC287_FIXUP_LENOVO_14IRP8_DUETITL, ALC287_FIXUP_13S_GEN2_SPEAKERS, ALC256_FIXUP_SET_COEF_DEFAULTS, ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE, @@ -7495,6 +7496,26 @@ static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec, __snd_hda_apply_fixup(codec, id, action, 0); } +/* A special fixup for Lenovo Slim/Yoga Pro 9 14IRP8 and Yoga DuetITL 2021; + * 14IRP8 PCI SSID will mistakenly be matched with the DuetITL codec SSID, + * so we need to apply different fixup on this case. The only DuetITL codec + * SSID reported so far is the 17aa:3802, while the 14IRP8 has the 17aa:38be + * and 17aa:38bf. If it weren't for the PCI SSID, the 14IRP8 models would + * have matched correctly. + */ +static void alc287_fixup_lenovo_14irp8_duetitl(struct hda_codec *codec, + const struct hda_fixup *fix, + int action) +{ + int id; + + if (codec->core.subsystem_id == 0x17aa3802) + id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* DuetITL */ + else + id = ALC287_FIXUP_TAS2781_I2C; /* 14IRP8 */ + __snd_hda_apply_fixup(codec, id, action, 0); +} + static const struct hda_fixup alc269_fixups[] = { [ALC269_FIXUP_GPIO2] = { .type = HDA_FIXUP_FUNC, @@ -9379,6 +9400,10 @@ static const struct hda_fixup alc269_fixups[] = { .type = HDA_FIXUP_FUNC, .v.func = alc298_fixup_lenovo_c940_duet7, }, + [ALC287_FIXUP_LENOVO_14IRP8_DUETITL] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc287_fixup_lenovo_14irp8_duetitl, + }, [ALC287_FIXUP_13S_GEN2_SPEAKERS] = { .type = HDA_FIXUP_VERBS, .v.verbs = (const struct hda_verb[]) { @@ -10247,7 +10272,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340), SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC), SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN), - SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), + SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga Pro 9 14IRP8 / DuetITL 2021", ALC287_FIXUP_LENOVO_14IRP8_DUETITL), SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS), SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7), SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),