blob: 4d31711cf6273989855d583ad473838d8bb6818e [file] [log] [blame]
Ruihai Zhoud4b6b812023-11-08 09:11:34 +08001/* SPDX-License-Identifier: GPL-2.0-only */
2
3#include <console/console.h>
4#include <soc/i2c.h>
Cong Yang0ab39182024-01-29 14:29:55 +08005#include <soc/regulator.h>
Ruihai Zhoud4b6b812023-11-08 09:11:34 +08006
7#include "gpio.h"
8#include "panel.h"
9
10#define PMIC_TPS65132_I2C I2C3
11
12static 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 Yang0ab39182024-01-29 14:29:55 +080027 mainboard_set_regulator_voltage(MTK_REGULATOR_VDD18, 1900000);
Ruihai Zhoud4b6b812023-11-08 09:11:34 +080028 power_on_mipi_panel(&cfg);
29}
30
31static 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 Zhou6fd812b2024-01-08 16:28:40 +080040
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 Zhoud4b6b812023-11-08 09:11:34 +080049};
50
51struct 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}