summaryrefslogtreecommitdiff
path: root/include/usb_pd.h
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-12-13 07:12:00 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2018-12-18 21:27:47 +0000
commit9b03aa4e66c18f9e37460a9cbe0eb16a3c20a9f7 (patch)
treeec25256c6ca9fc392344ea76b385e2ef4ad2ddff /include/usb_pd.h
parent85f6feabf4fd8747d88818af67c6b97be240a369 (diff)
downloadchrome-ec-9b03aa4e66c18f9e37460a9cbe0eb16a3c20a9f7.tar.gz
tcpc: wait for TCPC wake up upon first access
Previously we tried to perform i2c communication with the TCPC when it was in low power mode and only if the i2c transaction failed did we wait for the device to wake up. Now that the PS8751 will respond to i2c transaction (ACK them) when it is in LPM, ensure the init happers before we start talking to the device to handle an interrupt. BRANCH=none BUG=b:118063849,b:121109893 TEST=verify that plug and unplug for PS8751, ANX3429, and ANX3447 LPM still works. Change-Id: I8c18195e55ee6d04af7d4ff24230a3bd2d147d53 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1375102 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1383318
Diffstat (limited to 'include/usb_pd.h')
-rw-r--r--include/usb_pd.h27
1 files changed, 9 insertions, 18 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h
index 1927add067..7865f15d44 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -1039,6 +1039,15 @@ int pd_build_request(int port, uint32_t *rdo, uint32_t *ma, uint32_t *mv,
int pd_is_max_request_allowed(void);
/**
+ * Waits for the TCPC to exit low power mode (including re-initializing) if it
+ * is currently in low power mode. If not, then the function immediately
+ * returns.
+ *
+ * @param port USB-C port number
+ */
+void pd_wait_exit_low_power(int port);
+
+/**
* Informs the TCPM state machine that code within the EC has accessed the TCPC
* via its communication bus (e.g. i2c). This is important to keep track of as
* accessing a TCPC may pull the hardware out of low-power mode.
@@ -1062,24 +1071,6 @@ void pd_device_accessed(int port);
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()
- *
- * @param port USB-C port number
- * @return True if device is in LPM and i2c transaction should be retried
- */
-int pd_device_in_low_power(int port);
-
-/**
- * Requests that the PD task wakeup the TCPC out of low power mode properly, and
- * waits for the wakeup operation to complete.
- *
- * @param port USB-C port number
- */
-void pd_wait_for_wakeup(int port);
-
-/**
* Process source capabilities packet
*
* @param port USB-C port number