mbox series

[v2,0/3] Add ability to disable UVC Gadget's interrupt endpoint

Message ID 20230130105045.120886-1-dan.scally@ideasonboard.com (mailing list archive)
Headers show
Series Add ability to disable UVC Gadget's interrupt endpoint | expand

Message

Dan Scally Jan. 30, 2023, 10:50 a.m. UTC
The UVC Gadget includes a hardcoded interrupt endpoint against the VideoControl
interface, though it is misnamed as a control endpoint (the default endpoint 0
is actually used for that role). The UVC specification says that this is an
optional feature of a UVC compliant camera provided certain scenarios don't hold
true, specifically...

1. The device supports hardware triggers for still image capture
2. The device implements any AutoUpdate controls
3. The device implements any Asynchronous controls

Those are all scenarios that will be determined by userspace, meaning that in some
implementations the interrupt endpoint is unnecessary. There is an additional
problem in that the current implementation of the uvc function driver contains
no mechanism through which data can be sent over this endpoint, making it unuseable
in any case. This series disables the endpoint by default but adds a configfs
attribute allowing users to re-enable it if desired.

Daniel Scally (3):
  usb: gadget: uvc: Rename uvc_control_ep
  usb: gadget: uvc: Add new enable_interrupt_ep attribute
  usb: gadget: uvc: Disable interrupt endpoint by default

 .../ABI/testing/configfs-usb-gadget-uvc       |  4 +-
 drivers/usb/gadget/function/f_uvc.c           | 76 +++++++++++--------
 drivers/usb/gadget/function/u_uvc.h           |  2 +
 drivers/usb/gadget/function/uvc.h             |  3 +-
 drivers/usb/gadget/function/uvc_configfs.c    | 53 +++++++++++++
 5 files changed, 104 insertions(+), 34 deletions(-)