1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
6 #include <soc/regulator.h>
7 #include <soc/tps65132s.h>
12 static void mipi_panel_power_on(void)
14 const struct tps65132s_reg_setting reg_settings
[] = {
15 { PMIC_TPS65132_VPOS
, 0x14, 0x1F },
16 { PMIC_TPS65132_VNEG
, 0x14, 0x1F },
17 { PMIC_TPS65132_DLYX
, 0x95, 0xFF },
18 { PMIC_TPS65132_ASSDD
, 0x5b, 0xFF },
20 const struct tps65132s_cfg cfg
= {
21 .i2c_bus
= PMIC_I2C_BUS
,
22 .en
= GPIO_EN_PP3300_DISP_X
,
23 .sync
= GPIO_EN_PP3300_SDBRDG_X
,
24 .settings
= reg_settings
,
25 .setting_counts
= ARRAY_SIZE(reg_settings
),
28 mainboard_set_regulator_voltage(MTK_REGULATOR_VIO18
, 1800000);
29 mtk_i2c_bus_init(PMIC_I2C_BUS
, I2C_SPEED_FAST
);
31 if (is_pmic_aw37503(PMIC_I2C_BUS
)) {
32 printk(BIOS_DEBUG
, "Initialize and power on PMIC AW37503\n");
33 aw37503_init(PMIC_I2C_BUS
);
34 gpio_output(GPIO_EN_PP3300_DISP_X
, 1);
36 gpio_output(GPIO_EN_PP3300_SDBRDG_X
, 1);
38 } else if (tps65132s_setup(&cfg
) != CB_SUCCESS
) {
39 printk(BIOS_ERR
, "Failed to setup tps65132s\n");
43 gpio_output(GPIO_EDPBRDG_RST_L
, 1);
45 gpio_output(GPIO_EDPBRDG_RST_L
, 0);
47 gpio_output(GPIO_EDPBRDG_RST_L
, 1);
50 static struct panel_description starmie_panels
[] = {
51 /* K&D panel vendor and ILI9882T chip,
52 K&D and STA panel are identical except manufacturer_name. */
54 .configure_backlight
= backlight_control
,
55 .power_on
= mipi_panel_power_on
,
56 .name
= "STA_ILI9882T",
57 .disp_path
= DISP_PATH_MIPI
,
58 .orientation
= LB_FB_ORIENTATION_LEFT_UP
,
60 /* STA panel vendor and ILI9882T chip */
62 .configure_backlight
= backlight_control
,
63 .power_on
= mipi_panel_power_on
,
64 .name
= "STA_ILI9882T",
65 .disp_path
= DISP_PATH_MIPI
,
66 .orientation
= LB_FB_ORIENTATION_LEFT_UP
,
68 /* STA panel vendor and HIMAX83102_J02 chip */
70 .configure_backlight
= backlight_control
,
71 .power_on
= mipi_panel_power_on
,
72 .name
= "STA_HIMAX83102_J02",
73 .disp_path
= DISP_PATH_MIPI
,
74 .orientation
= LB_FB_ORIENTATION_LEFT_UP
,
78 struct panel_description
*get_panel_description(void)
80 uint32_t id
= panel_id() & 0xF;
81 if (id
>= ARRAY_SIZE(starmie_panels
))
84 return &starmie_panels
[id
];