From e1095496e1f2e2284f51a89a46083e932d6dc24f Mon Sep 17 00:00:00 2001 From: Zanxi Chen Date: Tue, 9 Nov 2021 19:49:10 +0800 Subject: [PATCH] mb/google/trogdor: Adjust mipi panel backlight gpio According hareware design, mipi panel backlight relies on AP_BKLTEN(GPIO_12) and TP_EN(GPIO_85). Meanwhile, TP_EN(GPIO_85) needs pull up to enable PP3300_DISP_ON before AP_BKLTEN(GPIO_12) up. BUG=b:197709288,b:199081803,b:205166230 BRANCH=trogdor TEST=emerge-strongbad coreboot Change-Id: Ie9920e5366f6b1ea9e0da228bd211317516b390a Signed-off-by: Zanxi Chen Reviewed-on: https://review.coreboot.org/c/coreboot/+/59044 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- src/mainboard/google/trogdor/board.h | 4 +++- src/mainboard/google/trogdor/mainboard.c | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mainboard/google/trogdor/board.h b/src/mainboard/google/trogdor/board.h index 208cafc4da..534cfe9e12 100644 --- a/src/mainboard/google/trogdor/board.h +++ b/src/mainboard/google/trogdor/board.h @@ -15,7 +15,7 @@ #define GPIO_AMP_ENABLE GPIO(23) /* Display specific GPIOS */ -#define GPIO_BACKLIGHT_ENABLE ((CONFIG(TROGDOR_HAS_MIPI_PANEL)) ? GPIO(85) : GPIO(12)) +#define GPIO_BACKLIGHT_ENABLE GPIO(12) /* MIPI panel specific GPIOs. Only for mipi_panel-enabled devices (e.g. Mrbland). */ #if CONFIG(TROGDOR_HAS_MIPI_PANEL) @@ -23,6 +23,7 @@ #define GPIO_AVDD_LCD_ENABLE GPIO(88) #define GPIO_AVEE_LCD_ENABLE GPIO(21) #define GPIO_VDD_RESET_1V8 GPIO(87) +#define GPIO_TP_EN GPIO(85) #define GPIO_EDP_BRIDGE_ENABLE dead_code_t(gpio_t) #define GPIO_EN_PP3300_DX_EDP dead_code_t(gpio_t) #define GPIO_PS8640_EDP_BRIDGE_PD_L dead_code_t(gpio_t) @@ -33,6 +34,7 @@ #define GPIO_AVDD_LCD_ENABLE dead_code_t(gpio_t) #define GPIO_AVEE_LCD_ENABLE dead_code_t(gpio_t) #define GPIO_VDD_RESET_1V8 dead_code_t(gpio_t) +#define GPIO_TP_EN dead_code_t(gpio_t) #define GPIO_EDP_BRIDGE_ENABLE (CONFIG(TROGDOR_REV0) ? GPIO(14) : GPIO(104)) #define GPIO_EN_PP3300_DX_EDP (CONFIG(TROGDOR_REV0) ? GPIO(106) : \ (CONFIG(BOARD_GOOGLE_TROGDOR) && board_id() == 1 ? GPIO(30) : \ diff --git a/src/mainboard/google/trogdor/mainboard.c b/src/mainboard/google/trogdor/mainboard.c index 2a2fa94235..cfc811d051 100644 --- a/src/mainboard/google/trogdor/mainboard.c +++ b/src/mainboard/google/trogdor/mainboard.c @@ -145,6 +145,12 @@ static void configure_mipi_panel(void) mdelay(5); gpio_output(GPIO_VDD_RESET_1V8, 1); } + /* + * In mipi panel, TP_EN(GPIO 85) need pull up before + * GPIO_BACKLIGHT_ENABLE(GPIO12) up. + */ + if (CONFIG(TROGDOR_HAS_MIPI_PANEL)) + gpio_output(GPIO_TP_EN, 1); } static struct panel_serializable_data *get_mipi_panel(enum lb_fb_orientation *orientation)