mb/starlabs/starfighter/mtl: add speaker idle CFR option
Realtek advised leaving the StarFighter speaker path idle with GPIO2 low and LINE2 EAPD disabled when no audio is playing. Add a "Legacy Speaker Control" CFR option for the Meteor Lake variant so coreboot can optionally boot the codec in that muted state. This avoids the cold-boot / G3 speaker pop when paired with the Linux runtime sequencing fix that asserts EAPD and GPIO2 only for playback. Keep the option enabled by default so existing kernels continue to use the legacy speaker setup. Without the matching Linux change, forcing GPIO2 low at boot would leave the external speaker amp disabled and result in no speaker output. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I62427d3f13b8a68a58bca4ed7896482da4abf23b Reviewed-on: https://review.coreboot.org/c/coreboot/+/91662 Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
f3c656b76a
commit
493770d730
4 changed files with 55 additions and 1 deletions
|
|
@ -14,8 +14,9 @@ static void disable_microphone(uint8_t *base)
|
|||
azalia_program_verb_table(base, override_verb, ARRAY_SIZE(override_verb));
|
||||
}
|
||||
|
||||
void mainboard_azalia_program_runtime_verbs(uint8_t *base, uint32_t viddid)
|
||||
void __weak mainboard_azalia_program_runtime_verbs(uint8_t *base, uint32_t viddid)
|
||||
{
|
||||
(void)viddid;
|
||||
if (get_uint_option("microphone", 1) == 0)
|
||||
disable_microphone(base);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,25 @@
|
|||
#include <variants.h>
|
||||
#include <common/cfr.h>
|
||||
|
||||
#if CONFIG(BOARD_STARLABS_STARFIGHTER_MTL)
|
||||
static const struct sm_object legacy_speaker_control = SM_DECLARE_BOOL({
|
||||
.opt_name = "legacy_speaker_control",
|
||||
.ui_name = "Legacy Speaker Control",
|
||||
.ui_helptext = "Enabled: keep the default speaker initialization.\n"
|
||||
"Disabled: boot with GPIO2 low and LINE2 EAPD off "
|
||||
"so the speakers start muted.",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
static struct sm_obj_form audio_group = {
|
||||
.ui_name = "Audio",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&legacy_speaker_control,
|
||||
NULL
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
static struct sm_obj_form battery_group = {
|
||||
.ui_name = "Battery",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
|
|
@ -128,6 +147,9 @@ static struct sm_obj_form wireless_group = {
|
|||
};
|
||||
|
||||
static struct sm_obj_form *sm_root[] = {
|
||||
#if CONFIG(BOARD_STARLABS_STARFIGHTER_MTL)
|
||||
&audio_group,
|
||||
#endif
|
||||
&battery_group,
|
||||
&debug_group,
|
||||
#if CONFIG(DRIVERS_INTEL_USB4_RETIMER)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ romstage-y += romstage.c
|
|||
ramstage-y += board_id.c
|
||||
ramstage-y += devtree.c
|
||||
ramstage-y += gpio.c
|
||||
ramstage-y += hda.c
|
||||
ramstage-y += hda_verb.c
|
||||
ramstage-y += ramstage.c
|
||||
$(call add_vbt_to_cbfs, vbt_qhd.bin, data_qhd.vbt)
|
||||
|
|
|
|||
30
src/mainboard/starlabs/starfighter/variants/mtl/hda.c
Normal file
30
src/mainboard/starlabs/starfighter/variants/mtl/hda.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <device/azalia_codec/realtek.h>
|
||||
#include <device/azalia_device.h>
|
||||
#include <option.h>
|
||||
|
||||
/* Leave the speaker path muted so the OS can sequence EAPD and GPIO2 later. */
|
||||
static const uint32_t speaker_idle_verb[] = {
|
||||
AZALIA_VERB_12B(0, 0x01, 0x716, 0x04),
|
||||
AZALIA_VERB_12B(0, 0x01, 0x717, 0x04),
|
||||
AZALIA_VERB_12B(0, 0x01, 0x715, 0x00),
|
||||
AZALIA_VERB_12B(0, ALC269_LINE2, 0x70c, 0x00),
|
||||
};
|
||||
|
||||
static const uint32_t microphone_disable_verb[] = {
|
||||
AZALIA_PIN_CFG(0, ALC269_DMIC12, AZALIA_PIN_CFG_NC(0)),
|
||||
};
|
||||
|
||||
void mainboard_azalia_program_runtime_verbs(uint8_t *base, uint32_t viddid)
|
||||
{
|
||||
(void)viddid;
|
||||
|
||||
if (get_uint_option("microphone", 1) == 0)
|
||||
azalia_program_verb_table(base, microphone_disable_verb,
|
||||
ARRAY_SIZE(microphone_disable_verb));
|
||||
|
||||
if (get_uint_option("legacy_speaker_control", 1) == 0)
|
||||
azalia_program_verb_table(base, speaker_idle_verb,
|
||||
ARRAY_SIZE(speaker_idle_verb));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue