summaryrefslogtreecommitdiff
path: root/common/usb_common.c
diff options
context:
space:
mode:
authorPatryk Duda <pdk@semihalf.com>2020-09-04 13:27:56 +0200
committerCommit Bot <commit-bot@chromium.org>2020-09-11 00:33:32 +0000
commit56618fa0256003920c0c714048b3121b0fc643af (patch)
tree3b565fc135d5f97e3ed5399e43e6c19ab0a7b3d8 /common/usb_common.c
parent791c0ac14a8d3679b8c284cf9ecc294d23666bad (diff)
downloadchrome-ec-56618fa0256003920c0c714048b3121b0fc643af.tar.gz
TCPMv2: Obtain correct dual role state when going suspend
Some boards (eg. eve) don't source VBUS in S3 state. In this case DRP state should be set to force sink instead of toggle off. This CL introduces pd_get_drp_state_in_suspend() function and uses it to obtain correct DRP state when entering suspend. Default implementation of pd_get_drp_state_in_suspend() returns PD_DRP_TOGGLE_OFF, so this commit introduces no functional changes. BUG=b:162254118 BRANCH=none TEST=No functional changes in this CL make -j buildall Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: Iacf8fcdbad027563015f593653d3ed8a49752131 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2395558 Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'common/usb_common.c')
-rw-r--r--common/usb_common.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/usb_common.c b/common/usb_common.c
index 9a467ed96d..afd67bf0cd 100644
--- a/common/usb_common.c
+++ b/common/usb_common.c
@@ -548,6 +548,12 @@ __overridable void pd_execute_data_swap(int port,
{
}
+__overridable enum pd_dual_role_states pd_get_drp_state_in_suspend(void)
+{
+ /* Disable dual role when going to suspend */
+ return PD_DRP_TOGGLE_OFF;
+}
+
__overridable void pd_try_execute_vconn_swap(int port, int flags)
{
/*