From 6200d53e312392673bb478f45adc5ed08f1dc015 Mon Sep 17 00:00:00 2001 From: Swathi Tamilselvan Date: Thu, 26 Feb 2026 10:41:15 +0530 Subject: [PATCH] mb/google/bluey: Use LPASS GPIO configure API for Soundwire GPIOs Update the API used to configure Soundwire GPIOs to the LPASS GPIO configure API, as these GPIOs are controlled by the LPASS subsystem. Applies to the Soundwire amplifier GPIOs: - GPIO_SNDW_AMP_0_ENABLE (GPIO 204) - GPIO_SNDW_AMP_1_ENABLE (GPIO 205) - GPIO_SNDW_0_SCL (GPIO 202) - GPIO_SNDW_0_SDA (GPIO 203) Test=1. Create an image.serial.bin and verify it boots successfully on X1P42100. 2. Dump the corresponding TLMM GPIO CFG register and verify if the eGPIO bit is disabled. The register details are part of HRD-X1P42100-S1 document. https://docs.qualcomm.com/bundle/resource/topics/HRD-X1P42100-S1/ Change-Id: I9cc16b659fc5302ef81951ffbad8e62ce90e2890 Signed-off-by: Swathi Tamilselvan Reviewed-on: https://review.coreboot.org/c/coreboot/+/91561 Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik --- src/mainboard/google/bluey/board.h | 4 ++++ src/mainboard/google/bluey/chromeos.c | 3 --- src/mainboard/google/bluey/mainboard.c | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/mainboard/google/bluey/board.h b/src/mainboard/google/bluey/board.h index 0544381e69..361aa6587c 100644 --- a/src/mainboard/google/bluey/board.h +++ b/src/mainboard/google/bluey/board.h @@ -28,6 +28,10 @@ #endif /* Soundwire AMP GPIOs */ +#define GPIO_SNDW_0_SCL GPIO(202) +#define GPIO_FUN_SNDW_0_SCL 4 /* 4=LPASS_10:WSA_SWR_CLK, Also try 1=ENTERPRISEMGMT_11 */ +#define GPIO_SNDW_0_SDA GPIO(203) +#define GPIO_FUN_SNDW_0_SDA 3 /* 3=LPASS_11:WSA_SWR_DATA */ #define GPIO_SNDW_AMP_0_ENABLE GPIO(204) #define GPIO_SNDW_AMP_1_ENABLE GPIO(205) diff --git a/src/mainboard/google/bluey/chromeos.c b/src/mainboard/google/bluey/chromeos.c index 0f2b7da21f..e8609d4c06 100644 --- a/src/mainboard/google/bluey/chromeos.c +++ b/src/mainboard/google/bluey/chromeos.c @@ -21,9 +21,6 @@ void setup_chromeos_gpios(void) gpio_input_irq(GPIO_FPMCU_INT, IRQ_TYPE_LEVEL, GPIO_PULL_UP); } } - - gpio_output(GPIO_SNDW_AMP_0_ENABLE, 0); - gpio_output(GPIO_SNDW_AMP_1_ENABLE, 0); } void fill_lb_gpios(struct lb_gpios *gpios) diff --git a/src/mainboard/google/bluey/mainboard.c b/src/mainboard/google/bluey/mainboard.c index ac80ceef80..3bc7557519 100644 --- a/src/mainboard/google/bluey/mainboard.c +++ b/src/mainboard/google/bluey/mainboard.c @@ -92,6 +92,25 @@ static void setup_usb_typec(void) gpio_output(GPIO_USB_C1_RETIMER_RESET_L, 1); } +static void setup_audio_gpios(void) +{ + gpio_configure_no_egpio(GPIO_SNDW_AMP_0_ENABLE, GPIO_FUNC_GPIO, + GPIO_NO_PULL, GPIO_2MA, GPIO_OUTPUT); + gpio_set(GPIO_SNDW_AMP_0_ENABLE, 0); + gpio_configure_no_egpio(GPIO_SNDW_AMP_1_ENABLE, GPIO_FUNC_GPIO, + GPIO_NO_PULL, GPIO_2MA, GPIO_OUTPUT); + gpio_set(GPIO_SNDW_AMP_1_ENABLE, 0); + gpio_configure_no_egpio(GPIO_SNDW_0_SCL, GPIO_FUN_SNDW_0_SCL, + GPIO_NO_PULL, GPIO_16MA, GPIO_OUTPUT); + gpio_configure_no_egpio(GPIO_SNDW_0_SDA, GPIO_FUN_SNDW_0_SDA, + GPIO_NO_PULL, GPIO_16MA, GPIO_OUTPUT); +} + +static void setup_audio(void) +{ + setup_audio_gpios(); +} + static void setup_usb(void) { setup_usb_typec(); @@ -236,6 +255,9 @@ static void mainboard_init(struct device *dev) /* Setup USB related initial config */ setup_usb(); + + /* Setup audio related initial config */ + setup_audio(); } static void mainboard_enable(struct device *dev)