xref: /linux/drivers/usb/gadget/function/u_uac1.h (revision 5fd54ace4721fc5ce2bb5aef6318fcf17f421460)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * u_uac1.h - Utility definitions for UAC1 function
4  *
5  * Copyright (C) 2016 Ruslan Bilovol <ruslan.bilovol@gmail.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  */
11 
12 #ifndef __U_UAC1_H
13 #define __U_UAC1_H
14 
15 #include <linux/usb/composite.h>
16 
17 #define UAC1_OUT_EP_MAX_PACKET_SIZE	200
18 #define UAC1_DEF_CCHMASK	0x3
19 #define UAC1_DEF_CSRATE		48000
20 #define UAC1_DEF_CSSIZE		2
21 #define UAC1_DEF_PCHMASK	0x3
22 #define UAC1_DEF_PSRATE		48000
23 #define UAC1_DEF_PSSIZE		2
24 #define UAC1_DEF_REQ_NUM	2
25 
26 
27 struct f_uac1_opts {
28 	struct usb_function_instance	func_inst;
29 	int				c_chmask;
30 	int				c_srate;
31 	int				c_ssize;
32 	int				p_chmask;
33 	int				p_srate;
34 	int				p_ssize;
35 	int				req_number;
36 	unsigned			bound:1;
37 
38 	struct mutex			lock;
39 	int				refcnt;
40 };
41 
42 #endif /* __U_UAC1_H */
43