1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
5 #include <drivers/parade/ps8640/ps8640.h>
9 #include <soc/regulator.h>
14 static void bridge_ps8640_power_on(void)
17 * PS8640 power-on sequence is described in chapter 14, PS8640_DS_V1.4_20200210.docx
18 * - set VDD12 to be 1.2V
20 * - set VDD33 to be 3.3V
25 * - delay more than 50ms (55ms for margin)
27 * - delay more than 50ms (55ms for margin)
31 /* Set VRF12 to 1.2V and VCN33 to 3.3V */
32 mainboard_set_regulator_voltage(MTK_REGULATOR_VRF12
, 1200000);
34 mainboard_set_regulator_voltage(MTK_REGULATOR_VCN33
, 3300000);
38 gpio_output(GPIO_EDPBRDG_PWREN
, 1);
39 gpio_output(GPIO_EDPBRDG_RST_L
, 0);
41 gpio_output(GPIO_EDPBRDG_RST_L
, 1);
43 gpio_output(GPIO_EDPBRDG_RST_L
, 0);
45 gpio_output(GPIO_EDPBRDG_RST_L
, 1);
48 static void panel_power_on(void)
50 /* Turn on the panel */
51 gpio_output(GPIO_EN_PP3300_DISP_X
, 1);
52 bridge_ps8640_power_on();
55 static int bridge_ps8640_get_edid(struct edid
*edid
)
59 if (ps8640_init(BRIDGE_I2C
, chip
) < 0) {
60 printk(BIOS_ERR
, "%s: Can't init PS8640 bridge\n", __func__
);
63 if (ps8640_get_edid(BRIDGE_I2C
, chip
, edid
) < 0) {
64 printk(BIOS_ERR
, "%s: Can't get panel's edid\n", __func__
);
70 static struct panel_description ps8640_bridge
= {
71 .configure_backlight
= backlight_control
,
72 .power_on
= panel_power_on
,
73 .get_edid
= bridge_ps8640_get_edid
,
74 .disp_path
= DISP_PATH_MIPI
,
75 .orientation
= LB_FB_ORIENTATION_NORMAL
,
78 struct panel_description
*get_ps8640_description(void)
80 mtk_i2c_bus_init(BRIDGE_I2C
, I2C_SPEED_FAST
);
81 return &ps8640_bridge
;