Yang Wu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/85858?usp=email )
Change subject: mb/google/rauru: Add alc5650 support ......................................................................
mb/google/rauru: Add alc5650 support
Configure ALC5650 for hylia to support beep sound in depthcharge.
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 --- M src/mainboard/google/rauru/chromeos.c M src/mainboard/google/rauru/devicetree.cb M src/mainboard/google/rauru/gpio.h M src/mainboard/google/rauru/mainboard.c 4 files changed, 30 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/58/85858/1
diff --git a/src/mainboard/google/rauru/chromeos.c b/src/mainboard/google/rauru/chromeos.c index f530396..6a34cb9 100644 --- a/src/mainboard/google/rauru/chromeos.c +++ b/src/mainboard/google/rauru/chromeos.c @@ -46,8 +46,14 @@ {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)); } diff --git a/src/mainboard/google/rauru/devicetree.cb b/src/mainboard/google/rauru/devicetree.cb index 7f6dc59..1705dbe 100644 --- a/src/mainboard/google/rauru/devicetree.cb +++ b/src/mainboard/google/rauru/devicetree.cb @@ -4,6 +4,7 @@ field AUDIO_AMP 28 29 option AMP_NAU8318 0 option AMP_TAS2563 1 + option AMP_ALC5645 2 end end
diff --git a/src/mainboard/google/rauru/gpio.h b/src/mainboard/google/rauru/gpio.h index 6191e05..ef7db86 100644 --- a/src/mainboard/google/rauru/gpio.h +++ b/src/mainboard/google/rauru/gpio.h @@ -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 diff --git a/src/mainboard/google/rauru/mainboard.c b/src/mainboard/google/rauru/mainboard.c index a49caf6..c1090e3 100644 --- a/src/mainboard/google/rauru/mainboard.c +++ b/src/mainboard/google/rauru/mainboard.c @@ -29,11 +29,29 @@ gpio_set_mode(GPIO_I2SO4_D0, GPIO_FUNC(I2SOUT1_DO, I2SOUT4_DATA0)); }
+static void configure_alc5645(void) +{ + 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); +} 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(); + printk(BIOS_INFO, "Audio configure TAS2563\n"); + } else if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_ALC5645))) { + configure_alc5645(); + printk(BIOS_INFO, "Audio configure ALC5645\n"); + } else { + printk(BIOS_INFO, "Audio configure default amps NAU8318\n"); }
printk(BIOS_INFO, "%s: done\n", __func__);