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>
This commit is contained in:
Yidi Lin 2023-11-28 16:03:44 +08:00 committed by Felix Held
parent 508296333b
commit fe73a0e7b1
2 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,10 @@
## SPDX-License-Identifier: GPL-2.0-only ## 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 chip soc/mediatek/mt8186
device cpu_cluster 0 on end device cpu_cluster 0 on end

View File

@ -3,6 +3,7 @@
#include <bootmode.h> #include <bootmode.h>
#include <console/console.h> #include <console/console.h>
#include <device/device.h> #include <device/device.h>
#include <fw_config.h>
#include <gpio.h> #include <gpio.h>
#include <soc/bl31.h> #include <soc/bl31.h>
#include <soc/i2c.h> #include <soc/i2c.h>
@ -51,10 +52,11 @@ static void mainboard_init(struct device *dev)
setup_usb_host(); setup_usb_host();
if (CONFIG(BOARD_GOOGLE_CHINCHOU)) if (!fw_config_is_provisioned() ||
configure_alc5645(); fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_ALC1019)))
else
configure_alc1019(); configure_alc1019();
else if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_ALC5645)))
configure_alc5645();
if (spm_init()) if (spm_init())
printk(BIOS_ERR, "spm init failed, system suspend may not work\n"); printk(BIOS_ERR, "spm init failed, system suspend may not work\n");