summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2021-09-13 10:18:56 -0600
committerCommit Bot <commit-bot@chromium.org>2021-09-14 05:23:27 +0000
commit222d31de4bcf82884562719709e0dc2a8aa31301 (patch)
tree21373840780698ef220b1b79c17d7af17c2118e7
parent6c8d7c8cf289ef2483ce595aa33119f313c45b18 (diff)
downloadchrome-ec-222d31de4bcf82884562719709e0dc2a8aa31301.tar.gz
zephyr: I2C cleanup
Zephyr does not use the GPIO based I2C recovery. Delete i2c_get_line_levels() and I2C_CONFIG_GPIO() as these symbols are no longer referenced. Move a the DT_NODE_EXISTS to the top of the file as the named-i2c-ports node is need throughout this file. BUG=none BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I62cec339b448b78d1e9ca150227f604f23af32f7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3158972 Commit-Queue: Yuval Peress <peress@google.com> Reviewed-by: Yuval Peress <peress@google.com>
-rw-r--r--zephyr/shim/src/i2c.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/zephyr/shim/src/i2c.c b/zephyr/shim/src/i2c.c
index afb102be2a..065d1c059b 100644
--- a/zephyr/shim/src/i2c.c
+++ b/zephyr/shim/src/i2c.c
@@ -9,6 +9,13 @@
#include "i2c/i2c.h"
/*
+ * The named-i2c-ports node is required by the I2C shim
+ */
+#if !DT_NODE_EXISTS(DT_PATH(named_i2c_ports))
+#error I2C shim requires the named-i2c-ports node to be defined.
+#endif
+
+/*
* Initialize device bindings in i2c_devices.
* This macro should be called from within DT_FOREACH_CHILD.
*/
@@ -21,9 +28,6 @@
#define INIT_PHYSICAL_PORTS(id) \
i2c_physical_ports[I2C_PORT(id)] = DT_PROP_OR(id, physical_port, -1);
-#define I2C_CONFIG_GPIO(id, type) \
- DT_STRING_UPPER_TOKEN(DT_CHILD(DT_CHILD(id, config), type), enum_name)
-
#define I2C_PORT_INIT(id) \
{ \
.name = DT_LABEL(id), \
@@ -38,19 +42,12 @@
* be removed at that point.
*/
const struct i2c_port_t i2c_ports[] = {
-#if DT_NODE_EXISTS(DT_PATH(named_i2c_ports))
DT_FOREACH_CHILD(DT_PATH(named_i2c_ports), I2C_PORT_INIT)
-#endif
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
static int i2c_remote_ports[I2C_PORT_COUNT];
static int i2c_physical_ports[I2C_PORT_COUNT];
-int i2c_get_line_levels(int port)
-{
- return I2C_LINE_IDLE;
-}
-
static const struct device *i2c_devices[I2C_PORT_COUNT];
static int init_device_bindings(const struct device *device)