coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
panel_anx7625.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <console/console.h>
4 #include <delay.h>
6 #include <edid.h>
7 #include <gpio.h>
8 #include <soc/dsi.h>
9 #include <soc/i2c.h>
10 
11 #include "panel.h"
12 
13 #define ANX7625_I2C_BUS 4
14 
15 static struct panel_serializable_data anx7625_data = {
16  .init = { PANEL_END },
17 };
18 
19 static void dummy_power_on(void)
20 {
21  /*
22  * The panel has been already powered on when getting panel information
23  * so we should do nothing here.
24  */
25 }
26 
27 static void start_anx7625(void)
28 {
30  printk(BIOS_ERR, "Can't start display via ANX7625.\n");
31 }
32 
33 static struct panel_description anx7625_panel = {
34  .s = &anx7625_data,
35  .orientation = LB_FB_ORIENTATION_NORMAL,
36  .power_on = dummy_power_on,
37  .post_power_on = start_anx7625,
38 };
39 
40 static void power_on_anx7625(void)
41 {
42  /* Disable backlight before turning on bridge */
43  gpio_output(GPIO(PERIPHERAL_EN13), 0);
44  gpio_output(GPIO(DISP_PWM), 0);
45 
46  /* Turn on bridge */
51  mdelay(2);
53  mdelay(10);
56 }
57 
59 {
60  /* To read panel EDID, we have to first power on anx7625. */
62 
64 
66  printk(BIOS_ERR, "Can't init ANX7625 bridge.\n");
67  return NULL;
68  }
69 
71  printk(BIOS_ERR, "Can't get panel's edid.\n");
72  return NULL;
73  }
74  return &anx7625_panel;
75 }
76 
78 {
79  timing->da_hs_trail += 9;
80 }
int anx7625_init(uint8_t bus)
Definition: anx7625.c:866
int anx7625_dp_get_edid(uint8_t bus, struct edid *out)
Definition: anx7625.c:845
int anx7625_dp_start(uint8_t bus, const struct edid *edid)
Definition: anx7625.c:828
@ LB_FB_ORIENTATION_NORMAL
#define printk(level,...)
Definition: stdlib.h:16
void mdelay(unsigned int msecs)
Definition: delay.c:2
@ GPIO
Definition: chip.h:84
void gpio_output(gpio_t gpio, int value)
Definition: gpio.c:194
#define PANEL_END
Definition: panel.h:53
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
Definition: loglevel.h:72
#define GPIO_PP3300_LCM_EN
Definition: panel.h:29
#define GPIO_PP1200_MIPIBRDG_EN
Definition: panel.h:27
#define GPIO_VDDIO_MIPIBRDG_EN
Definition: panel.h:32
#define GPIO_PP1800_LCM_EN
Definition: panel.h:28
#define GPIO_MIPIBRDG_RST_L_1V8
Definition: panel.h:26
#define GPIO_MIPIBRDG_PWRDN_L_1V8
Definition: panel.h:25
static uint8_t panel_id(void)
Definition: boardid.c:45
static struct panel_description anx7625_panel
Definition: panel_anx7625.c:33
void mtk_dsi_override_phy_timing(struct mtk_phy_timing *timing)
Definition: panel_anx7625.c:77
struct panel_description * get_panel_description(int panel_id)
Definition: panel_anx7625.c:58
static void dummy_power_on(void)
Definition: panel_anx7625.c:19
static void start_anx7625(void)
Definition: panel_anx7625.c:27
#define ANX7625_I2C_BUS
Definition: panel_anx7625.c:13
static struct panel_serializable_data anx7625_data
Definition: panel_anx7625.c:15
static void power_on_anx7625(void)
Definition: panel_anx7625.c:40
void mtk_i2c_bus_init(uint8_t bus)
Definition: i2c.c:65
#define NULL
Definition: stddef.h:19
struct panel_serializable_data * s
Definition: panel.h:11
struct edid edid
Definition: panel.h:30