summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2022-02-22 16:57:43 +0800
committerCommit Bot <commit-bot@chromium.org>2022-02-24 07:47:53 +0000
commit5ab67c51fbe6b4523c721cb7a7604b8cc1af927e (patch)
treea6ef3b250d5559f440395cfbc3109b5261af7364
parent9a9312025a4f5762fce0e410961a6cd5aeb91474 (diff)
downloadchrome-ec-5ab67c51fbe6b4523c721cb7a7604b8cc1af927e.tar.gz
corsola: move usba_port_enable to device tree
BUG=b:220814055 TEST=build krabby/kingler BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Ie14e049d0c1b6c902b0bde1cb1c78de5997e3fd8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3479016 Tested-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
-rw-r--r--zephyr/projects/corsola/BUILD.py6
-rw-r--r--zephyr/projects/corsola/src/usbc_config.c5
-rw-r--r--zephyr/projects/corsola/usba.dts11
3 files changed, 16 insertions, 6 deletions
diff --git a/zephyr/projects/corsola/BUILD.py b/zephyr/projects/corsola/BUILD.py
index a03dfe7ebe..0720b38cb1 100644
--- a/zephyr/projects/corsola/BUILD.py
+++ b/zephyr/projects/corsola/BUILD.py
@@ -18,7 +18,11 @@ def register_corsola_project(
register_func(
project_name=project_name,
zephyr_board=chip,
- dts_overlays=[here / "power_signal.dts", *extra_dts_overlays],
+ dts_overlays=[
+ here / "power_signal.dts",
+ here / "usba.dts",
+ *extra_dts_overlays,
+ ],
kconfig_files=[here / "prj.conf", *extra_kconfig_files],
)
diff --git a/zephyr/projects/corsola/src/usbc_config.c b/zephyr/projects/corsola/src/usbc_config.c
index 4bc902374d..569db96a19 100644
--- a/zephyr/projects/corsola/src/usbc_config.c
+++ b/zephyr/projects/corsola/src/usbc_config.c
@@ -70,11 +70,6 @@ __override uint8_t board_get_usb_pd_port_count(void)
}
/* USB-A */
-const int usb_port_enable[] = {
- GPIO_SIGNAL(DT_NODELABEL(en_pp5000_usb_a0_vbus))
-};
-BUILD_ASSERT(ARRAY_SIZE(usb_port_enable) == USB_PORT_COUNT);
-
void usb_a0_interrupt(enum gpio_signal signal)
{
enum usb_charge_mode mode = gpio_pin_get_dt(
diff --git a/zephyr/projects/corsola/usba.dts b/zephyr/projects/corsola/usba.dts
new file mode 100644
index 0000000000..77ab3fe70e
--- /dev/null
+++ b/zephyr/projects/corsola/usba.dts
@@ -0,0 +1,11 @@
+/* Copyright 2022 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.
+ */
+
+/ {
+ usba-port-enable-list {
+ compatible = "cros-ec,usba-port-enable-pins";
+ enable-pins = <&en_pp5000_usb_a0_vbus>;
+ };
+};