1
0
Fork 0
Commit Graph

6 Commits (0c7244209588630a9b45e52490ef1390e04499a6)

Author SHA1 Message Date
Joel Pepper b206548be6 usb: gadget: uvc: configfs: Add bFrameIndex attributes
- Add bFrameIndex as a UVCG_FRAME_ATTR_RO for each frame size.
- Automatically assign ascending bFrameIndex to each frame in a format.

Before all "bFrameindex" attributes were set to "1" with no way to
configure the gadget otherwise. This resulted in the host always
negotiating for bFrameIndex 1 (i.e. the first frame size of the gadget).
After the negotiation the host driver will set the user or application
selected frame size, while the gadget is actually set to the first frame
size.

Now, when the containing format is linked into the streaming header,
iterate over all child frame descriptors and assign ascending indices.
The automatically assigned indices can be read from the new read only
bFrameIndex configfs attribute in each frame descriptor item.

Signed-off-by: Joel Pepper <joel.pepper@rwth-aachen.de>
[Simplified documentation, renamed function, blank space update]
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-09-24 19:00:35 +03:00
Laurent Pinchart 61ff10e0ea 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>
2018-09-24 18:54:32 +03:00
Laurent Pinchart bf71544883 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>
2018-09-24 18:54:26 +03:00
Kieran Bingham d7af78b924 usb: gadget: uvc: Expose configuration name through video node
When utilising multiple instantiations of a UVC gadget on a composite
device, there is no clear method to link a particular configuration to
its respective video node.

Provide a means for identifying the correct video node by exposing the
name of the function configuration through sysfs.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2018-07-26 13:43:18 +03:00
Alexandre Belloni 375f62e7dd Documentation: configfs-usb-gadget-uvc: fix kernel version
v3.20 doesn't exist, it is actually v4.0.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2016-05-31 11:12:58 +03:00
Andrzej Pietrasiewicz 46919a23ee usb: gadget: uvc: configfs support in uvc function
Add support for using the uvc function as a component of USB gadgets composed
with configfs.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-01-12 12:13:26 -06:00