summaryrefslogtreecommitdiff
path: root/include/usb_api.h
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@google.com>2017-02-22 16:43:41 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-03-01 09:31:27 -0800
commitbc819424626206be0cdafcb591c0c2fbdfb95642 (patch)
treef62b8955a1894216702f53d6e1e5a426f688c39b /include/usb_api.h
parentb8c255484c59161217becdc29e353424d1f7a364 (diff)
downloadchrome-ec-bc819424626206be0cdafcb591c0c2fbdfb95642.tar.gz
stm32/usb: Add support for remote wake-up
USB uses a special mode the trigger remote wake-up during host suspend, by setting the K-state on the data differential pair, and setting a bit in the USB config descriptor attributes field. Let's enable that so that hammer can wake up host from S3. BRANCH=none BUG=chrome-os-partner:62325 TEST=Connect hammer to chell, put chell in S3. Press a key (or use ("kb 3 3 1; kb 3 3 0" in console), or touch trackpad => host wakes. Change-Id: Ib7b1e9047e01869f07ddd771c9c9bc640eef10d6 Reviewed-on: https://chromium-review.googlesource.com/446240 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/usb_api.h')
-rw-r--r--include/usb_api.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/usb_api.h b/include/usb_api.h
index c2e365cf28..a251b3f857 100644
--- a/include/usb_api.h
+++ b/include/usb_api.h
@@ -42,6 +42,14 @@ void usb_disconnect(void);
*/
void usb_release(void);
+/*
+ * Tell the host to wake up. Requires CONFIG_USB_REMOTE_WAKEUP to be defined,
+ * and a chip that implements the function.
+ *
+ * This function sleeps, so it must not be used in interrupt context.
+ */
+void usb_wake(void);
+
#ifdef CONFIG_USB_SELECT_PHY
/* Select which PHY to use. */
void usb_select_phy(uint32_t phy);