mb/google/rauru: Add ALC5650 support
Configure ALC5650 for Hylia to support beep sound in the payload. BRANCH=rauru BUG=b:383376419 TEST=Verify devbeep in depthcharge console Change-Id: I2c247be87ad212fa52e21e1e6da17c07d82f1988 Signed-off-by: Yang Wu <wuyang5@huaqin.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/85858 Reviewed-by: Yidi Lin <yidilin@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
parent
67ba09b6c5
commit
dccf1380b1
4 changed files with 36 additions and 2 deletions
|
|
@ -46,8 +46,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
{GPIO_EN_SPKR.id, ACTIVE_LOW, -1, "speaker reset"},
|
||||
};
|
||||
|
||||
struct lb_gpio alc5645_gpios[] = {
|
||||
{GPIO_EN_SPKR.id, ACTIVE_HIGH, -1, "speaker enable"},
|
||||
};
|
||||
|
||||
if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_TAS2563)))
|
||||
lb_add_gpios(gpios, smartamp_gpios, ARRAY_SIZE(smartamp_gpios));
|
||||
else if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_ALC5645)))
|
||||
lb_add_gpios(gpios, alc5645_gpios, ARRAY_SIZE(alc5645_gpios));
|
||||
else
|
||||
lb_add_gpios(gpios, nau8318_gpios, ARRAY_SIZE(nau8318_gpios));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ fw_config
|
|||
field AUDIO_AMP 28 29
|
||||
option AMP_NAU8318 0
|
||||
option AMP_TAS2563 1
|
||||
option AMP_ALC5645 2
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,11 @@
|
|||
#define GPIO_I2SI4_LRCK GPIO(I2SIN1_LRCK)
|
||||
#define GPIO_I2SO4_D0 GPIO(I2SOUT1_DO)
|
||||
|
||||
#define GPIO_I2SI6_MCK GPIO(I2SIN0_MCK)
|
||||
#define GPIO_I2SI6_BCK GPIO(I2SIN0_BCK)
|
||||
#define GPIO_I2SI6_LRCK GPIO(I2SIN0_LRCK)
|
||||
#define GPIO_I2SO6_D0 GPIO(I2SOUT0_DO)
|
||||
|
||||
void setup_chromeos_gpios(void);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#define AFE_SE_SECURE_CON1 (AUDIO_BASE + 0x5634)
|
||||
|
||||
static void configure_i2s(void)
|
||||
static void configure_tas2563(void)
|
||||
{
|
||||
/* Switch to normal mode */
|
||||
write32p(AFE_SE_SECURE_CON1, 0x0);
|
||||
|
|
@ -27,13 +27,35 @@ static void configure_i2s(void)
|
|||
gpio_set_mode(GPIO_I2SI4_BCK, GPIO_FUNC(I2SIN1_BCK, I2SIN4_BCK));
|
||||
gpio_set_mode(GPIO_I2SI4_LRCK, GPIO_FUNC(I2SIN1_LRCK, I2SIN4_LRCK));
|
||||
gpio_set_mode(GPIO_I2SO4_D0, GPIO_FUNC(I2SOUT1_DO, I2SOUT4_DATA0));
|
||||
|
||||
printk(BIOS_INFO, "%s: done\n", __func__);
|
||||
}
|
||||
|
||||
static void configure_alc5645(void)
|
||||
{
|
||||
/* Switch to normal mode */
|
||||
write32p(AFE_SE_SECURE_CON1, 0x0);
|
||||
|
||||
/* Set up I2S */
|
||||
gpio_set_mode(GPIO_I2SI6_MCK, GPIO_FUNC(I2SIN0_MCK, I2S_MCK0));
|
||||
gpio_set_mode(GPIO_I2SI6_BCK, GPIO_FUNC(I2SIN0_BCK, I2SIN6_0_BCK));
|
||||
gpio_set_mode(GPIO_I2SI6_LRCK, GPIO_FUNC(I2SIN0_LRCK, I2SIN6_0_LRCK));
|
||||
gpio_set_mode(GPIO_I2SO6_D0, GPIO_FUNC(I2SOUT0_DO, I2SOUT6_0_DO));
|
||||
|
||||
/* Init I2C bus timing register for audio codecs */
|
||||
mtk_i2c_bus_init(I2C3, I2C_SPEED_STANDARD);
|
||||
|
||||
printk(BIOS_INFO, "%s: done\n", __func__);
|
||||
}
|
||||
static void configure_audio(void)
|
||||
{
|
||||
if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_TAS2563))) {
|
||||
mtk_i2c_bus_init(I2C3, I2C_SPEED_FAST);
|
||||
configure_i2s();
|
||||
configure_tas2563();
|
||||
} else if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_ALC5645))) {
|
||||
configure_alc5645();
|
||||
} else {
|
||||
printk(BIOS_INFO, "Audio configure default amps NAU8318\n");
|
||||
}
|
||||
|
||||
printk(BIOS_INFO, "%s: done\n", __func__);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue