summaryrefslogtreecommitdiff
path: root/common/usbc
diff options
context:
space:
mode:
authorAbe Levkoy <alevkoy@chromium.org>2020-07-24 15:14:29 -0600
committerCommit Bot <commit-bot@chromium.org>2020-07-25 02:00:49 +0000
commit5f1150d2bf8c890a5d57310b4f106814c9cb8cca (patch)
tree56bd62226d7562f6ae539fac5ce8b1051d1c4313 /common/usbc
parent9ce7944afcba6930af667a1479fd8bf7d4d7648d (diff)
downloadchrome-ec-5f1150d2bf8c890a5d57310b4f106814c9cb8cca.tar.gz
TCPMv2: Clean up typos and grammos
Also delete stale TODOs. Change CPRINTF to CPRINTS. BUG=none TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I8ae520c137af569526896b6e834e99522162e6f6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2317902 Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'common/usbc')
-rw-r--r--common/usbc/usb_pd_dpm.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/common/usbc/usb_pd_dpm.c b/common/usbc/usb_pd_dpm.c
index 968fd13844..54ccdad536 100644
--- a/common/usbc/usb_pd_dpm.c
+++ b/common/usbc/usb_pd_dpm.c
@@ -123,44 +123,37 @@ static void dpm_attempt_mode_entry(int port)
pd_get_modes_discovery(port, TCPC_TX_SOP) != PD_DISC_COMPLETE)
return;
- /* Check if we discovered USB4 mode */
+ /* Check if the device and cable support USB4. */
if (IS_ENABLED(CONFIG_USB_PD_USB4) && enter_usb_is_capable(port)) {
pe_dpm_request(port, DPM_REQUEST_ENTER_USB);
return;
}
- /*
- * IF USB4 mode is not discovered or if the device/cable is not
- * USB4 capable, Check if we discovered a Thunderbolt mode.
- */
+ /* If not, check if they support Thunderbolt alt mode. */
if (IS_ENABLED(CONFIG_USB_PD_TBT_COMPAT_MODE) &&
- pd_is_mode_discovered_for_svid(port, TCPC_TX_SOP,
- USB_VID_INTEL))
+ pd_is_mode_discovered_for_svid(port, TCPC_TX_SOP, USB_VID_INTEL))
vdo_count = tbt_setup_next_vdm(port,
ARRAY_SIZE(vdm), vdm, &tx_type);
- /*
- * IF thunderbolt mode is not discovered or if the device/cable is not
- * thunderbolt compatible, Check if we discovered a DisplayPort mode
- */
+ /* If not, check if they support DisplayPort alt mode. */
if (vdo_count == 0 && !dpm[port].mode_entry_done &&
pd_is_mode_discovered_for_svid(port, TCPC_TX_SOP,
USB_SID_DISPLAYPORT))
vdo_count = dp_setup_next_vdm(port, ARRAY_SIZE(vdm), vdm);
/*
- * If we did not enter any alternate mode, just mark discovery done
- * and get out of here.
+ * If the PE didn't discover any supported alternate mode, just mark
+ * setup done and get out of here.
*/
if (vdo_count == 0 && !dpm[port].mode_entry_done) {
- CPRINTF("C%d: No supported ALT mode discovered\n", port);
+ CPRINTS("C%d: No supported alt mode discovered", port);
dpm_set_mode_entry_done(port);
return;
}
if (vdo_count < 0) {
dpm_set_mode_entry_done(port);
- CPRINTF("C%d: Couldn't set up ALT VDM\n", port);
+ CPRINTS("C%d: Couldn't construct alt mode VDM", port);
return;
}
@@ -182,8 +175,6 @@ static void dpm_attempt_mode_exit(int port)
uint16_t svid;
uint32_t vdm;
- /* TODO: Add exit mode support for SOP' and SOP'' */
-
if (IS_ENABLED(CONFIG_USB_PD_TBT_COMPAT_MODE) &&
tbt_is_active(port))
svid = USB_VID_INTEL;