From 78a26aca8b8324115f3d8078747a74ee27a257a6 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Mon, 13 May 2024 11:11:53 +0200 Subject: mb/prodrive/hermes/hda_verb.c: Refactor port B Vref cfg Refactor the `get_port_b_vref_cfg()` function to only return the variable bits of the value. The NID itself is not connected, and the `misc` field in the verb conveys the Vref value. Change-Id: I5108f5339c5b002403a4e5339da6d52046c8bcbe Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/82395 Reviewed-by: Paul Menzel Reviewed-by: Patrick Rudolph Tested-by: build bot (Jenkins) --- src/mainboard/prodrive/hermes/hda_verb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mainboard/prodrive/hermes/hda_verb.c b/src/mainboard/prodrive/hermes/hda_verb.c index cab4fd344b..5876df5a2b 100644 --- a/src/mainboard/prodrive/hermes/hda_verb.c +++ b/src/mainboard/prodrive/hermes/hda_verb.c @@ -95,15 +95,15 @@ static u32 get_port_b_vref_cfg(uint8_t pink_rear_vref) switch (pink_rear_vref) { default: case 0: - return 0x411110f0; /* Disabled (Hi-Z) */ + return 0; /* Disabled (Hi-Z) */ case 1: - return 0x411111f0; /* 50% of LDO out */ + return 1; /* 50% of LDO out */ case 2: - return 0x411114f0; /* 80% of LDO out */ + return 4; /* 80% of LDO out */ case 3: - return 0x411115f0; /* 100% of LDO out */ + return 5; /* 100% of LDO out */ case 4: - return 0x411112f0; /* Ground */ + return 2; /* Ground */ } } @@ -145,7 +145,7 @@ static void mainboard_r0x_configure_alc888(u8 *base, u32 viddid) * persist after codec resets, a custom Realtek driver (ab)uses NID 0x12 * to restore port B Vref after resetting the codec. */ - AZALIA_PIN_CFG(0, 0x12, port_b_vref_cfg), + AZALIA_PIN_CFG(0, 0x12, 0x411110f0 | port_b_vref_cfg << 8), AZALIA_PIN_CFG(0, 0x19, front_mic_cfg), AZALIA_PIN_CFG(0, 0x1b, front_panel_cfg), 0x0205000d, /* Pin 37 vrefo hidden register - used as port C vref */ -- cgit v1.2.3