summaryrefslogtreecommitdiff
path: root/src/mainboard/google/geralt
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/geralt')
-rw-r--r--src/mainboard/google/geralt/display.c47
-rw-r--r--src/mainboard/google/geralt/display.h1
-rw-r--r--src/mainboard/google/geralt/panel_geralt.c18
3 files changed, 51 insertions, 15 deletions
diff --git a/src/mainboard/google/geralt/display.c b/src/mainboard/google/geralt/display.c
index bbdd808fa1..243ed6d739 100644
--- a/src/mainboard/google/geralt/display.c
+++ b/src/mainboard/google/geralt/display.c
@@ -3,6 +3,7 @@
#include <assert.h>
#include <console/console.h>
#include <delay.h>
+#include <device/i2c_simple.h>
#include <edid.h>
#include <framebuffer_info.h>
#include <gpio.h>
@@ -10,11 +11,16 @@
#include <soc/dptx.h>
#include <soc/dsi.h>
#include <soc/gpio_common.h>
+#include <soc/i2c.h>
#include <soc/mtcmos.h>
#include "display.h"
+#include "gpio.h"
#include "panel.h"
+#define PMIC_TPS65132_I2C I2C3
+#define PMIC_TPS65132_SLAVE 0x3E
+
int configure_display(void)
{
struct edid edid;
@@ -72,3 +78,44 @@ int configure_display(void)
return 0;
}
+
+void tps65132s_program_eeprom(void)
+{
+ u8 value = 0;
+ u8 value1 = 0;
+
+ /* Initialize I2C3 for PMIC TPS65132 */
+ mtk_i2c_bus_init(PMIC_TPS65132_I2C, I2C_SPEED_FAST);
+ mdelay(10);
+
+ gpio_output(GPIO_EN_PPVAR_MIPI_DISP, 1);
+ gpio_output(GPIO_EN_PPVAR_MIPI_DISP_150MA, 1);
+ mdelay(10);
+
+ i2c_read_field(PMIC_TPS65132_I2C, PMIC_TPS65132_SLAVE, 0x00, &value, 0xFF, 0);
+ i2c_read_field(PMIC_TPS65132_I2C, PMIC_TPS65132_SLAVE, 0x01, &value1, 0xFF, 0);
+
+ if (value != 0x11 || value1 != 0x11) {
+ printk(BIOS_INFO, "Just set AVDD AVEE 5.7V to EEPROM Data in first time.\n");
+
+ /* Set AVDD = 5.7V */
+ if (panel_pmic_reg_mask(PMIC_TPS65132_I2C, PMIC_TPS65132_SLAVE, 0x00, 0x11,
+ 0x1F) < 0)
+ return;
+
+ /* Set AVEE = -5.7V */
+ if (panel_pmic_reg_mask(PMIC_TPS65132_I2C, PMIC_TPS65132_SLAVE, 0x01, 0x11,
+ 0x1F) < 0)
+ return;
+
+ /* Set EEPROM Data */
+ if (panel_pmic_reg_mask(PMIC_TPS65132_I2C, PMIC_TPS65132_SLAVE, 0xFF, 0x80,
+ 0xFC) < 0)
+ return;
+ mdelay(50);
+ }
+
+ gpio_output(GPIO_EN_PPVAR_MIPI_DISP, 0);
+ gpio_output(GPIO_EN_PPVAR_MIPI_DISP_150MA, 0);
+ mdelay(5);
+}
diff --git a/src/mainboard/google/geralt/display.h b/src/mainboard/google/geralt/display.h
index 29153b303c..71e0e08392 100644
--- a/src/mainboard/google/geralt/display.h
+++ b/src/mainboard/google/geralt/display.h
@@ -4,5 +4,6 @@
#define __MAINBOARD_GOOGLE_GERALT_DISPLAY_H__
int configure_display(void);
+void tps65132s_program_eeprom(void);
#endif
diff --git a/src/mainboard/google/geralt/panel_geralt.c b/src/mainboard/google/geralt/panel_geralt.c
index 2991360506..7828651397 100644
--- a/src/mainboard/google/geralt/panel_geralt.c
+++ b/src/mainboard/google/geralt/panel_geralt.c
@@ -11,11 +11,10 @@
#include <soc/pmif.h>
#include <string.h>
+#include "display.h"
#include "gpio.h"
#include "panel.h"
-#define PMIC_TPS65132_I2C I2C3
-#define PMIC_TPS65132_SLAVE 0x3E
static void configure_mipi_pwm_backlight(void)
{
@@ -30,28 +29,17 @@ static void configure_edp_aux_backlight(void)
static void power_on_mipi_boe_tv110c9m_ll0(void)
{
+ tps65132s_program_eeprom();
+
/* Enable VM18V */
mainboard_enable_regulator(MTK_REGULATOR_VDD18, true);
- /* Initialize I2C3 for PMIC TPS65132 */
- mtk_i2c_bus_init(PMIC_TPS65132_I2C, I2C_SPEED_FAST);
- mdelay(10);
-
gpio_output(GPIO_DISP_RST_1V8_L, 0);
mdelay(1);
gpio_output(GPIO_EN_PPVAR_MIPI_DISP, 1);
gpio_output(GPIO_EN_PPVAR_MIPI_DISP_150MA, 1);
mdelay(10);
-
- /* Set AVDD = 5.7V */
- if (panel_pmic_reg_mask(PMIC_TPS65132_I2C, PMIC_TPS65132_SLAVE, 0x00, 0x11, 0x1F) < 0)
- return;
-
- /* Set AVEE = -5.7V */
- if (panel_pmic_reg_mask(PMIC_TPS65132_I2C, PMIC_TPS65132_SLAVE, 0x01, 0x11, 0x1F) < 0)
- return;
-
gpio_output(GPIO_DISP_RST_1V8_L, 1);
mdelay(1);
gpio_output(GPIO_DISP_RST_1V8_L, 0);