-
Notifications
You must be signed in to change notification settings - Fork 8.4k
usb: host: class: support for usb host video class #94085
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?
Changes from 1 commit
16b61db
010638b
9c27337
a071c98
4617ffc
474238e
c960560
5bd97c9
f5e898b
d814fbe
cfd72a3
e51fbbf
d334d1d
9bb8b64
f545687
ca1514b
4139fff
fd1abd7
16538fd
ef9d0cf
2f940be
399578c
357c154
0ec11fe
47fa1e9
7e1aaef
6d3a8c8
8e040d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ supported: | |
| - pwm | ||
| - spi | ||
| - usb_device | ||
| - usb_host | ||
| - watchdog | ||
| - netif:eth | ||
| - netif:openthread | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think See comment below for |
||
| 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); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just small detail: |
||
| #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) | ||
|
|
@@ -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; | ||
|
|
@@ -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 { | ||
|
|
@@ -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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 { | ||
|
|
@@ -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 { | ||
|
|
||
There was a problem hiding this comment.
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.