summaryrefslogtreecommitdiff
path: root/common/usb_pd_protocol.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/usb_pd_protocol.c')
-rw-r--r--common/usb_pd_protocol.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index b124ad0245..b6507baa5c 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -2725,6 +2725,19 @@ void pd_request_source_voltage(int port, int mv)
task_wake(PD_PORT_TO_TASK_ID(port));
}
+
+void pd_set_external_voltage_limit(int port, int mv)
+{
+ pd_set_max_voltage(mv);
+
+ if (pd[port].task_state == PD_STATE_SNK_READY ||
+ pd[port].task_state == PD_STATE_SNK_TRANSITION) {
+ /* Set flag to send new power request in pd_task */
+ pd[port].new_power_request = 1;
+ task_wake(PD_PORT_TO_TASK_ID(port));
+ }
+}
+
#endif /* CONFIG_USB_PD_DUAL_ROLE */
static int command_pd(int argc, char **argv)