mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
usb: gadget: uvc: add a new attribute streaming_intf
This patch adds a new uvc attribute "streaming_intf" to show the number of streaming interface. The uvc application program may needs to query the information. Change-Id: I4554e204ab4457f67f35d2e7bfec2902196f79d3 Signed-off-by: William Wu <william.wu@rock-chips.com>
This commit is contained in:
@@ -913,6 +913,7 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f)
|
||||
}
|
||||
|
||||
uvc->streaming_intf = ret;
|
||||
opts->streaming_intf = ret;
|
||||
|
||||
/* Copy descriptors */
|
||||
f->fs_descriptors = uvc_copy_descriptors(uvc, USB_SPEED_FULL);
|
||||
|
||||
@@ -26,6 +26,7 @@ struct f_uvc_opts {
|
||||
unsigned int streaming_interval;
|
||||
unsigned int streaming_maxpacket;
|
||||
unsigned int streaming_maxburst;
|
||||
unsigned int streaming_intf;
|
||||
|
||||
/*
|
||||
* Control descriptors array pointers for full-/high-speed and
|
||||
|
||||
@@ -2204,9 +2204,20 @@ UVCG_OPTS_ATTR(streaming_maxburst, streaming_maxburst, identity_conv,
|
||||
|
||||
#undef UVCG_OPTS_ATTR
|
||||
|
||||
static ssize_t f_uvc_opts_streaming_intf_show(struct config_item *item,
|
||||
char *page)
|
||||
{
|
||||
struct f_uvc_opts *opts = to_f_uvc_opts(item);
|
||||
|
||||
return sprintf(page, "%d\n", opts->streaming_intf);
|
||||
}
|
||||
|
||||
UVC_ATTR_RO(f_uvc_opts_, streaming_intf, streaming_intf);
|
||||
|
||||
static struct configfs_attribute *uvc_attrs[] = {
|
||||
&f_uvc_opts_attr_streaming_bulk,
|
||||
&f_uvc_opts_attr_streaming_interval,
|
||||
&f_uvc_opts_attr_streaming_intf,
|
||||
&f_uvc_opts_attr_streaming_maxpacket,
|
||||
&f_uvc_opts_attr_streaming_maxburst,
|
||||
NULL,
|
||||
|
||||
Reference in New Issue
Block a user