Linux Audio

Check our new training course

Loading...
v6.8
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/*
 3 * u_tcm.h
 4 *
 5 * Utility definitions for the tcm function
 6 *
 7 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
 8 *		http://www.samsung.com
 9 *
10 * Author: Andrzej Pietrasiewicz <andrzej.p@xxxxxxxxxxx>
 
 
 
 
11 */
12
13#ifndef U_TCM_H
14#define U_TCM_H
15
16#include <linux/usb/composite.h>
17
18/**
19 * @dependent: optional dependent module. Meant for legacy gadget.
20 * If non-null its refcount will be increased when a tpg is created and
21 * decreased when tpg is dropped.
22 * @dep_lock: lock for dependent module operations.
23 * @ready: true if the dependent module information is set.
24 * @can_attach: true a function can be bound to gadget
25 * @has_dep: true if there is a dependent module
26 *
27 */
28struct f_tcm_opts {
29	struct usb_function_instance	func_inst;
30	struct module			*dependent;
31	struct mutex			dep_lock;
32	bool				ready;
33	bool				can_attach;
34	bool				has_dep;
35
36	/*
37	 * Callbacks to be removed when legacy tcm gadget disappears.
38	 *
39	 * If you use the new function registration interface
40	 * programmatically, you MUST set these callbacks to
41	 * something sensible (e.g. probe/remove the composite).
42	 */
43	int (*tcm_register_callback)(struct usb_function_instance *);
44	void (*tcm_unregister_callback)(struct usb_function_instance *);
45};
46
47#endif /* U_TCM_H */
v4.6
 
 1/*
 2 * u_tcm.h
 3 *
 4 * Utility definitions for the tcm function
 5 *
 6 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
 7 *		http://www.samsung.com
 8 *
 9 * Author: Andrzej Pietrasiewicz <andrzej.p@xxxxxxxxxxx>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#ifndef U_TCM_H
17#define U_TCM_H
18
19#include <linux/usb/composite.h>
20
21/**
22 * @dependent: optional dependent module. Meant for legacy gadget.
23 * If non-null its refcount will be increased when a tpg is created and
24 * decreased when tpg is dropped.
25 * @dep_lock: lock for dependent module operations.
26 * @ready: true if the dependent module information is set.
27 * @can_attach: true a function can be bound to gadget
28 * @has_dep: true if there is a dependent module
29 *
30 */
31struct f_tcm_opts {
32	struct usb_function_instance	func_inst;
33	struct module			*dependent;
34	struct mutex			dep_lock;
35	bool				ready;
36	bool				can_attach;
37	bool				has_dep;
38
39	/*
40	 * Callbacks to be removed when legacy tcm gadget disappears.
41	 *
42	 * If you use the new function registration interface
43	 * programmatically, you MUST set these callbacks to
44	 * something sensible (e.g. probe/remove the composite).
45	 */
46	int (*tcm_register_callback)(struct usb_function_instance *);
47	void (*tcm_unregister_callback)(struct usb_function_instance *);
48};
49
50#endif /* U_TCM_H */