summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Mittelberg <bmbm@google.com>2023-05-09 06:50:45 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-05-10 07:00:21 +0000
commit8d162bcda7ba68ebc0092773fcee675ed57e4ff9 (patch)
treeecdcfbc9eb86da51fc3e3f3dcaff8ce3ab903ceb
parentbe430430bbb9c28c43e3747168778be716232a67 (diff)
downloadchrome-ec-8d162bcda7ba68ebc0092773fcee675ed57e4ff9.tar.gz
myst: move all CBI fields to board-level files
moving the PPC interrupt handler to be under program/myst/myst BUG=b:281645793 BRANCH=none TEST=zmake build myst Change-Id: Ia4a5daab6d280f2f8116486378925b4432a58731 Signed-off-by: Boris Mittelberg <bmbm@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516860 Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r--zephyr/program/myst/myst/include/usb_mux_config.h11
-rw-r--r--zephyr/program/myst/myst/src/usb_mux_config.c24
-rw-r--r--zephyr/program/myst/src/usbc_config.c24
3 files changed, 23 insertions, 36 deletions
diff --git a/zephyr/program/myst/myst/include/usb_mux_config.h b/zephyr/program/myst/myst/include/usb_mux_config.h
deleted file mode 100644
index 848753ba67..0000000000
--- a/zephyr/program/myst/myst/include/usb_mux_config.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Copyright 2023 The ChromiumOS Authors
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef __MYST_USB_MUX_CONFIG_H
-#define __MYST_USB_MUX_CONFIG_H
-
-uint32_t get_io_db_type_from_cached_cbi(void);
-
-#endif /* __MYST_USB_MUX_CONFIG_H */
diff --git a/zephyr/program/myst/myst/src/usb_mux_config.c b/zephyr/program/myst/myst/src/usb_mux_config.c
index 19eacbf989..561202fd23 100644
--- a/zephyr/program/myst/myst/src/usb_mux_config.c
+++ b/zephyr/program/myst/myst/src/usb_mux_config.c
@@ -10,7 +10,6 @@
#include "cros_cbi.h"
#include "hooks.h"
#include "usb_mux.h"
-#include "usb_mux_config.h"
#include "usbc/ppc.h"
#include "usbc/tcpci.h"
#include "usbc/usb_muxes.h"
@@ -42,6 +41,29 @@ __override uint8_t board_get_usb_pd_port_count(void)
return CONFIG_USB_PD_PORT_MAX_COUNT;
}
+void ppc_interrupt(enum gpio_signal signal)
+{
+ uint32_t io_db_type = get_io_db_type_from_cached_cbi();
+
+ switch (signal) {
+ case GPIO_USB_C0_PPC_INT_ODL:
+ ktu1125_interrupt(USBC_PORT_C0);
+ break;
+
+ case GPIO_USB_C1_PPC_INT_ODL:
+ if (io_db_type == FW_IO_DB_SKU_A) {
+ nx20p348x_interrupt(USBC_PORT_C1);
+ }
+ if (io_db_type == FW_IO_DB_SKU_B) {
+ ktu1125_interrupt(USBC_PORT_C1);
+ }
+ break;
+
+ default:
+ break;
+ }
+}
+
static void setup_mux(void)
{
switch (get_io_db_type_from_cached_cbi()) {
diff --git a/zephyr/program/myst/src/usbc_config.c b/zephyr/program/myst/src/usbc_config.c
index bc76a66be3..8167dec2f9 100644
--- a/zephyr/program/myst/src/usbc_config.c
+++ b/zephyr/program/myst/src/usbc_config.c
@@ -22,7 +22,6 @@
#include "hooks.h"
#include "power.h"
#include "usb_mux.h"
-#include "usb_mux_config.h"
#include "usb_pd_tcpm.h"
#include "usbc/usb_muxes.h"
#include "usbc_config.h"
@@ -118,29 +117,6 @@ void usb_pd_soc_interrupt(enum gpio_signal signal)
CPRINTSUSB("SOC PD Interrupt");
}
-void ppc_interrupt(enum gpio_signal signal)
-{
- uint32_t io_db_type = get_io_db_type_from_cached_cbi();
-
- switch (signal) {
- case GPIO_USB_C0_PPC_INT_ODL:
- ktu1125_interrupt(USBC_PORT_C0);
- break;
-
- case GPIO_USB_C1_PPC_INT_ODL:
- if (io_db_type == FW_IO_DB_SKU_A) {
- nx20p348x_interrupt(USBC_PORT_C1);
- }
- if (io_db_type == FW_IO_DB_SKU_B) {
- ktu1125_interrupt(USBC_PORT_C1);
- }
- break;
-
- default:
- break;
- }
-}
-
/* Round up 3250 max current to multiple of 128mA for ISL9241 AC prochot. */
static void charger_prochot_init_isl9241(void)
{