summaryrefslogtreecommitdiff
path: root/src/mainboard/google/geralt
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/geralt')
-rw-r--r--src/mainboard/google/geralt/display.c51
1 files changed, 30 insertions, 21 deletions
diff --git a/src/mainboard/google/geralt/display.c b/src/mainboard/google/geralt/display.c
index 5c81434fea..396d6e0c03 100644
--- a/src/mainboard/google/geralt/display.c
+++ b/src/mainboard/google/geralt/display.c
@@ -1,5 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
+#include <assert.h>
#include <console/console.h>
#include <delay.h>
#include <edid.h>
@@ -7,45 +8,53 @@
#include <gpio.h>
#include <soc/ddp.h>
#include <soc/dptx.h>
+#include <soc/dsi.h>
#include <soc/gpio_common.h>
#include <soc/mtcmos.h>
#include "display.h"
-#include "gpio.h"
-
-/* Set up backlight control pins as output pin and power-off by default */
-static void configure_edp_panel_backlight(void)
-{
- gpio_output(GPIO_AP_DISP_BKLTEN, 0);
- gpio_output(GPIO_EDP_BL_PWM_1V8, 0);
-}
-
-static void power_on_edp_panel(void)
-{
- gpio_output(GPIO_EN_PP3300_EDP_DISP_X, 1);
- gpio_set_pull(GPIO_EDP_HPD_1V8, GPIO_PULL_ENABLE, GPIO_PULL_UP);
- gpio_set_mode(GPIO_EDP_HPD_1V8, 4);
-}
+#include "panel.h"
int configure_display(void)
{
struct edid edid;
struct fb_info *info;
const char *name;
+ struct panel_description *panel = get_active_panel();
+ if (!panel)
+ return -1;
printk(BIOS_INFO, "%s: Starting display initialization\n", __func__);
mtcmos_display_power_on();
- configure_edp_panel_backlight();
- power_on_edp_panel();
+
+ panel->configure_panel_backlight();
+ panel->power_on();
mtk_ddp_init();
mdelay(200);
- if (mtk_edp_init(&edid) < 0) {
- printk(BIOS_ERR, "%s: Failed to initialize eDP\n", __func__);
- return -1;
+ if (panel->disp_path == DISP_PATH_EDP) {
+ if (mtk_edp_init(&edid) < 0) {
+ printk(BIOS_ERR, "%s: Failed to initialize eDP\n", __func__);
+ return -1;
+ }
+
+ } else {
+ u32 mipi_dsi_flags = (MIPI_DSI_MODE_VIDEO |
+ MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
+ MIPI_DSI_MODE_LPM |
+ MIPI_DSI_MODE_EOT_PACKET);
+
+ edid = panel->s->edid;
+
+ if (mtk_dsi_init(mipi_dsi_flags, MIPI_DSI_FMT_RGB888, 4, &edid,
+ panel->s->init) < 0) {
+ printk(BIOS_ERR, "%s: Failed in DSI init\n", __func__);
+ return -1;
+ }
}
+
name = edid.ascii_string;
if (name[0] == '\0')
name = "unknown name";
@@ -55,7 +64,7 @@ int configure_display(void)
edid_set_framebuffer_bits_per_pixel(&edid, 32, 0);
- mtk_ddp_mode_set(&edid, DISP_PATH_EDP);
+ mtk_ddp_mode_set(&edid, panel->disp_path);
info = fb_new_framebuffer_info_from_edid(&edid, (uintptr_t)0);
if (info)
fb_set_orientation(info, LB_FB_ORIENTATION_NORMAL);