blob: 589fae86114185e20ffe861602e32acd2cfb28c2 [file] [log] [blame]
Nishad Kamdar2e759732020-03-28 16:41:15 +05301/* SPDX-License-Identifier: GPL-2.0 */
Ruslan Bilovol0591bc22017-06-18 16:23:54 +03002/*
3 * u_uac1.h - Utility definitions for UAC1 function
4 *
5 * Copyright (C) 2016 Ruslan Bilovol <ruslan.bilovol@gmail.com>
Ruslan Bilovol0591bc22017-06-18 16:23:54 +03006 */
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 Bilovol0356e622021-07-12 14:55:29 +020021#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 Bilovol0591bc22017-06-18 16:23:54 +030028
29
30struct 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 Bilovol0356e622021-07-12 14:55:29 +020038
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 Bilovol0591bc22017-06-18 16:23:54 +030051 int req_number;
52 unsigned bound:1;
53
54 struct mutex lock;
55 int refcnt;
56};
57
58#endif /* __U_UAC1_H */