blob: da16febd6afc513be3359e54135643a6072d6a34 [file] [log] [blame]
Naresh Tannirue3b18452014-03-04 14:44:27 +05301/*
Sidipotu Ashokeaec6392016-04-19 09:37:57 +05302 * Copyright (c) 2013-2015, 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
Preetam Singh Ranawat2d0e4632015-02-02 12:40:59 +053035#define PLATFORM_IMAGE_NAME "modem"
36
Naresh Tannirue3b18452014-03-04 14:44:27 +053037/*
38 * Below are the devices for which is back end is same, SLIMBUS_0_RX.
39 * All these devices are handled by the internal HW codec. We can
Preetam Singh Ranawatc61f8672015-06-18 23:20:28 +053040 * enable any one of these devices at any time. An exception here is
41 * 44.1k headphone which uses different backend. This is filtered
42 * as different hal internal device in the code but remains same
43 * as standard android device AUDIO_DEVICE_OUT_WIRED_HEADPHONE
44 * for other layers.
Naresh Tannirue3b18452014-03-04 14:44:27 +053045 */
46#define AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND \
47 (AUDIO_DEVICE_OUT_EARPIECE | AUDIO_DEVICE_OUT_SPEAKER | \
Naresh Tanniru9c4ba542015-11-06 18:01:09 +053048 AUDIO_DEVICE_OUT_WIRED_HEADSET | AUDIO_DEVICE_OUT_WIRED_HEADPHONE|\
49 AUDIO_DEVICE_OUT_LINE)
Naresh Tannirue3b18452014-03-04 14:44:27 +053050
Narsinga Rao Chellaf99003c2015-07-08 19:38:38 -070051/*
52 * Below are the input devices for which back end is same, SLIMBUS_0_TX.
53 * All these devices are handled by the internal HW codec. We can
54 * enable any one of these devices at any time
55 */
56#define AUDIO_DEVICE_IN_ALL_CODEC_BACKEND \
57 (AUDIO_DEVICE_IN_BUILTIN_MIC | AUDIO_DEVICE_IN_BACK_MIC | \
58 AUDIO_DEVICE_IN_WIRED_HEADSET | AUDIO_DEVICE_IN_VOICE_CALL) & ~AUDIO_DEVICE_BIT_IN
59
Naresh Tannirue3b18452014-03-04 14:44:27 +053060/* Sound devices specific to the platform
61 * The DEVICE_OUT_* and DEVICE_IN_* should be mapped to these sound
62 * devices to enable corresponding mixer paths
63 */
64enum {
65 SND_DEVICE_NONE = 0,
66
67 /* Playback devices */
68 SND_DEVICE_MIN,
69 SND_DEVICE_OUT_BEGIN = SND_DEVICE_MIN,
70 SND_DEVICE_OUT_HANDSET = SND_DEVICE_OUT_BEGIN,
71 SND_DEVICE_OUT_SPEAKER,
Preetam Singh Ranawat8bde2c52015-03-20 12:00:49 +053072 SND_DEVICE_OUT_SPEAKER_EXTERNAL_1,
73 SND_DEVICE_OUT_SPEAKER_EXTERNAL_2,
Naresh Tannirue3b18452014-03-04 14:44:27 +053074 SND_DEVICE_OUT_SPEAKER_REVERSE,
Preetam Singh Ranawatc7f7f5c2015-04-02 12:19:58 +053075 SND_DEVICE_OUT_SPEAKER_WSA,
Banajit Goswami20cdd212015-09-11 01:11:30 -070076 SND_DEVICE_OUT_SPEAKER_VBAT,
Naresh Tanniru9c4ba542015-11-06 18:01:09 +053077 SND_DEVICE_OUT_LINE,
Naresh Tannirue3b18452014-03-04 14:44:27 +053078 SND_DEVICE_OUT_HEADPHONES,
Apoorv Raghuvanshi21492162015-02-19 18:19:36 -080079 SND_DEVICE_OUT_HEADPHONES_44_1,
Naresh Tannirue3b18452014-03-04 14:44:27 +053080 SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES,
Naresh Tanniru9c4ba542015-11-06 18:01:09 +053081 SND_DEVICE_OUT_SPEAKER_AND_LINE,
Preetam Singh Ranawat8bde2c52015-03-20 12:00:49 +053082 SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_1,
83 SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_2,
Naresh Tannirue3b18452014-03-04 14:44:27 +053084 SND_DEVICE_OUT_VOICE_HANDSET,
85 SND_DEVICE_OUT_VOICE_SPEAKER,
Preetam Singh Ranawatc7f7f5c2015-04-02 12:19:58 +053086 SND_DEVICE_OUT_VOICE_SPEAKER_WSA,
Banajit Goswami20cdd212015-09-11 01:11:30 -070087 SND_DEVICE_OUT_VOICE_SPEAKER_VBAT,
Naresh Tannirue3b18452014-03-04 14:44:27 +053088 SND_DEVICE_OUT_VOICE_HEADPHONES,
Naresh Tanniru9c4ba542015-11-06 18:01:09 +053089 SND_DEVICE_OUT_VOICE_LINE,
Naresh Tannirue3b18452014-03-04 14:44:27 +053090 SND_DEVICE_OUT_HDMI,
91 SND_DEVICE_OUT_SPEAKER_AND_HDMI,
92 SND_DEVICE_OUT_BT_SCO,
Naresh Tannirudb72d1e2014-03-05 17:33:47 +053093 SND_DEVICE_OUT_BT_SCO_WB,
Naresh Tannirue3b18452014-03-04 14:44:27 +053094 SND_DEVICE_OUT_VOICE_TTY_FULL_HEADPHONES,
95 SND_DEVICE_OUT_VOICE_TTY_VCO_HEADPHONES,
96 SND_DEVICE_OUT_VOICE_TTY_HCO_HANDSET,
Preetam Singh Ranawat7112f3b2015-02-26 16:51:58 +053097 SND_DEVICE_OUT_VOICE_TX,
Naresh Tannirudb72d1e2014-03-05 17:33:47 +053098 SND_DEVICE_OUT_AFE_PROXY,
99 SND_DEVICE_OUT_USB_HEADSET,
100 SND_DEVICE_OUT_SPEAKER_AND_USB_HEADSET,
101 SND_DEVICE_OUT_TRANSMISSION_FM,
102 SND_DEVICE_OUT_ANC_HEADSET,
103 SND_DEVICE_OUT_ANC_FB_HEADSET,
104 SND_DEVICE_OUT_VOICE_ANC_HEADSET,
105 SND_DEVICE_OUT_VOICE_ANC_FB_HEADSET,
106 SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET,
107 SND_DEVICE_OUT_ANC_HANDSET,
108 SND_DEVICE_OUT_SPEAKER_PROTECTED,
Preetam Singh Ranawat8bde2c52015-03-20 12:00:49 +0530109 SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED,
Banajit Goswami20cdd212015-09-11 01:11:30 -0700110 SND_DEVICE_OUT_SPEAKER_PROTECTED_VBAT,
111 SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED_VBAT,
Naresh Tanniruc0517bc2014-10-26 15:30:55 +0530112#ifdef RECORD_PLAY_CONCURRENCY
113 SND_DEVICE_OUT_VOIP_HANDSET,
114 SND_DEVICE_OUT_VOIP_SPEAKER,
115 SND_DEVICE_OUT_VOIP_HEADPHONES,
116#endif
Naresh Tannirue3b18452014-03-04 14:44:27 +0530117 SND_DEVICE_OUT_END,
118
119 /*
120 * Note: IN_BEGIN should be same as OUT_END because total number of devices
121 * SND_DEVICES_MAX should not exceed MAX_RX + MAX_TX devices.
122 */
123 /* Capture devices */
124 SND_DEVICE_IN_BEGIN = SND_DEVICE_OUT_END,
125 SND_DEVICE_IN_HANDSET_MIC = SND_DEVICE_IN_BEGIN,
Preetam Singh Ranawat8bde2c52015-03-20 12:00:49 +0530126 SND_DEVICE_IN_HANDSET_MIC_EXTERNAL,
Naresh Tannirue3b18452014-03-04 14:44:27 +0530127 SND_DEVICE_IN_HANDSET_MIC_AEC,
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530128 SND_DEVICE_IN_HANDSET_MIC_NS,
129 SND_DEVICE_IN_HANDSET_MIC_AEC_NS,
130 SND_DEVICE_IN_HANDSET_DMIC,
131 SND_DEVICE_IN_HANDSET_DMIC_AEC,
132 SND_DEVICE_IN_HANDSET_DMIC_NS,
133 SND_DEVICE_IN_HANDSET_DMIC_AEC_NS,
134 SND_DEVICE_IN_SPEAKER_MIC,
Naresh Tannirue3b18452014-03-04 14:44:27 +0530135 SND_DEVICE_IN_SPEAKER_MIC_AEC,
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530136 SND_DEVICE_IN_SPEAKER_MIC_NS,
137 SND_DEVICE_IN_SPEAKER_MIC_AEC_NS,
138 SND_DEVICE_IN_SPEAKER_DMIC,
139 SND_DEVICE_IN_SPEAKER_DMIC_AEC,
140 SND_DEVICE_IN_SPEAKER_DMIC_NS,
141 SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS,
142 SND_DEVICE_IN_HEADSET_MIC,
143 SND_DEVICE_IN_HEADSET_MIC_FLUENCE,
Naresh Tannirue3b18452014-03-04 14:44:27 +0530144 SND_DEVICE_IN_VOICE_SPEAKER_MIC,
145 SND_DEVICE_IN_VOICE_HEADSET_MIC,
146 SND_DEVICE_IN_HDMI_MIC,
147 SND_DEVICE_IN_BT_SCO_MIC,
Vicky Sehrawate240e5d2014-08-12 17:17:04 -0700148 SND_DEVICE_IN_BT_SCO_MIC_NREC,
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530149 SND_DEVICE_IN_BT_SCO_MIC_WB,
Vicky Sehrawate240e5d2014-08-12 17:17:04 -0700150 SND_DEVICE_IN_BT_SCO_MIC_WB_NREC,
Naresh Tannirue3b18452014-03-04 14:44:27 +0530151 SND_DEVICE_IN_CAMCORDER_MIC,
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530152 SND_DEVICE_IN_VOICE_DMIC,
153 SND_DEVICE_IN_VOICE_SPEAKER_DMIC,
154 SND_DEVICE_IN_VOICE_SPEAKER_QMIC,
Naresh Tannirue3b18452014-03-04 14:44:27 +0530155 SND_DEVICE_IN_VOICE_TTY_FULL_HEADSET_MIC,
156 SND_DEVICE_IN_VOICE_TTY_VCO_HANDSET_MIC,
157 SND_DEVICE_IN_VOICE_TTY_HCO_HEADSET_MIC,
158 SND_DEVICE_IN_VOICE_REC_MIC,
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530159 SND_DEVICE_IN_VOICE_REC_MIC_NS,
160 SND_DEVICE_IN_VOICE_REC_DMIC_STEREO,
161 SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE,
Preetam Singh Ranawat7112f3b2015-02-26 16:51:58 +0530162 SND_DEVICE_IN_VOICE_RX,
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530163 SND_DEVICE_IN_USB_HEADSET_MIC,
164 SND_DEVICE_IN_CAPTURE_FM,
165 SND_DEVICE_IN_AANC_HANDSET_MIC,
166 SND_DEVICE_IN_QUAD_MIC,
167 SND_DEVICE_IN_HANDSET_STEREO_DMIC,
168 SND_DEVICE_IN_SPEAKER_STEREO_DMIC,
169 SND_DEVICE_IN_CAPTURE_VI_FEEDBACK,
Karthik Reddy Kattad9fff862014-07-21 21:07:21 +0530170 SND_DEVICE_IN_VOICE_SPEAKER_DMIC_BROADSIDE,
171 SND_DEVICE_IN_SPEAKER_DMIC_BROADSIDE,
172 SND_DEVICE_IN_SPEAKER_DMIC_AEC_BROADSIDE,
173 SND_DEVICE_IN_SPEAKER_DMIC_NS_BROADSIDE,
174 SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS_BROADSIDE,
Sidipotu Ashok3bcca232014-11-07 14:41:58 +0530175 SND_DEVICE_IN_VOICE_FLUENCE_DMIC_AANC,
Karthik Reddy Kattad71b94b2015-01-19 14:06:53 +0530176 SND_DEVICE_IN_HANDSET_QMIC,
177 SND_DEVICE_IN_SPEAKER_QMIC_AEC,
178 SND_DEVICE_IN_SPEAKER_QMIC_NS,
179 SND_DEVICE_IN_SPEAKER_QMIC_AEC_NS,
Shiv Maliyappanahalli5a10aea2015-07-02 10:36:23 -0700180 SND_DEVICE_IN_THREE_MIC,
Naresh Tannirue3b18452014-03-04 14:44:27 +0530181 SND_DEVICE_IN_END,
182
183 SND_DEVICE_MAX = SND_DEVICE_IN_END,
184
185};
186
Naresh Tannirue3b18452014-03-04 14:44:27 +0530187#define DEFAULT_OUTPUT_SAMPLING_RATE 48000
Preetam Singh Ranawatc61f8672015-06-18 23:20:28 +0530188#define OUTPUT_SAMPLING_RATE_44100 44100
189#define MAX_PORT 6
190#define ALL_CODEC_BACKEND_PORT 0
191#define HEADPHONE_44_1_BACKEND_PORT 5
Apoorv Raghuvanshi21492162015-02-19 18:19:36 -0800192enum {
193 DEFAULT_CODEC_BACKEND,
194 HEADPHONE_44_1_BACKEND,
195 MAX_CODEC_BACKENDS
196};
Preetam Singh Ranawatc61f8672015-06-18 23:20:28 +0530197#define AUDIO_PARAMETER_KEY_NATIVE_AUDIO "audio.nat.codec.enabled"
Sidipotu Ashoke6f78cb2015-11-05 14:42:20 +0530198#define AUDIO_PARAMETER_KEY_NATIVE_AUDIO_MODE "native_audio_mode"
Naresh Tannirue3b18452014-03-04 14:44:27 +0530199
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530200#define ALL_SESSION_VSID 0xFFFFFFFF
Preetam Singh Ranawat8bde2c52015-03-20 12:00:49 +0530201#define DEFAULT_MUTE_RAMP_DURATION_MS 20
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530202#define DEFAULT_VOLUME_RAMP_DURATION_MS 20
203#define MIXER_PATH_MAX_LENGTH 100
Sidipotu Ashoke6f78cb2015-11-05 14:42:20 +0530204#define SND_CARD_MAX_LENGTH 100
205#define CODEC_VERSION_MAX_LENGTH 100
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530206
207#define MAX_VOL_INDEX 5
208#define MIN_VOL_INDEX 0
209#define percent_to_index(val, min, max) \
210 ((val) * ((max) - (min)) * 0.01 + (min) + .5)
211
Naresh Tannirue3b18452014-03-04 14:44:27 +0530212/*
213 * tinyAlsa library interprets period size as number of frames
214 * one frame = channel_count * sizeof (pcm sample)
215 * so if format = 16-bit PCM and channels = Stereo, frame size = 2 ch * 2 = 4 bytes
216 * DEEP_BUFFER_OUTPUT_PERIOD_SIZE = 1024 means 1024 * 4 = 4096 bytes
217 * We should take care of returning proper size when AudioFlinger queries for
218 * the buffer size of an input/output stream
219 */
Alexy Joseph029faa22015-06-18 14:22:14 -0700220#define DEEP_BUFFER_OUTPUT_PERIOD_SIZE 1920
221#define DEEP_BUFFER_OUTPUT_PERIOD_COUNT 2
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530222#define LOW_LATENCY_OUTPUT_PERIOD_SIZE 240
Naresh Tannirue3b18452014-03-04 14:44:27 +0530223#define LOW_LATENCY_OUTPUT_PERIOD_COUNT 2
224
Ravi Kumar Alamandadc9bb152014-09-08 15:59:58 -0700225#define LOW_LATENCY_CAPTURE_SAMPLE_RATE 48000
226#define LOW_LATENCY_CAPTURE_PERIOD_SIZE 240
Sharad Sangle896e7b12014-11-07 17:06:29 +0530227#define LOW_LATENCY_CAPTURE_USE_CASE 1
Ravi Kumar Alamandadc9bb152014-09-08 15:59:58 -0700228
Naresh Tannirue3b18452014-03-04 14:44:27 +0530229#define HDMI_MULTI_PERIOD_SIZE 336
230#define HDMI_MULTI_PERIOD_COUNT 8
231#define HDMI_MULTI_DEFAULT_CHANNEL_COUNT 6
232#define HDMI_MULTI_PERIOD_BYTES (HDMI_MULTI_PERIOD_SIZE * HDMI_MULTI_DEFAULT_CHANNEL_COUNT * 2)
233
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530234#define AUDIO_CAPTURE_PERIOD_DURATION_MSEC 20
235#define AUDIO_CAPTURE_PERIOD_COUNT 2
236
Preetam Singh Ranawat8bde2c52015-03-20 12:00:49 +0530237#define LOW_LATENCY_CAPTURE_SAMPLE_RATE 48000
238#define LOW_LATENCY_CAPTURE_PERIOD_SIZE 240
239#define LOW_LATENCY_CAPTURE_USE_CASE 1
240
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530241#define DEVICE_NAME_MAX_SIZE 128
242#define HW_INFO_ARRAY_MAX_SIZE 32
243
244#define DEEP_BUFFER_PCM_DEVICE 0
245#define AUDIO_RECORD_PCM_DEVICE 0
246#define MULTIMEDIA2_PCM_DEVICE 1
Naresh Tanniru3a7dbe72015-06-25 20:08:01 -0700247#define MULTIMEDIA3_PCM_DEVICE 4
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530248#define FM_PLAYBACK_PCM_DEVICE 5
249#define FM_CAPTURE_PCM_DEVICE 6
250#define HFP_PCM_RX 5
Satya Krishna Pindiproli640c91e2014-03-14 11:09:09 +0530251#define HFP_SCO_RX 17
252#define HFP_ASM_RX_TX 18
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530253
254#define INCALL_MUSIC_UPLINK_PCM_DEVICE 1
255#define INCALL_MUSIC_UPLINK2_PCM_DEVICE 16
256#define SPKR_PROT_CALIB_RX_PCM_DEVICE 5
Laxminath Kasam999caa42015-05-08 18:17:23 +0530257#define SPKR_PROT_CALIB_TX_PCM_DEVICE 26
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530258#define PLAYBACK_OFFLOAD_DEVICE 9
Naresh Tanniru06f99432015-08-26 14:01:20 -0700259#define PLAYBACK_OFFLOAD_DEVICE2 24
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530260#define COMPRESS_VOIP_CALL_PCM_DEVICE 3
261
Banajit Goswami88d6cc52014-04-10 17:59:02 -0700262/* Define macro for Internal FM volume mixer */
263#define FM_RX_VOLUME "Internal FM RX Volume"
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530264
265#define LOWLATENCY_PCM_DEVICE 12
266#define EC_REF_RX "I2S_RX"
267#define COMPRESS_CAPTURE_DEVICE 19
268
269#define VOICE_CALL_PCM_DEVICE 2
270#define VOICE2_CALL_PCM_DEVICE 13
271#define VOLTE_CALL_PCM_DEVICE 15
Venkata Narendra Kumar Gutta90bef992015-01-28 15:32:45 +0530272#define QCHAT_CALL_PCM_DEVICE 26
Venkata Narendra Kumar Guttaed408a12015-03-31 20:24:04 +0530273#define QCHAT_CALL_PCM_DEVICE_OF_EXT_CODEC 28
Karthik Reddy Katta3b0a60c2014-04-06 14:52:37 +0530274#define VOWLAN_CALL_PCM_DEVICE 16
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530275
Preetam Singh Ranawat7112f3b2015-02-26 16:51:58 +0530276#define AFE_PROXY_PLAYBACK_PCM_DEVICE 7
277#define AFE_PROXY_RECORD_PCM_DEVICE 8
278
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530279#define LIB_CSD_CLIENT "libcsd-client.so"
280/* CSD-CLIENT related functions */
281typedef int (*init_t)();
282typedef int (*deinit_t)();
283typedef int (*disable_device_t)();
284typedef int (*enable_device_config_t)(int, int);
285typedef int (*enable_device_t)(int, int, uint32_t);
Preetam Singh Ranawat8bde2c52015-03-20 12:00:49 +0530286typedef int (*volume_t)(uint32_t, int, uint16_t);
287typedef int (*mic_mute_t)(uint32_t, int, uint16_t);
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530288typedef int (*slow_talk_t)(uint32_t, uint8_t);
289typedef int (*start_voice_t)(uint32_t);
290typedef int (*stop_voice_t)(uint32_t);
291typedef int (*start_playback_t)(uint32_t);
292typedef int (*stop_playback_t)(uint32_t);
Vidyakumar Athota21b3bb92014-04-25 11:08:08 -0700293typedef int (*set_lch_t)(uint32_t, enum voice_lch_mode);
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530294typedef int (*start_record_t)(uint32_t, int);
295typedef int (*stop_record_t)(uint32_t);
296/* CSD Client structure */
297struct csd_data {
298 void *csd_client;
299 init_t init;
300 deinit_t deinit;
301 disable_device_t disable_device;
302 enable_device_config_t enable_device_config;
303 enable_device_t enable_device;
304 volume_t volume;
305 mic_mute_t mic_mute;
306 slow_talk_t slow_talk;
307 start_voice_t start_voice;
308 stop_voice_t stop_voice;
309 start_playback_t start_playback;
310 stop_playback_t stop_playback;
Vidyakumar Athota21b3bb92014-04-25 11:08:08 -0700311 set_lch_t set_lch;
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530312 start_record_t start_record;
313 stop_record_t stop_record;
314};
Naresh Tannirue3b18452014-03-04 14:44:27 +0530315
Preetam Singh Ranawat2d0e4632015-02-02 12:40:59 +0530316int platform_get_subsys_image_name (char *buf);
317
Preetam Singh Ranawat8bde2c52015-03-20 12:00:49 +0530318/* HDMI Passthrough defines */
319enum {
320 LEGACY_PCM = 0,
321 PASSTHROUGH,
322 PASSTHROUGH_CONVERT
323};
324/*
325 * ID for setting mute and lateny on the device side
326 * through Device PP Params mixer control.
327 */
328#define DEVICE_PARAM_MUTE_ID 0
329#define DEVICE_PARAM_LATENCY_ID 1
Karthik Reddy Kattae4078ed2015-04-21 11:46:15 +0530330
331#define ENUM_TO_STRING(X) #X
332
333struct audio_device_to_audio_interface {
334 audio_devices_t device;
335 char device_name[100];
336 char interface_name[100];
337};
Laxminath Kasam44f49402015-05-29 18:37:11 +0530338
339struct speaker_device_to_tz_names {
340 snd_device_t snd_device;
341 char spkr_1_tz_name[100];
342 char spkr_2_tz_name[100];
343};
Naresh Tannirue3b18452014-03-04 14:44:27 +0530344#endif // QCOM_AUDIO_PLATFORM_H