diff options
author | Yidi Lin <yidilin@chromium.org> | 2023-11-28 16:03:44 +0800 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-11-30 15:07:16 +0000 |
commit | fe73a0e7b14668ec6722e92ff55b3600681ad346 (patch) | |
tree | f374910a6e21f5b26655382dc44e16fa13938b92 | |
parent | 508296333b144487721d7efc4dcd240496ae579a (diff) |
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>
-rw-r--r-- | src/mainboard/google/corsola/devicetree.cb | 6 | ||||
-rw-r--r-- | src/mainboard/google/corsola/mainboard.c | 8 |
2 files changed, 11 insertions, 3 deletions
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 <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 @@ 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"); |