Skip to content

Commit 48b1cff

Browse files
patrickdelaunayMarek Vasut
authored andcommitted
usb: hub: introduce HUB_DEBOUNCE_TIMEOUT
Introduce define for connection timeout, named HUB_DEBOUNCE_TIMEOUT as in linux kernel drivers/usb/core/hub.c Signed-off-by: Patrick Delaunay <[email protected]>
1 parent 98ac785 commit 48b1cff

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

common/usb_hub.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
#define HUB_SHORT_RESET_TIME 20
4848
#define HUB_LONG_RESET_TIME 200
4949

50+
#define HUB_DEBOUNCE_TIMEOUT 1000
51+
5052
#define PORT_OVERCURRENT_MAX_SCAN_COUNT 3
5153

5254
struct usb_device_scan {
@@ -208,10 +210,10 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
208210
* will be done based on this value in the USB port loop in
209211
* usb_hub_configure() later.
210212
*/
211-
hub->connect_timeout = hub->query_delay + 1000;
213+
hub->connect_timeout = hub->query_delay + HUB_DEBOUNCE_TIMEOUT;
212214
debug("devnum=%d poweron: query_delay=%d connect_timeout=%d\n",
213215
dev->devnum, max(100, (int)pgood_delay),
214-
max(100, (int)pgood_delay) + 1000);
216+
max(100, (int)pgood_delay) + HUB_DEBOUNCE_TIMEOUT);
215217
}
216218

217219
#if !CONFIG_IS_ENABLED(DM_USB)

0 commit comments

Comments
 (0)