Fix build warnings
[platform/adaptation/spreadtrum/audio-hal-sc7727.git] / vb_control_parameters.h
1 /*
2  * Copyright (C) 2012 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef VBC_CONTROL_PARAMETERS_H
18 #define VBC_CONTROL_PARAMETERS_H
19
20 #include "pthread.h"
21
22
23 #define BUF_SIZE 1024
24
25 #define VBC_PIPE_NAME_MAX_LEN 16
26 #define VOIP_PIPE_NAME_MAX     VBC_PIPE_NAME_MAX_LEN
27 #define NAME_LEN_MAX 16
28
29 #define AUDIO_XML_PATH "/usr/etc/audio_hw.xml"
30
31 #define MODEM_T_ENABLE_PROPERTY     "persist.modem.t.enable"
32 #define MODEM_W_ENABLE_PROPERTY     "persist.modem.w.enable"
33
34
35 typedef enum {
36     CP_W,
37     CP_TG,
38     CP_MAX
39 }cp_type_t;
40
41 /*support multiple call for multiple modem(cp0/cp1/...):
42 different modem is corresponding to different pipe and all pipes use the only vbc.
43 support multiple pipe:
44 1. change VBC_PIPE_COUNT
45 2. change the definition of s_vbc_ctrl_pipe_info.
46 3. change channel_id for different cp .On sharp, 0 for cp0,  1 for cp1,2 for ap
47 */
48
49 typedef struct
50 {
51     char s_vbc_ctrl_pipe_name[VBC_PIPE_NAME_MAX_LEN];
52     int channel_id;
53     cp_type_t cp_type;
54 }vbc_ctrl_pipe_para_t;
55
56
57 struct voip_res
58 {
59     cp_type_t cp_type;
60     int8_t  pipe_name[VOIP_PIPE_NAME_MAX];
61     int  channel_id;
62     int enable;
63     int is_done;
64     void *adev;
65     pthread_t thread_id;
66 };
67
68 typedef struct
69 {
70     int8_t index;
71     int is_switch;
72     int8_t is_ext;
73 }i2s_ctl_t;
74
75
76
77 typedef struct debuginfo
78 {
79     int enable;
80     int sleeptime_gate;
81     int pcmwritetime_gate;
82     int lastthis_outwritetime_gate;
83 }debuginfo;
84
85 typedef struct{
86     int num;
87     vbc_ctrl_pipe_para_t *vbc_ctrl_pipe_info;
88     i2s_ctl_t i2s_bt;
89     i2s_ctl_t i2s_extspk;
90     struct voip_res  voip_res;
91     debuginfo debug_info;
92 }audio_modem_t;
93
94 /*audio mode structure,we can expand  for more fields if necessary*/
95 typedef struct
96 {
97         int index;
98     char mode_name[NAME_LEN_MAX];
99
100 }audio_mode_item_t;
101
102 /*we mostly have four mode,(headset,headfree,handset,handsfree),
103     differet product may configure different mode number,htc have 25 modes.*/
104 typedef struct{
105         int num;
106         audio_mode_item_t *audio_mode_item_info;
107 }aud_mode_t;
108
109 #endif
110