xref: /linux/drivers/usb/gadget/function/u_midi.h (revision 5fd54ace4721fc5ce2bb5aef6318fcf17f421460)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * u_midi.h
4  *
5  * Utility definitions for the midi function
6  *
7  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
8  *		http://www.samsung.com
9  *
10  * Author: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License version 2 as
14  * published by the Free Software Foundation.
15  */
16 
17 #ifndef U_MIDI_H
18 #define U_MIDI_H
19 
20 #include <linux/usb/composite.h>
21 
22 struct f_midi_opts {
23 	struct usb_function_instance	func_inst;
24 	int				index;
25 	char				*id;
26 	bool				id_allocated;
27 	unsigned int			in_ports;
28 	unsigned int			out_ports;
29 	unsigned int			buflen;
30 	unsigned int			qlen;
31 
32 	/*
33 	 * Protect the data form concurrent access by read/write
34 	 * and create symlink/remove symlink.
35 	 */
36 	 struct mutex			lock;
37 	 int				refcnt;
38 };
39 
40 #endif /* U_MIDI_H */
41 
42