summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwuyang5 <wuyang5@huaqin.corp-partner.google.com>2023-11-02 09:33:01 +0800
committerMatt DeVillier <matt.devillier@amd.corp-partner.google.com>2023-11-17 15:03:01 +0000
commit823f95e8a39bb81e3a35dbf454063a0b119d1a0d (patch)
tree46f9461fc070d64b2edb1e2dc0e0a318523d1ae2 /src
parent9664463c712ddc95e402b1f3617bb2dbcd861035 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/corsola/mainboard.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/mainboard/google/corsola/mainboard.c b/src/mainboard/google/corsola/mainboard.c
index b2c65eb411..69e72d7d13 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 @@ static void configure_audio(void)
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 @@ static void mainboard_init(struct device *dev)
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");