summaryrefslogtreecommitdiff
path: root/board/jacuzzi/board.c
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2019-10-23 20:02:29 +0800
committerCommit Bot <commit-bot@chromium.org>2020-01-09 10:37:09 +0000
commit4e6ab09d352419f119cff05366c6bd706a4fc71d (patch)
treec176c9b37716ca64cec62c66de06fd979269ada6 /board/jacuzzi/board.c
parent6d4b9490cc6f3c7fe44875eba0a2e6af60ccc73a (diff)
downloadchrome-ec-4e6ab09d352419f119cff05366c6bd706a4fc71d.tar.gz
RELAND: jacuzzi: enable i2c bitbang
This is a reland of CL:1876290 but for jacuzzi only. Original commit message: > - Enable bitbang driver > - increase the console/hook stack size because accessing bitbang i2c bus > requires more stack memory than before BUG=b:147204768 TEST=1) make buildall 2) boot on juniper BRANCH=kukui Change-Id: Id67e13325d024b292a66bdd38a0698c719d495e3 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1993120 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'board/jacuzzi/board.c')
-rw-r--r--board/jacuzzi/board.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/board/jacuzzi/board.c b/board/jacuzzi/board.c
index 0626e97b37..799d36ba9c 100644
--- a/board/jacuzzi/board.c
+++ b/board/jacuzzi/board.c
@@ -27,6 +27,7 @@
#include "hooks.h"
#include "host_command.h"
#include "i2c.h"
+#include "i2c_bitbang.h"
#include "it8801.h"
#include "keyboard_scan.h"
#include "lid_switch.h"
@@ -66,10 +67,19 @@ BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
/* I2C ports */
const struct i2c_port_t i2c_ports[] = {
{"typec", 0, 400, GPIO_I2C1_SCL, GPIO_I2C1_SDA},
+#ifdef BOARD_JACUZZI
{"other", 1, 100, GPIO_I2C2_SCL, GPIO_I2C2_SDA},
+#else /* Juniper */
+ {"other", 1, 400, GPIO_I2C2_SCL, GPIO_I2C2_SDA},
+#endif
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
+const struct i2c_port_t i2c_bitbang_ports[] = {
+ {"battery", 2, 100, GPIO_I2C3_SCL, GPIO_I2C3_SDA, .drv = &bitbang_drv},
+};
+const unsigned int i2c_bitbang_ports_used = ARRAY_SIZE(i2c_bitbang_ports);
+
#define BC12_I2C_ADDR PI3USB9201_I2C_ADDR_3
/* power signal list. Must match order of enum power_signal. */
@@ -415,3 +425,8 @@ int board_get_charger_i2c(void)
/* TODO(b:138415463): confirm the bus allocation for future builds */
return board_get_version() == 1 ? 2 : 1;
}
+
+int board_get_battery_i2c(void)
+{
+ return board_get_version() >= 1 ? 2 : 1;
+}