diff options
author | Nicolas Boichat <drinkcat@google.com> | 2017-02-22 16:43:41 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-03-01 09:31:27 -0800 |
commit | bc819424626206be0cdafcb591c0c2fbdfb95642 (patch) | |
tree | f62b8955a1894216702f53d6e1e5a426f688c39b /chip/stm32/usb_hid_keyboard.c | |
parent | b8c255484c59161217becdc29e353424d1f7a364 (diff) | |
download | chrome-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_keyboard.c')
-rw-r--r-- | chip/stm32/usb_hid_keyboard.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/chip/stm32/usb_hid_keyboard.c b/chip/stm32/usb_hid_keyboard.c index 38354815c3..91b8c8ed35 100644 --- a/chip/stm32/usb_hid_keyboard.c +++ b/chip/stm32/usb_hid_keyboard.c @@ -165,6 +165,11 @@ static void write_keyboard_report(void) STM32_TOGGLE_EP(USB_EP_HID_KEYBOARD, EP_TX_MASK, EP_TX_VALID, 0); } + +#ifdef CONFIG_USB_REMOTE_WAKEUP + /* Wake up host, if required. */ + usb_wake(); +#endif } static void hid_keyboard_tx(void) |