summaryrefslogtreecommitdiff
path: root/config/coreboot/default
diff options
context:
space:
mode:
authorRiku Viitanen <riku.viitanen@protonmail.com>2025-12-02 21:58:04 +0200
committerRiku Viitanen <riku.viitanen@protonmail.com>2025-12-02 21:58:53 +0200
commit2dea4b79b29781307d5f002c38b963291ed51970 (patch)
treebaefc9fed8bffcb8cb7389a815d4dbeafa4b8012 /config/coreboot/default
parent9d740e95129ffd3b77623f327d6057a2459586c8 (diff)
T480: Fix headphone jack detection
Recently, a HDA verb bugfix was merged to coreboot: https://review.coreboot.org/c/coreboot/+/90023 Tested on a T480. Before the fix, detection *never* worked. After fix, it seems to reliably work. TODO: update docs to reflect this. Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
Diffstat (limited to 'config/coreboot/default')
-rw-r--r--config/coreboot/default/patches/0044-mb-lenovo-t480-Fix-headphone-jack.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/config/coreboot/default/patches/0044-mb-lenovo-t480-Fix-headphone-jack.patch b/config/coreboot/default/patches/0044-mb-lenovo-t480-Fix-headphone-jack.patch
new file mode 100644
index 00000000..92e18e57
--- /dev/null
+++ b/config/coreboot/default/patches/0044-mb-lenovo-t480-Fix-headphone-jack.patch
@@ -0,0 +1,83 @@
+From 5d463e5e0c33f1788d329ba07ebc20dad552c49e Mon Sep 17 00:00:00 2001
+From: Arthur Heymans <arthur@aheymans.xyz>
+Date: Thu, 13 Nov 2025 15:45:46 +0100
+Subject: [PATCH] mb/lenovo/t480: Fix headphone jack
+
+Add additional register configuration for the Realtek ALC257 audio
+codec on the Lenovo ThinkPad T480. This includes:
+
+- Hidden register SW reset sequence
+- ClassD 2W amplifier configuration
+- Jack detection (JD1) setup for headphone port
+- Silence data mode threshold setting at -84dB
+
+Shamelessly taken from google/brya/variants/pujjolo/hda_verb.c
+
+Change-Id: Ib77138d782ceb9feeaef82935bc1c0d5c3066183
+Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
+Reviewed-on: https://review.coreboot.org/c/coreboot/+/90023
+Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
+Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
+Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
+---
+ .../sklkbl_thinkpad/variants/t480/hda_verb.c | 37 ++++++++++++++++++-
+ 1 file changed, 36 insertions(+), 1 deletion(-)
+
+diff --git a/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480/hda_verb.c b/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480/hda_verb.c
+index 3a951ce0da..fc8cac8680 100644
+--- a/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480/hda_verb.c
++++ b/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480/hda_verb.c
+@@ -5,7 +5,7 @@
+ const u32 cim_verb_data[] = {
+ 0x10ec0257, // Vendor/Device ID: Realtek ALC257
+ 0x17aa225d, // Subsystem ID
+- 11,
++ 18,
+ AZALIA_SUBVENDOR(0, 0x17aa225d),
+
+ AZALIA_PIN_CFG(0, 0x12, AZALIA_PIN_DESC(
+@@ -51,6 +51,41 @@ const u32 cim_verb_data[] = {
+ 1, 15
+ )),
+
++ //==========Widget node 0x20 - 0 :Hidden register SW reset
++ 0x0205001A,
++ 0x0204C003,
++ 0x0205001A,
++ 0x0204C003,
++ 0x05850000,
++ 0x0584F880,
++ 0x05850000,
++ 0x0584F880,
++ //==========Widget node 0x20 - 1 : ClassD 2W
++ 0x02050038,
++ 0x02048981,
++ 0x0205001B,
++ 0x02040A4B,
++ //==========Widget node 0x20 - 2
++ 0x0205003C,
++ 0x02043154,
++ 0x0205003C,
++ 0x02043114,
++ //==========Widget node 0x20 - 3 :
++ 0x02050046,
++ 0x02040004,
++ 0x05750003,
++ 0x057409A3,
++ //==========Widget node 0x20 - 4 :JD1 enable 1JD port for HP JD
++ 0x02050009,
++ 0x02046003,
++ 0x0205000A,
++ 0x02047770,
++ //==========Widget node 0x20 - 5 : Silence data mode Threshold (-84dB)
++ 0x02050037,
++ 0x0204FE15,
++ 0x02050030,
++ 0x02049004,
++
+ 0x8086280b, // Vendor/Device ID: Intel Kabylake HDMI
+ 0x80860101, // Subsystem ID
+ 4,
+--
+2.52.0
+