Debian Codegraph @

src/mainboard/google/corsola/panel_tps65132s.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <console/console.h>
4 #include <delay.h>
5 #include <gpio.h>
6 #include <soc/regulator.h>
7 #include <soc/tps65132s.h>
8
9 #include "gpio.h"
10 #include "panel.h"
11
12 void tps65132s_power_on(struct tps65132s_cfg *config)
13 {
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 },
19 };
20 config->settings = reg_settings;
21 config->setting_counts = ARRAY_SIZE(reg_settings);
22
23 mainboard_set_regulator_voltage(MTK_REGULATOR_VIO18, 1800000);
24 mtk_i2c_bus_init(config->i2c_bus, I2C_SPEED_FAST);
25
26 if (is_pmic_aw37503(config->i2c_bus)) {
27 printk(BIOS_DEBUG, "Initialize and power on PMIC AW37503\n");
28 aw37503_init(config->i2c_bus);
29 gpio_output(config->en, 1);
30 mdelay(2);
31 gpio_output(config->sync, 1);
32 mdelay(3);
33 } else if (tps65132s_setup(config) != CB_SUCCESS) {
34 printk(BIOS_ERR, "Failed to setup tps65132s\n");
35 }
36
37 /* DISP_RST_1V8_L */
38 gpio_output(GPIO_EDPBRDG_RST_L, 1);
39 mdelay(1);
40 gpio_output(GPIO_EDPBRDG_RST_L, 0);
41 udelay(20);
42 gpio_output(GPIO_EDPBRDG_RST_L, 1);
43 }