summaryrefslogtreecommitdiff
path: root/chip/stm32/usb_hid_touchpad.c
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 /chip/stm32/usb_hid_touchpad.c
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 'chip/stm32/usb_hid_touchpad.c')
-rw-r--r--chip/stm32/usb_hid_touchpad.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/chip/stm32/usb_hid_touchpad.c b/chip/stm32/usb_hid_touchpad.c
index a0fc3b311a..92e1b09886 100644
--- a/chip/stm32/usb_hid_touchpad.c
+++ b/chip/stm32/usb_hid_touchpad.c
@@ -327,6 +327,11 @@ void set_touchpad_report(struct usb_hid_touchpad_report *report)
report, sizeof(*report));
/* enable TX */
STM32_TOGGLE_EP(USB_EP_HID_TOUCHPAD, EP_TX_MASK, EP_TX_VALID, 0);
+
+#ifdef CONFIG_USB_REMOTE_WAKEUP
+ /* Wake up host, if required. */
+ usb_wake();
+#endif
}
static void hid_touchpad_tx(void)