| 1 |
|
| 2 |
|
| 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/dsi.h> |
| 9 |
#include <soc/i2c.h> |
| 10 |
|
| 11 |
#include "gpio.h" |
| 12 |
#include "panel.h" |
| 13 |
|
| 14 |
static void bridge_anx7625_power_on(void) |
| 15 |
{ |
| 16 |
|
| 17 |
gpio_output(GPIO_EDPBRDG_RST_L, 0); |
| 18 |
gpio_output(GPIO_EN_PP1000_EDPBRDG, 1); |
| 19 |
gpio_output(GPIO_EN_PP1800_EDPBRDG, 1); |
| 20 |
gpio_output(GPIO_EN_PP3300_EDPBRDG, 1); |
| 21 |
mdelay(14); |
| 22 |
gpio_output(GPIO_EDPBRDG_PWREN, 1); |
| 23 |
mdelay(80); |
| 24 |
gpio_output(GPIO_EDPBRDG_RST_L, 1); |
| 25 |
} |
| 26 |
|
| 27 |
static int bridge_anx7625_get_edid(struct edid *edid) |
| 28 |
{ |
| 29 |
if (anx7625_init(BRIDGE_I2C) < 0) { |
| 30 |
printk(BIOS_ERR, "%s: Can't init ANX7625 bridge\n", __func__); |
| 31 |
return -1; |
| 32 |
} |
| 33 |
if (anx7625_dp_get_edid(BRIDGE_I2C, edid) < 0) { |
| 34 |
printk(BIOS_ERR, "%s: Can't get panel's edid\n", __func__); |
| 35 |
return -1; |
| 36 |
} |
| 37 |
return 0; |
| 38 |
} |
| 39 |
|
| 40 |
static int bridge_anx7625_post_power_on(const struct edid *edid) |
| 41 |
{ |
| 42 |
return anx7625_dp_start(BRIDGE_I2C, edid); |
| 43 |
} |
| 44 |
|
| 45 |
static void panel_power_on(void) |
| 46 |
{ |
| 47 |
|
| 48 |
gpio_output(GPIO_EN_PP3300_DISP_X, 1); |
| 49 |
bridge_anx7625_power_on(); |
| 50 |
} |
| 51 |
|
| 52 |
static struct panel_description anx7625_bridge = { |
| 53 |
.configure_backlight = backlight_control, |
| 54 |
.power_on = panel_power_on, |
| 55 |
.get_edid = bridge_anx7625_get_edid, |
| 56 |
.post_power_on = bridge_anx7625_post_power_on, |
| 57 |
.disp_path = DISP_PATH_MIPI, |
| 58 |
.orientation = LB_FB_ORIENTATION_NORMAL, |
| 59 |
}; |
| 60 |
|
| 61 |
struct panel_description *get_anx7625_description(void) |
| 62 |
{ |
| 63 |
mtk_i2c_bus_init(BRIDGE_I2C, I2C_SPEED_FAST); |
| 64 |
return &anx7625_bridge; |
| 65 |
} |
| 66 |
|
| 67 |
void mtk_dsi_override_phy_timing(struct mtk_phy_timing *timing) |
| 68 |
{ |
| 69 |
timing->da_hs_trail += 9; |
| 70 |
} |