Matt DeVillier has submitted this change. ( https://review.coreboot.org/c/coreboot/+/79064?usp=email )
Change subject: mb/google/corsola: Configure I2C and I2S interface for ALC5650 ......................................................................
mb/google/corsola: Configure I2C and I2S interface for ALC5650
Configure I2S1 and I2C5 for ALC5650 to support beep sound in depthcharge.
BRANCH=corsola BUG=b:305828247 TEST=Verify devbeep in depthcharge console
Change-Id: Ibd098adb8d5568ad338bbfece0edfd0c38cbf854 Signed-off-by: Yang Wu wuyang5@huaqin.corp-partner.google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/79064 Reviewed-by: Yidi Lin yidilin@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Ruihai Zhou zhouruihai@huaqin.corp-partner.google.com Reviewed-by: Yu-Ping Wu yupingso@google.com --- M src/mainboard/google/corsola/mainboard.c 1 file changed, 20 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Yidi Lin: Looks good to me, approved Ruihai Zhou: Looks good to me, but someone else must approve Yu-Ping Wu: Looks good to me, approved
diff --git a/src/mainboard/google/corsola/mainboard.c b/src/mainboard/google/corsola/mainboard.c index b2c65eb..69e72d7 100644 --- a/src/mainboard/google/corsola/mainboard.c +++ b/src/mainboard/google/corsola/mainboard.c @@ -5,6 +5,7 @@ #include <device/device.h> #include <gpio.h> #include <soc/bl31.h> +#include <soc/i2c.h> #include <soc/msdc.h> #include <soc/spm.h> #include <soc/usb.h> @@ -12,7 +13,7 @@ #include "display.h" #include "gpio.h"
-static void configure_audio(void) +static void configure_alc1019(void) { mtcmos_audio_power_on();
@@ -23,6 +24,20 @@ gpio_set_mode(GPIO(EINT4), PAD_EINT4_FUNC_I2S3_DO); }
+static void configure_alc5645(void) +{ + mtcmos_audio_power_on(); + + /* Set up I2S */ + gpio_set_mode(GPIO(I2S1_MCK), PAD_I2S1_MCK_FUNC_I2S1_MCK); + gpio_set_mode(GPIO(I2S1_BCK), PAD_I2S1_BCK_FUNC_I2S1_BCK); + gpio_set_mode(GPIO(I2S1_LRCK), PAD_I2S1_LRCK_FUNC_I2S1_LRCK); + gpio_set_mode(GPIO(I2S1_DO), PAD_I2S1_DO_FUNC_I2S1_DO); + + /* Init I2C bus timing register for audio codecs */ + mtk_i2c_bus_init(I2C5, I2C_SPEED_STANDARD); +} + static void mainboard_init(struct device *dev) { mtk_msdc_configure_emmc(true); @@ -36,7 +51,10 @@
setup_usb_host();
- configure_audio(); + if (CONFIG(BOARD_GOOGLE_CHINCHOU)) + configure_alc5645(); + else + configure_alc1019();
if (spm_init()) printk(BIOS_ERR, "spm init failed, system suspend may not work\n");