cpu/x86/smm/pci_resource_store: Store DEV/VEN ID
[coreboot2.git] / src / mainboard / google / corsola / panel_anx7625.c
blob193a501b876bc0b9e5368c28434caae070c6d74e
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
4 #include <delay.h>
5 #include <drivers/analogix/anx7625/anx7625.h>
6 #include <edid.h>
7 #include <gpio.h>
8 #include <soc/i2c.h>
10 #include "gpio.h"
11 #include "panel.h"
13 static void bridge_anx7625_power_on(void)
15 /* Turn on bridge */
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);
20 mdelay(14);
21 gpio_output(GPIO_EDPBRDG_PWREN, 1);
22 mdelay(80);
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__);
30 return -1;
32 if (anx7625_dp_get_edid(BRIDGE_I2C, edid) < 0) {
33 printk(BIOS_ERR, "%s: Can't get panel's edid\n", __func__);
34 return -1;
36 return 0;
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;