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>
This commit is contained in:
parent
93df1d9cfa
commit
b32e4d6763
|
@ -168,6 +168,10 @@ static bool configure_display(void)
|
|||
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)
|
||||
|
|
|
@ -21,6 +21,7 @@ struct panel_description {
|
|||
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. */
|
||||
|
|
|
@ -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 @@ static void power_on_anx7625(void)
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue