Skip to content

Commit 8e040d0

Browse files
committed
some changes for baords, video drivers, usbh.h, uvc.h
Signed-off-by: Aiden Hu <[email protected]>
1 parent 6d3a8c8 commit 8e040d0

File tree

6 files changed

+42
-5
lines changed

6 files changed

+42
-5
lines changed

boards/nxp/rd_rw612_bga/rd_rw612_bga.dtsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,10 @@ zephyr_udc0: &usb_otg {
257257
status = "okay";
258258
};
259259

260+
zephyr_uhc0: &usbh {
261+
status = "okay";
262+
};
263+
260264
&dma0 {
261265
status = "okay";
262266
};

boards/nxp/rd_rw612_bga/rd_rw612_bga.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ supported:
2828
- pwm
2929
- spi
3030
- usb_device
31+
- usb_host
3132
- watchdog
3233
- netif:eth
3334
- netif:openthread

drivers/video/video_ctrls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ void video_auto_cluster_ctrl(struct video_ctrl *ctrls, uint8_t sz, bool set_vola
270270
}
271271
}
272272

273-
static int video_find_ctrl(const struct device *dev, uint32_t id, struct video_ctrl **ctrl)
273+
int video_find_ctrl(const struct device *dev, uint32_t id, struct video_ctrl **ctrl)
274274
{
275275
struct video_device *vdev = video_find_vdev(dev);
276276

drivers/video/video_ctrls.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ int video_init_menu_ctrl(struct video_ctrl *ctrl, const struct device *dev, uint
7272
int video_init_int_menu_ctrl(struct video_ctrl *ctrl, const struct device *dev, uint32_t id,
7373
uint8_t def, const int64_t menu[], size_t menu_len);
7474

75+
int video_find_ctrl(const struct device *dev, uint32_t id, struct video_ctrl **ctrl);
76+
7577
void video_cluster_ctrl(struct video_ctrl *ctrls, uint8_t sz);
7678

7779
void video_auto_cluster_ctrl(struct video_ctrl *ctrls, uint8_t sz, bool set_volatile);

include/zephyr/usb/usbh.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
extern "C" {
2828
#endif
2929

30+
31+
/* device signal value definitions */
32+
#define USBH_DEVICE_CONNECTED 1
33+
#define USBH_DEVICE_DISCONNECTED 2
34+
35+
3036
/**
3137
* @brief USB HOST Core Layer API
3238
* @defgroup usb_host_core_api USB Host Core API

subsys/usb/common/include/usb_uvc.h

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,18 @@
2424
/* Video Class-Specific Request Codes */
2525
#define UVC_SET_CUR 0x01
2626
#define UVC_GET_CUR 0x81
27+
#define UVC_SET_CUR_ALL 0x11
2728
#define UVC_GET_MIN 0x82
2829
#define UVC_GET_MAX 0x83
2930
#define UVC_GET_RES 0x84
3031
#define UVC_GET_LEN 0x85
31-
#define UVC_GET_INFO 0x86
32+
#define UVC_GET_INFO 0x86
3233
#define UVC_GET_DEF 0x87
34+
#define UVC_GET_CUR_ALL 0x91
35+
#define UVC_GET_MIN_ALL 0x92
36+
#define UVC_GET_MAX_ALL 0x93
37+
#define UVC_GET_RES_ALL 0x94
38+
#define UVC_GET_DEF_ALL 0x97
3339

3440
/* Flags announcing which controls are supported */
3541
#define UVC_INFO_SUPPORTS_GET BIT(0)
@@ -232,6 +238,16 @@ struct uvc_unit_descriptor {
232238
uint8_t bUnitID;
233239
};
234240

241+
struct uvc_input_terminal_descriptor {
242+
uint8_t bLength;
243+
uint8_t bDescriptorType;
244+
uint8_t bDescriptorSubtype;
245+
uint8_t bTerminalID;
246+
uint16_t wTerminalType;
247+
uint8_t bAssocTerminal;
248+
uint8_t iTerminal;
249+
} __packed;
250+
235251
struct uvc_output_terminal_descriptor {
236252
uint8_t bLength;
237253
uint8_t bDescriptorType;
@@ -401,7 +417,9 @@ struct uvc_frame_descriptor {
401417
uint16_t wHeight;
402418
uint32_t dwMinBitRate;
403419
uint32_t dwMaxBitRate;
404-
/* Other fields depending on bDescriptorSubtype value */
420+
uint32_t dwMaxVideoFrameBufferSize;
421+
uint32_t dwDefaultFrameInterval;
422+
uint8_t bFrameIntervalType;
405423
} __packed;
406424

407425
struct uvc_frame_continuous_descriptor {
@@ -435,7 +453,7 @@ struct uvc_frame_discrete_descriptor {
435453
uint32_t dwMaxVideoFrameBufferSize;
436454
uint32_t dwDefaultFrameInterval;
437455
uint8_t bFrameIntervalType;
438-
uint32_t dwFrameInterval[CONFIG_USBD_VIDEO_MAX_FRMIVAL];
456+
uint32_t dwFrameInterval[CONFIG_USBH_VIDEO_MAX_FRMIVAL];
439457
} __packed;
440458

441459
struct uvc_frame_based_continuous_descriptor {
@@ -467,7 +485,13 @@ struct uvc_frame_based_discrete_descriptor {
467485
uint32_t dwMaxBitRate;
468486
uint32_t dwDefaultFrameInterval;
469487
uint8_t bFrameIntervalType;
470-
uint32_t dwFrameInterval[CONFIG_USBD_VIDEO_MAX_FRMIVAL];
488+
uint32_t dwFrameInterval[CONFIG_USBH_VIDEO_MAX_FRMIVAL];
489+
} __packed;
490+
491+
struct uvc_cs_descriptor_header {
492+
uint8_t bLength;
493+
uint8_t bDescriptorType;
494+
uint8_t bDescriptorSubtype;
471495
} __packed;
472496

473497
struct uvc_color_descriptor {

0 commit comments

Comments
 (0)