summaryrefslogtreecommitdiff
path: root/include/i2c.h
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2019-07-23 10:50:13 -0600
committerCommit Bot <commit-bot@chromium.org>2019-07-25 16:50:42 +0000
commit286e3b9033c551f5fe24fe8c41de17b35bf27c81 (patch)
tree3f27651b0f4c440c3715b76aa2535b24089ff6c0 /include/i2c.h
parent7e0885d97099d8c3e51913103d442fec6a31fb4c (diff)
downloadchrome-ec-286e3b9033c551f5fe24fe8c41de17b35bf27c81.tar.gz
i2c: don't scan i2c addresses less than 0x08
None of the existing i2c addresses in the EC code base are less than 0x08 and those addresses are reserved by the i2c and SMBus specification. BRANCH=none BUG=b:138156666 TEST=i2c bus scan with a smart battery doesn't "misbehave" any more and other devices can be detected properly. Change-Id: I561b082c4c7e3df7caaa33b6ef6ad467dabbd5a5 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1715326 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'include/i2c.h')
-rw-r--r--include/i2c.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/i2c.h b/include/i2c.h
index ccb65fc7a0..ed041b2876 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -43,6 +43,16 @@
#define I2C_IS_BIG_ENDIAN(addr_flags) ((addr_flags) & I2C_FLAG_BIG_ENDIAN)
/*
+ * All 7-bit addresses in the following formats
+ * 0000 XXX
+ * 1111 XXX
+ * are reserved for various purposes. Valid 7-bit client adderesses start at
+ * 0x08 and end at 0x77 inclusive.
+ */
+#define I2C_FIRST_VALID_ADDR 0x08
+#define I2C_LAST_VALID_ADDR 0x77
+
+/*
* Max data size for a version 3 request/response packet. This is
* big enough for EC_CMD_GET_VERSION plus header info.
*/