summaryrefslogtreecommitdiff
path: root/include/usb_api.h
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2018-02-01 11:33:25 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-02-02 10:17:30 -0800
commit76927bdc5a17ddbdc9fc601b761c2a4984ecc1e9 (patch)
tree0ef346ffe19b05b9fddeb0320c244705c5686baf /include/usb_api.h
parentc721ad9162b9fe20ce872c1d28cd8b1ad60e2c25 (diff)
downloadchrome-ec-76927bdc5a17ddbdc9fc601b761c2a4984ecc1e9.tar.gz
stm32/usb: Add HOOK_USB_PM_CHANGE, called when USB is resumed/suspended
In particular, this will allow touchpad driver and keyboard matrix scanning to be powered off/disabled when the USB interface is disabled without setting the remote wake feature (USB_REQ_FEATURE_DEVICE_REMOTE_WAKEUP), as events would be ignored anyway. BRANCH=none BUG=b:72683995 TEST=With next CLs, touchpad and keyboard matrix scanning are disabled when lid is closed. Change-Id: I3750bfaf8c31cde075adf9da4fef39753b8981c5 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/897067 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/usb_api.h')
-rw-r--r--include/usb_api.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/usb_api.h b/include/usb_api.h
index 8778dcc54e..7ebf25b135 100644
--- a/include/usb_api.h
+++ b/include/usb_api.h
@@ -49,6 +49,13 @@ void usb_release(void);
int usb_is_suspended(void);
/*
+ * Returns true if USB remote wakeup is currently enabled by host.
+ * Requires CONFIG_USB_SUSPEND to be defined, always return 0 if
+ * CONFIG_USB_REMOTE_WAKEUP is not defined.
+ */
+int usb_is_remote_wakeup_enabled(void);
+
+/*
* Preserve in non-volatile memory the state of the USB hardware registers
* which cannot be simply re-initialized when powered up again.
*/