Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/79309?usp=email )
Change subject: mb/google/corsola: Use fw_config to differentiate audio amps ......................................................................
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 yidilin@chromium.org Signed-off-by: Yang Wu wuyang5@huaqin.corp-partner.google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/79309 Reviewed-by: Ruihai Zhou zhouruihai@huaqin.corp-partner.google.com Reviewed-by: Yu-Ping Wu yupingso@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/google/corsola/devicetree.cb M src/mainboard/google/corsola/mainboard.c 2 files changed, 11 insertions(+), 3 deletions(-)
Approvals: Ruihai Zhou: Looks good to me, but someone else must approve build bot (Jenkins): Verified Yu-Ping Wu: Looks good to me, approved
diff --git a/src/mainboard/google/corsola/devicetree.cb b/src/mainboard/google/corsola/devicetree.cb index 0e8bb91..300ba7b 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 a6659a5..37f3a70 100644 --- a/src/mainboard/google/corsola/mainboard.c +++ b/src/mainboard/google/corsola/mainboard.c @@ -3,6 +3,7 @@ #include <bootmode.h> #include <console/console.h> #include <device/device.h> +#include <fw_config.h> #include <gpio.h> #include <soc/bl31.h> #include <soc/i2c.h> @@ -51,10 +52,11 @@
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");