Nishad Kamdar | 2e75973 | 2020-03-28 16:41:15 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Ruslan Bilovol | 0591bc2 | 2017-06-18 16:23:54 +0300 | [diff] [blame] | 2 | /* |
| 3 | * u_uac1.h - Utility definitions for UAC1 function |
| 4 | * |
| 5 | * Copyright (C) 2016 Ruslan Bilovol <ruslan.bilovol@gmail.com> |
Ruslan Bilovol | 0591bc2 | 2017-06-18 16:23:54 +0300 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __U_UAC1_H |
| 9 | #define __U_UAC1_H |
| 10 | |
| 11 | #include <linux/usb/composite.h> |
| 12 | |
| 13 | #define UAC1_OUT_EP_MAX_PACKET_SIZE 200 |
| 14 | #define UAC1_DEF_CCHMASK 0x3 |
| 15 | #define UAC1_DEF_CSRATE 48000 |
| 16 | #define UAC1_DEF_CSSIZE 2 |
| 17 | #define UAC1_DEF_PCHMASK 0x3 |
| 18 | #define UAC1_DEF_PSRATE 48000 |
| 19 | #define UAC1_DEF_PSSIZE 2 |
| 20 | #define UAC1_DEF_REQ_NUM 2 |
Ruslan Bilovol | 0356e62 | 2021-07-12 14:55:29 +0200 | [diff] [blame] | 21 | #define UAC1_DEF_INT_REQ_NUM 10 |
| 22 | |
| 23 | #define UAC1_DEF_MUTE_PRESENT 1 |
| 24 | #define UAC1_DEF_VOLUME_PRESENT 1 |
| 25 | #define UAC1_DEF_MIN_DB (-100*256) /* -100 dB */ |
| 26 | #define UAC1_DEF_MAX_DB 0 /* 0 dB */ |
| 27 | #define UAC1_DEF_RES_DB (1*256) /* 1 dB */ |
Ruslan Bilovol | 0591bc2 | 2017-06-18 16:23:54 +0300 | [diff] [blame] | 28 | |
| 29 | |
| 30 | struct f_uac1_opts { |
| 31 | struct usb_function_instance func_inst; |
| 32 | int c_chmask; |
| 33 | int c_srate; |
| 34 | int c_ssize; |
| 35 | int p_chmask; |
| 36 | int p_srate; |
| 37 | int p_ssize; |
Ruslan Bilovol | 0356e62 | 2021-07-12 14:55:29 +0200 | [diff] [blame] | 38 | |
| 39 | bool p_mute_present; |
| 40 | bool p_volume_present; |
| 41 | s16 p_volume_min; |
| 42 | s16 p_volume_max; |
| 43 | s16 p_volume_res; |
| 44 | |
| 45 | bool c_mute_present; |
| 46 | bool c_volume_present; |
| 47 | s16 c_volume_min; |
| 48 | s16 c_volume_max; |
| 49 | s16 c_volume_res; |
| 50 | |
Ruslan Bilovol | 0591bc2 | 2017-06-18 16:23:54 +0300 | [diff] [blame] | 51 | int req_number; |
| 52 | unsigned bound:1; |
| 53 | |
| 54 | struct mutex lock; |
| 55 | int refcnt; |
| 56 | }; |
| 57 | |
| 58 | #endif /* __U_UAC1_H */ |