When using uncompressed video formats other then the default
YUYV, the user of the uvc gadget needs to set the proper GUID
format. Together with that GUID format it is needed to set
an corresponding BitsPerPixel value. This patch is adding
support to set the values via libusbgx/gadget-tool.
The functions config parameters like maxburst, maxpacket, interval
and function_name are possible to be set by scheme file
as well. This patch adds support to import and export
these variables.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
The return value of scandir is used in init_frames to iterate over
the elements. The iteration is done over nmb not ret. So this patch
is fixing this to fill the right variable.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
When the one of the supported formats is missing in the
configfs layout, currently the export function will run
into an error. We fix it by just passing 0 if the format
is missing to keep on parsing.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
The function init_frames is falsely checking for the negative
result from scandir on an unsigned variable. This will never
be true.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Thomas Haemmerle <thomas.haemmerle@wolfvision.net>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
v2 -> v3: - simplified exit paths of functions with returns instead of gotos
- added cleanup code for remove
- added gadget-uvc example file
- simplified class link creation
- added support for more than one format
v3 -> v4:
- fixed 4k resolution on gadget-uvc example