diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2017-08-10 14:36:30 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-08-16 04:03:24 -0700 |
commit | 9e33d6ce3c6c0a8de24dd6afa71f2adc255a156b (patch) | |
tree | 081b226e96525148b389e76681e41b502edd5eb4 /chip/stm32/usb_dwc_stream.h | |
parent | a1abf686c3174c6b18d20e8fc250cc4d5a045d97 (diff) | |
download | chrome-ec-9e33d6ce3c6c0a8de24dd6afa71f2adc255a156b.tar.gz |
chip/stm32/usb: Replace reset handler by generic event handler
Some USB interface handlers need to know when USB has been
successfully resumed after a wake event. For example, this is
useful so that HID keyboard can send the events at the right time.
BRANCH=none
BUG=b:35775048
TEST=Using USB HID keyboard patches to queue keys in a FIFO:
After USB autosuspends, press a single key and hold it. Without
this patch the endpoint data only gets reloaded on the _next_
event.
TEST=On hammer, I2C passthrough still works.
Change-Id: I9b52b9de16767c8a66c702a5ae70369334a3d590
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/569547
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'chip/stm32/usb_dwc_stream.h')
-rw-r--r-- | chip/stm32/usb_dwc_stream.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/chip/stm32/usb_dwc_stream.h b/chip/stm32/usb_dwc_stream.h index df1311f03f..e46e7a929c 100644 --- a/chip/stm32/usb_dwc_stream.h +++ b/chip/stm32/usb_dwc_stream.h @@ -14,7 +14,7 @@ #include "producer.h" #include "queue.h" #include "usb_descriptor.h" -#include "usb_dwc_hw.h" +#include "usb_hw.h" /* * Compile time Per-USB stream configuration stored in flash. Instances of this @@ -173,9 +173,9 @@ extern struct producer_ops const usb_stream_producer_ops; { \ usb_epN_rx(ENDPOINT); \ } \ - static void CONCAT2(NAME, _ep_reset)(void) \ + static void CONCAT2(NAME, _ep_event)(enum usb_ep_event evt) \ { \ - usb_stream_reset(&NAME); \ + usb_stream_event(&NAME, evt); \ } \ struct dwc_usb_ep CONCAT2(NAME, _ep_ctl) = { \ .max_packet = USB_MAX_PACKET_SIZE, \ @@ -196,7 +196,7 @@ extern struct producer_ops const usb_stream_producer_ops; USB_DECLARE_EP(ENDPOINT, \ CONCAT2(NAME, _ep_tx), \ CONCAT2(NAME, _ep_rx), \ - CONCAT2(NAME, _ep_reset)); + CONCAT2(NAME, _ep_event)); /* This is a short version for declaring Google serial endpoints */ #define USB_STREAM_CONFIG(NAME, \ @@ -231,6 +231,7 @@ int tx_stream_handler(struct usb_stream_config const *config); */ void usb_stream_tx(struct usb_stream_config const *config); void usb_stream_rx(struct usb_stream_config const *config); -void usb_stream_reset(struct usb_stream_config const *config); +void usb_stream_event(struct usb_stream_config const *config, + enum usb_ep_event evt); #endif /* __CROS_EC_USB_STREAM_H */ |