git: b44869cba1b3 - main - sound: add patch for Lenovo Legion 5 Intel

From: Nuno Teixeira <eduardo_at_FreeBSD.org>
Date: Fri, 16 Sep 2022 13:33:24 UTC
The branch main has been updated by eduardo (ports committer):

URL: https://cgit.FreeBSD.org/src/commit/?id=b44869cba1b391931b831135a9cefcc6ca635103

commit b44869cba1b391931b831135a9cefcc6ca635103
Author:     Nuno Teixeira <eduardo@FreeBSD.org>
AuthorDate: 2022-09-16 13:29:30 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2022-09-16 13:29:30 +0000

    sound: add patch for Lenovo Legion 5 Intel
    
    Laptop Legion Lenovo 5 15MH05 (Intel)
    
    Patch to fix the sound on this machine.
    It requires sending the speaker and the headphone jack to the same nid.
    
    PR:             265632
    Approved by:    emaste
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D36511
---
 sys/dev/sound/pci/hda/hdaa_patches.c | 3 ++-
 sys/dev/sound/pci/hda/hdac.h         | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/dev/sound/pci/hda/hdaa_patches.c b/sys/dev/sound/pci/hda/hdaa_patches.c
index 632f74a0a0cc..8d5eb77e0874 100644
--- a/sys/dev/sound/pci/hda/hdaa_patches.c
+++ b/sys/dev/sound/pci/hda/hdaa_patches.c
@@ -319,7 +319,8 @@ hdac_pin_patch(struct hdaa_widget *w)
 			break;
 		}
 	} else if (id == HDA_CODEC_ALC257 &&
-	    (subid == LENOVO_L5AMD_SUBVENDOR)) {
+	    (subid == LENOVO_L5AMD_SUBVENDOR ||
+	    subid == LENOVO_L5INTEL_SUBVENDOR)) {
 		switch (nid) {
 		case 20:
 			patch_str = "as=1 seq=0";
diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h
index a4928dd0b4c5..04dd9c643bcf 100644
--- a/sys/dev/sound/pci/hda/hdac.h
+++ b/sys/dev/sound/pci/hda/hdac.h
@@ -372,6 +372,7 @@
 #define	LENOVO_T431S_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x2208)
 #define	LENOVO_G580_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x3977)
 #define	LENOVO_L5AMD_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x381b)
+#define	LENOVO_L5INTEL_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x380f)
 #define	LENOVO_3000_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x384e)
 #define LENOVO_ALL_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0xffff)