Skip to content

usb: device_next: uvc: move files to common directory#103369

Merged
aescolar merged 2 commits intozephyrproject-rtos:mainfrom
josuah:uvc_common
Feb 6, 2026
Merged

usb: device_next: uvc: move files to common directory#103369
aescolar merged 2 commits intozephyrproject-rtos:mainfrom
josuah:uvc_common

Conversation

@josuah
Copy link
Copy Markdown
Contributor

@josuah josuah commented Feb 2, 2026

In order to anticipate the introduction of a host class API, move some headers to a common directory for both device and host class implementation.

This was split from this PR as it has no dependency:

@josuah josuah marked this pull request as ready for review February 2, 2026 20:24
@josuah josuah closed this Feb 2, 2026
@josuah josuah reopened this Feb 2, 2026
jfischer-no
jfischer-no previously approved these changes Feb 2, 2026
@josuah josuah added the area: USB Universal Serial Bus label Feb 2, 2026
Comment thread subsys/usb/common/include/usb_common_uvc.h Outdated
Comment thread subsys/usb/common/uvc.c Outdated
@josuah josuah force-pushed the uvc_common branch 2 times, most recently from f4062b7 to 56dbc8f Compare February 3, 2026 21:50
Comment thread subsys/usb/common/include/uvc.h Outdated
#ifndef ZEPHYR_INCLUDE_USBD_CLASS_UVC_H_
#define ZEPHYR_INCLUDE_USBD_CLASS_UVC_H_
#ifndef ZEPHYR_INCLUDE_USB_COMMON_UVC_H
#define ZEPHYR_INCLUDE_USB_COMMON_UVC_H
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subsys/usb/common/include/
@josuah Do we need include directory? We do not have it, for example, in drivers/usb.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I mistook an arch WG discussion for a review.
Updated, thank you.

jfischer-no
jfischer-no previously approved these changes Feb 4, 2026

if(CONFIG_USBD_VIDEO_CLASS)
zephyr_include_directories(.)
zephyr_sources(uvc.c)
Copy link
Copy Markdown
Contributor

@tmon-nordic tmon-nordic Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You use uvc.c in CMakeLists.txt in commit prior to where uvc.c is introduced.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes my bad, there was some bad rebase happening.
I think I fixed it in API3 without fixing it in uvc_common.

Comment on lines -63 to -67
enum uvc_control_type {
UVC_CONTROL_SIGNED,
UVC_CONTROL_UNSIGNED,
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have the removals from usbd_uvc.c in "usb: uvc: move the header definition to include/" commit. I was initially wondering where enum uvc_control_type, struct uvc_control_map, struct uvc_guid_quirk came from.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like one of the commit got accidentally left into API2, and got merged.

I corrected it by merging the two commits.

Sorry for the confusion.

@carlescufi carlescufi mentioned this pull request Feb 5, 2026
18 tasks
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 <josuah.demangeon@nordicsemi.no>
Move UVC helper functions to a file shared between UVC host and device.
The arrays are not visible anymore from either USB host or device, but
instead accessed through a front-end funciton.

Signed-off-by: Josuah Demangeon <josuah.demangeon@nordicsemi.no>
@josuah josuah requested a review from tmon-nordic February 5, 2026 15:59
@josuah
Copy link
Copy Markdown
Contributor Author

josuah commented Feb 5, 2026

Sorry for the "functinos" instead of "functions" typo in the commit message...

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Feb 5, 2026

@jfischer-no jfischer-no added this to the v4.4.0 milestone Feb 5, 2026
@aescolar aescolar merged commit 5412bf3 into zephyrproject-rtos:main Feb 6, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: USB Universal Serial Bus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants