Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 1 | /* |
Narsinga Rao Chella | f99003c | 2015-07-08 19:38:38 -0700 | [diff] [blame^] | 2 | * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 3 | * Not a Contribution. |
| 4 | * |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 5 | * 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 Athota | 21b3bb9 | 2014-04-25 11:08:08 -0700 | [diff] [blame] | 22 | #include <sound/voice_params.h> |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 23 | |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 24 | enum { |
| 25 | FLUENCE_NONE, |
| 26 | FLUENCE_DUAL_MIC = 0x1, |
| 27 | FLUENCE_QUAD_MIC = 0x2, |
| 28 | }; |
| 29 | |
Karthik Reddy Katta | d9fff86 | 2014-07-21 21:07:21 +0530 | [diff] [blame] | 30 | enum { |
| 31 | FLUENCE_ENDFIRE = 0x1, |
| 32 | FLUENCE_BROADSIDE = 0x2, |
| 33 | }; |
| 34 | |
Preetam Singh Ranawat | 2d0e463 | 2015-02-02 12:40:59 +0530 | [diff] [blame] | 35 | #define PLATFORM_IMAGE_NAME "modem" |
| 36 | |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 37 | /* |
| 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 Ranawat | c61f867 | 2015-06-18 23:20:28 +0530 | [diff] [blame] | 40 | * 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 Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 45 | */ |
| 46 | #define AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND \ |
| 47 | (AUDIO_DEVICE_OUT_EARPIECE | AUDIO_DEVICE_OUT_SPEAKER | \ |
| 48 | AUDIO_DEVICE_OUT_WIRED_HEADSET | AUDIO_DEVICE_OUT_WIRED_HEADPHONE) |
| 49 | |
Narsinga Rao Chella | f99003c | 2015-07-08 19:38:38 -0700 | [diff] [blame^] | 50 | /* |
| 51 | * Below are the input devices for which back end is same, SLIMBUS_0_TX. |
| 52 | * All these devices are handled by the internal HW codec. We can |
| 53 | * enable any one of these devices at any time |
| 54 | */ |
| 55 | #define AUDIO_DEVICE_IN_ALL_CODEC_BACKEND \ |
| 56 | (AUDIO_DEVICE_IN_BUILTIN_MIC | AUDIO_DEVICE_IN_BACK_MIC | \ |
| 57 | AUDIO_DEVICE_IN_WIRED_HEADSET | AUDIO_DEVICE_IN_VOICE_CALL) & ~AUDIO_DEVICE_BIT_IN |
| 58 | |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 59 | /* Sound devices specific to the platform |
| 60 | * The DEVICE_OUT_* and DEVICE_IN_* should be mapped to these sound |
| 61 | * devices to enable corresponding mixer paths |
| 62 | */ |
| 63 | enum { |
| 64 | SND_DEVICE_NONE = 0, |
| 65 | |
| 66 | /* Playback devices */ |
| 67 | SND_DEVICE_MIN, |
| 68 | SND_DEVICE_OUT_BEGIN = SND_DEVICE_MIN, |
| 69 | SND_DEVICE_OUT_HANDSET = SND_DEVICE_OUT_BEGIN, |
| 70 | SND_DEVICE_OUT_SPEAKER, |
Preetam Singh Ranawat | 8bde2c5 | 2015-03-20 12:00:49 +0530 | [diff] [blame] | 71 | SND_DEVICE_OUT_SPEAKER_EXTERNAL_1, |
| 72 | SND_DEVICE_OUT_SPEAKER_EXTERNAL_2, |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 73 | SND_DEVICE_OUT_SPEAKER_REVERSE, |
Preetam Singh Ranawat | c7f7f5c | 2015-04-02 12:19:58 +0530 | [diff] [blame] | 74 | SND_DEVICE_OUT_SPEAKER_WSA, |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 75 | SND_DEVICE_OUT_HEADPHONES, |
Apoorv Raghuvanshi | 2149216 | 2015-02-19 18:19:36 -0800 | [diff] [blame] | 76 | SND_DEVICE_OUT_HEADPHONES_44_1, |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 77 | SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES, |
Preetam Singh Ranawat | 8bde2c5 | 2015-03-20 12:00:49 +0530 | [diff] [blame] | 78 | SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_1, |
| 79 | SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_2, |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 80 | SND_DEVICE_OUT_VOICE_HANDSET, |
| 81 | SND_DEVICE_OUT_VOICE_SPEAKER, |
Preetam Singh Ranawat | c7f7f5c | 2015-04-02 12:19:58 +0530 | [diff] [blame] | 82 | SND_DEVICE_OUT_VOICE_SPEAKER_WSA, |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 83 | SND_DEVICE_OUT_VOICE_HEADPHONES, |
| 84 | SND_DEVICE_OUT_HDMI, |
| 85 | SND_DEVICE_OUT_SPEAKER_AND_HDMI, |
| 86 | SND_DEVICE_OUT_BT_SCO, |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 87 | SND_DEVICE_OUT_BT_SCO_WB, |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 88 | SND_DEVICE_OUT_VOICE_TTY_FULL_HEADPHONES, |
| 89 | SND_DEVICE_OUT_VOICE_TTY_VCO_HEADPHONES, |
| 90 | SND_DEVICE_OUT_VOICE_TTY_HCO_HANDSET, |
Preetam Singh Ranawat | 7112f3b | 2015-02-26 16:51:58 +0530 | [diff] [blame] | 91 | SND_DEVICE_OUT_VOICE_TX, |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 92 | SND_DEVICE_OUT_AFE_PROXY, |
| 93 | SND_DEVICE_OUT_USB_HEADSET, |
| 94 | SND_DEVICE_OUT_SPEAKER_AND_USB_HEADSET, |
| 95 | SND_DEVICE_OUT_TRANSMISSION_FM, |
| 96 | SND_DEVICE_OUT_ANC_HEADSET, |
| 97 | SND_DEVICE_OUT_ANC_FB_HEADSET, |
| 98 | SND_DEVICE_OUT_VOICE_ANC_HEADSET, |
| 99 | SND_DEVICE_OUT_VOICE_ANC_FB_HEADSET, |
| 100 | SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET, |
| 101 | SND_DEVICE_OUT_ANC_HANDSET, |
| 102 | SND_DEVICE_OUT_SPEAKER_PROTECTED, |
Preetam Singh Ranawat | 8bde2c5 | 2015-03-20 12:00:49 +0530 | [diff] [blame] | 103 | SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED, |
Naresh Tanniru | c0517bc | 2014-10-26 15:30:55 +0530 | [diff] [blame] | 104 | #ifdef RECORD_PLAY_CONCURRENCY |
| 105 | SND_DEVICE_OUT_VOIP_HANDSET, |
| 106 | SND_DEVICE_OUT_VOIP_SPEAKER, |
| 107 | SND_DEVICE_OUT_VOIP_HEADPHONES, |
| 108 | #endif |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 109 | SND_DEVICE_OUT_END, |
| 110 | |
| 111 | /* |
| 112 | * Note: IN_BEGIN should be same as OUT_END because total number of devices |
| 113 | * SND_DEVICES_MAX should not exceed MAX_RX + MAX_TX devices. |
| 114 | */ |
| 115 | /* Capture devices */ |
| 116 | SND_DEVICE_IN_BEGIN = SND_DEVICE_OUT_END, |
| 117 | SND_DEVICE_IN_HANDSET_MIC = SND_DEVICE_IN_BEGIN, |
Preetam Singh Ranawat | 8bde2c5 | 2015-03-20 12:00:49 +0530 | [diff] [blame] | 118 | SND_DEVICE_IN_HANDSET_MIC_EXTERNAL, |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 119 | SND_DEVICE_IN_HANDSET_MIC_AEC, |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 120 | SND_DEVICE_IN_HANDSET_MIC_NS, |
| 121 | SND_DEVICE_IN_HANDSET_MIC_AEC_NS, |
| 122 | SND_DEVICE_IN_HANDSET_DMIC, |
| 123 | SND_DEVICE_IN_HANDSET_DMIC_AEC, |
| 124 | SND_DEVICE_IN_HANDSET_DMIC_NS, |
| 125 | SND_DEVICE_IN_HANDSET_DMIC_AEC_NS, |
| 126 | SND_DEVICE_IN_SPEAKER_MIC, |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 127 | SND_DEVICE_IN_SPEAKER_MIC_AEC, |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 128 | SND_DEVICE_IN_SPEAKER_MIC_NS, |
| 129 | SND_DEVICE_IN_SPEAKER_MIC_AEC_NS, |
| 130 | SND_DEVICE_IN_SPEAKER_DMIC, |
| 131 | SND_DEVICE_IN_SPEAKER_DMIC_AEC, |
| 132 | SND_DEVICE_IN_SPEAKER_DMIC_NS, |
| 133 | SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS, |
| 134 | SND_DEVICE_IN_HEADSET_MIC, |
| 135 | SND_DEVICE_IN_HEADSET_MIC_FLUENCE, |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 136 | SND_DEVICE_IN_VOICE_SPEAKER_MIC, |
| 137 | SND_DEVICE_IN_VOICE_HEADSET_MIC, |
| 138 | SND_DEVICE_IN_HDMI_MIC, |
| 139 | SND_DEVICE_IN_BT_SCO_MIC, |
Vicky Sehrawat | e240e5d | 2014-08-12 17:17:04 -0700 | [diff] [blame] | 140 | SND_DEVICE_IN_BT_SCO_MIC_NREC, |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 141 | SND_DEVICE_IN_BT_SCO_MIC_WB, |
Vicky Sehrawat | e240e5d | 2014-08-12 17:17:04 -0700 | [diff] [blame] | 142 | SND_DEVICE_IN_BT_SCO_MIC_WB_NREC, |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 143 | SND_DEVICE_IN_CAMCORDER_MIC, |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 144 | SND_DEVICE_IN_VOICE_DMIC, |
| 145 | SND_DEVICE_IN_VOICE_SPEAKER_DMIC, |
| 146 | SND_DEVICE_IN_VOICE_SPEAKER_QMIC, |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 147 | SND_DEVICE_IN_VOICE_TTY_FULL_HEADSET_MIC, |
| 148 | SND_DEVICE_IN_VOICE_TTY_VCO_HANDSET_MIC, |
| 149 | SND_DEVICE_IN_VOICE_TTY_HCO_HEADSET_MIC, |
| 150 | SND_DEVICE_IN_VOICE_REC_MIC, |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 151 | SND_DEVICE_IN_VOICE_REC_MIC_NS, |
| 152 | SND_DEVICE_IN_VOICE_REC_DMIC_STEREO, |
| 153 | SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE, |
Preetam Singh Ranawat | 7112f3b | 2015-02-26 16:51:58 +0530 | [diff] [blame] | 154 | SND_DEVICE_IN_VOICE_RX, |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 155 | SND_DEVICE_IN_USB_HEADSET_MIC, |
| 156 | SND_DEVICE_IN_CAPTURE_FM, |
| 157 | SND_DEVICE_IN_AANC_HANDSET_MIC, |
| 158 | SND_DEVICE_IN_QUAD_MIC, |
| 159 | SND_DEVICE_IN_HANDSET_STEREO_DMIC, |
| 160 | SND_DEVICE_IN_SPEAKER_STEREO_DMIC, |
| 161 | SND_DEVICE_IN_CAPTURE_VI_FEEDBACK, |
Karthik Reddy Katta | d9fff86 | 2014-07-21 21:07:21 +0530 | [diff] [blame] | 162 | SND_DEVICE_IN_VOICE_SPEAKER_DMIC_BROADSIDE, |
| 163 | SND_DEVICE_IN_SPEAKER_DMIC_BROADSIDE, |
| 164 | SND_DEVICE_IN_SPEAKER_DMIC_AEC_BROADSIDE, |
| 165 | SND_DEVICE_IN_SPEAKER_DMIC_NS_BROADSIDE, |
| 166 | SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS_BROADSIDE, |
Sidipotu Ashok | 3bcca23 | 2014-11-07 14:41:58 +0530 | [diff] [blame] | 167 | SND_DEVICE_IN_VOICE_FLUENCE_DMIC_AANC, |
Karthik Reddy Katta | d71b94b | 2015-01-19 14:06:53 +0530 | [diff] [blame] | 168 | SND_DEVICE_IN_HANDSET_QMIC, |
| 169 | SND_DEVICE_IN_SPEAKER_QMIC_AEC, |
| 170 | SND_DEVICE_IN_SPEAKER_QMIC_NS, |
| 171 | SND_DEVICE_IN_SPEAKER_QMIC_AEC_NS, |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 172 | SND_DEVICE_IN_END, |
| 173 | |
| 174 | SND_DEVICE_MAX = SND_DEVICE_IN_END, |
| 175 | |
| 176 | }; |
| 177 | |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 178 | #define DEFAULT_OUTPUT_SAMPLING_RATE 48000 |
Preetam Singh Ranawat | c61f867 | 2015-06-18 23:20:28 +0530 | [diff] [blame] | 179 | #define OUTPUT_SAMPLING_RATE_44100 44100 |
| 180 | #define MAX_PORT 6 |
| 181 | #define ALL_CODEC_BACKEND_PORT 0 |
| 182 | #define HEADPHONE_44_1_BACKEND_PORT 5 |
Apoorv Raghuvanshi | 2149216 | 2015-02-19 18:19:36 -0800 | [diff] [blame] | 183 | enum { |
| 184 | DEFAULT_CODEC_BACKEND, |
| 185 | HEADPHONE_44_1_BACKEND, |
| 186 | MAX_CODEC_BACKENDS |
| 187 | }; |
Preetam Singh Ranawat | c61f867 | 2015-06-18 23:20:28 +0530 | [diff] [blame] | 188 | #define AUDIO_PARAMETER_KEY_NATIVE_AUDIO "audio.nat.codec.enabled" |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 189 | |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 190 | #define ALL_SESSION_VSID 0xFFFFFFFF |
Preetam Singh Ranawat | 8bde2c5 | 2015-03-20 12:00:49 +0530 | [diff] [blame] | 191 | #define DEFAULT_MUTE_RAMP_DURATION_MS 20 |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 192 | #define DEFAULT_VOLUME_RAMP_DURATION_MS 20 |
| 193 | #define MIXER_PATH_MAX_LENGTH 100 |
| 194 | |
| 195 | #define MAX_VOL_INDEX 5 |
| 196 | #define MIN_VOL_INDEX 0 |
| 197 | #define percent_to_index(val, min, max) \ |
| 198 | ((val) * ((max) - (min)) * 0.01 + (min) + .5) |
| 199 | |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 200 | /* |
| 201 | * tinyAlsa library interprets period size as number of frames |
| 202 | * one frame = channel_count * sizeof (pcm sample) |
| 203 | * so if format = 16-bit PCM and channels = Stereo, frame size = 2 ch * 2 = 4 bytes |
| 204 | * DEEP_BUFFER_OUTPUT_PERIOD_SIZE = 1024 means 1024 * 4 = 4096 bytes |
| 205 | * We should take care of returning proper size when AudioFlinger queries for |
| 206 | * the buffer size of an input/output stream |
| 207 | */ |
Alexy Joseph | 029faa2 | 2015-06-18 14:22:14 -0700 | [diff] [blame] | 208 | #define DEEP_BUFFER_OUTPUT_PERIOD_SIZE 1920 |
| 209 | #define DEEP_BUFFER_OUTPUT_PERIOD_COUNT 2 |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 210 | #define LOW_LATENCY_OUTPUT_PERIOD_SIZE 240 |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 211 | #define LOW_LATENCY_OUTPUT_PERIOD_COUNT 2 |
| 212 | |
Ravi Kumar Alamanda | dc9bb15 | 2014-09-08 15:59:58 -0700 | [diff] [blame] | 213 | #define LOW_LATENCY_CAPTURE_SAMPLE_RATE 48000 |
| 214 | #define LOW_LATENCY_CAPTURE_PERIOD_SIZE 240 |
Sharad Sangle | 896e7b1 | 2014-11-07 17:06:29 +0530 | [diff] [blame] | 215 | #define LOW_LATENCY_CAPTURE_USE_CASE 1 |
Ravi Kumar Alamanda | dc9bb15 | 2014-09-08 15:59:58 -0700 | [diff] [blame] | 216 | |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 217 | #define HDMI_MULTI_PERIOD_SIZE 336 |
| 218 | #define HDMI_MULTI_PERIOD_COUNT 8 |
| 219 | #define HDMI_MULTI_DEFAULT_CHANNEL_COUNT 6 |
| 220 | #define HDMI_MULTI_PERIOD_BYTES (HDMI_MULTI_PERIOD_SIZE * HDMI_MULTI_DEFAULT_CHANNEL_COUNT * 2) |
| 221 | |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 222 | #define AUDIO_CAPTURE_PERIOD_DURATION_MSEC 20 |
| 223 | #define AUDIO_CAPTURE_PERIOD_COUNT 2 |
| 224 | |
Preetam Singh Ranawat | 8bde2c5 | 2015-03-20 12:00:49 +0530 | [diff] [blame] | 225 | #define LOW_LATENCY_CAPTURE_SAMPLE_RATE 48000 |
| 226 | #define LOW_LATENCY_CAPTURE_PERIOD_SIZE 240 |
| 227 | #define LOW_LATENCY_CAPTURE_USE_CASE 1 |
| 228 | |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 229 | #define DEVICE_NAME_MAX_SIZE 128 |
| 230 | #define HW_INFO_ARRAY_MAX_SIZE 32 |
| 231 | |
| 232 | #define DEEP_BUFFER_PCM_DEVICE 0 |
| 233 | #define AUDIO_RECORD_PCM_DEVICE 0 |
| 234 | #define MULTIMEDIA2_PCM_DEVICE 1 |
| 235 | #define FM_PLAYBACK_PCM_DEVICE 5 |
| 236 | #define FM_CAPTURE_PCM_DEVICE 6 |
| 237 | #define HFP_PCM_RX 5 |
Satya Krishna Pindiproli | 640c91e | 2014-03-14 11:09:09 +0530 | [diff] [blame] | 238 | #define HFP_SCO_RX 17 |
| 239 | #define HFP_ASM_RX_TX 18 |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 240 | |
| 241 | #define INCALL_MUSIC_UPLINK_PCM_DEVICE 1 |
| 242 | #define INCALL_MUSIC_UPLINK2_PCM_DEVICE 16 |
| 243 | #define SPKR_PROT_CALIB_RX_PCM_DEVICE 5 |
Laxminath Kasam | 999caa4 | 2015-05-08 18:17:23 +0530 | [diff] [blame] | 244 | #define SPKR_PROT_CALIB_TX_PCM_DEVICE 26 |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 245 | #define PLAYBACK_OFFLOAD_DEVICE 9 |
Preetam Singh Ranawat | 8bde2c5 | 2015-03-20 12:00:49 +0530 | [diff] [blame] | 246 | |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 247 | #define COMPRESS_VOIP_CALL_PCM_DEVICE 3 |
| 248 | |
Banajit Goswami | 88d6cc5 | 2014-04-10 17:59:02 -0700 | [diff] [blame] | 249 | /* Define macro for Internal FM volume mixer */ |
| 250 | #define FM_RX_VOLUME "Internal FM RX Volume" |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 251 | |
| 252 | #define LOWLATENCY_PCM_DEVICE 12 |
| 253 | #define EC_REF_RX "I2S_RX" |
| 254 | #define COMPRESS_CAPTURE_DEVICE 19 |
| 255 | |
| 256 | #define VOICE_CALL_PCM_DEVICE 2 |
| 257 | #define VOICE2_CALL_PCM_DEVICE 13 |
| 258 | #define VOLTE_CALL_PCM_DEVICE 15 |
Venkata Narendra Kumar Gutta | 90bef99 | 2015-01-28 15:32:45 +0530 | [diff] [blame] | 259 | #define QCHAT_CALL_PCM_DEVICE 26 |
Venkata Narendra Kumar Gutta | ed408a1 | 2015-03-31 20:24:04 +0530 | [diff] [blame] | 260 | #define QCHAT_CALL_PCM_DEVICE_OF_EXT_CODEC 28 |
Karthik Reddy Katta | 3b0a60c | 2014-04-06 14:52:37 +0530 | [diff] [blame] | 261 | #define VOWLAN_CALL_PCM_DEVICE 16 |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 262 | |
Preetam Singh Ranawat | 7112f3b | 2015-02-26 16:51:58 +0530 | [diff] [blame] | 263 | #define AFE_PROXY_PLAYBACK_PCM_DEVICE 7 |
| 264 | #define AFE_PROXY_RECORD_PCM_DEVICE 8 |
| 265 | |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 266 | #define LIB_CSD_CLIENT "libcsd-client.so" |
| 267 | /* CSD-CLIENT related functions */ |
| 268 | typedef int (*init_t)(); |
| 269 | typedef int (*deinit_t)(); |
| 270 | typedef int (*disable_device_t)(); |
| 271 | typedef int (*enable_device_config_t)(int, int); |
| 272 | typedef int (*enable_device_t)(int, int, uint32_t); |
Preetam Singh Ranawat | 8bde2c5 | 2015-03-20 12:00:49 +0530 | [diff] [blame] | 273 | typedef int (*volume_t)(uint32_t, int, uint16_t); |
| 274 | typedef int (*mic_mute_t)(uint32_t, int, uint16_t); |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 275 | typedef int (*slow_talk_t)(uint32_t, uint8_t); |
| 276 | typedef int (*start_voice_t)(uint32_t); |
| 277 | typedef int (*stop_voice_t)(uint32_t); |
| 278 | typedef int (*start_playback_t)(uint32_t); |
| 279 | typedef int (*stop_playback_t)(uint32_t); |
Vidyakumar Athota | 21b3bb9 | 2014-04-25 11:08:08 -0700 | [diff] [blame] | 280 | typedef int (*set_lch_t)(uint32_t, enum voice_lch_mode); |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 281 | typedef int (*start_record_t)(uint32_t, int); |
| 282 | typedef int (*stop_record_t)(uint32_t); |
| 283 | /* CSD Client structure */ |
| 284 | struct csd_data { |
| 285 | void *csd_client; |
| 286 | init_t init; |
| 287 | deinit_t deinit; |
| 288 | disable_device_t disable_device; |
| 289 | enable_device_config_t enable_device_config; |
| 290 | enable_device_t enable_device; |
| 291 | volume_t volume; |
| 292 | mic_mute_t mic_mute; |
| 293 | slow_talk_t slow_talk; |
| 294 | start_voice_t start_voice; |
| 295 | stop_voice_t stop_voice; |
| 296 | start_playback_t start_playback; |
| 297 | stop_playback_t stop_playback; |
Vidyakumar Athota | 21b3bb9 | 2014-04-25 11:08:08 -0700 | [diff] [blame] | 298 | set_lch_t set_lch; |
Naresh Tanniru | db72d1e | 2014-03-05 17:33:47 +0530 | [diff] [blame] | 299 | start_record_t start_record; |
| 300 | stop_record_t stop_record; |
| 301 | }; |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 302 | |
Preetam Singh Ranawat | 2d0e463 | 2015-02-02 12:40:59 +0530 | [diff] [blame] | 303 | int platform_get_subsys_image_name (char *buf); |
| 304 | |
Preetam Singh Ranawat | 8bde2c5 | 2015-03-20 12:00:49 +0530 | [diff] [blame] | 305 | /* HDMI Passthrough defines */ |
| 306 | enum { |
| 307 | LEGACY_PCM = 0, |
| 308 | PASSTHROUGH, |
| 309 | PASSTHROUGH_CONVERT |
| 310 | }; |
| 311 | /* |
| 312 | * ID for setting mute and lateny on the device side |
| 313 | * through Device PP Params mixer control. |
| 314 | */ |
| 315 | #define DEVICE_PARAM_MUTE_ID 0 |
| 316 | #define DEVICE_PARAM_LATENCY_ID 1 |
Karthik Reddy Katta | e4078ed | 2015-04-21 11:46:15 +0530 | [diff] [blame] | 317 | |
| 318 | #define ENUM_TO_STRING(X) #X |
| 319 | |
| 320 | struct audio_device_to_audio_interface { |
| 321 | audio_devices_t device; |
| 322 | char device_name[100]; |
| 323 | char interface_name[100]; |
| 324 | }; |
Laxminath Kasam | 8225243 | 2015-05-29 18:37:11 +0530 | [diff] [blame] | 325 | |
| 326 | struct speaker_device_to_tz_names { |
| 327 | snd_device_t snd_device; |
| 328 | char spkr_1_tz_name[100]; |
| 329 | char spkr_2_tz_name[100]; |
| 330 | }; |
Naresh Tanniru | e3b1845 | 2014-03-04 14:44:27 +0530 | [diff] [blame] | 331 | #endif // QCOM_AUDIO_PLATFORM_H |