diff options
Diffstat (limited to 'include/usbc_ocp.h')
-rw-r--r-- | include/usbc_ocp.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/include/usbc_ocp.h b/include/usbc_ocp.h index d31ce57724..6c1d641931 100644 --- a/include/usbc_ocp.h +++ b/include/usbc_ocp.h @@ -1,4 +1,4 @@ -/* Copyright 2020 The Chromium OS Authors. All rights reserved. +/* Copyright 2020 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -6,8 +6,33 @@ #ifndef __CROS_EC_USBC_OCP_H #define __CROS_EC_USBC_OCP_H +#include "common.h" + /* Common APIs for USB Type-C Overcurrent Protection (OCP) Module */ +/* + * PD 3.1 Ver 1.3 7.1.7.1 Output Over Current Protection + * + * "After three consecutive over current events Source Shall go to + * ErrorRecovery. + * + * Sources Should attempt to send a Hard Reset message when over + * current protection engages followed by an Alert Message indicating + * an OCP event once an Explicit Contract has been established. + * + * The Source Shall prevent continual system or port cycling if over + * current protection continues to engage after initially resuming + * either default operation or renegotiation. Latching off the port or + * system is an acceptable response to recurring over current." + * + * Our policy will be first two OCPs -> hard reset + * 3rd -> ErrorRecovery + * 4th -> port latched off + */ +#define OCP_HR_CNT 2 + +#define OCP_MAX_CNT 4 + /** * Increment the overcurrent event counter. * |