summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2019-10-23 20:02:10 +0800
committerCommit Bot <commit-bot@chromium.org>2019-12-16 08:06:04 +0000
commit7b61704fd1a09c5aae26f163e096d9695e479f21 (patch)
tree2692c9bdf01c6a73625b46c3bc5092bbb9ffaf06 /board
parent7c89289e32ba60dca6d00aca6827b6ebe82f87ba (diff)
downloadchrome-ec-7b61704fd1a09c5aae26f163e096d9695e479f21.tar.gz
i2c: add support for i2c bit-banging
Krane/Jacuzzi need a 100KHz SMBus port for battery, in addition to the existing two i2c ports. This CL adds a bit-bang driver that supports i2c/smbus bit-banging through a set of pre-defined gpio pins. BUG=b:138161741,b:138415463 TEST=On a reworked jacuzzi (battery i2c connected to other gpios), 1) `battery` shows reasonable output (this verifies i2c_readN, i2c_read_string) 2) `i2cscan` works for port 3 (bitbang port) 3) `cutoff` (verifies i2c_writeN) 4) `i2ctest` stress test BRANCH=master Change-Id: I78020e5c51707c3d9f0fd54f2c299e2f29cabe2f Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1765110 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/host/gpio.inc3
1 files changed, 3 insertions, 0 deletions
diff --git a/board/host/gpio.inc b/board/host/gpio.inc
index 5a08172a07..c567aa0277 100644
--- a/board/host/gpio.inc
+++ b/board/host/gpio.inc
@@ -31,3 +31,6 @@ GPIO(BASE_CHG_VDD_EN, PIN(0, 12), 0)
GPIO(SPI1_NSS, PIN(0, 13), GPIO_OUT_HIGH)
GPIO(USB_C0_DISCHARGE, PIN(0, 15), 0)
+
+GPIO(I2C_SCL, PIN(0, 16), GPIO_INPUT)
+GPIO(I2C_SDA, PIN(0, 17), GPIO_INPUT)