summaryrefslogtreecommitdiff
path: root/include/usb_pd_tcpm.h
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-06-28 15:31:40 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-07-18 18:15:26 -0700
commit16a8f8f4fa5bce677f202ff78892f3f50978065b (patch)
tree5b2b2b9bbe9c79632b00dc1c1d893a598add556a /include/usb_pd_tcpm.h
parentd22bdeeaecd864835eacb9c22e05f09050fb0237 (diff)
downloadchrome-ec-16a8f8f4fa5bce677f202ff78892f3f50978065b.tar.gz
tcpc: debounce entry into low-power mode
We need to keep track of the low-power mode hardware state for each TCPC so we can put a TCPC back into low power mode when it exits low power mode before the software TCPM state machine wants it out of low power mode. This change also breaks the low power mode entry out of the drp_toggle method into its own method: enter_low_power_mode. BRANCH=none BUG=b:77544959 TEST=Verified Analogix does not get into low-power mode loop. Tested other SRC/SNK capabilities as well. Tested the device will go back into low power mode if the AP access the TCPC via the 'ectool usbpdmuxinfo' command. Change-Id: I2fdefeda2bf13c2b79d988f0017629115438d313 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1119255 Reviewed-by: Scott Collyer <scollyer@chromium.org>
Diffstat (limited to 'include/usb_pd_tcpm.h')
-rw-r--r--include/usb_pd_tcpm.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h
index 1b77e40450..be1139b0e1 100644
--- a/include/usb_pd_tcpm.h
+++ b/include/usb_pd_tcpm.h
@@ -242,6 +242,20 @@ struct tcpm_drv {
*/
int (*set_src_ctrl)(int port, int enable);
#endif
+
+#ifdef CONFIG_USB_PD_TCPC_LOW_POWER
+ /**
+ * Instructs the TCPC to enter into low power mode.
+ *
+ * NOTE: Do no use tcpc_(read|write) style helper methods in this
+ * function. You must use i2c_(read|write) directly.
+ *
+ * @param port Type-C port number
+ *
+ * @return EC_SUCCESS or error
+ */
+ int (*enter_low_power_mode)(int port);
+#endif
};
enum tcpc_alert_polarity {