summaryrefslogtreecommitdiff
path: root/zephyr/projects/trogdor/lazor/src
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2021-06-04 12:24:39 +0200
committerCommit Bot <commit-bot@chromium.org>2021-06-09 18:50:08 +0000
commit3bf7cf9dfe738f1f156d6b9dc5ade87290d1d78e (patch)
tree71760a5287b41a9738b10c7c313ad623a4ffeac6 /zephyr/projects/trogdor/lazor/src
parentf2f9b534389a672ef9a3f5353b49922150dab1d3 (diff)
downloadchrome-ec-3bf7cf9dfe738f1f156d6b9dc5ade87290d1d78e.tar.gz
zephyr: lazor: Enable I2C_PASSTHRU_RESTRICTED config
Enable the I2C_PASSTHRU_RESTRICTED config for Lazor. Define board_allow_i2c_passthru function in platform-specific code. BUG=b:188885798 BRANCH=none TEST=Verify that I2C_PASSTHRU command works properly e.g. DUT displays the battery level correctly. Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Icf8a13f1c3aaecc660322a2153654c70c1accd7b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2939675 Reviewed-by: Yuval Peress <peress@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/projects/trogdor/lazor/src')
-rw-r--r--zephyr/projects/trogdor/lazor/src/i2c.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/zephyr/projects/trogdor/lazor/src/i2c.c b/zephyr/projects/trogdor/lazor/src/i2c.c
new file mode 100644
index 0000000000..c76e6c3d4f
--- /dev/null
+++ b/zephyr/projects/trogdor/lazor/src/i2c.c
@@ -0,0 +1,17 @@
+/* Copyright 2021 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "i2c/i2c.h"
+#include "config_chip.h"
+
+/* Lazor board specific i2c implementation */
+
+#ifdef CONFIG_PLATFORM_EC_I2C_PASSTHRU_RESTRICTED
+int board_allow_i2c_passthru(int port)
+{
+ return (i2c_get_device_for_port(port) ==
+ i2c_get_device_for_port(I2C_PORT_VIRTUAL_BATTERY));
+}
+#endif