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/g/usb.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/g/usb.c')
-rw-r--r-- | chip/g/usb.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/chip/g/usb.c b/chip/g/usb.c index 0fc4f62242..901a959e92 100644 --- a/chip/g/usb.c +++ b/chip/g/usb.c @@ -200,14 +200,6 @@ static void showregs(void) #define CONFIG_USB_BCD_DEV 0x0100 /* 1.00 */ #endif -#ifndef USB_BMATTRIBUTES -#ifdef CONFIG_USB_SELF_POWERED -#define USB_BMATTRIBUTES 0xc0 /* Self powered. */ -#else -#define USB_BMATTRIBUTES 0x80 /* Bus powered. */ -#endif -#endif - /* USB Standard Device Descriptor */ static const struct usb_device_descriptor dev_desc = { .bLength = USB_DT_DEVICE_SIZE, @@ -234,7 +226,14 @@ const struct usb_config_descriptor USB_CONF_DESC(conf) = { .bNumInterfaces = USB_IFACE_COUNT, .bConfigurationValue = 1, /* Caution: hard-coded value */ .iConfiguration = USB_STR_VERSION, - .bmAttributes = USB_BMATTRIBUTES, /* bus or self powered */ + .bmAttributes = 0x80 /* Reserved bit */ +#ifdef CONFIG_USB_SELF_POWERED /* bus or self powered */ + | 0x40 +#endif +#ifdef CONFIG_USB_REMOTE_WAKEUP + | 0x20 +#endif + , .bMaxPower = (CONFIG_USB_MAXPOWER_MA / 2), }; |