]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
usb: gadget: uvc: configfs: Add bFormatIndex attributes
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sat, 26 May 2018 21:51:57 +0000 (00:51 +0300)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 24 Sep 2018 15:54:32 +0000 (18:54 +0300)
commit61ff10e0ea0cb39c737eab7e4fc5f0ae4d0fff33
tree8e223ae0ac15fa3eaddddb4ca32a63b861ae7a64
parentbf71544883a1ccb20021eb5139475496dbd8abd9
usb: gadget: uvc: configfs: Add bFormatIndex attributes

The UVC format description are numbered using the descriptor's
bFormatIndex field. The index is used in UVC requests, and is thus
needed to handle requests in userspace. Make it dynamically discoverable
by exposing it in a bFormatIndex configfs attribute of the uncompressed
and mjpeg format config items.

The bFormatIndex value exposed through the attribute is stored in the
config item private data. However, that value is never set: the driver
instead computes the bFormatIndex value when linking the stream class
header in the configfs hierarchy and stores it directly in the class
descriptors in a separate structure. In order to expose the value
through the configfs attribute, store it in the config item private data
as well. This results in a small code simplification.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Documentation/ABI/testing/configfs-usb-gadget-uvc
drivers/usb/gadget/function/uvc_configfs.c