blob: cd6dbe9b4474ce4efa815f903613d8cc74b51bca [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 <soc/i2c.h>
Bo-Chen Chen49465162022-11-30 14:47:41 +08004
5#include "gpio.h"
6#include "panel.h"
7
Ruihai Zhou4a604182023-05-29 20:27:06 +08008#define PMIC_TPS65132_I2C I2C3
Rex-BC Chend7b74602023-01-17 11:04:58 +08009
Bo-Chen Chen817c6a72023-01-10 15:59:05 +080010static void power_on_mipi_boe_tv110c9m_ll0(void)
Bo-Chen Chen49465162022-11-30 14:47:41 +080011{
Ruihai Zhou4a604182023-05-29 20:27:06 +080012 const struct tps65132s_reg_setting reg_settings[] = {
13 { PMIC_TPS65132_VPOS, 0x11, 0x1f },
14 { PMIC_TPS65132_VNEG, 0x11, 0x1f },
15 { PMIC_TPS65132_DLYX, 0x95, 0xff },
16 { PMIC_TPS65132_ASSDD, 0x5b, 0xff },
17 };
18 const struct tps65132s_cfg cfg = {
19 .i2c_bus = PMIC_TPS65132_I2C,
20 .en = GPIO_EN_PPVAR_MIPI_DISP,
21 .sync = GPIO_EN_PPVAR_MIPI_DISP_150MA,
22 .settings = reg_settings,
23 .setting_counts = ARRAY_SIZE(reg_settings),
24 };
Ruihai Zhoud4b6b812023-11-08 09:11:34 +080025 power_on_mipi_panel(&cfg);
Bo-Chen Chen49465162022-11-30 14:47:41 +080026}
27
28static struct panel_description panels[] = {
29 [1] = {
Bo-Chen Chen817c6a72023-01-10 15:59:05 +080030 .name = "BOE_TV110C9M_LL0",
31 .power_on = power_on_mipi_boe_tv110c9m_ll0,
Yidi Linba604b52024-01-03 16:07:24 +080032 .configure_backlight = configure_mipi_pwm_backlight,
33 .orientation = LB_FB_ORIENTATION_BOTTOM_UP,
Bo-Chen Chen49465162022-11-30 14:47:41 +080034 .disp_path = DISP_PATH_MIPI,
Bo-Chen Chenf57155b2022-12-07 19:09:57 +080035 .pwm_ctrl_gpio = true,
Bo-Chen Chen49465162022-11-30 14:47:41 +080036 },
Bo-Chen Chen49465162022-11-30 14:47:41 +080037};
38
39struct panel_description *get_panel_description(uint32_t panel_id)
40{
Yidi Lin0b192d32023-03-20 17:40:31 +080041 /* Only PANEL_ID_LOW_CHANNEL value is valid for the reference board. */
42 uint32_t id = panel_id & 0xF;
43
44 if (id >= ARRAY_SIZE(panels))
Bo-Chen Chen49465162022-11-30 14:47:41 +080045 return NULL;
46
Yidi Lin0b192d32023-03-20 17:40:31 +080047 return &panels[id];
Bo-Chen Chen49465162022-11-30 14:47:41 +080048}