mb/google/skywalker: Add CS35L51 support for beep sound for Padme

Add the FW_CONFIG configuration for the Padme project of audio amp
and set up I2S for CS35L51.

BUG=b:422688421
TEST=emerge-jedi coreboot chromeos-bootimage
BRANCH=Skywalker

Change-Id: I3486561dcc8695d3d3585c4844654bb7c68a2979
Signed-off-by: Youwen Huang <huangyouwen5@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/89273
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yidi Lin <yidilin@google.com>
This commit is contained in:
Youwen Huang 2025-09-19 20:29:09 +08:00 committed by Yu-Ping Wu
commit 61488ffd57
3 changed files with 28 additions and 2 deletions

View file

@ -81,6 +81,11 @@ void fill_lb_gpios(struct lb_gpios *gpios)
{GPIO_EN_SPKR.id, ACTIVE_HIGH, -1, "alc5645_spk_en"},
};
lb_add_gpios(gpios, alc5645_gpios, ARRAY_SIZE(alc5645_gpios));
} else if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_CS35L51))) {
struct lb_gpio cs35l51_gpios[] = {
{GPIO_RST_SPKR_L.id, ACTIVE_LOW, -1, "speaker reset"},
};
lb_add_gpios(gpios, cs35l51_gpios, ARRAY_SIZE(cs35l51_gpios));
}
struct lb_gpio edp_pwm_backlight_gpios[] = {

View file

@ -9,6 +9,7 @@ fw_config
option AMP_RT9123 0
option AMP_RT1019 1
option AMP_ALC5645 3
option AMP_CS35L51 4
end
field STORAGE 30 31

View file

@ -22,13 +22,31 @@
#define AFE_SE_SECURE_CON1 (AUDIO_BASE + 0x5634)
static void configure_rt9123_rt1019(void)
static void setup_i2s_speaker(void)
{
/* SoC I2S */
gpio_set_mode(GPIO_I2S_SPKR_BCK, GPIO_FUNC(DMIC0_DAT0, I2SOUT1_BCK));
gpio_set_mode(GPIO_I2S_SPKR_LRCK, GPIO_FUNC(DMIC1_CLK, I2SOUT1_LRCK));
gpio_set_mode(GPIO_I2S_SPKR_DO, GPIO_FUNC(DMIC1_DAT0, I2SOUT1_DO));
printk(BIOS_INFO, "%s: I2S configuration done\n", __func__);
}
static void configure_rt9123_rt1019(void)
{
/* Set the SOC corresponding pin to I2S related function */
setup_i2s_speaker();
printk(BIOS_INFO, "%s: AMP configuration done\n", __func__);
}
static void configure_cs35l51(void)
{
/* Set the SOC corresponding pin to I2S related function */
setup_i2s_speaker();
/* Init I2C bus timing register for audio codecs */
mtk_i2c_bus_init(I2C7, I2C_SPEED_STANDARD);
printk(BIOS_INFO, "%s: AMP configuration done\n", __func__);
}
@ -59,6 +77,8 @@ static void configure_audio(void)
configure_rt9123_rt1019();
else if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_ALC5645)))
configure_alc5645();
else if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_CS35L51)))
configure_cs35l51();
else
printk(BIOS_WARNING, "Unknown amp\n");
}