Skip to content

Conversation

@josuah
Copy link
Contributor

@josuah josuah commented Nov 21, 2025

Dependencies:

Aggregated:

This PR is only here to aggregate multiple other PRs together as a way to combine all "preview" features together.

It is not meant to be merged, and will stay a draft.

If you wish to add more commit to this PR, I would recommend to open a PR against the main branch, and add a message in this thread so I can pick the commit. This way, your change can be merged directly.

Josuah Demangeon and others added 11 commits November 20, 2025 01:00
Add a "struct usbh_status" that contains a bitmask of flags to keep
track of the global state of the host context, like done for the
device_next implementation.

Signed-off-by: Josuah Demangeon <[email protected]>
Add missing copyright notice for the linker script to help with
check_compliance.py.

Signed-off-by: Josuah Demangeon <[email protected]>
Add a "struct usbh_class_api" for the host implementation, and move all
the function poitners to it. Add more fields to "struct usbh_class_data".

Signed-off-by: Josuah Demangeon <[email protected]>
Add API wrappers around the function pointers in struct usbh_class_api,
while also documenting the USB host class internal API.

Signed-off-by: Josuah Demangeon <[email protected]>
Add functions to probe/remove all classes as part of a new usbh_class.c
and a matching usbh_class.h. These functions are called from the function
usbh_init_device_intl() in usbh_core.c to initialize every class upon
connection of a device. Every class driver provide filters to match the
interfaces of the device.

Co-authored-by: Aiden Hu <[email protected]>
Signed-off-by: Josuah Demangeon <[email protected]>
Move the UVC header with all the definitions from the UVC standard to
share it between USB host and device class implementation.

Signed-off-by: Josuah Demangeon <[email protected]>
Add tests making sure the USB Host class APIs introduced build
and run as expected.

Signed-off-by: Josuah Demangeon <[email protected]>
Loop through each of the VideoStreaming and VideoControl descriptor
to parse them. This is meant as a stub for the purpose of testing the
class API.

Signed-off-by: Josuah Demangeon <[email protected]>
Add a test to run the USB Video Class host support by using
the existing Zephyr USB Video Class device support.
This allows running implementing the host side from the device side.
A draft implementation of UVC is added leveraging this test.

Signed-off-by: Josuah Demangeon <[email protected]>
The public API file <zephyr/usb/class/usbd_uvc.h> lacked an include
to <zephyr/drivers/video.h> making it fail depending on the order of
the includes.

Signed-off-by: Josuah Demangeon <[email protected]>
Modify the USB device int sequence to read the device
descriptor only after setting a valid device address.

Signed-off-by: Santhosh Charles <[email protected]>
When hub is used, need to consider about multiple
devices are attached.

Signed-off-by: Aiden Hu <[email protected]>
add usbh_device_get_root and usbh_device_is_root
function to check root device

Signed-off-by: Aiden Hu <[email protected]>
For usb xfer, set endpoint type and interval by the
selected endpoint desc.

Signed-off-by: Aiden Hu <[email protected]>
Convert xfer's interval to actual value because
mcux_ep->interval is already calculated.

Signed-off-by: Aiden Hu <[email protected]>
maxPacketSize and numberPerUframe of pipe should
be set considering additional transactions.

Signed-off-by: Aiden Hu <[email protected]>
@josuah josuah force-pushed the pr_usb_host_class_api4 branch from 3f8f7bc to 2ce56b8 Compare November 21, 2025 12:18
@sonarqubecloud
Copy link

@AidenHu
Copy link
Contributor

AidenHu commented Nov 21, 2025

@josuah
so how about the commit add two APIs for connect/disconnect from the PR Usb host hub class enablement #99735 ? In host core, we need to provide APIs or trigger to be used by hub class to connect/disconnect the device. This commit can not be created by main. Or do you have any idea about this topic?

@josuah josuah changed the title Pr usb host class api4 USB Host: integrate class API [4: aggregated] Nov 21, 2025
@josuah josuah mentioned this pull request Nov 21, 2025
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants