Debian Codegraph @

src/mainboard/google/geralt/panel_ciri.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <soc/i2c.h>
4 #include <soc/regulator.h>
5
6 #include "gpio.h"
7 #include "panel.h"
8
9 #define PMIC_TPS65132_I2C I2C3
10 #define VOLTAGE_5_7V 0x11
11 #define VOLTAGE_6V 0x14
12
13 static void power_on_mipi_himax_83102j(uint8_t voltage_reg_val)
14 {
15 const struct tps65132s_reg_setting reg_settings[] = {
16 { PMIC_TPS65132_VPOS, voltage_reg_val, 0x1f },
17 { PMIC_TPS65132_VNEG, voltage_reg_val, 0x1f },
18 { PMIC_TPS65132_DLYX, 0x55, 0xff },
19 { PMIC_TPS65132_ASSDD, 0x5b, 0xff },
20 };
21 const struct tps65132s_cfg cfg = {
22 .i2c_bus = PMIC_TPS65132_I2C,
23 .en = GPIO_EN_PPVAR_MIPI_DISP,
24 .sync = GPIO_EN_PPVAR_MIPI_DISP_150MA,
25 .settings = reg_settings,
26 .setting_counts = ARRAY_SIZE(reg_settings),
27 };
28 mainboard_set_regulator_voltage(MTK_REGULATOR_VDD18, 1900000);
29 power_on_mipi_panel(&cfg);
30 }
31
32 static void power_on_mipi_himax_83102j_5_7v(void)
33 {
34 power_on_mipi_himax_83102j(VOLTAGE_5_7V);
35 }
36
37 static void power_on_mipi_himax_83102j_6v(void)
38 {
39 power_on_mipi_himax_83102j(VOLTAGE_6V);
40 }
41
42 static struct panel_description ciri_panels[] = {
43 [17] = {
44 .name = "BOE_NV110WUM_L60",
45 .power_on = power_on_mipi_himax_83102j_5_7v,
46 .configure_backlight = configure_mipi_pwm_backlight,
47 .orientation = LB_FB_ORIENTATION_LEFT_UP,
48 .disp_path = DISP_PATH_MIPI,
49 .pwm_ctrl_gpio = true,
50 },
51
52 [34] = {
53 .name = "IVO_T109NW41",
54 .power_on = power_on_mipi_himax_83102j_5_7v,
55 .configure_backlight = configure_mipi_pwm_backlight,
56 .orientation = LB_FB_ORIENTATION_LEFT_UP,
57 .disp_path = DISP_PATH_MIPI,
58 .pwm_ctrl_gpio = true,
59 },
60
61 [51] = {
62 .name = "CSOT_PNA957QT1_1",
63 .power_on = power_on_mipi_himax_83102j_6v,
64 .configure_backlight = configure_mipi_pwm_backlight,
65 .orientation = LB_FB_ORIENTATION_LEFT_UP,
66 .disp_path = DISP_PATH_MIPI,
67 .pwm_ctrl_gpio = true,
68 }
69 };
70
71 struct panel_description *get_panel_description(uint32_t panel_id)
72 {
73 uint32_t id = panel_id & 0xFF;
74
75 if (id >= ARRAY_SIZE(ciri_panels))
76 return NULL;
77
78 return &ciri_panels[id];
79 }