diff options
-rw-r--r-- | zephyr/program/myst/myst/include/usb_mux_config.h | 11 | ||||
-rw-r--r-- | zephyr/program/myst/myst/src/usb_mux_config.c | 24 | ||||
-rw-r--r-- | zephyr/program/myst/src/usbc_config.c | 24 |
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) { |