Yang Wu | 9ab5ae7 | 2024-03-29 18:08:04 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
Yang Wu | 9ab5ae7 | 2024-03-29 18:08:04 +0800 | [diff] [blame] | 3 | #include <delay.h> |
| 4 | #include <gpio.h> |
| 5 | #include <soc/regulator.h> |
| 6 | |
| 7 | #include "gpio.h" |
| 8 | #include "panel.h" |
| 9 | |
| 10 | static void mipi_panel_power_on(void) |
| 11 | { |
| 12 | mainboard_set_regulator_voltage(MTK_REGULATOR_VIO18, 1800000); |
| 13 | udelay(100); |
| 14 | mainboard_set_regulator_voltage(MTK_REGULATOR_VCN33, 3300000); |
| 15 | |
| 16 | gpio_output(GPIO_EN_PP3300_DISP_X, 1); |
| 17 | mdelay(5); |
| 18 | |
| 19 | /* DISP_RST_1V8_L */ |
| 20 | gpio_output(GPIO_EDPBRDG_RST_L, 1); |
| 21 | mdelay(15); |
| 22 | gpio_output(GPIO_EDPBRDG_RST_L, 0); |
| 23 | udelay(20); |
| 24 | gpio_output(GPIO_EDPBRDG_RST_L, 1); |
| 25 | } |
| 26 | |
| 27 | static struct panel_description wugtrio_panels[] = { |
Yang Wu | 11afdb3 | 2024-04-23 10:36:40 +0800 | [diff] [blame] | 28 | /* STA Technology panel with bias IC on it */ |
| 29 | [0] = { |
| 30 | .configure_backlight = backlight_control, |
| 31 | .power_on = mipi_panel_power_on, |
| 32 | .name = "STA_ER88577", |
| 33 | .disp_path = DISP_PATH_MIPI, |
| 34 | .orientation = LB_FB_ORIENTATION_RIGHT_UP, |
| 35 | }, |
Yang Wu | 9ab5ae7 | 2024-03-29 18:08:04 +0800 | [diff] [blame] | 36 | /* K&D Technology panel with bias IC on it */ |
| 37 | [4] = { |
| 38 | .configure_backlight = backlight_control, |
| 39 | .power_on = mipi_panel_power_on, |
| 40 | .name = "KD_KD101NE3_40TI", |
| 41 | .disp_path = DISP_PATH_MIPI, |
Yang Wu | 68def20 | 2024-04-07 11:48:29 +0800 | [diff] [blame] | 42 | .orientation = LB_FB_ORIENTATION_RIGHT_UP, |
Yang Wu | 9ab5ae7 | 2024-03-29 18:08:04 +0800 | [diff] [blame] | 43 | }, |
| 44 | }; |
| 45 | |
| 46 | struct panel_description *get_panel_description(void) |
| 47 | { |
| 48 | uint32_t id = panel_id() & 0xF; |
| 49 | if (id >= ARRAY_SIZE(wugtrio_panels)) |
| 50 | return NULL; |
| 51 | |
| 52 | return &wugtrio_panels[id]; |
| 53 | } |