From c4e14c2929c9b510c05ac7e54a9d0c441056f5e5 Mon Sep 17 00:00:00 2001 From: Yidi Lin Date: Tue, 9 Jan 2024 11:50:27 +0800 Subject: mb/google/cherry: Use common mtk_display_init() TEST=check FW screen on dojo Change-Id: Ie870899226588ac2a2e80f77e434455f4913d387 Signed-off-by: Yidi Lin Reviewed-on: https://review.coreboot.org/c/coreboot/+/79778 Tested-by: build bot (Jenkins) Reviewed-by: Yu-Ping Wu --- src/mainboard/google/cherry/mainboard.c | 52 ++++++++------------------------- 1 file changed, 12 insertions(+), 40 deletions(-) (limited to 'src/mainboard/google/cherry/mainboard.c') diff --git a/src/mainboard/google/cherry/mainboard.c b/src/mainboard/google/cherry/mainboard.c index c1593ca999..0e78f62a87 100644 --- a/src/mainboard/google/cherry/mainboard.c +++ b/src/mainboard/google/cherry/mainboard.c @@ -7,13 +7,10 @@ #include #include #include -#include -#include #include #include -#include +#include #include -#include #include #include #include @@ -58,7 +55,7 @@ bool mainboard_needs_pcie_init(void) } /* Set up backlight control pins as output pin and power-off by default */ -static void configure_panel_backlight(void) +static void configure_backlight(void) { gpio_output(GPIO_AP_EDP_BKLTEN, 0); gpio_output(GPIO_BL_PWM_1V8, 0); @@ -72,41 +69,16 @@ static void power_on_panel(void) gpio_output(GPIO_EN_PP3300_DISP_X, 1); } -static bool configure_display(void) -{ - struct edid edid; - struct fb_info *info; - const char *name; - - printk(BIOS_INFO, "%s: Starting display initialization\n", __func__); - - mtcmos_display_power_on(); - mtcmos_protect_display_bus(); - configure_panel_backlight(); - power_on_panel(); - - mtk_ddp_init(); - mdelay(200); - - if (mtk_edp_init(&edid) < 0) { - printk(BIOS_ERR, "%s: Failed to initialize eDP\n", __func__); - return false; - } - name = edid.ascii_string; - if (name[0] == '\0') - name = "unknown name"; - printk(BIOS_INFO, "%s: '%s %s' %dx%d@%dHz\n", __func__, - edid.manufacturer_name, name, edid.mode.ha, edid.mode.va, - edid.mode.refresh); - - edid_set_framebuffer_bits_per_pixel(&edid, 32, 0); - - mtk_ddp_mode_set(&edid); - info = fb_new_framebuffer_info_from_edid(&edid, (uintptr_t)0); - if (info) - fb_set_orientation(info, LB_FB_ORIENTATION_NORMAL); +static struct panel_description panel = { + .configure_backlight = configure_backlight, + .power_on = power_on_panel, + .disp_path = DISP_PATH_EDP, + .orientation = LB_FB_ORIENTATION_NORMAL, +}; - return true; +struct panel_description *get_active_panel(void) +{ + return &panel; } static void configure_i2s(void) @@ -133,7 +105,7 @@ static void configure_audio(void) static void mainboard_init(struct device *dev) { if (display_init_required()) - configure_display(); + mtk_display_init(); else printk(BIOS_INFO, "%s: Skipped display initialization\n", __func__); -- cgit v1.2.3