| 1 |
|
| 2 |
|
| 3 |
#include <fw_config.h> |
| 4 |
#include <gpio.h> |
| 5 |
#include <soc/ddp.h> |
| 6 |
#include <soc/dsi.h> |
| 7 |
#include <variants.h> |
| 8 |
|
| 9 |
#include "gpio.h" |
| 10 |
#include "panel.h" |
| 11 |
|
| 12 |
|
| 13 |
static void configure_backlight(void) |
| 14 |
{ |
| 15 |
gpio_output(GPIO_AP_EDP_BKLTEN, 0); |
| 16 |
gpio_output(GPIO_BL_PWM_1V8, 0); |
| 17 |
} |
| 18 |
|
| 19 |
static void power_on_panel(void) |
| 20 |
{ |
| 21 |
gpio_set_mode(GPIO_EDP_HPD_1V8, GPIO_FUNC(EINT13, EDP_TX_HPD)); |
| 22 |
} |
| 23 |
|
| 24 |
static struct panel_description rauru_panel = { |
| 25 |
.configure_backlight = configure_backlight, |
| 26 |
.power_on = power_on_panel, |
| 27 |
.disp_path = DISP_PATH_EDP, |
| 28 |
.orientation = LB_FB_ORIENTATION_NORMAL, |
| 29 |
}; |
| 30 |
|
| 31 |
static void power_on_load_switch(void) |
| 32 |
{ |
| 33 |
gpio_output(GPIO_EN_PP3300_EDP_X, 1); |
| 34 |
gpio_set_mode(GPIO_EDP_HPD_1V8, GPIO_FUNC(EINT13, EDP_TX_HPD)); |
| 35 |
gpio_set_pull(GPIO_EDP_HPD_1V8, GPIO_PULL_ENABLE, GPIO_PULL_UP); |
| 36 |
} |
| 37 |
|
| 38 |
static struct panel_description edp_panel = { |
| 39 |
.configure_backlight = configure_backlight, |
| 40 |
.power_on = power_on_load_switch, |
| 41 |
.disp_path = DISP_PATH_EDP, |
| 42 |
.orientation = LB_FB_ORIENTATION_NORMAL, |
| 43 |
}; |
| 44 |
|
| 45 |
__weak void fw_config_panel_override(struct panel_description *panel) |
| 46 |
{ |
| 47 |
} |
| 48 |
|
| 49 |
struct panel_description *get_active_panel(void) |
| 50 |
{ |
| 51 |
if (CONFIG(BOARD_GOOGLE_RAURU)) |
| 52 |
return &rauru_panel; |
| 53 |
|
| 54 |
fw_config_panel_override(&edp_panel); |
| 55 |
|
| 56 |
return &edp_panel; |
| 57 |
} |