summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-10-04 12:37:33 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-10-05 19:37:58 -0700
commitb7288876ac2500d50a49d925833382be6f1eb5fc (patch)
tree1e4a929edfb1e04f72c5f8170ede7747f1f20218 /include
parent4170abd620557cddef031546ba0a249b834f7b38 (diff)
downloadchrome-ec-b7288876ac2500d50a49d925833382be6f1eb5fc.tar.gz
usb-pd: allow a task to prevent TCPC LPM
If a particularly low priority task (like hooks) wants to access the TCPC, then we do not want the LPM debounce to trigger in the middle of the communication sequence. This is especially a concern if the TCPC access is on debug registers that do not push out the LPM debounce deadline. BRANCH=none BUG=b:111406013 TEST=TCPC communication on meep is much more reliable with this change. TCPC will still go into low power mode after all tasks stop preventing LPM. Change-Id: I58cee8e202ced4085f131ff86dbda9d366e1dcca Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1262107 Reviewed-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/usb_pd.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h
index c5f6799a26..929b6d43ab 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -1046,6 +1046,18 @@ int pd_is_max_request_allowed(void);
void pd_device_accessed(int port);
/**
+ * Prevents the TCPC from going back into low power mode. Invocations must be
+ * called in a pair from the same task, otherwise the TCPC will never re-enter
+ * low power mode.
+ *
+ * Note: This will not wake the device up if it is in LPM.
+ *
+ * @param port USB-C port number
+ * @param prevent 1 to prevent this port from entering LPM
+ */
+void pd_prevent_low_power_mode(int port, int prevent);
+
+/**
* Returns true if this TCPC is in low power mode and a failed i2c transaction
* should be retried after waiting for the device to wake up via
* pd_wait_for_wakeup()