diff options
author | Nicolas Boichat <drinkcat@google.com> | 2017-03-07 09:23:39 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-03-08 03:13:19 -0800 |
commit | 3898267abbf1b200018daae8afee60b33f24bb3e (patch) | |
tree | fc24e79e620ed52f6afb9d2420f123bc45575986 /include/usb_descriptor.h | |
parent | ff4f39d90618557cf81bd324ddc9ec2477d379fe (diff) | |
download | chrome-ec-3898267abbf1b200018daae8afee60b33f24bb3e.tar.gz |
chip/stm32/usb: Add support for USB SET_FEATURE control requests
This is required so that the kernel can enable/disable remote wake-up
capabilities, and in particular for the kernel to enable autosuspend.
Also, properly implement GET_STATUS.
BRANCH=none
BUG=b:35579996
TEST=echo auto > /sys/bus/usb/drivers/usb/X-Y/power/control, device
autosuspends after 2 seconds, and wakes on keypress.
Note that this introduces other bugs, where keys are missing,
repeated, see b/35775048.
Change-Id: I7ddd257ac3877d27fb2da813f20583a614a0169b
Reviewed-on: https://chromium-review.googlesource.com/450826
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_descriptor.h')
-rw-r--r-- | include/usb_descriptor.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/usb_descriptor.h b/include/usb_descriptor.h index 7cb64e35aa..c2df5f53f9 100644 --- a/include/usb_descriptor.h +++ b/include/usb_descriptor.h @@ -214,8 +214,13 @@ struct usb_endpoint_descriptor { /* Standard requests for bRequest field in a SETUP packet. */ #define USB_REQ_GET_STATUS 0x00 +#define USB_REQ_GET_STATUS_SELF_POWERED (1 << 0) +#define USB_REQ_GET_STATUS_REMOTE_WAKEUP (1 << 1) #define USB_REQ_CLEAR_FEATURE 0x01 #define USB_REQ_SET_FEATURE 0x03 +#define USB_REQ_FEATURE_ENDPOINT_HALT 0x0000 +#define USB_REQ_FEATURE_DEVICE_REMOTE_WAKEUP 0x0001 +#define USB_REQ_FEATURE_TEST_MODE 0x0002 #define USB_REQ_SET_ADDRESS 0x05 #define USB_REQ_GET_DESCRIPTOR 0x06 #define USB_REQ_SET_DESCRIPTOR 0x07 |