From 0697132df7ffc36ab697ce4de134f585f1644097 Mon Sep 17 00:00:00 2001 From: Aseda Aboagye Date: Wed, 13 Sep 2017 14:42:08 -0700 Subject: [PATCH] zoombini: Add support for sensor i2c bus. BUG=None BRANCH=None TEST=make -j buildall. Change-Id: I7f79e01fe2d2004a3e9df733852f25bd89033d58 Signed-off-by: Aseda Aboagye Reviewed-on: https://chromium-review.googlesource.com/666289 Commit-Ready: Aseda Aboagye Tested-by: Aseda Aboagye Reviewed-by: Shawn N --- board/zoombini/board.c | 1 + board/zoombini/board.h | 1 + board/zoombini/gpio.inc | 3 +++ 3 files changed, 5 insertions(+) diff --git a/board/zoombini/board.c b/board/zoombini/board.c index 05aaf91239..0fd619d693 100644 --- a/board/zoombini/board.c +++ b/board/zoombini/board.c @@ -94,6 +94,7 @@ BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); const struct i2c_port_t i2c_ports[] = { {"power", I2C_PORT_POWER, 400, GPIO_I2C0_SCL, GPIO_I2C0_SDA}, {"pmic", I2C_PORT_PMIC, 400, GPIO_I2C3_SCL, GPIO_I2C3_SDA}, + {"sensor", I2C_PORT_SENSOR, 400, GPIO_I2C7_SCL, GPIO_I2C7_SDA}, {"tcpc0", I2C_PORT_TCPC0, 1000, GPIO_I2C5_SCL, GPIO_I2C5_SDA}, {"tcpc1", I2C_PORT_TCPC1, 1000, GPIO_I2C1_SCL, GPIO_I2C1_SDA}, {"tcpc2", I2C_PORT_TCPC2, 1000, GPIO_I2C2_SCL, GPIO_I2C2_SDA}, diff --git a/board/zoombini/board.h b/board/zoombini/board.h index da020be4c0..143e1ef716 100644 --- a/board/zoombini/board.h +++ b/board/zoombini/board.h @@ -110,6 +110,7 @@ #define I2C_PORT_CHARGER I2C_PORT_POWER #define I2C_PORT_POWER NPCX_I2C_PORT0_0 #define I2C_PORT_PMIC NPCX_I2C_PORT3_0 +#define I2C_PORT_SENSOR NPCX_I2C_PORT7_0 #define I2C_PORT_TCPC0 NPCX_I2C_PORT5_0 #define I2C_PORT_TCPC1 NPCX_I2C_PORT1_0 #define I2C_PORT_TCPC2 NPCX_I2C_PORT2_0 diff --git a/board/zoombini/gpio.inc b/board/zoombini/gpio.inc index daf558164f..95e87c9df6 100644 --- a/board/zoombini/gpio.inc +++ b/board/zoombini/gpio.inc @@ -59,6 +59,8 @@ GPIO(I2C3_SCL, PIN(D, 1), GPIO_INPUT) GPIO(I2C3_SDA, PIN(D, 0), GPIO_INPUT) GPIO(I2C5_SCL, PIN(3, 3), GPIO_INPUT) GPIO(I2C5_SDA, PIN(3, 6), GPIO_INPUT) +GPIO(I2C7_SCL, PIN(B, 3), GPIO_INPUT) +GPIO(I2C7_SDA, PIN(B, 2), GPIO_INPUT) GPIO(BAT_PRESENT_L, PIN(E, 5), GPIO_INPUT) GPIO(USB_PD_RST_L, PIN(F, 1), GPIO_ODR_HIGH) @@ -93,6 +95,7 @@ ALTERNATE(PIN_MASK(9, 0x07), 1, MODULE_I2C, GPIO_PULL_UP) /* I2C1 SDA / I2C2 */ ALTERNATE(PIN_MASK(8, 0x80), 1, MODULE_I2C, GPIO_PULL_UP) /* I2C1 SCL */ ALTERNATE(PIN_MASK(D, 0x03), 1, MODULE_I2C, GPIO_PULL_UP) /* I2C3 */ ALTERNATE(PIN_MASK(3, 0x48), 1, MODULE_I2C, GPIO_PULL_UP) /* I2C5 */ +ALTERNATE(PIN_MASK(B, 0x0C), 1, MODULE_I2C, GPIO_PULL_UP) /* I2C7 */ /* Keyboard Pins */ /* KSI_00-01 */