Skip to content

Commit 4c3cd20

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 fb4f304 commit 4c3cd20

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-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: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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 Hub levels allowed in the USB topology.
22+
The root HUB's level is 1. USB specification allows up to 5 levels.
23+
24+
config USBH_HUB_INIT_PRIORITY
25+
int "Hub manager initialization priority"
26+
default 85
27+
help
28+
Initialization priority for the Hub manager. Should be
29+
higher than the USB host stack but lower than device drivers
30+
31+
module = USBH_HUB
32+
module-str = usbh hub
33+
default-count = 1
34+
source "subsys/logging/Kconfig.template.log_config"
35+
36+
endif # USBH_HUB_CLASS

0 commit comments

Comments
 (0)