diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 81e1bd2e8a..054ea56d8f 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -3915,6 +3915,9 @@ static int pd_control(struct host_cmd_handler_args *args) #else return EC_RES_INVALID_COMMAND; #endif + } else if (cmd->subcmd == PD_CHIP_ON && board_set_tcpc_power_mode) { + board_set_tcpc_power_mode(cmd->chip, 1); + return EC_RES_SUCCESS; } else { return EC_RES_INVALID_COMMAND; } diff --git a/include/ec_commands.h b/include/ec_commands.h index 67d026118f..d15c213e98 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -4179,7 +4179,8 @@ enum ec_pd_control_cmd { PD_SUSPEND = 0, /* Suspend the PD chip (EC: stop talking to PD) */ PD_RESUME, /* Resume the PD chip (EC: start talking to PD) */ PD_RESET, /* Force reset the PD chip */ - PD_CONTROL_DISABLE /* Disable further calls to this command */ + PD_CONTROL_DISABLE, /* Disable further calls to this command */ + PD_CHIP_ON, /* Power on the PD chip */ }; struct __ec_align1 ec_params_pd_control { diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h index 3f231fb3f7..edcd3f5875 100644 --- a/include/usb_pd_tcpm.h +++ b/include/usb_pd_tcpm.h @@ -242,6 +242,14 @@ struct tcpc_config_t { */ uint16_t tcpc_get_alert_status(void); +/** + * Optional, set the TCPC power mode. + * + * @param port Type-C port number + * @param mode 0: off/sleep, 1: on/awake + */ +void board_set_tcpc_power_mode(int port, int mode) __attribute__((weak)); + /** * Initialize TCPC. *