mbox series

[v2,0/8] usb: gadget: uvc: Improve configfs support

Message ID 20180801215505.7658-1-laurent.pinchart@ideasonboard.com (mailing list archive)
Headers show
Series usb: gadget: uvc: Improve configfs support | expand

Message

Laurent Pinchart Aug. 1, 2018, 9:54 p.m. UTC
Hello,

This patch series reworks the UVC gadget function configfs implementation to
support multiple UVC functions in a single device and 

The first two patches simplify the code (01/08) and improve readability
(02/08).

The series then moves to dynamically allocating all configfs groups to support
multiple instances. It first fixes a config item reference leak (03/08) that
would cause a memory leak with dynamic allocation, and then allocate configfs
groups dynamically (04/08).

As a consequence we have to expose the interface numbers through new configfs
attributes (05/08) in order to let the userspace helper application discover
them. The next two patches add and document new bFormatIndex (06/08) and
bFrameIndex (07/08) configfs attributes to expose indices of UVC format and
frame descriptors to userspace, allowing their dynamic discovery.

The last patch finally fixes a bug that allowed modification of descriptors
after linking them (08/08).

Felipe, all this is based on top of your testing/next branch, and is a
candidate for v4.20. Please let me know if I should base the patches on a
different branch.

Changes since v1:

- Fix config items reference leak
- Free dynamically allocated configfs groups
- Squash attribute documentation and attribute creation patches

Joel Pepper (2):
  usb: gadget: uvc: configfs: Add bFrameIndex attributes
  usb: gadget: uvc: configfs: Prevent format changes after linking
    header

Laurent Pinchart (6):
  usb: gadget: uvc: configfs: Don't wrap groups unnecessarily
  usb: gadget: uvc: configfs: Add section header comments
  usb: gadget: uvc: configfs: Drop leaked references to config items
  usb: gadget: uvc: configfs: Allocate groups dynamically
  usb: gadget: uvc: configfs: Add interface number attributes
  usb: gadget: uvc: configfs: Add bFormatIndex attributes

 Documentation/ABI/testing/configfs-usb-gadget-uvc |  24 +
 drivers/usb/gadget/function/f_uvc.c               |  10 +-
 drivers/usb/gadget/function/u_uvc.h               |   3 +
 drivers/usb/gadget/function/uvc_configfs.c        | 926 +++++++++++++---------
 4 files changed, 600 insertions(+), 363 deletions(-)