git: e431b38b0f77 - stable/14 - snd_hda: Patch Framework 16 AMD

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Tue, 01 Apr 2025 13:20:10 UTC
The branch stable/14 has been updated by christos:

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

commit e431b38b0f77a6deff9f6f214fe520b689c38bd2
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2025-03-25 19:13:49 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2025-04-01 13:20:05 +0000

    snd_hda: Patch Framework 16 AMD
    
    Reported by:    jrm
    Tested by:      jrm
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Reviewed by:    jrm
    Differential Revision:  https://reviews.freebsd.org/D49416
    
    (cherry picked from commit 2f1f523a45fb7f9fddd36a3402edbf7b111996c3)
---
 sys/dev/sound/pci/hda/hdaa_patches.c | 14 ++++++++++++++
 sys/dev/sound/pci/hda/hdac.h         |  1 +
 2 files changed, 15 insertions(+)

diff --git a/sys/dev/sound/pci/hda/hdaa_patches.c b/sys/dev/sound/pci/hda/hdaa_patches.c
index 8ad1c845c254..233ba1ae8d13 100644
--- a/sys/dev/sound/pci/hda/hdaa_patches.c
+++ b/sys/dev/sound/pci/hda/hdaa_patches.c
@@ -340,6 +340,20 @@ hdac_pin_patch(struct hdaa_widget *w)
 			patch_str = "as=3 seq=15 color=Black loc=Left";
 			break;
 		}
+	} else if (id == HDA_CODEC_ALC295 &&
+	    subid == FRAMEWORK_LAPTOP_0005_SUBVENDOR) {
+		switch (nid) {
+		case 20:
+			/*
+			 * This pin is a duplicate of pin 23 (both as=1 seq=0),
+			 * which ends up in the driver disabling the
+			 * association altogether. Since sound quality from pin
+			 * 23 seems to be better, configure this one as a back
+			 * speaker.
+			 */
+			patch_str = "as=1 seq=2";
+			break;
+		}
 	} else if (id == HDA_CODEC_ALC295 &&
 	    subid == FRAMEWORK_LAPTOP_0006_SUBVENDOR) {
 		switch (nid) {
diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h
index 9b11dcba32a8..cb383d3be498 100644
--- a/sys/dev/sound/pci/hda/hdac.h
+++ b/sys/dev/sound/pci/hda/hdac.h
@@ -530,6 +530,7 @@
 #define FRAMEWORK_LAPTOP_0001_SUBVENDOR HDA_MODEL_CONSTRUCT(FRAMEWORK, 0x0001)
 #define FRAMEWORK_LAPTOP_0002_SUBVENDOR HDA_MODEL_CONSTRUCT(FRAMEWORK, 0x0002)
 #define FRAMEWORK_LAPTOP_0003_SUBVENDOR HDA_MODEL_CONSTRUCT(FRAMEWORK, 0x0003)
+#define FRAMEWORK_LAPTOP_0005_SUBVENDOR HDA_MODEL_CONSTRUCT(FRAMEWORK, 0x0005)
 #define FRAMEWORK_LAPTOP_0006_SUBVENDOR HDA_MODEL_CONSTRUCT(FRAMEWORK, 0x0006)
 
 /* All codecs you can eat... */