1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * u_uac2.h
4  *
5  * Utility definitions for UAC2 function
6  *
7  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
8  *		http://www.samsung.com
9  *
10  * Author: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
11  */
12 
13 #ifndef U_UAC2_H
14 #define U_UAC2_H
15 
16 #include <linux/usb/composite.h>
17 
18 #define UAC2_DEF_PCHMASK 0x3
19 #define UAC2_DEF_PSRATE 48000
20 #define UAC2_DEF_PSSIZE 2
21 #define UAC2_DEF_CCHMASK 0x3
22 #define UAC2_DEF_CSRATE 64000
23 #define UAC2_DEF_CSSIZE 2
24 #define UAC2_DEF_CSYNC		USB_ENDPOINT_SYNC_ASYNC
25 #define UAC2_DEF_REQ_NUM 2
26 #define UAC2_DEF_FB_MAX 5
27 
28 struct f_uac2_opts {
29 	struct usb_function_instance	func_inst;
30 	int				p_chmask;
31 	int				p_srate;
32 	int				p_ssize;
33 	int				c_chmask;
34 	int				c_srate;
35 	int				c_ssize;
36 	int				c_sync;
37 	int				req_number;
38 	int				fb_max;
39 	bool				bound;
40 
41 	struct mutex			lock;
42 	int				refcnt;
43 };
44 
45 #endif
46