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