mb/google/herobrine: Add support for audio

Add GPIO configuration for target specific i2s ports.

BUG=b:182963902
TEST=Validated on qualcomm sc7280 development board
     Boot on herobrine board (no speakers to test yet)

Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Change-Id: I2ce95332f892d5d4acb2755307df84d37feb8002
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57449
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Srinivasa Rao Mandadapu 2021-08-27 19:31:34 +05:30 committed by Shelley Chen
parent 3538461468
commit 2360d7c277
3 changed files with 21 additions and 0 deletions

View File

@ -31,6 +31,11 @@
#define USB_HUB_LDO_EN GPIO(157)
#endif
#define GPIO_AMP_ENABLE GPIO(63)
#define GPIO_MI2S1_SCK GPIO(106)
#define GPIO_MI2S1_DATA0 GPIO(107)
#define GPIO_MI2S1_WS GPIO(108)
#define QCOM_SC7280_SKU1 0x0
#define QCOM_SC7280_SKU2 0x1

View File

@ -21,6 +21,7 @@ void setup_chromeos_gpios(void)
gpio_output(GPIO_FP_RST_L, 0);
gpio_output(GPIO_EN_FP_RAILS, 0);
}
gpio_output(GPIO_AMP_ENABLE, 0);
}
void fill_lb_gpios(struct lb_gpios *gpios)
@ -28,6 +29,8 @@ void fill_lb_gpios(struct lb_gpios *gpios)
const struct lb_gpio chromeos_gpios[] = {
{GPIO_SD_CD_L.addr, ACTIVE_LOW, gpio_get(GPIO_SD_CD_L),
"SD card detect"},
{GPIO_AMP_ENABLE.addr, ACTIVE_HIGH, gpio_get(GPIO_AMP_ENABLE),
"speaker enable"},
#if CONFIG(EC_GOOGLE_CHROMEEC)
{GPIO_EC_IN_RW.addr, ACTIVE_LOW, gpio_get(GPIO_EC_IN_RW),
"EC in RW"},

View File

@ -36,6 +36,18 @@ static void configure_sdhci(void)
write32((void *)SDC2_TLMM_CFG_ADDR, 0x1FE4);
}
static void qi2s_configure_gpios(void)
{
gpio_configure(GPIO_MI2S1_SCK, GPIO106_FUNC_MI2S1_SCK,
GPIO_NO_PULL, GPIO_16MA, GPIO_OUTPUT);
gpio_configure(GPIO_MI2S1_WS, GPIO108_FUNC_MI2S1_WS,
GPIO_NO_PULL, GPIO_16MA, GPIO_OUTPUT);
gpio_configure(GPIO_MI2S1_DATA0, GPIO107_FUNC_MI2S1_DATA0,
GPIO_NO_PULL, GPIO_16MA, GPIO_OUTPUT);
}
static void mainboard_init(struct device *dev)
{
/* Configure clock for eMMC */
@ -90,6 +102,7 @@ static void mainboard_init(struct device *dev)
gpio_output(GPIO_FP_RST_L, 1);
setup_usb();
qi2s_configure_gpios();
}
static void mainboard_enable(struct device *dev)