summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongBeum.Ha <ybha@samsung.corp-partner.google.com>2021-10-06 16:11:40 +0900
committerCommit Bot <commit-bot@chromium.org>2021-10-07 01:57:30 +0000
commitde506307ca883fd60bda63dfe53752be6ee50036 (patch)
tree414954651768c98df4aa41983148250a448b06ae
parent28105643137674d01fdb740017ee1f8355f2f504 (diff)
downloadchrome-ec-de506307ca883fd60bda63dfe53752be6ee50036.tar.gz
bugzzy : set VSN/VSP/VBST
change VBST to 5.65V change VSN/VSP to 5.5V BUG=b:198072674 BRANCH=None TEST=make -j BOARD=bugzzy Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: I108914d5a6171034047101d95eafb997b5a2abd4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3207767 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--baseboard/dedede/variant_ec_npcx796fc.c7
-rw-r--r--board/bugzzy/board.c23
-rw-r--r--board/bugzzy/board.h15
-rw-r--r--board/bugzzy/gpio.inc5
4 files changed, 44 insertions, 6 deletions
diff --git a/baseboard/dedede/variant_ec_npcx796fc.c b/baseboard/dedede/variant_ec_npcx796fc.c
index 6d9dfb368a..3a198ff0c0 100644
--- a/baseboard/dedede/variant_ec_npcx796fc.c
+++ b/baseboard/dedede/variant_ec_npcx796fc.c
@@ -186,6 +186,11 @@ __attribute__((weak)) const struct i2c_port_t i2c_ports[] = {
GPIO_EC_I2C_SUB_USB_C1_SCL, GPIO_EC_I2C_SUB_USB_C1_SDA
},
#endif
+#ifdef BOARD_BUGZZY
+ {
+ "lcd", I2C_PORT_LCD, 400, GPIO_EC_I2C_LCD_SCL,
+ GPIO_EC_I2C_LCD_SDA
+ },
+#endif
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
-
diff --git a/board/bugzzy/board.c b/board/bugzzy/board.c
index 2d24c9553a..499e6c5e62 100644
--- a/board/bugzzy/board.c
+++ b/board/bugzzy/board.c
@@ -199,6 +199,7 @@ const struct temp_sensor_t temp_sensors[] = {
};
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
+static int board_id = -1;
void board_init(void)
{
@@ -727,9 +728,25 @@ static void panel_power_change_deferred(void)
{
int signal = gpio_get_level(GPIO_EN_PP1800_PANEL_S0);
- gpio_set_level(GPIO_EN_LCD_ENP, signal);
- msleep(1);
- gpio_set_level(GPIO_EN_LCD_ENN, signal);
+ if (board_id == -1) {
+ uint32_t val;
+
+ if (cbi_get_board_version(&val) == EC_SUCCESS)
+ board_id = val;
+ }
+
+ if (board_id < 4) {
+ gpio_set_level(GPIO_EN_LCD_ENP, signal);
+ msleep(1);
+ gpio_set_level(GPIO_EN_LCD_ENN, signal);
+ } else if (signal != 0) {
+ i2c_write8(I2C_PORT_LCD, I2C_ADDR_ISL98607_FLAGS,
+ ISL98607_REG_VBST_OUT, ISL98607_VBST_OUT_5P65);
+ i2c_write8(I2C_PORT_LCD, I2C_ADDR_ISL98607_FLAGS,
+ ISL98607_REG_VN_OUT, ISL98607_VN_OUT_5P5);
+ i2c_write8(I2C_PORT_LCD, I2C_ADDR_ISL98607_FLAGS,
+ ISL98607_REG_VP_OUT, ISL98607_VP_OUT_5P5);
+ }
gpio_set_level(GPIO_TSP_TA, signal & extpower_is_present());
}
diff --git a/board/bugzzy/board.h b/board/bugzzy/board.h
index 2697e17d8c..51dd38d8d8 100644
--- a/board/bugzzy/board.h
+++ b/board/bugzzy/board.h
@@ -113,12 +113,27 @@
#define I2C_PORT_USB_C0 NPCX_I2C_PORT1_0
#define I2C_PORT_SUB_USB_C1 NPCX_I2C_PORT2_0
#define I2C_PORT_USB_MUX I2C_PORT_USB_C0
+#define I2C_PORT_LCD NPCX_I2C_PORT3_0
/* TODO(b:147440290): Need to handle multiple charger ICs */
#define I2C_PORT_CHARGER I2C_PORT_USB_C0
#define I2C_PORT_ACCEL I2C_PORT_SENSOR
#define I2C_ADDR_EEPROM_FLAGS 0x50 /* 7b address */
+#define I2C_ADDR_ISL98607_FLAGS 0x29
+
+/* ISL98607 registers and value */
+/* VBST Voltage Adjustment */
+#define ISL98607_REG_VBST_OUT 0x06
+#define ISL98607_VBST_OUT_5P65 0x0a
+
+/* VN Voltage Adjustment */
+#define ISL98607_REG_VN_OUT 0x08
+#define ISL98607_VN_OUT_5P5 0x0a
+
+/* VP Voltage Adjustment */
+#define ISL98607_REG_VP_OUT 0x09
+#define ISL98607_VP_OUT_5P5 0x0a
/*
* I2C pin names for baseboard
diff --git a/board/bugzzy/gpio.inc b/board/bugzzy/gpio.inc
index 979b2867c0..af69120e22 100644
--- a/board/bugzzy/gpio.inc
+++ b/board/bugzzy/gpio.inc
@@ -51,6 +51,8 @@ GPIO(EC_I2C_SENSOR_SDA, PIN(B, 4), GPIO_INPUT)
GPIO(EC_I2C_USB_C0_SCL, PIN(9, 0), GPIO_INPUT)
GPIO(EC_I2C_USB_C0_SDA, PIN(8, 7), GPIO_INPUT)
GPIO(EC_I2C_SUB_C1_SCL_HDMI_EN_ODL, PIN(9, 2), GPIO_INPUT) /* C1 I2C SCL OR HDMI en */
+GPIO(EC_I2C_LCD_SCL, PIN(D, 1), GPIO_INPUT)
+GPIO(EC_I2C_LCD_SDA, PIN(D, 0), GPIO_INPUT)
/* Misc Enables */
GPIO(EN_VCCIO_EXT, PIN(6, 1), GPIO_OUT_LOW)
@@ -123,6 +125,7 @@ ALTERNATE(PIN_MASK(B, 0x3C), 0, MODULE_I2C, 0) /* I2C7,I2C0 */
ALTERNATE(PIN_MASK(3, 0x48), 0, MODULE_I2C, 0) /* I2C5 */
ALTERNATE(PIN_MASK(9, 0x07), 0, MODULE_I2C, 0) /* I2C2, I2C1 SCL */
ALTERNATE(PIN_MASK(8, 0x80), 0, MODULE_I2C, 0) /* I2C1 SDA */
+ALTERNATE(PIN_MASK(D, 0x03), 0, MODULE_I2C, 0) /* I2C3 */
/* NC pins, enable internal pull-up to avoid floating state. */
GPIO(GPIO00_NC, PIN(0, 0), GPIO_INPUT | GPIO_PULL_DOWN)
@@ -134,6 +137,4 @@ GPIO(GPIO60_NC, PIN(6, 0), GPIO_INPUT | GPIO_PULL_DOWN)
GPIO(GPIO80_NC, PIN(8, 0), GPIO_INPUT | GPIO_PULL_DOWN)
GPIO(GPIO81_NC, PIN(8, 1), GPIO_INPUT | GPIO_PULL_DOWN)
GPIO(GPIOC0_NC, PIN(C, 0), GPIO_INPUT | GPIO_PULL_DOWN)
-GPIO(GPIOD0_NC, PIN(D, 0), GPIO_INPUT | GPIO_PULL_DOWN)
-GPIO(GPIOD1_NC, PIN(D, 1), GPIO_INPUT | GPIO_PULL_DOWN)
GPIO(GPIOD6_NC, PIN(D, 6), GPIO_INPUT | GPIO_PULL_DOWN)