summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2017-08-10 14:36:30 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-08-16 04:03:24 -0700
commit9e33d6ce3c6c0a8de24dd6afa71f2adc255a156b (patch)
tree081b226e96525148b389e76681e41b502edd5eb4 /board
parenta1abf686c3174c6b18d20e8fc250cc4d5a045d97 (diff)
downloadchrome-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 'board')
-rw-r--r--board/polyberry/board.c2
-rw-r--r--board/stm32f446e-eval/board.c3
-rw-r--r--board/sweetberry/board.c2
-rw-r--r--board/twinkie/sniffer.c7
4 files changed, 8 insertions, 6 deletions
diff --git a/board/polyberry/board.c b/board/polyberry/board.c
index 65039abd86..5bb811f82c 100644
--- a/board/polyberry/board.c
+++ b/board/polyberry/board.c
@@ -16,9 +16,9 @@
#include "update_fw.h"
#include "usb_descriptor.h"
#include "util.h"
-#include "usb_dwc_hw.h"
#include "usb_dwc_console.h"
#include "usb_dwc_update.h"
+#include "usb_hw.h"
/******************************************************************************
* Define the strings used in our USB descriptors.
diff --git a/board/stm32f446e-eval/board.c b/board/stm32f446e-eval/board.c
index 749f55c0d4..fc796464e2 100644
--- a/board/stm32f446e-eval/board.c
+++ b/board/stm32f446e-eval/board.c
@@ -13,9 +13,8 @@
#include "registers.h"
#include "stm32-dma.h"
#include "usb_descriptor.h"
-#include "usb_dwc_hw.h"
#include "usb_dwc_console.h"
-
+#include "usb_hw.h"
/******************************************************************************
* Define the strings used in our USB descriptors.
diff --git a/board/sweetberry/board.c b/board/sweetberry/board.c
index d05bb70bf4..8131eb9b18 100644
--- a/board/sweetberry/board.c
+++ b/board/sweetberry/board.c
@@ -17,8 +17,8 @@
#include "update_fw.h"
#include "usb_descriptor.h"
#include "util.h"
-#include "usb_dwc_hw.h"
#include "usb_dwc_console.h"
+#include "usb_hw.h"
#include "usb_power.h"
#include "usb_dwc_update.h"
diff --git a/board/twinkie/sniffer.c b/board/twinkie/sniffer.c
index a5028fda0c..da364b6325 100644
--- a/board/twinkie/sniffer.c
+++ b/board/twinkie/sniffer.c
@@ -221,8 +221,11 @@ static void ep_tx(void)
task_set_event(TASK_ID_SNIFFER, 1 << b, 0);
}
-static void ep_reset(void)
+static void ep_event(enum usb_ep_event evt)
{
+ if (evt != USB_EVENT_RESET)
+ return;
+
/* Bulk IN endpoint */
btable_ep[USB_EP_SNIFFER].tx_addr = usb_sram_addr(ep_buf[0]);
btable_ep[USB_EP_SNIFFER].tx_count = EP_BUF_SIZE;
@@ -231,7 +234,7 @@ static void ep_reset(void)
(0 << 9) /* Bulk EP */ |
(0 << 12) /* RX Disabled */;
}
-USB_DECLARE_EP(USB_EP_SNIFFER, ep_tx, ep_tx, ep_reset);
+USB_DECLARE_EP(USB_EP_SNIFFER, ep_tx, ep_tx, ep_event);
/* --- RX operation using comparator linked to timer --- */