From fe73a0e7b14668ec6722e92ff55b3600681ad346 Mon Sep 17 00:00:00 2001 From: Yidi Lin Date: Tue, 28 Nov 2023 16:03:44 +0800 Subject: mb/google/corsola: Use fw_config to differentiate audio amps Use fw_config to differentiate audio amps instead of the kconfig option. BRANCH=corsola BUG=b:305828247 TEST=Verify devbeep in depthcharge console Change-Id: I5f887f5e0d16dc14039fb12b636257d01339b2de Signed-off-by: Yidi Lin Signed-off-by: Yang Wu Reviewed-on: https://review.coreboot.org/c/coreboot/+/79309 Reviewed-by: Ruihai Zhou Reviewed-by: Yu-Ping Wu Tested-by: build bot (Jenkins) --- src/mainboard/google/corsola/devicetree.cb | 6 ++++++ src/mainboard/google/corsola/mainboard.c | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/mainboard/google/corsola') diff --git a/src/mainboard/google/corsola/devicetree.cb b/src/mainboard/google/corsola/devicetree.cb index 0e8bb91fc2..300ba7b8a7 100644 --- a/src/mainboard/google/corsola/devicetree.cb +++ b/src/mainboard/google/corsola/devicetree.cb @@ -1,4 +1,10 @@ ## SPDX-License-Identifier: GPL-2.0-only +fw_config + field AUDIO_AMP 28 29 + option AMP_ALC1019 0 + option AMP_ALC5645 1 + end +end chip soc/mediatek/mt8186 device cpu_cluster 0 on end diff --git a/src/mainboard/google/corsola/mainboard.c b/src/mainboard/google/corsola/mainboard.c index a6659a5b04..37f3a70941 100644 --- a/src/mainboard/google/corsola/mainboard.c +++ b/src/mainboard/google/corsola/mainboard.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -51,10 +52,11 @@ static void mainboard_init(struct device *dev) setup_usb_host(); - if (CONFIG(BOARD_GOOGLE_CHINCHOU)) - configure_alc5645(); - else + if (!fw_config_is_provisioned() || + fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_ALC1019))) configure_alc1019(); + else if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_ALC5645))) + configure_alc5645(); if (spm_init()) printk(BIOS_ERR, "spm init failed, system suspend may not work\n"); -- cgit v1.2.3