blob: 15c885928d8d2fa81e6149ee1b32471e0900d059 [file] [log] [blame]
Ruihai Zhoud4b6b812023-11-08 09:11:34 +08001/* SPDX-License-Identifier: GPL-2.0-only */
2
Ruihai Zhoud4b6b812023-11-08 09:11:34 +08003#include <soc/i2c.h>
Cong Yang0ab39182024-01-29 14:29:55 +08004#include <soc/regulator.h>
Ruihai Zhoud4b6b812023-11-08 09:11:34 +08005
6#include "gpio.h"
7#include "panel.h"
8
9#define PMIC_TPS65132_I2C I2C3
10
11static 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 };
Cong Yang0ab39182024-01-29 14:29:55 +080026 mainboard_set_regulator_voltage(MTK_REGULATOR_VDD18, 1900000);
Ruihai Zhoud4b6b812023-11-08 09:11:34 +080027 power_on_mipi_panel(&cfg);
28}
29
30static 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 },
Ruihai Zhou6fd812b2024-01-08 16:28:40 +080039
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 }
Ruihai Zhoud4b6b812023-11-08 09:11:34 +080048};
49
50struct 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}