jitao shi has uploaded this change for review. ( 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 require dsi signal output before mipirx enable.
Signed-off-by: Jitao Shi jitao.shi@mediatek.com Change-Id: I3bded27087490f32ee233e615cfad1fd05fb582d --- 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, 30 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/47380/1
diff --git a/src/mainboard/google/kukui/mainboard.c b/src/mainboard/google/kukui/mainboard.c index 268b7ca..6ac0530 100644 --- a/src/mainboard/google/kukui/mainboard.c +++ b/src/mainboard/google/kukui/mainboard.c @@ -96,6 +96,12 @@ mdelay(6); }
+static void post_power_on_panel(struct panel_description *panel) +{ + if (panel->post_power_on) + panel->post_power_on(); +} + struct panel_description *get_panel_from_cbfs(struct panel_description *desc) { /* The CBFS name will be panel-{MANUFACTURER}-${PANEL_NAME}, @@ -168,6 +174,9 @@ printk(BIOS_ERR, "%s: Failed in DSI init.\n", __func__); return false; } + + post_power_on_panel(panel); + mtk_ddp_mode_set(edid); set_vbe_mode_info_valid(edid, 0); set_vbe_framebuffer_orientation(panel->s->orientation); diff --git a/src/mainboard/google/kukui/panel.h b/src/mainboard/google/kukui/panel.h index 7ae31dd..c60c577 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 turn on panel */ };
/* 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..d9df6f0 100644 --- a/src/mainboard/google/kukui/panel_anx7625.c +++ b/src/mainboard/google/kukui/panel_anx7625.c @@ -27,21 +27,33 @@ 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 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) +{ + u8 i2c_bus = 4; + struct edid *edid = &anx7625_data.edid; + + printk(BIOS_ERR, "start display start_anx7625\n"); + + if (anx7625_dp_start(i2c_bus, 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, + .power_on = dummy_power_on, + .post_power_on = start_anx7625, };
struct panel_description *get_panel_description(int panel_id) @@ -61,9 +73,5 @@ 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; }