1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
5 #include <drivers/analogix/anx7625/anx7625.h>
13 static void bridge_anx7625_power_on(void)
16 gpio_output(GPIO_EDPBRDG_RST_L
, 0);
17 gpio_output(GPIO_EN_PP1000_EDPBRDG
, 1);
18 gpio_output(GPIO_EN_PP1800_EDPBRDG
, 1);
19 gpio_output(GPIO_EN_PP3300_EDPBRDG
, 1);
21 gpio_output(GPIO_EDPBRDG_PWREN
, 1);
23 gpio_output(GPIO_EDPBRDG_RST_L
, 1);
26 static int bridge_anx7625_get_edid(struct edid
*edid
)
28 if (anx7625_init(BRIDGE_I2C
) < 0) {
29 printk(BIOS_ERR
, "%s: Can't init ANX7625 bridge\n", __func__
);
32 if (anx7625_dp_get_edid(BRIDGE_I2C
, edid
) < 0) {
33 printk(BIOS_ERR
, "%s: Can't get panel's edid\n", __func__
);
39 static int bridge_anx7625_post_power_on(const struct edid
*edid
)
41 return anx7625_dp_start(BRIDGE_I2C
, edid
);
44 static void panel_power_on(void)
46 /* Turn on the panel */
47 gpio_output(GPIO_EN_PP3300_DISP_X
, 1);
48 bridge_anx7625_power_on();
51 static struct panel_description anx7625_bridge
= {
52 .configure_backlight
= backlight_control
,
53 .power_on
= panel_power_on
,
54 .get_edid
= bridge_anx7625_get_edid
,
55 .post_power_on
= bridge_anx7625_post_power_on
,
56 .disp_path
= DISP_PATH_MIPI
,
57 .orientation
= LB_FB_ORIENTATION_NORMAL
,
60 struct panel_description
*get_anx7625_description(void)
62 mtk_i2c_bus_init(BRIDGE_I2C
, I2C_SPEED_FAST
);
63 return &anx7625_bridge
;