Ruihai Zhou | d4b6b81 | 2023-11-08 09:11:34 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <console/console.h> |
| 4 | #include <soc/i2c.h> |
Cong Yang | 0ab3918 | 2024-01-29 14:29:55 +0800 | [diff] [blame] | 5 | #include <soc/regulator.h> |
Ruihai Zhou | d4b6b81 | 2023-11-08 09:11:34 +0800 | [diff] [blame] | 6 | |
| 7 | #include "gpio.h" |
| 8 | #include "panel.h" |
| 9 | |
| 10 | #define PMIC_TPS65132_I2C I2C3 |
| 11 | |
| 12 | static void power_on_mipi_himax_83102j(void) |
| 13 | { |
| 14 | const struct tps65132s_reg_setting reg_settings[] = { |
| 15 | { PMIC_TPS65132_VPOS, 0x11, 0x1f }, |
| 16 | { PMIC_TPS65132_VNEG, 0x11, 0x1f }, |
| 17 | { PMIC_TPS65132_DLYX, 0x55, 0xff }, |
| 18 | { PMIC_TPS65132_ASSDD, 0x5b, 0xff }, |
| 19 | }; |
| 20 | const struct tps65132s_cfg cfg = { |
| 21 | .i2c_bus = PMIC_TPS65132_I2C, |
| 22 | .en = GPIO_EN_PPVAR_MIPI_DISP, |
| 23 | .sync = GPIO_EN_PPVAR_MIPI_DISP_150MA, |
| 24 | .settings = reg_settings, |
| 25 | .setting_counts = ARRAY_SIZE(reg_settings), |
| 26 | }; |
Cong Yang | 0ab3918 | 2024-01-29 14:29:55 +0800 | [diff] [blame] | 27 | mainboard_set_regulator_voltage(MTK_REGULATOR_VDD18, 1900000); |
Ruihai Zhou | d4b6b81 | 2023-11-08 09:11:34 +0800 | [diff] [blame] | 28 | power_on_mipi_panel(&cfg); |
| 29 | } |
| 30 | |
| 31 | static struct panel_description ciri_panels[] = { |
| 32 | [17] = { |
| 33 | .name = "BOE_NV110WUM_L60", |
| 34 | .power_on = power_on_mipi_himax_83102j, |
| 35 | .configure_backlight = configure_mipi_pwm_backlight, |
| 36 | .orientation = LB_FB_ORIENTATION_LEFT_UP, |
| 37 | .disp_path = DISP_PATH_MIPI, |
| 38 | .pwm_ctrl_gpio = true, |
| 39 | }, |
Ruihai Zhou | 6fd812b | 2024-01-08 16:28:40 +0800 | [diff] [blame] | 40 | |
| 41 | [34] = { |
| 42 | .name = "IVO_T109NW41", |
| 43 | .power_on = power_on_mipi_himax_83102j, |
| 44 | .configure_backlight = configure_mipi_pwm_backlight, |
| 45 | .orientation = LB_FB_ORIENTATION_LEFT_UP, |
| 46 | .disp_path = DISP_PATH_MIPI, |
| 47 | .pwm_ctrl_gpio = true, |
| 48 | } |
Ruihai Zhou | d4b6b81 | 2023-11-08 09:11:34 +0800 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | struct panel_description *get_panel_description(uint32_t panel_id) |
| 52 | { |
| 53 | uint32_t id = panel_id & 0xFF; |
| 54 | |
| 55 | if (id >= ARRAY_SIZE(ciri_panels)) |
| 56 | return NULL; |
| 57 | |
| 58 | return &ciri_panels[id]; |
| 59 | } |