Skip to content

Commit 0473e94

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 9ea6f7c commit 0473e94

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

subsys/usb/host/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ zephyr_library_sources_ifdef(
1818
usbh_shell.c
1919
)
2020

21+
zephyr_library_sources_ifdef(
22+
CONFIG_USBH_HUB_CLASS
23+
class/usbh_hub.c
24+
class/usbh_hub_mgr.c
25+
)
26+
2127
zephyr_library_sources_ifdef(
2228
CONFIG_USBIP
2329
usbip.c

subsys/usb/host/class/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#
2+
# Copyright 2025 NXP
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
6+
rsource "Kconfig.hub_host"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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 2 7
20+
help
21+
Maximum number of Hub levels allowed in the USB topology.
22+
USB specification allows up to 7 levels, but practical
23+
implementations usually limit to 5 levels for performance
24+
and power management reasons.
25+
26+
config USBH_HUB_INIT_PRIORITY
27+
int "Hub manager initialization priority"
28+
default 85
29+
help
30+
Initialization priority for the Hub manager. Should be
31+
higher than the USB host stack but lower than device drivers
32+
33+
module = USBH_HUB
34+
module-str = usbh hub
35+
default-count = 1
36+
source "subsys/logging/Kconfig.template.log_config"
37+
38+
endif # USBH_HUB_CLASS

0 commit comments

Comments
 (0)