diff --git a/driver/tcpm/tcpm.h b/driver/tcpm/tcpm.h index b2d8aef2ea..34f1138c57 100644 --- a/driver/tcpm/tcpm.h +++ b/driver/tcpm/tcpm.h @@ -72,7 +72,17 @@ static inline void tcpc_lock(int port, int lock) /* TCPM driver wrapper function */ static inline int tcpm_init(int port) { - return tcpc_config[port].drv->init(port); + int rv; + + rv = tcpc_config[port].drv->init(port); + if (rv) + return rv; + + /* Board specific post TCPC init */ + if (board_tcpc_post_init) + rv = board_tcpc_post_init(port); + + return rv; } static inline int tcpm_release(int port) diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h index edcd3f5875..d8ad743caa 100644 --- a/include/usb_pd_tcpm.h +++ b/include/usb_pd_tcpm.h @@ -273,4 +273,13 @@ void tcpc_alert_clear(int port); */ int tcpc_run(int port, int evt); +/** + * Initialize board specific TCPC functions post TCPC initialization. + * + * @param port Type-C port number + * + * @return EC_SUCCESS or error + */ +int board_tcpc_post_init(int port) __attribute__((weak)); + #endif /* __CROS_EC_USB_PD_TCPM_H */