blob: 0b59a4e3d5aacbc2b358ec1b59bdb0ab4add1dcd [file] [log] [blame]
Bo-Chen Chen49465162022-11-30 14:47:41 +08001/* SPDX-License-Identifier: GPL-2.0-only */
2
Rex-BC Chend7b74602023-01-17 11:04:58 +08003#include <console/console.h>
Rex-BC Chend7b74602023-01-17 11:04:58 +08004#include <soc/i2c.h>
Bo-Chen Chen49465162022-11-30 14:47:41 +08005
6#include "gpio.h"
7#include "panel.h"
8
Ruihai Zhou4a604182023-05-29 20:27:06 +08009#define PMIC_TPS65132_I2C I2C3
Rex-BC Chend7b74602023-01-17 11:04:58 +080010
Bo-Chen Chen817c6a72023-01-10 15:59:05 +080011static void power_on_mipi_boe_tv110c9m_ll0(void)
Bo-Chen Chen49465162022-11-30 14:47:41 +080012{
Ruihai Zhou4a604182023-05-29 20:27:06 +080013 const struct tps65132s_reg_setting reg_settings[] = {
14 { PMIC_TPS65132_VPOS, 0x11, 0x1f },
15 { PMIC_TPS65132_VNEG, 0x11, 0x1f },
16 { PMIC_TPS65132_DLYX, 0x95, 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 };
Ruihai Zhoud4b6b812023-11-08 09:11:34 +080026 power_on_mipi_panel(&cfg);
Bo-Chen Chen49465162022-11-30 14:47:41 +080027}
28
29static struct panel_description panels[] = {
30 [1] = {
Bo-Chen Chen817c6a72023-01-10 15:59:05 +080031 .name = "BOE_TV110C9M_LL0",
32 .power_on = power_on_mipi_boe_tv110c9m_ll0,
Yidi Linba604b52024-01-03 16:07:24 +080033 .configure_backlight = configure_mipi_pwm_backlight,
34 .orientation = LB_FB_ORIENTATION_BOTTOM_UP,
Bo-Chen Chen49465162022-11-30 14:47:41 +080035 .disp_path = DISP_PATH_MIPI,
Bo-Chen Chenf57155b2022-12-07 19:09:57 +080036 .pwm_ctrl_gpio = true,
Bo-Chen Chen49465162022-11-30 14:47:41 +080037 },
Bo-Chen Chen49465162022-11-30 14:47:41 +080038};
39
40struct panel_description *get_panel_description(uint32_t panel_id)
41{
Yidi Lin0b192d32023-03-20 17:40:31 +080042 /* Only PANEL_ID_LOW_CHANNEL value is valid for the reference board. */
43 uint32_t id = panel_id & 0xF;
44
45 if (id >= ARRAY_SIZE(panels))
Bo-Chen Chen49465162022-11-30 14:47:41 +080046 return NULL;
47
Yidi Lin0b192d32023-03-20 17:40:31 +080048 return &panels[id];
Bo-Chen Chen49465162022-11-30 14:47:41 +080049}