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
>
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 "
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
{
29
if
(
anx7625_dp_start
(
ANX7625_I2C_BUS
, &
anx7625_data
.
edid
) < 0)
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 */
47
gpio_output
(
GPIO_MIPIBRDG_RST_L_1V8
, 0);
48
gpio_output
(
GPIO_PP1200_MIPIBRDG_EN
, 1);
49
gpio_output
(
GPIO_VDDIO_MIPIBRDG_EN
, 1);
50
gpio_output
(
GPIO_PP1800_LCM_EN
, 1);
51
mdelay
(2);
52
gpio_output
(
GPIO_MIPIBRDG_PWRDN_L_1V8
, 1);
53
mdelay
(10);
54
gpio_output
(
GPIO_MIPIBRDG_RST_L_1V8
, 1);
55
gpio_output
(
GPIO_PP3300_LCM_EN
, 1);
56
}
57
58
struct
panel_description
*
get_panel_description
(
int
panel_id
)
59
{
60
/* To read panel EDID, we have to first power on anx7625. */
61
power_on_anx7625
();
62
63
mtk_i2c_bus_init
(
ANX7625_I2C_BUS
);
64
65
if
(
anx7625_init
(
ANX7625_I2C_BUS
)) {
66
printk
(
BIOS_ERR
,
"Can't init ANX7625 bridge.\n"
);
67
return
NULL
;
68
}
69
70
if
(
anx7625_dp_get_edid
(
ANX7625_I2C_BUS
, &
anx7625_data
.
edid
)) {
71
printk
(
BIOS_ERR
,
"Can't get panel's edid.\n"
);
72
return
NULL
;
73
}
74
return
&
anx7625_panel
;
75
}
76
77
void
mtk_dsi_override_phy_timing
(
struct
mtk_phy_timing
*timing)
78
{
79
timing->
da_hs_trail
+= 9;
80
}
anx7625_init
int anx7625_init(uint8_t bus)
Definition:
anx7625.c:866
anx7625_dp_get_edid
int anx7625_dp_get_edid(uint8_t bus, struct edid *out)
Definition:
anx7625.c:845
anx7625_dp_start
int anx7625_dp_start(uint8_t bus, const struct edid *edid)
Definition:
anx7625.c:828
anx7625.h
LB_FB_ORIENTATION_NORMAL
@ LB_FB_ORIENTATION_NORMAL
Definition:
coreboot_tables.h:266
printk
#define printk(level,...)
Definition:
stdlib.h:16
console.h
delay.h
mdelay
void mdelay(unsigned int msecs)
Definition:
delay.c:2
GPIO
@ GPIO
Definition:
chip.h:84
gpio_output
void gpio_output(gpio_t gpio, int value)
Definition:
gpio.c:194
PANEL_END
#define PANEL_END
Definition:
panel.h:53
BIOS_ERR
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
Definition:
loglevel.h:72
panel.h
GPIO_PP3300_LCM_EN
#define GPIO_PP3300_LCM_EN
Definition:
panel.h:29
GPIO_PP1200_MIPIBRDG_EN
#define GPIO_PP1200_MIPIBRDG_EN
Definition:
panel.h:27
GPIO_VDDIO_MIPIBRDG_EN
#define GPIO_VDDIO_MIPIBRDG_EN
Definition:
panel.h:32
GPIO_PP1800_LCM_EN
#define GPIO_PP1800_LCM_EN
Definition:
panel.h:28
GPIO_MIPIBRDG_RST_L_1V8
#define GPIO_MIPIBRDG_RST_L_1V8
Definition:
panel.h:26
GPIO_MIPIBRDG_PWRDN_L_1V8
#define GPIO_MIPIBRDG_PWRDN_L_1V8
Definition:
panel.h:25
panel_id
static uint8_t panel_id(void)
Definition:
boardid.c:45
anx7625_panel
static struct panel_description anx7625_panel
Definition:
panel_anx7625.c:33
mtk_dsi_override_phy_timing
void mtk_dsi_override_phy_timing(struct mtk_phy_timing *timing)
Definition:
panel_anx7625.c:77
get_panel_description
struct panel_description * get_panel_description(int panel_id)
Definition:
panel_anx7625.c:58
dummy_power_on
static void dummy_power_on(void)
Definition:
panel_anx7625.c:19
start_anx7625
static void start_anx7625(void)
Definition:
panel_anx7625.c:27
ANX7625_I2C_BUS
#define ANX7625_I2C_BUS
Definition:
panel_anx7625.c:13
anx7625_data
static struct panel_serializable_data anx7625_data
Definition:
panel_anx7625.c:15
power_on_anx7625
static void power_on_anx7625(void)
Definition:
panel_anx7625.c:40
mtk_i2c_bus_init
void mtk_i2c_bus_init(uint8_t bus)
Definition:
i2c.c:65
gpio.h
NULL
#define NULL
Definition:
stddef.h:19
mtk_phy_timing
Definition:
dsi_common.h:216
mtk_phy_timing::da_hs_trail
u8 da_hs_trail
Definition:
dsi_common.h:220
panel_description
Definition:
panel.h:9
panel_description::s
struct panel_serializable_data * s
Definition:
panel.h:11
panel_serializable_data
Definition:
panel.h:29
panel_serializable_data::edid
struct edid edid
Definition:
panel.h:30
panel_serializable_data::init
u8 init[]
Definition:
panel.h:31
src
mainboard
google
kukui
panel_anx7625.c
Generated by
1.9.1