summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/function/f_uvc.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-05-23 18:47:56 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-09-24 18:54:26 +0300
commitbf71544883a1ccb20021eb5139475496dbd8abd9 (patch)
treee9614859bafc12c92acfa0ff9f09f27eb10fa939 /drivers/usb/gadget/function/f_uvc.c
parentefbf0af70b4f7ee6ed1533ed0d905255c0545e08 (diff)
usb: gadget: uvc: configfs: Add interface number attributes
The video control and video streaming interface numbers are needed in the UVC gadget userspace stack to reply to UVC requests. They are hardcoded to fixed values at the moment, preventing configurations with multiple functions. To fix this, make them dynamically discoverable by userspace through read-only configfs attributes in <function>/control/bInterfaceNumber and <function>/streaming/bInterfaceNumber respectively. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'drivers/usb/gadget/function/f_uvc.c')
-rw-r--r--drivers/usb/gadget/function/f_uvc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
index 95cb1b5f5ffe..4ea987741e6e 100644
--- a/drivers/usb/gadget/function/f_uvc.c
+++ b/drivers/usb/gadget/function/f_uvc.c
@@ -699,12 +699,14 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f)
uvc_iad.bFirstInterface = ret;
uvc_control_intf.bInterfaceNumber = ret;
uvc->control_intf = ret;
+ opts->control_interface = ret;
if ((ret = usb_interface_id(c, f)) < 0)
goto error;
uvc_streaming_intf_alt0.bInterfaceNumber = ret;
uvc_streaming_intf_alt1.bInterfaceNumber = ret;
uvc->streaming_intf = ret;
+ opts->streaming_interface = ret;
/* Copy descriptors */
f->fs_descriptors = uvc_copy_descriptors(uvc, USB_SPEED_FULL);