From 83fa2cb53742f43c3a254d0453bd96048ee29a82 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Fri, 25 May 2018 16:31:32 +0100 Subject: configfs: Provide configfs support Parse a configuration name from the commandline, and utilise it to identify the configfs configuration path. Only the short-name (i.e. "uvc.1") is necessary to provide if there is no ambiguity regarding the gadget, otherwise the gadget path should be included ("g1/functions/uvc.1"). If the parameter is not provided then the first function is utilised. Legacy g_webcam is still supported, and the parameter will define the UDC to match against if provided. Signed-off-by: Kieran Bingham Signed-off-by: Laurent Pinchart --- configfs.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 configfs.h (limited to 'configfs.h') diff --git a/configfs.h b/configfs.h new file mode 100644 index 0000000..56056c1 --- /dev/null +++ b/configfs.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * ConfigFS Gadget device handling + * + * Copyright (C) 2018 Kieran Bingham + * + * Contact: Kieran Bingham + */ + +#ifndef __CONFIGFS_H__ +#define __CONFIGFS_H__ + +struct uvc_function_config { + char *video; + char *udc; + + unsigned int streaming_interval; + unsigned int streaming_maxburst; + unsigned int streaming_maxpacket; +}; + +struct uvc_function_config *configfs_parse_uvc_function(const char *function); +void configfs_free_uvc_function(struct uvc_function_config *fc); + +#endif -- cgit v1.2.3