Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
16b61db
usb: host: add host status to the host context
Aug 8, 2025
010638b
usb: host: add copyright notice to linker script
Oct 23, 2025
9c27337
usb: host: class: implement more of the class/data struct fields
Aug 14, 2025
a071c98
usb: host: introduce wrappers to access the class function pointers
Aug 15, 2025
4617ffc
usb: host: introduce usbh_class with init/remove functions
Aug 15, 2025
474238e
usb: uvc: move the header definition to include/
Jul 25, 2025
c960560
tests: usb: host: test basic API functionality
Sep 11, 2025
5bd97c9
usb: host: use SPDX-FileCopyrightText prefix
Dec 8, 2025
f5e898b
tests: usb: host: test basic API functionality
Sep 11, 2025
d814fbe
usb: uvc: move the header definition to include/
Jul 25, 2025
cfd72a3
uvc: device: move helper functions to a common directory
Aug 17, 2025
e51fbbf
usb: uvc: common: correct the size for UVC_PU_CONTRAST_CONTROL
Nov 27, 2025
d334d1d
usb: host: uvc: placeholder implementation
Jul 26, 2025
9bb8b64
tests: usb: uvc: connect USB device and host via UVB
Jul 24, 2025
f545687
usb: device_next: uvc: fix public API include
Oct 29, 2025
ca1514b
usb: host: device: Read descriptor after setting device address
santhosh-c-c Nov 13, 2025
4139fff
subsys: usb: host: support multiple devices under hub
AidenHu Nov 18, 2025
fd1abd7
subsys: usb: host: remove root member for usbh_context
AidenHu Nov 19, 2025
16538fd
drivers: uhc: use correct endpoint type and interval
AidenHu Nov 18, 2025
ef9d0cf
drivers: uhc: correct interval usage for usb xfer
AidenHu Nov 18, 2025
2f940be
drivers: uhc: set right value for pipe by xfer's mps
AidenHu Nov 19, 2025
399578c
subsys: usb: host: refine connect/disconnect handling
AidenHu Nov 26, 2025
357c154
usb: host: uvc: implement full host uvc driver with video API support
AidenHu Dec 2, 2025
0ec11fe
samples: add USB host UVC camera demo with LCD live preview
AidenHu Dec 4, 2025
47fa1e9
subsys: usb: host: add config support for hub class
AidenHu Dec 2, 2025
7e1aaef
subsys: usb: host: new usb host hub class implementation
AidenHu Nov 28, 2025
6d3a8c8
usb: host: class: update UVC Kconfig for host uvc
AidenHu Dec 10, 2025
8e040d0
some changes for baords, video drivers, usbh.h, uvc.h
AidenHu Dec 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions boards/nxp/rd_rw612_bga/rd_rw612_bga.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ zephyr_udc0: &usb_otg {
status = "okay";
};

zephyr_uhc0: &usbh {
status = "okay";
};

&dma0 {
status = "okay";
};
Expand Down
1 change: 1 addition & 0 deletions boards/nxp/rd_rw612_bga/rd_rw612_bga.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ supported:
- pwm
- spi
- usb_device
- usb_host
- watchdog
- netif:eth
- netif:openthread
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/video_ctrls.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void video_auto_cluster_ctrl(struct video_ctrl *ctrls, uint8_t sz, bool set_vola
}
}

static int video_find_ctrl(const struct device *dev, uint32_t id, struct video_ctrl **ctrl)
int video_find_ctrl(const struct device *dev, uint32_t id, struct video_ctrl **ctrl)
Copy link
Contributor

Choose a reason for hiding this comment

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

This might need to remain private, see comments below.

{
struct video_device *vdev = video_find_vdev(dev);

Expand Down
2 changes: 2 additions & 0 deletions drivers/video/video_ctrls.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ int video_init_menu_ctrl(struct video_ctrl *ctrl, const struct device *dev, uint
int video_init_int_menu_ctrl(struct video_ctrl *ctrl, const struct device *dev, uint32_t id,
uint8_t def, const int64_t menu[], size_t menu_len);

int video_find_ctrl(const struct device *dev, uint32_t id, struct video_ctrl **ctrl);

Comment on lines +75 to +76
Copy link
Contributor

Choose a reason for hiding this comment

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

I think video_query_ctrl() does everything video_find_ctrl() is doing, and video_find_ctrl() is expected to remain private API.

See comment below for video_query_ctrl() usage...

void video_cluster_ctrl(struct video_ctrl *ctrls, uint8_t sz);

void video_auto_cluster_ctrl(struct video_ctrl *ctrls, uint8_t sz, bool set_volatile);
Expand Down
6 changes: 6 additions & 0 deletions include/zephyr/usb/usbh.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
extern "C" {
#endif


/* device signal value definitions */
#define USBH_DEVICE_CONNECTED 1
#define USBH_DEVICE_DISCONNECTED 2


Comment on lines +30 to +35
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like not used anywhere, possibly to remove from this commit.

/**
* @brief USB HOST Core Layer API
* @defgroup usb_host_core_api USB Host Core API
Expand Down
32 changes: 28 additions & 4 deletions subsys/usb/common/include/usb_uvc.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@
/* Video Class-Specific Request Codes */
#define UVC_SET_CUR 0x01
#define UVC_GET_CUR 0x81
#define UVC_SET_CUR_ALL 0x11
#define UVC_GET_MIN 0x82
#define UVC_GET_MAX 0x83
#define UVC_GET_RES 0x84
#define UVC_GET_LEN 0x85
#define UVC_GET_INFO 0x86
#define UVC_GET_INFO 0x86
Comment on lines -31 to +32
Copy link
Contributor

Choose a reason for hiding this comment

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

Just small detail:
Is indentation change needed? If not best to keep the same indentation everywhere.
You might need to configure the text editor to use "tabs 8 character wide".

#define UVC_GET_DEF 0x87
#define UVC_GET_CUR_ALL 0x91
#define UVC_GET_MIN_ALL 0x92
#define UVC_GET_MAX_ALL 0x93
#define UVC_GET_RES_ALL 0x94
#define UVC_GET_DEF_ALL 0x97

/* Flags announcing which controls are supported */
#define UVC_INFO_SUPPORTS_GET BIT(0)
Expand Down Expand Up @@ -232,6 +238,16 @@ struct uvc_unit_descriptor {
uint8_t bUnitID;
};

struct uvc_input_terminal_descriptor {
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t bDescriptorSubtype;
uint8_t bTerminalID;
uint16_t wTerminalType;
uint8_t bAssocTerminal;
uint8_t iTerminal;
} __packed;

struct uvc_output_terminal_descriptor {
uint8_t bLength;
uint8_t bDescriptorType;
Expand Down Expand Up @@ -401,7 +417,9 @@ struct uvc_frame_descriptor {
uint16_t wHeight;
uint32_t dwMinBitRate;
uint32_t dwMaxBitRate;
/* Other fields depending on bDescriptorSubtype value */
uint32_t dwMaxVideoFrameBufferSize;
uint32_t dwDefaultFrameInterval;
uint8_t bFrameIntervalType;
} __packed;

struct uvc_frame_continuous_descriptor {
Expand Down Expand Up @@ -435,7 +453,7 @@ struct uvc_frame_discrete_descriptor {
uint32_t dwMaxVideoFrameBufferSize;
uint32_t dwDefaultFrameInterval;
uint8_t bFrameIntervalType;
uint32_t dwFrameInterval[CONFIG_USBD_VIDEO_MAX_FRMIVAL];
uint32_t dwFrameInterval[CONFIG_USBH_VIDEO_MAX_FRMIVAL];
Comment on lines -438 to +456
Copy link
Contributor

Choose a reason for hiding this comment

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

This is being used by both USB and USB device, so a Kconfig option that is independent from host/device is needed.

I moved that to a dedicated commit in API3 so that it can be used for both device and host.

} __packed;

struct uvc_frame_based_continuous_descriptor {
Expand Down Expand Up @@ -467,7 +485,13 @@ struct uvc_frame_based_discrete_descriptor {
uint32_t dwMaxBitRate;
uint32_t dwDefaultFrameInterval;
uint8_t bFrameIntervalType;
uint32_t dwFrameInterval[CONFIG_USBD_VIDEO_MAX_FRMIVAL];
uint32_t dwFrameInterval[CONFIG_USBH_VIDEO_MAX_FRMIVAL];
} __packed;

struct uvc_cs_descriptor_header {
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t bDescriptorSubtype;
} __packed;

struct uvc_color_descriptor {
Expand Down
Loading