diff options
author | Srinivasa Rao Mandadapu <srivasam@codeaurora.org> | 2021-08-27 19:31:34 +0530 |
---|---|---|
committer | Shelley Chen <shchen@google.com> | 2022-01-08 00:35:59 +0000 |
commit | 2360d7c2771536b785dbcb435f135c5eff713a46 (patch) | |
tree | a33e5ffa11aa0c7f37cfd11c022c46ccc697c9d3 | |
parent | 3538461468aa7b0b14e1c76e09f6104a3e551b4a (diff) |
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>
-rw-r--r-- | src/mainboard/google/herobrine/board.h | 5 | ||||
-rw-r--r-- | src/mainboard/google/herobrine/chromeos.c | 3 | ||||
-rw-r--r-- | src/mainboard/google/herobrine/mainboard.c | 13 |
3 files changed, 21 insertions, 0 deletions
diff --git a/src/mainboard/google/herobrine/board.h b/src/mainboard/google/herobrine/board.h index 0f396bc816..d336bce0ad 100644 --- a/src/mainboard/google/herobrine/board.h +++ b/src/mainboard/google/herobrine/board.h @@ -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 diff --git a/src/mainboard/google/herobrine/chromeos.c b/src/mainboard/google/herobrine/chromeos.c index 4c37ef129c..b5631fc8b2 100644 --- a/src/mainboard/google/herobrine/chromeos.c +++ b/src/mainboard/google/herobrine/chromeos.c @@ -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"}, diff --git a/src/mainboard/google/herobrine/mainboard.c b/src/mainboard/google/herobrine/mainboard.c index a97f97ef56..e929ec9365 100644 --- a/src/mainboard/google/herobrine/mainboard.c +++ b/src/mainboard/google/herobrine/mainboard.c @@ -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) |