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 26 #define UAC2_DEF_MUTE_PRESENT 1 27 #define UAC2_DEF_VOLUME_PRESENT 1 28 #define UAC2_DEF_MIN_DB (-100*256) /* -100 dB */ 29 #define UAC2_DEF_MAX_DB 0 /* 0 dB */ 30 #define UAC2_DEF_RES_DB (1*256) /* 1 dB */ 31 32 #define UAC2_DEF_REQ_NUM 2 33 #define UAC2_DEF_FB_MAX 5 34 #define UAC2_DEF_INT_REQ_NUM 10 35 36 struct f_uac2_opts { 37 struct usb_function_instance func_inst; 38 int p_chmask; 39 int p_srate; 40 int p_ssize; 41 int c_chmask; 42 int c_srate; 43 int c_ssize; 44 int c_sync; 45 46 bool p_mute_present; 47 bool p_volume_present; 48 s16 p_volume_min; 49 s16 p_volume_max; 50 s16 p_volume_res; 51 52 bool c_mute_present; 53 bool c_volume_present; 54 s16 c_volume_min; 55 s16 c_volume_max; 56 s16 c_volume_res; 57 58 int req_number; 59 int fb_max; 60 bool bound; 61 62 struct mutex lock; 63 int refcnt; 64 }; 65 66 #endif 67