summaryrefslogtreecommitdiff
path: root/include/usbc_ppc.h
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2020-10-30 14:18:56 -0600
committerCommit Bot <commit-bot@chromium.org>2020-11-17 16:44:16 +0000
commit51484d77533e60cdfe21902eaf759c3be14df40a (patch)
treed28d5db09af798fd2972a4c4f902d770a951fe1a /include/usbc_ppc.h
parent15b590a0999752abe28584a0c502fe9435ec7e41 (diff)
downloadchrome-ec-51484d77533e60cdfe21902eaf759c3be14df40a.tar.gz
TCPM: Add OCP module
Currently, the overcurrent protection is tracked in the PPC code. However, as different chips are able to report overcurrent move this code into a generic module. Logic for not sourcing Vbus or Vconn on latched ports moves into the TC layer, and an overridable board overcurrent function is provided for boards which have no special actions to take. BRANCH=None BUG=b:171501161 TEST=make -j buildall; TCPMv2 tested with following drawcia patch Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I75919e345a5b0bce4a0b67432a13515e7716cf6a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532676 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'include/usbc_ppc.h')
-rw-r--r--include/usbc_ppc.h44
1 files changed, 0 insertions, 44 deletions
diff --git a/include/usbc_ppc.h b/include/usbc_ppc.h
index fbff51b596..8c18857961 100644
--- a/include/usbc_ppc.h
+++ b/include/usbc_ppc.h
@@ -11,18 +11,6 @@
/* Common APIs for USB Type-C Power Path Controllers (PPC) */
-/*
- * Number of times a port may overcurrent before we latch off the port until a
- * physical disconnect is detected.
- */
-#define PPC_OC_CNT_THRESH 3
-
-/*
- * Number of seconds until a latched-off port is re-enabled for sourcing after
- * detecting a physical disconnect.
- */
-#define PPC_OC_COOLDOWN_DELAY_US (2 * SECOND)
-
/* The role of connected device. */
enum ppc_device_role {
PPC_DEV_SNK,
@@ -200,22 +188,6 @@ int ppc_prints(const char *string, int port);
int ppc_err_prints(const char *string, int port, int error);
/**
- * Increment the overcurrent event counter.
- *
- * @param port: The Type-C port that has overcurrented.
- * @return EC_SUCCESS on success, EC_ERROR_INVAL if non-existent port.
- */
-int ppc_add_oc_event(int port);
-
-/**
- * Clear the overcurrent event counter.
- *
- * @param port: The Type-C port's counter to clear.
- * @return EC_SUCCESS on success, EC_ERROR_INVAL if non-existent port.
- */
-int ppc_clear_oc_event_counter(int port);
-
-/**
* Discharge PD VBUS on src/sink disconnect & power role swap
*
* @param port: The Type-C port number.
@@ -233,14 +205,6 @@ int ppc_discharge_vbus(int port, int enable);
int ppc_init(int port);
/**
- * Is the port latched off due to multiple overcurrent events in succession?
- *
- * @param port: The Type-C port number.
- * @return 1 if the port is latched off, 0 if it is not latched off.
- */
-int ppc_is_port_latched_off(int port);
-
-/**
* Is the port sourcing Vbus?
*
* @param port: The Type-C port number.
@@ -322,14 +286,6 @@ int ppc_vbus_sink_enable(int port, int enable);
int ppc_vbus_source_enable(int port, int enable);
/**
- * Board specific callback when a port overcurrents.
- *
- * @param port: The Type-C port which overcurrented.
- * @param is_overcurrented: 1 if port overcurrented, 0 if the condition is gone.
- */
-void board_overcurrent_event(int port, int is_overcurrented);
-
-/**
* Put the PPC into its lowest power state. In this state it should still fire
* interrupts if Vbus changes etc. This is called by board-specific code when
* appropriate.