Ruihai Zhou | d5c1e13 | 2023-03-28 16:49:01 +0800 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <delay.h> |
| 4 | #include <gpio.h> |
| 5 | #include <soc/regulator.h> |
| 6 | |
| 7 | #include "display.h" |
| 8 | #include "gpio.h" |
| 9 | |
| 10 | static void mipi_panel_power_on(void) |
| 11 | { |
| 12 | tps65132s_program_eeprom(); |
| 13 | mainboard_set_regulator_voltage(MTK_REGULATOR_VIO18, 1800000); |
| 14 | mdelay(1); |
| 15 | gpio_output(GPIO_EN_PP3300_DISP_X, 1); |
| 16 | gpio_output(GPIO_EN_PP3300_SDBRDG_X, 1); |
| 17 | mdelay(1); |
| 18 | /* DISP_RST_1V8_L */ |
| 19 | gpio_output(GPIO_EDPBRDG_RST_L, 1); |
| 20 | mdelay(1); |
| 21 | gpio_output(GPIO_EDPBRDG_RST_L, 0); |
| 22 | udelay(20); |
| 23 | gpio_output(GPIO_EDPBRDG_RST_L, 1); |
| 24 | } |
| 25 | |
| 26 | static struct panel_description starmie_panels[] = { |
| 27 | [8] = { |
| 28 | .power_on = mipi_panel_power_on, |
| 29 | .name = "STA_ILI9882T", |
| 30 | .orientation = LB_FB_ORIENTATION_LEFT_UP, |
| 31 | }, |
| 32 | [10] = { |
| 33 | .power_on = mipi_panel_power_on, |
| 34 | .name = "STA_HIMAX83102_J02", |
| 35 | .orientation = LB_FB_ORIENTATION_LEFT_UP, |
| 36 | }, |
| 37 | }; |
| 38 | |
| 39 | struct panel_description *get_panel_description(void) |
| 40 | { |
| 41 | uint32_t id = panel_id() & 0xF; |
| 42 | if (id >= ARRAY_SIZE(starmie_panels)) |
| 43 | return NULL; |
| 44 | |
| 45 | return get_panel_from_cbfs(&starmie_panels[id]); |
| 46 | } |