summaryrefslogtreecommitdiff
path: root/zephyr/projects/corsola/src/krabby
diff options
context:
space:
mode:
authorEric Yilun Lin <yllin@chromium.org>2021-11-16 14:46:06 +0800
committerCommit Bot <commit-bot@chromium.org>2021-11-19 05:07:22 +0000
commit5800bf43a1d741eae7bfc5c13c25be912008214a (patch)
treece0000c0d5fde4e9437843182aead57f2ae0afe0 /zephyr/projects/corsola/src/krabby
parent14accf89923cc498ae585359c3ba0110fa0855b0 (diff)
downloadchrome-ec-5800bf43a1d741eae7bfc5c13c25be912008214a.tar.gz
zephyr: krabby: restructure folder layout
To follow the guidelines in go/zephyr-variant. next steps: - restructure kingler layout - move common configs into prj.conf - move source files from cros-ec/krabby to zephyr BUG=b:206553789 TEST=zmake -b krabby; zmake -b kingler BRANCH=main Change-Id: I145fcb90cca360f733ecad41d0fcc82283563634 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3289581 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'zephyr/projects/corsola/src/krabby')
-rw-r--r--zephyr/projects/corsola/src/krabby/i2c.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/zephyr/projects/corsola/src/krabby/i2c.c b/zephyr/projects/corsola/src/krabby/i2c.c
new file mode 100644
index 0000000000..12f626847c
--- /dev/null
+++ b/zephyr/projects/corsola/src/krabby/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 "i2c.h"
+
+/* Krabby 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