1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
5 #include <drivers/parade/ps8640/ps8640.h>
12 static void power_on_ps8640(void)
14 /* Disable backlight before turning on bridge */
15 gpio_output(GPIO(PERIPHERAL_EN13
), 0);
16 gpio_output(GPIO(DISP_PWM
), 0);
19 gpio_output(GPIO_MIPIBRDG_RST_L_1V8
, 0);
20 gpio_output(GPIO_PP1200_MIPIBRDG_EN
, 1);
21 gpio_output(GPIO_VDDIO_MIPIBRDG_EN
, 1);
23 gpio_output(GPIO_MIPIBRDG_PWRDN_L_1V8
, 1);
25 gpio_output(GPIO_MIPIBRDG_RST_L_1V8
, 1);
26 gpio_output(GPIO_PP3300_LCM_EN
, 1);
29 static void dummy_power_on(void)
31 /* The panel has been already powered on when getting panel information
32 * so we should do nothing here.
36 static struct panel_serializable_data ps8640_data
= {
37 .init
= { PANEL_END
},
40 static struct panel_description ps8640_panel
= {
42 .orientation
= LB_FB_ORIENTATION_NORMAL
,
43 .power_on
= dummy_power_on
,
46 struct panel_description
*get_panel_description(int panel_id
)
48 /* To read panel EDID, we have to first power on PS8640. */
51 u8 i2c_bus
= 4, i2c_addr
= 0x08;
52 mtk_i2c_bus_init(i2c_bus
);
54 ps8640_init(i2c_bus
, i2c_addr
);
55 struct edid
*edid
= &ps8640_data
.edid
;
56 if (ps8640_get_edid(i2c_bus
, i2c_addr
, edid
)) {
57 printk(BIOS_ERR
, "Can't get panel's edid\n");