From a8a9552d75f91b05a65a1da7281e877d71f87b94 Mon Sep 17 00:00:00 2001 From: Rex-BC Chen Date: Tue, 4 Jan 2022 11:07:22 +0800 Subject: [PATCH] mb/google/corsola: Configure audio According schematics, we configure audio by turning on setting of audio power and selecting I2S pin-mux. Schematics references: kingler: schematic_kingler_proto0_gerber_20211115.pdf krabby: crab_proto 0_20211112_final.pdf BUG=b:204164695 TEST=Verified by CLI command(badusbbeep/devbeep) on kingler and krabby Signed-off-by: Jiaxin Yu Change-Id: Ia6374d0e5535b7cff4df8759312786fef8b94b6b Reviewed-on: https://review.coreboot.org/c/coreboot/+/60738 Tested-by: build bot (Jenkins) Reviewed-by: Rex-BC Chen Reviewed-by: Hung-Te Lin --- src/mainboard/google/corsola/mainboard.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/mainboard/google/corsola/mainboard.c b/src/mainboard/google/corsola/mainboard.c index 910d8d6ea9..959dca6767 100644 --- a/src/mainboard/google/corsola/mainboard.c +++ b/src/mainboard/google/corsola/mainboard.c @@ -24,6 +24,17 @@ static void register_reset_to_bl31(void) register_bl31_aux_param(¶m_reset.h); } +static void configure_audio(void) +{ + mtcmos_audio_power_on(); + + /* Set up I2S */ + gpio_set_mode(GPIO(I2S2_MCK), PAD_I2S2_MCK_FUNC_I2S2_MCK); + gpio_set_mode(GPIO(I2S2_BCK), PAD_I2S2_BCK_FUNC_I2S2_BCK); + gpio_set_mode(GPIO(I2S2_LRCK), PAD_I2S2_LRCK_FUNC_I2S2_LRCK); + gpio_set_mode(GPIO(EINT4), PAD_EINT4_FUNC_I2S3_DO); +} + static void mainboard_init(struct device *dev) { mtk_msdc_configure_emmc(true); @@ -35,6 +46,8 @@ static void mainboard_init(struct device *dev) setup_usb_host(); + configure_audio(); + if (spm_init()) printk(BIOS_ERR, "spm init failed, system suspend may not work\n");