mb/google/geralt: Replace GERALT_USE_MAX98390 with FW_CONFIG for TAS2563
Use FW_CONFIG to differentiate MAX98390 and TAS2563. Since config GERALT_USE_MAX98390 is no longer needed after using FW_CONFIG, we remove GERALT_USE_MAX98390 from Kconfig. BUG=b:345629159 BRANCH=none TEST=emerge-GERALT coreboot TEST=Verify beep function through deploy in depthcharge successfully. Change-Id: Ie9f0cbc30dd950b85581fc1924fa351efe1e0aab Signed-off-by: Rui Zhou <zhourui@huaqin.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/83287 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Yidi Lin <yidilin@google.com>
This commit is contained in:
@ -9,10 +9,6 @@ if BOARD_GOOGLE_GERALT_COMMON
|
|||||||
config GERALT_SDCARD_INIT
|
config GERALT_SDCARD_INIT
|
||||||
def_bool BOARD_GOOGLE_GERALT
|
def_bool BOARD_GOOGLE_GERALT
|
||||||
|
|
||||||
config GERALT_USE_MAX98390
|
|
||||||
def_bool BOARD_GOOGLE_CIRI || \
|
|
||||||
BOARD_GOOGLE_GERALT
|
|
||||||
|
|
||||||
config GERALT_USE_NAU8318
|
config GERALT_USE_NAU8318
|
||||||
def_bool n
|
def_bool n
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include <bootmode.h>
|
#include <bootmode.h>
|
||||||
#include <boot/coreboot_tables.h>
|
#include <boot/coreboot_tables.h>
|
||||||
#include <drivers/tpm/cr50.h>
|
#include <drivers/tpm/cr50.h>
|
||||||
|
#include <fw_config.h>
|
||||||
#include <gpio.h>
|
#include <gpio.h>
|
||||||
|
|
||||||
#include "gpio.h"
|
#include "gpio.h"
|
||||||
@ -53,17 +54,18 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||||||
lb_add_gpios(gpios, sd_card_gpios, ARRAY_SIZE(sd_card_gpios));
|
lb_add_gpios(gpios, sd_card_gpios, ARRAY_SIZE(sd_card_gpios));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CONFIG(GERALT_USE_MAX98390)) {
|
if (CONFIG(GERALT_USE_NAU8318)) {
|
||||||
struct lb_gpio max98390_gpios[] = {
|
|
||||||
{GPIO_RST_SPKR_L.id, ACTIVE_LOW, -1, "speaker reset"},
|
|
||||||
};
|
|
||||||
lb_add_gpios(gpios, max98390_gpios, ARRAY_SIZE(max98390_gpios));
|
|
||||||
} else if (CONFIG(GERALT_USE_NAU8318)) {
|
|
||||||
struct lb_gpio nau8318_gpios[] = {
|
struct lb_gpio nau8318_gpios[] = {
|
||||||
{GPIO_EN_SPKR.id, ACTIVE_HIGH, -1, "speaker enable"},
|
{GPIO_EN_SPKR.id, ACTIVE_HIGH, -1, "speaker enable"},
|
||||||
{GPIO_BEEP_ON_OD.id, ACTIVE_HIGH, -1, "beep enable"},
|
{GPIO_BEEP_ON_OD.id, ACTIVE_HIGH, -1, "beep enable"},
|
||||||
};
|
};
|
||||||
lb_add_gpios(gpios, nau8318_gpios, ARRAY_SIZE(nau8318_gpios));
|
lb_add_gpios(gpios, nau8318_gpios, ARRAY_SIZE(nau8318_gpios));
|
||||||
|
} else if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_MAX98390)) ||
|
||||||
|
fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_TAS2563))) {
|
||||||
|
struct lb_gpio smartamp_gpios[] = {
|
||||||
|
{GPIO_RST_SPKR_L.id, ACTIVE_LOW, -1, "speaker reset"},
|
||||||
|
};
|
||||||
|
lb_add_gpios(gpios, smartamp_gpios, ARRAY_SIZE(smartamp_gpios));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
## SPDX-License-Identifier: GPL-2.0-only
|
## SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
|
||||||
|
fw_config
|
||||||
|
field AUDIO_AMP 28 29
|
||||||
|
option AMP_MAX98390 0
|
||||||
|
option AMP_TAS2563 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
chip soc/mediatek/mt8188
|
chip soc/mediatek/mt8188
|
||||||
device cpu_cluster 0 on end
|
device cpu_cluster 0 on end
|
||||||
end
|
end
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <bootmode.h>
|
#include <bootmode.h>
|
||||||
#include <device/device.h>
|
#include <device/device.h>
|
||||||
|
#include <fw_config.h>
|
||||||
#include <soc/bl31.h>
|
#include <soc/bl31.h>
|
||||||
#include <soc/display.h>
|
#include <soc/display.h>
|
||||||
#include <soc/i2c.h>
|
#include <soc/i2c.h>
|
||||||
@ -31,8 +32,11 @@ static void configure_i2s(void)
|
|||||||
|
|
||||||
static void configure_audio(void)
|
static void configure_audio(void)
|
||||||
{
|
{
|
||||||
if (CONFIG(GERALT_USE_MAX98390)) {
|
if (CONFIG(GERALT_USE_NAU8318))
|
||||||
printk(BIOS_DEBUG, "Configure MAX98390 audio\n");
|
return;
|
||||||
|
|
||||||
|
if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_MAX98390)) ||
|
||||||
|
fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_TAS2563))) {
|
||||||
|
|
||||||
mtk_i2c_bus_init(I2C0, I2C_SPEED_FAST);
|
mtk_i2c_bus_init(I2C0, I2C_SPEED_FAST);
|
||||||
configure_i2s();
|
configure_i2s();
|
||||||
|
Reference in New Issue
Block a user