Hung-Te Lin has submitted this change. ( https://review.coreboot.org/c/coreboot/+/47380 )
Change subject: mb/google/kukui: Add panel api after dsi start ......................................................................
mb/google/kukui: Add panel api after dsi start
Some bridge chip or panel requires dsi signal output before dsi receiver works.
BUG=b:168728787 BRANCH=kukui TEST=Display is normal on Kukui
Signed-off-by: Jitao Shi jitao.shi@mediatek.com Change-Id: I3bded27087490f32ee233e615cfad1fd05fb582d Reviewed-on: https://review.coreboot.org/c/coreboot/+/47380 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Yu-Ping Wu yupingso@google.com --- M src/mainboard/google/kukui/mainboard.c M src/mainboard/google/kukui/panel.h M src/mainboard/google/kukui/panel_anx7625.c 3 files changed, 36 insertions(+), 26 deletions(-)
Approvals: build bot (Jenkins): Verified Yu-Ping Wu: Looks good to me, approved
diff --git a/src/mainboard/google/kukui/mainboard.c b/src/mainboard/google/kukui/mainboard.c index a197a7f..7efa01b 100644 --- a/src/mainboard/google/kukui/mainboard.c +++ b/src/mainboard/google/kukui/mainboard.c @@ -168,6 +168,10 @@ printk(BIOS_ERR, "%s: Failed in DSI init.\n", __func__); return false; } + + if (panel->post_power_on) + panel->post_power_on(); + mtk_ddp_mode_set(edid); struct fb_info *info = fb_new_framebuffer_info_from_edid(edid, 0); if (info) diff --git a/src/mainboard/google/kukui/panel.h b/src/mainboard/google/kukui/panel.h index 7ae31dd..1749565 100644 --- a/src/mainboard/google/kukui/panel.h +++ b/src/mainboard/google/kukui/panel.h @@ -21,6 +21,7 @@ const char *name; /* Panel name for constructing CBFS file name */ struct panel_serializable_data *s; void (*power_on)(void); /* Callback to turn on panel */ + void (*post_power_on)(void); /* Callback to run after panel is turned on */ };
/* Returns the panel description from given ID. */ diff --git a/src/mainboard/google/kukui/panel_anx7625.c b/src/mainboard/google/kukui/panel_anx7625.c index cc41c86..aa22cf3 100644 --- a/src/mainboard/google/kukui/panel_anx7625.c +++ b/src/mainboard/google/kukui/panel_anx7625.c @@ -9,6 +9,33 @@
#include "panel.h"
+#define ANX7625_I2C_BUS 4 + +static struct panel_serializable_data anx7625_data = { + .orientation = LB_FB_ORIENTATION_NORMAL, + .init = { INIT_END_CMD }, +}; + +static void dummy_power_on(void) +{ + /* + * The panel has been already powered on when getting panel information + * so we should do nothing here. + */ +} + +static void start_anx7625(void) +{ + if (anx7625_dp_start(ANX7625_I2C_BUS, &anx7625_data.edid) < 0) + printk(BIOS_ERR, "Can't start display via ANX7625.\n"); +} + +static struct panel_description anx7625_panel = { + .s = &anx7625_data, + .power_on = dummy_power_on, + .post_power_on = start_anx7625, +}; + static void power_on_anx7625(void) { /* Disable backlight before turning on bridge */ @@ -27,43 +54,21 @@ gpio_output(GPIO_PP3300_LCM_EN, 1); }
-static void dummy_power_on(void) -{ - /* The panel has been already powered on when getting panel information - * so we should do nothing here. - */ -} - -static struct panel_serializable_data anx7625_data = { - .orientation = LB_FB_ORIENTATION_NORMAL, - .init = { INIT_END_CMD }, -}; - -static struct panel_description anx7625_panel = { - .s = &anx7625_data, - .power_on = dummy_power_on, -}; - struct panel_description *get_panel_description(int panel_id) { /* To read panel EDID, we have to first power on anx7625. */ power_on_anx7625();
- u8 i2c_bus = 4; - mtk_i2c_bus_init(i2c_bus); + mtk_i2c_bus_init(ANX7625_I2C_BUS);
- if (anx7625_init(i2c_bus)) { + if (anx7625_init(ANX7625_I2C_BUS)) { printk(BIOS_ERR, "Can't init ANX7625 bridge.\n"); return NULL; } - struct edid *edid = &anx7625_data.edid; - if (anx7625_dp_get_edid(i2c_bus, edid)) { + + if (anx7625_dp_get_edid(ANX7625_I2C_BUS, &anx7625_data.edid)) { printk(BIOS_ERR, "Can't get panel's edid.\n"); return NULL; } - if (anx7625_dp_start(i2c_bus, edid) < 0) { - printk(BIOS_ERR, "Can't start display via ANX7625.\n"); - return NULL; - } return &anx7625_panel; }