blob: 22a0eb0ecdc125e1c2d862187e3dc114132df368 [file] [log] [blame]
Naresh Tannirue3b18452014-03-04 14:44:27 +05301/*
Sidipotu Ashok9f0b16e2016-04-28 13:48:28 +05302 * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
Naresh Tannirudb72d1e2014-03-05 17:33:47 +05303 * Not a Contribution.
4 *
Naresh Tannirue3b18452014-03-04 14:44:27 +05305 * Copyright (C) 2013 The Android Open Source Project
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20#ifndef QCOM_AUDIO_PLATFORM_H
21#define QCOM_AUDIO_PLATFORM_H
Vidyakumar Athota21b3bb92014-04-25 11:08:08 -070022#include <sound/voice_params.h>
Naresh Tannirue3b18452014-03-04 14:44:27 +053023
Naresh Tannirudb72d1e2014-03-05 17:33:47 +053024enum {
25 FLUENCE_NONE,
26 FLUENCE_DUAL_MIC = 0x1,
27 FLUENCE_QUAD_MIC = 0x2,
28};
29
Karthik Reddy Kattad9fff862014-07-21 21:07:21 +053030enum {
31 FLUENCE_ENDFIRE = 0x1,
32 FLUENCE_BROADSIDE = 0x2,
33};
34
Chaithanya Krishna Bacharaju9955b162016-05-25 16:25:53 +053035enum {
36 SOURCE_MONO_MIC = 0x1, /* Target contains 1 mic */
37 SOURCE_DUAL_MIC = 0x2, /* Target contains 2 mics */
38 SOURCE_THREE_MIC = 0x4, /* Target contains 3 mics */
39 SOURCE_QUAD_MIC = 0x8, /* Target contains 4 mics */
40};
41
Preetam Singh Ranawat2d0e4632015-02-02 12:40:59 +053042#define PLATFORM_IMAGE_NAME "modem"
43
Naresh Tannirue3b18452014-03-04 14:44:27 +053044/*
45 * Below are the devices for which is back end is same, SLIMBUS_0_RX.
46 * All these devices are handled by the internal HW codec. We can
Preetam Singh Ranawatc61f8672015-06-18 23:20:28 +053047 * enable any one of these devices at any time. An exception here is
48 * 44.1k headphone which uses different backend. This is filtered
49 * as different hal internal device in the code but remains same
50 * as standard android device AUDIO_DEVICE_OUT_WIRED_HEADPHONE
51 * for other layers.
Naresh Tannirue3b18452014-03-04 14:44:27 +053052 */
53#define AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND \
54 (AUDIO_DEVICE_OUT_EARPIECE | AUDIO_DEVICE_OUT_SPEAKER | \
Naresh Tanniru9c4ba542015-11-06 18:01:09 +053055 AUDIO_DEVICE_OUT_WIRED_HEADSET | AUDIO_DEVICE_OUT_WIRED_HEADPHONE|\
56 AUDIO_DEVICE_OUT_LINE)
Naresh Tannirue3b18452014-03-04 14:44:27 +053057
Narsinga Rao Chellaf99003c2015-07-08 19:38:38 -070058/*
59 * Below are the input devices for which back end is same, SLIMBUS_0_TX.
60 * All these devices are handled by the internal HW codec. We can
61 * enable any one of these devices at any time
62 */
63#define AUDIO_DEVICE_IN_ALL_CODEC_BACKEND \
64 (AUDIO_DEVICE_IN_BUILTIN_MIC | AUDIO_DEVICE_IN_BACK_MIC | \
65 AUDIO_DEVICE_IN_WIRED_HEADSET | AUDIO_DEVICE_IN_VOICE_CALL) & ~AUDIO_DEVICE_BIT_IN
66
Naresh Tannirue3b18452014-03-04 14:44:27 +053067/* Sound devices specific to the platform
68 * The DEVICE_OUT_* and DEVICE_IN_* should be mapped to these sound
69 * devices to enable corresponding mixer paths
70 */
71enum {
72 SND_DEVICE_NONE = 0,
73
74 /* Playback devices */
75 SND_DEVICE_MIN,
76 SND_DEVICE_OUT_BEGIN = SND_DEVICE_MIN,
77 SND_DEVICE_OUT_HANDSET = SND_DEVICE_OUT_BEGIN,
78 SND_DEVICE_OUT_SPEAKER,
Preetam Singh Ranawat8bde2c52015-03-20 12:00:49 +053079 SND_DEVICE_OUT_SPEAKER_EXTERNAL_1,
80 SND_DEVICE_OUT_SPEAKER_EXTERNAL_2,
Naresh Tannirue3b18452014-03-04 14:44:27 +053081 SND_DEVICE_OUT_SPEAKER_REVERSE,
Preetam Singh Ranawatc7f7f5c2015-04-02 12:19:58 +053082 SND_DEVICE_OUT_SPEAKER_WSA,
Banajit Goswami20cdd212015-09-11 01:11:30 -070083 SND_DEVICE_OUT_SPEAKER_VBAT,
Naresh Tanniru9c4ba542015-11-06 18:01:09 +053084 SND_DEVICE_OUT_LINE,
Naresh Tannirue3b18452014-03-04 14:44:27 +053085 SND_DEVICE_OUT_HEADPHONES,
Apoorv Raghuvanshi21492162015-02-19 18:19:36 -080086 SND_DEVICE_OUT_HEADPHONES_44_1,
Naresh Tannirue3b18452014-03-04 14:44:27 +053087 SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES,
Naresh Tanniru9c4ba542015-11-06 18:01:09 +053088 SND_DEVICE_OUT_SPEAKER_AND_LINE,
Preetam Singh Ranawat8bde2c52015-03-20 12:00:49 +053089 SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_1,
90 SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_2,
Naresh Tannirue3b18452014-03-04 14:44:27 +053091 SND_DEVICE_OUT_VOICE_HANDSET,
92 SND_DEVICE_OUT_VOICE_SPEAKER,
Preetam Singh Ranawatc7f7f5c2015-04-02 12:19:58 +053093 SND_DEVICE_OUT_VOICE_SPEAKER_WSA,
Banajit Goswami20cdd212015-09-11 01:11:30 -070094 SND_DEVICE_OUT_VOICE_SPEAKER_VBAT,
Naresh Tannirue3b18452014-03-04 14:44:27 +053095 SND_DEVICE_OUT_VOICE_HEADPHONES,
Naresh Tanniru9c4ba542015-11-06 18:01:09 +053096 SND_DEVICE_OUT_VOICE_LINE,
Naresh Tannirue3b18452014-03-04 14:44:27 +053097 SND_DEVICE_OUT_HDMI,
98 SND_DEVICE_OUT_SPEAKER_AND_HDMI,
99 SND_DEVICE_OUT_BT_SCO,
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530100 SND_DEVICE_OUT_BT_SCO_WB,
Naresh Tannirue3b18452014-03-04 14:44:27 +0530101 SND_DEVICE_OUT_VOICE_TTY_FULL_HEADPHONES,
102 SND_DEVICE_OUT_VOICE_TTY_VCO_HEADPHONES,
103 SND_DEVICE_OUT_VOICE_TTY_HCO_HANDSET,
Preetam Singh Ranawat7112f3b2015-02-26 16:51:58 +0530104 SND_DEVICE_OUT_VOICE_TX,
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530105 SND_DEVICE_OUT_AFE_PROXY,
106 SND_DEVICE_OUT_USB_HEADSET,
107 SND_DEVICE_OUT_SPEAKER_AND_USB_HEADSET,
108 SND_DEVICE_OUT_TRANSMISSION_FM,
109 SND_DEVICE_OUT_ANC_HEADSET,
110 SND_DEVICE_OUT_ANC_FB_HEADSET,
111 SND_DEVICE_OUT_VOICE_ANC_HEADSET,
112 SND_DEVICE_OUT_VOICE_ANC_FB_HEADSET,
113 SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET,
114 SND_DEVICE_OUT_ANC_HANDSET,
115 SND_DEVICE_OUT_SPEAKER_PROTECTED,
Preetam Singh Ranawat8bde2c52015-03-20 12:00:49 +0530116 SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED,
Banajit Goswami20cdd212015-09-11 01:11:30 -0700117 SND_DEVICE_OUT_SPEAKER_PROTECTED_VBAT,
118 SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED_VBAT,
Naresh Tanniruc0517bc2014-10-26 15:30:55 +0530119#ifdef RECORD_PLAY_CONCURRENCY
120 SND_DEVICE_OUT_VOIP_HANDSET,
121 SND_DEVICE_OUT_VOIP_SPEAKER,
122 SND_DEVICE_OUT_VOIP_HEADPHONES,
123#endif
Naresh Tannirue3b18452014-03-04 14:44:27 +0530124 SND_DEVICE_OUT_END,
125
126 /*
127 * Note: IN_BEGIN should be same as OUT_END because total number of devices
128 * SND_DEVICES_MAX should not exceed MAX_RX + MAX_TX devices.
129 */
130 /* Capture devices */
131 SND_DEVICE_IN_BEGIN = SND_DEVICE_OUT_END,
132 SND_DEVICE_IN_HANDSET_MIC = SND_DEVICE_IN_BEGIN,
Preetam Singh Ranawat8bde2c52015-03-20 12:00:49 +0530133 SND_DEVICE_IN_HANDSET_MIC_EXTERNAL,
Naresh Tannirue3b18452014-03-04 14:44:27 +0530134 SND_DEVICE_IN_HANDSET_MIC_AEC,
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530135 SND_DEVICE_IN_HANDSET_MIC_NS,
136 SND_DEVICE_IN_HANDSET_MIC_AEC_NS,
137 SND_DEVICE_IN_HANDSET_DMIC,
138 SND_DEVICE_IN_HANDSET_DMIC_AEC,
139 SND_DEVICE_IN_HANDSET_DMIC_NS,
140 SND_DEVICE_IN_HANDSET_DMIC_AEC_NS,
141 SND_DEVICE_IN_SPEAKER_MIC,
Naresh Tannirue3b18452014-03-04 14:44:27 +0530142 SND_DEVICE_IN_SPEAKER_MIC_AEC,
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530143 SND_DEVICE_IN_SPEAKER_MIC_NS,
144 SND_DEVICE_IN_SPEAKER_MIC_AEC_NS,
145 SND_DEVICE_IN_SPEAKER_DMIC,
146 SND_DEVICE_IN_SPEAKER_DMIC_AEC,
147 SND_DEVICE_IN_SPEAKER_DMIC_NS,
148 SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS,
149 SND_DEVICE_IN_HEADSET_MIC,
150 SND_DEVICE_IN_HEADSET_MIC_FLUENCE,
Naresh Tannirue3b18452014-03-04 14:44:27 +0530151 SND_DEVICE_IN_VOICE_SPEAKER_MIC,
152 SND_DEVICE_IN_VOICE_HEADSET_MIC,
153 SND_DEVICE_IN_HDMI_MIC,
154 SND_DEVICE_IN_BT_SCO_MIC,
Vicky Sehrawate240e5d2014-08-12 17:17:04 -0700155 SND_DEVICE_IN_BT_SCO_MIC_NREC,
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530156 SND_DEVICE_IN_BT_SCO_MIC_WB,
Vicky Sehrawate240e5d2014-08-12 17:17:04 -0700157 SND_DEVICE_IN_BT_SCO_MIC_WB_NREC,
Naresh Tannirue3b18452014-03-04 14:44:27 +0530158 SND_DEVICE_IN_CAMCORDER_MIC,
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530159 SND_DEVICE_IN_VOICE_DMIC,
160 SND_DEVICE_IN_VOICE_SPEAKER_DMIC,
161 SND_DEVICE_IN_VOICE_SPEAKER_QMIC,
Naresh Tannirue3b18452014-03-04 14:44:27 +0530162 SND_DEVICE_IN_VOICE_TTY_FULL_HEADSET_MIC,
163 SND_DEVICE_IN_VOICE_TTY_VCO_HANDSET_MIC,
164 SND_DEVICE_IN_VOICE_TTY_HCO_HEADSET_MIC,
165 SND_DEVICE_IN_VOICE_REC_MIC,
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530166 SND_DEVICE_IN_VOICE_REC_MIC_NS,
167 SND_DEVICE_IN_VOICE_REC_DMIC_STEREO,
168 SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE,
Preetam Singh Ranawat7112f3b2015-02-26 16:51:58 +0530169 SND_DEVICE_IN_VOICE_RX,
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530170 SND_DEVICE_IN_USB_HEADSET_MIC,
171 SND_DEVICE_IN_CAPTURE_FM,
172 SND_DEVICE_IN_AANC_HANDSET_MIC,
173 SND_DEVICE_IN_QUAD_MIC,
174 SND_DEVICE_IN_HANDSET_STEREO_DMIC,
175 SND_DEVICE_IN_SPEAKER_STEREO_DMIC,
176 SND_DEVICE_IN_CAPTURE_VI_FEEDBACK,
Karthik Reddy Kattad9fff862014-07-21 21:07:21 +0530177 SND_DEVICE_IN_VOICE_SPEAKER_DMIC_BROADSIDE,
178 SND_DEVICE_IN_SPEAKER_DMIC_BROADSIDE,
179 SND_DEVICE_IN_SPEAKER_DMIC_AEC_BROADSIDE,
180 SND_DEVICE_IN_SPEAKER_DMIC_NS_BROADSIDE,
181 SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS_BROADSIDE,
Sidipotu Ashok3bcca232014-11-07 14:41:58 +0530182 SND_DEVICE_IN_VOICE_FLUENCE_DMIC_AANC,
Karthik Reddy Kattad71b94b2015-01-19 14:06:53 +0530183 SND_DEVICE_IN_HANDSET_QMIC,
184 SND_DEVICE_IN_SPEAKER_QMIC_AEC,
185 SND_DEVICE_IN_SPEAKER_QMIC_NS,
186 SND_DEVICE_IN_SPEAKER_QMIC_AEC_NS,
Shiv Maliyappanahalli5a10aea2015-07-02 10:36:23 -0700187 SND_DEVICE_IN_THREE_MIC,
Chaithanya Krishna Bacharaju9955b162016-05-25 16:25:53 +0530188 SND_DEVICE_IN_HANDSET_TMIC,
Chaithanya Krishna Bacharaju24f86f32016-05-26 16:34:53 +0530189 SND_DEVICE_IN_UNPROCESSED_MIC,
190 SND_DEVICE_IN_UNPROCESSED_STEREO_MIC,
191 SND_DEVICE_IN_UNPROCESSED_THREE_MIC,
192 SND_DEVICE_IN_UNPROCESSED_QUAD_MIC,
193 SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC,
Naresh Tannirue3b18452014-03-04 14:44:27 +0530194 SND_DEVICE_IN_END,
195
196 SND_DEVICE_MAX = SND_DEVICE_IN_END,
197
198};
199
Naresh Tannirue3b18452014-03-04 14:44:27 +0530200#define DEFAULT_OUTPUT_SAMPLING_RATE 48000
Preetam Singh Ranawatc61f8672015-06-18 23:20:28 +0530201#define OUTPUT_SAMPLING_RATE_44100 44100
202#define MAX_PORT 6
203#define ALL_CODEC_BACKEND_PORT 0
204#define HEADPHONE_44_1_BACKEND_PORT 5
Manish Dewanganba9fcfa2016-03-24 16:20:06 +0530205#define MAX_CODEC_TX_BACKENDS 1
Apoorv Raghuvanshi21492162015-02-19 18:19:36 -0800206enum {
207 DEFAULT_CODEC_BACKEND,
Sidipotu Ashok9f0b16e2016-04-28 13:48:28 +0530208 SLIMBUS_0_RX = DEFAULT_CODEC_BACKEND,
Apoorv Raghuvanshi21492162015-02-19 18:19:36 -0800209 HEADPHONE_44_1_BACKEND,
Sidipotu Ashok9f0b16e2016-04-28 13:48:28 +0530210 SLIMBUS_5_RX = HEADPHONE_44_1_BACKEND,
211 HEADPHONE_BACKEND,
212 SLIMBUS_6_RX = HEADPHONE_BACKEND,
213 HDMI_RX_BACKEND,
Kuirong Wanga9f7cee2016-03-07 11:21:52 -0800214 USB_AUDIO_RX_BACKEND,
Apoorv Raghuvanshi21492162015-02-19 18:19:36 -0800215 MAX_CODEC_BACKENDS
216};
Preetam Singh Ranawatc61f8672015-06-18 23:20:28 +0530217#define AUDIO_PARAMETER_KEY_NATIVE_AUDIO "audio.nat.codec.enabled"
Sidipotu Ashoke6f78cb2015-11-05 14:42:20 +0530218#define AUDIO_PARAMETER_KEY_NATIVE_AUDIO_MODE "native_audio_mode"
Naresh Tannirue3b18452014-03-04 14:44:27 +0530219
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530220#define ALL_SESSION_VSID 0xFFFFFFFF
Preetam Singh Ranawat8bde2c52015-03-20 12:00:49 +0530221#define DEFAULT_MUTE_RAMP_DURATION_MS 20
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530222#define DEFAULT_VOLUME_RAMP_DURATION_MS 20
223#define MIXER_PATH_MAX_LENGTH 100
Sidipotu Ashoke6f78cb2015-11-05 14:42:20 +0530224#define SND_CARD_MAX_LENGTH 100
225#define CODEC_VERSION_MAX_LENGTH 100
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530226
227#define MAX_VOL_INDEX 5
228#define MIN_VOL_INDEX 0
229#define percent_to_index(val, min, max) \
230 ((val) * ((max) - (min)) * 0.01 + (min) + .5)
231
Naresh Tannirue3b18452014-03-04 14:44:27 +0530232/*
233 * tinyAlsa library interprets period size as number of frames
234 * one frame = channel_count * sizeof (pcm sample)
235 * so if format = 16-bit PCM and channels = Stereo, frame size = 2 ch * 2 = 4 bytes
236 * DEEP_BUFFER_OUTPUT_PERIOD_SIZE = 1024 means 1024 * 4 = 4096 bytes
237 * We should take care of returning proper size when AudioFlinger queries for
238 * the buffer size of an input/output stream
239 */
Alexy Joseph029faa22015-06-18 14:22:14 -0700240#define DEEP_BUFFER_OUTPUT_PERIOD_SIZE 1920
241#define DEEP_BUFFER_OUTPUT_PERIOD_COUNT 2
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530242#define LOW_LATENCY_OUTPUT_PERIOD_SIZE 240
Naresh Tannirue3b18452014-03-04 14:44:27 +0530243#define LOW_LATENCY_OUTPUT_PERIOD_COUNT 2
244
Ravi Kumar Alamandadc9bb152014-09-08 15:59:58 -0700245#define LOW_LATENCY_CAPTURE_SAMPLE_RATE 48000
246#define LOW_LATENCY_CAPTURE_PERIOD_SIZE 240
Sharad Sangle896e7b12014-11-07 17:06:29 +0530247#define LOW_LATENCY_CAPTURE_USE_CASE 1
Ravi Kumar Alamandadc9bb152014-09-08 15:59:58 -0700248
Naresh Tannirue3b18452014-03-04 14:44:27 +0530249#define HDMI_MULTI_PERIOD_SIZE 336
250#define HDMI_MULTI_PERIOD_COUNT 8
251#define HDMI_MULTI_DEFAULT_CHANNEL_COUNT 6
252#define HDMI_MULTI_PERIOD_BYTES (HDMI_MULTI_PERIOD_SIZE * HDMI_MULTI_DEFAULT_CHANNEL_COUNT * 2)
253
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530254#define AUDIO_CAPTURE_PERIOD_DURATION_MSEC 20
255#define AUDIO_CAPTURE_PERIOD_COUNT 2
256
257#define DEVICE_NAME_MAX_SIZE 128
258#define HW_INFO_ARRAY_MAX_SIZE 32
259
260#define DEEP_BUFFER_PCM_DEVICE 0
261#define AUDIO_RECORD_PCM_DEVICE 0
262#define MULTIMEDIA2_PCM_DEVICE 1
Naresh Tanniru3a7dbe72015-06-25 20:08:01 -0700263#define MULTIMEDIA3_PCM_DEVICE 4
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530264#define FM_PLAYBACK_PCM_DEVICE 5
265#define FM_CAPTURE_PCM_DEVICE 6
266#define HFP_PCM_RX 5
Satya Krishna Pindiproli640c91e2014-03-14 11:09:09 +0530267#define HFP_SCO_RX 17
268#define HFP_ASM_RX_TX 18
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530269
270#define INCALL_MUSIC_UPLINK_PCM_DEVICE 1
271#define INCALL_MUSIC_UPLINK2_PCM_DEVICE 16
272#define SPKR_PROT_CALIB_RX_PCM_DEVICE 5
Laxminath Kasam999caa42015-05-08 18:17:23 +0530273#define SPKR_PROT_CALIB_TX_PCM_DEVICE 26
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530274#define PLAYBACK_OFFLOAD_DEVICE 9
Naresh Tanniru06f99432015-08-26 14:01:20 -0700275#define PLAYBACK_OFFLOAD_DEVICE2 24
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530276#define COMPRESS_VOIP_CALL_PCM_DEVICE 3
277
Banajit Goswami88d6cc52014-04-10 17:59:02 -0700278/* Define macro for Internal FM volume mixer */
279#define FM_RX_VOLUME "Internal FM RX Volume"
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530280
281#define LOWLATENCY_PCM_DEVICE 12
282#define EC_REF_RX "I2S_RX"
283#define COMPRESS_CAPTURE_DEVICE 19
284
285#define VOICE_CALL_PCM_DEVICE 2
286#define VOICE2_CALL_PCM_DEVICE 13
287#define VOLTE_CALL_PCM_DEVICE 15
Venkata Narendra Kumar Gutta90bef992015-01-28 15:32:45 +0530288#define QCHAT_CALL_PCM_DEVICE 26
Venkata Narendra Kumar Guttaed408a12015-03-31 20:24:04 +0530289#define QCHAT_CALL_PCM_DEVICE_OF_EXT_CODEC 28
Karthik Reddy Katta3b0a60c2014-04-06 14:52:37 +0530290#define VOWLAN_CALL_PCM_DEVICE 16
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530291
Preetam Singh Ranawat7112f3b2015-02-26 16:51:58 +0530292#define AFE_PROXY_PLAYBACK_PCM_DEVICE 7
293#define AFE_PROXY_RECORD_PCM_DEVICE 8
294
Chaithanya Krishna Bacharaju9955b162016-05-25 16:25:53 +0530295#define PLATFORM_MAX_MIC_COUNT "input_mic_max_count"
296#define PLATFORM_DEFAULT_MIC_COUNT 2
297
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530298#define LIB_CSD_CLIENT "libcsd-client.so"
299/* CSD-CLIENT related functions */
300typedef int (*init_t)();
301typedef int (*deinit_t)();
302typedef int (*disable_device_t)();
303typedef int (*enable_device_config_t)(int, int);
304typedef int (*enable_device_t)(int, int, uint32_t);
Preetam Singh Ranawat8bde2c52015-03-20 12:00:49 +0530305typedef int (*volume_t)(uint32_t, int, uint16_t);
306typedef int (*mic_mute_t)(uint32_t, int, uint16_t);
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530307typedef int (*slow_talk_t)(uint32_t, uint8_t);
308typedef int (*start_voice_t)(uint32_t);
309typedef int (*stop_voice_t)(uint32_t);
310typedef int (*start_playback_t)(uint32_t);
311typedef int (*stop_playback_t)(uint32_t);
Vidyakumar Athota21b3bb92014-04-25 11:08:08 -0700312typedef int (*set_lch_t)(uint32_t, enum voice_lch_mode);
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530313typedef int (*start_record_t)(uint32_t, int);
314typedef int (*stop_record_t)(uint32_t);
315/* CSD Client structure */
316struct csd_data {
317 void *csd_client;
318 init_t init;
319 deinit_t deinit;
320 disable_device_t disable_device;
321 enable_device_config_t enable_device_config;
322 enable_device_t enable_device;
323 volume_t volume;
324 mic_mute_t mic_mute;
325 slow_talk_t slow_talk;
326 start_voice_t start_voice;
327 stop_voice_t stop_voice;
328 start_playback_t start_playback;
329 stop_playback_t stop_playback;
Vidyakumar Athota21b3bb92014-04-25 11:08:08 -0700330 set_lch_t set_lch;
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530331 start_record_t start_record;
332 stop_record_t stop_record;
333};
Naresh Tannirue3b18452014-03-04 14:44:27 +0530334
Preetam Singh Ranawat2d0e4632015-02-02 12:40:59 +0530335int platform_get_subsys_image_name (char *buf);
336
Preetam Singh Ranawat8bde2c52015-03-20 12:00:49 +0530337/* HDMI Passthrough defines */
338enum {
339 LEGACY_PCM = 0,
340 PASSTHROUGH,
341 PASSTHROUGH_CONVERT
342};
343/*
344 * ID for setting mute and lateny on the device side
345 * through Device PP Params mixer control.
346 */
347#define DEVICE_PARAM_MUTE_ID 0
348#define DEVICE_PARAM_LATENCY_ID 1
Karthik Reddy Kattae4078ed2015-04-21 11:46:15 +0530349
350#define ENUM_TO_STRING(X) #X
351
352struct audio_device_to_audio_interface {
353 audio_devices_t device;
354 char device_name[100];
355 char interface_name[100];
356};
Naresh Tannirue3b18452014-03-04 14:44:27 +0530357#endif // QCOM_AUDIO_PLATFORM_H