Skip to content

Commit c66cd2b

Browse files
committed
subsys: usb: host: Add accessory support for host hub
Add support for usb host hub class. Signed-off-by: Aiden Hu <[email protected]>
1 parent d194419 commit c66cd2b

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

subsys/usb/host/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ zephyr_library_sources_ifdef(
2323
class/usbh_uvc.c
2424
)
2525

26+
zephyr_library_sources_ifdef(
27+
CONFIG_USBH_HUB_CLASS
28+
class/usbh_hub.c
29+
class/usbh_hub_mgr.c
30+
)
31+
2632
zephyr_library_sources_ifdef(
2733
CONFIG_USBIP
2834
usbip.c

subsys/usb/host/class/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Copyright (c) 2025 Nordic Semiconductor ASA
2+
# Copyright 2025 NXP
23
#
34
# SPDX-License-Identifier: Apache-2.0
45

56
rsource "Kconfig.uvc"
7+
rsource "Kconfig.hub_host"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#
2+
# Copyright 2025 NXP
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
config USBH_HUB_CLASS
8+
bool "USB Host Hub Class Driver"
9+
default n
10+
help
11+
Enable USB Host Hub Class driver support.
12+
This allows connecting USB hubs and managing downstream devices.
13+
14+
if USBH_HUB_CLASS
15+
16+
config USBH_HUB_MAX_LEVELS
17+
int "Maximum Hub chain depth"
18+
default 5
19+
range 1 5
20+
help
21+
Maximum number of non-root hubs allowed in a single communication path
22+
between the host and any device. USB specification allows up to five
23+
non-root hubs per path, which means the deepest path can include 5 hubs.
24+
25+
config USBH_HUB_MAX_COUNT
26+
int "Maximum Hub count"
27+
default 7
28+
range 1 16
29+
help
30+
Maximum number of hub devices supported in the entire USB topology.
31+
32+
config USBH_HUB_INIT_PRIORITY
33+
int "Hub manager initialization priority"
34+
default 85
35+
help
36+
Initialization priority for the Hub manager. Should be
37+
higher than the USB host stack but lower than device drivers
38+
39+
module = USBH_HUB
40+
module-str = usbh hub
41+
default-count = 1
42+
source "subsys/logging/Kconfig.template.log_config"
43+
44+
endif # USBH_HUB_CLASS

0 commit comments

Comments
 (0)