-
Notifications
You must be signed in to change notification settings - Fork 8.3k
USB Host: integrate class API [3: UVC] #94591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
6f4b3ff to
94c43f4
Compare
2d01257 to
6a5c7fc
Compare
|
6a5c7fc to
71cb2cf
Compare
2fd3ae8 to
a38c550
Compare
|
Force-push:
|
cb1281f to
c1c99ae
Compare
|
The UVC implementation there is a stub, does not provide anything useful besides logging the descriptors. The purpose is to show how to implement basic descriptors access and how to use unit tests on host+device class together. |
Hi @josuah |
The UVC implementation in my PR ("API3") is just a demo of the API, #94085 is more complete and good structure for the UVC/Video part. And needed most changes for the USB API part (as far as I understand). I wanted to try to import all the commits of #94085 on to of #94591 so that #94085 only needs to add I was working on nRG54LM20 (and ESP32) to be able to test UVC on DWC2 USB host. As soon as this is complete, I can try. |
@josuah, thank you for clarification. |
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]>
c1c99ae to
70b627c
Compare
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]>
70b627c to
3456f3b
Compare
|








Dependency:
Downstream:
NOTE: this PR also contains the commit of #94504 and #94590
On top of the commits from the previous PRs:
UVC Device still works:
All tests are done on top of main...josuah:zephyr:pr_usb_host_class_api3