mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-06 15:01:35 +00:00
PD_CONTROL: add subcommand to power up a TCPC.
add a subcommand to the PD_CONTROL message to power up a specific TCPC. in practice, this typically just takes the TCPC out of sleep mode for cases where sleep mode is controlled by the EC. under the covers, board_set_tcpc_power_mode() gets a weak function definition so we don't need to special case this everywhere. TEST="make buildall" passes; "make tests" passes for reef. BRANCH=none BUG=b:35586895 Change-Id: Ib50e265d11eca10c3714049d8cfdf2657eff48c1 Signed-off-by: Caveh Jalali <caveh@google.com> Reviewed-on: https://chromium-review.googlesource.com/596796 Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user