Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 1 | /* |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 2 | * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved. |
Apoorv Raghuvanshi | 9eaf94e | 2013-10-04 16:13:44 -0700 | [diff] [blame] | 3 | * Not a Contribution. |
| 4 | * |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [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> |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 23 | |
Gangadhar S | b021034 | 2019-02-22 17:39:41 +0530 | [diff] [blame] | 24 | #define TRUMPET_TOPOLOGY 0x11000099 |
| 25 | #define ACDB_ID_STEREO_SPEAKER_DEVICE 15 |
| 26 | |
Mingming Yin | 8e5a4f6 | 2013-10-07 15:23:41 -0700 | [diff] [blame] | 27 | enum { |
| 28 | FLUENCE_NONE, |
Ravi Kumar Alamanda | b034ddb | 2013-11-06 15:52:18 -0800 | [diff] [blame] | 29 | FLUENCE_DUAL_MIC = 0x1, |
Aditya Bavanari | 4051c8d | 2017-12-13 13:31:26 +0530 | [diff] [blame] | 30 | FLUENCE_TRI_MIC = 0x2, |
| 31 | FLUENCE_QUAD_MIC = 0x4, |
| 32 | FLUENCE_HEX_MIC = 0x8, |
Mingming Yin | 8e5a4f6 | 2013-10-07 15:23:41 -0700 | [diff] [blame] | 33 | }; |
| 34 | |
Narsinga Rao Chella | 61e0f9b | 2014-03-06 21:25:22 -0800 | [diff] [blame] | 35 | enum { |
| 36 | FLUENCE_ENDFIRE = 0x1, |
| 37 | FLUENCE_BROADSIDE = 0x2, |
| 38 | }; |
| 39 | |
Chaithanya Krishna Bacharaju | 9955b16 | 2016-05-25 16:25:53 +0530 | [diff] [blame] | 40 | enum { |
| 41 | SOURCE_MONO_MIC = 0x1, /* Target contains 1 mic */ |
| 42 | SOURCE_DUAL_MIC = 0x2, /* Target contains 2 mics */ |
| 43 | SOURCE_THREE_MIC = 0x4, /* Target contains 3 mics */ |
| 44 | SOURCE_QUAD_MIC = 0x8, /* Target contains 4 mics */ |
Garmond Leung | e2433c3 | 2017-09-28 21:51:22 -0700 | [diff] [blame] | 45 | SOURCE_HEX_MIC = 0x16, /* Target contains 6 mics */ |
Chaithanya Krishna Bacharaju | 9955b16 | 2016-05-25 16:25:53 +0530 | [diff] [blame] | 46 | }; |
| 47 | |
Rohit kumar | f412040 | 2016-08-05 19:19:48 +0530 | [diff] [blame] | 48 | enum { |
| 49 | SPKR_1, |
| 50 | SPKR_2 |
| 51 | }; |
| 52 | |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 53 | /* |
| 54 | * Below are the devices for which is back end is same, SLIMBUS_0_RX. |
| 55 | * All these devices are handled by the internal HW codec. We can |
Apoorv Raghuvanshi | f59bb22 | 2015-02-18 12:23:23 -0800 | [diff] [blame] | 56 | * enable any one of these devices at any time. An exception here is |
| 57 | * 44.1k headphone which uses different backend. This is filtered |
| 58 | * as different hal internal device in the code but remains same |
| 59 | * as standard android device AUDIO_DEVICE_OUT_WIRED_HEADPHONE |
| 60 | * for other layers. |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 61 | */ |
| 62 | #define AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND \ |
| 63 | (AUDIO_DEVICE_OUT_EARPIECE | AUDIO_DEVICE_OUT_SPEAKER | \ |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 64 | AUDIO_DEVICE_OUT_SPEAKER_SAFE | \ |
Ravi Kumar Alamanda | 52de13c | 2015-10-17 22:21:52 -0700 | [diff] [blame] | 65 | AUDIO_DEVICE_OUT_WIRED_HEADSET | AUDIO_DEVICE_OUT_WIRED_HEADPHONE | \ |
| 66 | AUDIO_DEVICE_OUT_LINE) |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 67 | |
Narsinga Rao Chella | f99003c | 2015-07-08 19:38:38 -0700 | [diff] [blame] | 68 | /* |
| 69 | * Below are the input devices for which back end is same, SLIMBUS_0_TX. |
| 70 | * All these devices are handled by the internal HW codec. We can |
| 71 | * enable any one of these devices at any time |
| 72 | */ |
Arun Mirpuri | e008ed2 | 2019-03-21 11:21:04 -0700 | [diff] [blame] | 73 | int AUDIO_DEVICE_IN_ALL_CODEC_BACKEND; |
| 74 | |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 75 | /* Sound devices specific to the platform |
| 76 | * The DEVICE_OUT_* and DEVICE_IN_* should be mapped to these sound |
| 77 | * devices to enable corresponding mixer paths |
| 78 | */ |
| 79 | enum { |
| 80 | SND_DEVICE_NONE = 0, |
| 81 | |
| 82 | /* Playback devices */ |
| 83 | SND_DEVICE_MIN, |
| 84 | SND_DEVICE_OUT_BEGIN = SND_DEVICE_MIN, |
| 85 | SND_DEVICE_OUT_HANDSET = SND_DEVICE_OUT_BEGIN, |
| 86 | SND_DEVICE_OUT_SPEAKER, |
Tanya Finkel | 0013005 | 2014-07-14 04:26:56 -0700 | [diff] [blame] | 87 | SND_DEVICE_OUT_SPEAKER_EXTERNAL_1, |
| 88 | SND_DEVICE_OUT_SPEAKER_EXTERNAL_2, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 89 | SND_DEVICE_OUT_SPEAKER_REVERSE, |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 90 | SND_DEVICE_OUT_SPEAKER_SAFE, |
Banajit Goswami | 20cdd21 | 2015-09-11 01:11:30 -0700 | [diff] [blame] | 91 | SND_DEVICE_OUT_SPEAKER_VBAT, |
Ravi Kumar Alamanda | 52de13c | 2015-10-17 22:21:52 -0700 | [diff] [blame] | 92 | SND_DEVICE_OUT_LINE, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 93 | SND_DEVICE_OUT_HEADPHONES, |
Preetam Singh Ranawat | cb6212e | 2016-07-19 18:33:53 +0530 | [diff] [blame] | 94 | SND_DEVICE_OUT_HEADPHONES_DSD, |
Apoorv Raghuvanshi | f59bb22 | 2015-02-18 12:23:23 -0800 | [diff] [blame] | 95 | SND_DEVICE_OUT_HEADPHONES_44_1, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 96 | SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES, |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 97 | SND_DEVICE_OUT_SPEAKER_SAFE_AND_HEADPHONES, |
Ravi Kumar Alamanda | 52de13c | 2015-10-17 22:21:52 -0700 | [diff] [blame] | 98 | SND_DEVICE_OUT_SPEAKER_AND_LINE, |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 99 | SND_DEVICE_OUT_SPEAKER_SAFE_AND_LINE, |
Tanya Finkel | 0013005 | 2014-07-14 04:26:56 -0700 | [diff] [blame] | 100 | SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_1, |
| 101 | SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_2, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 102 | SND_DEVICE_OUT_VOICE_HANDSET, |
| 103 | SND_DEVICE_OUT_VOICE_SPEAKER, |
Vikram Panduranga | 8c68e86 | 2018-04-27 12:59:42 -0700 | [diff] [blame] | 104 | SND_DEVICE_OUT_VOICE_SPEAKER_STEREO, |
Banajit Goswami | 20cdd21 | 2015-09-11 01:11:30 -0700 | [diff] [blame] | 105 | SND_DEVICE_OUT_VOICE_SPEAKER_VBAT, |
Rohit kumar | f412040 | 2016-08-05 19:19:48 +0530 | [diff] [blame] | 106 | SND_DEVICE_OUT_VOICE_SPEAKER_2, |
| 107 | SND_DEVICE_OUT_VOICE_SPEAKER_2_VBAT, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 108 | SND_DEVICE_OUT_VOICE_HEADPHONES, |
Samyak Jain | fd24f1e | 2019-04-30 11:58:43 +0530 | [diff] [blame^] | 109 | SND_DEVICE_OUT_VOICE_HEADSET, |
Ravi Kumar Alamanda | 52de13c | 2015-10-17 22:21:52 -0700 | [diff] [blame] | 110 | SND_DEVICE_OUT_VOICE_LINE, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 111 | SND_DEVICE_OUT_HDMI, |
| 112 | SND_DEVICE_OUT_SPEAKER_AND_HDMI, |
Shiv Maliyappanahalli | c065640 | 2016-09-03 14:13:26 -0700 | [diff] [blame] | 113 | SND_DEVICE_OUT_DISPLAY_PORT, |
| 114 | SND_DEVICE_OUT_SPEAKER_AND_DISPLAY_PORT, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 115 | SND_DEVICE_OUT_BT_SCO, |
Shiv Maliyappanahalli | 34b585f | 2013-10-01 15:49:05 -0700 | [diff] [blame] | 116 | SND_DEVICE_OUT_BT_SCO_WB, |
Zhou Song | 12c2950 | 2019-03-16 10:37:18 +0800 | [diff] [blame] | 117 | SND_DEVICE_OUT_BT_SCO_SWB, |
Naresh Tanniru | 9d027a6 | 2015-03-13 01:32:10 +0530 | [diff] [blame] | 118 | SND_DEVICE_OUT_BT_A2DP, |
| 119 | SND_DEVICE_OUT_SPEAKER_AND_BT_A2DP, |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 120 | SND_DEVICE_OUT_SPEAKER_SAFE_AND_BT_A2DP, |
| 121 | SND_DEVICE_OUT_VOICE_HANDSET_TMUS, |
kunleiz | be6a844 | 2017-08-08 17:11:35 +0800 | [diff] [blame] | 122 | SND_DEVICE_OUT_SPEAKER_AND_BT_SCO, |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 123 | SND_DEVICE_OUT_SPEAKER_SAFE_AND_BT_SCO, |
kunleiz | be6a844 | 2017-08-08 17:11:35 +0800 | [diff] [blame] | 124 | SND_DEVICE_OUT_SPEAKER_AND_BT_SCO_WB, |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 125 | SND_DEVICE_OUT_SPEAKER_SAFE_AND_BT_SCO_WB, |
Zhou Song | 12c2950 | 2019-03-16 10:37:18 +0800 | [diff] [blame] | 126 | SND_DEVICE_OUT_SPEAKER_AND_BT_SCO_SWB, |
| 127 | SND_DEVICE_OUT_SPEAKER_SAFE_AND_BT_SCO_SWB, |
Sujin Panicker | b904fbe | 2019-04-04 13:28:07 +0530 | [diff] [blame] | 128 | SND_DEVICE_OUT_SPEAKER_WSA_AND_BT_SCO, |
| 129 | SND_DEVICE_OUT_SPEAKER_WSA_AND_BT_SCO_WB, |
Zhou Song | 12c2950 | 2019-03-16 10:37:18 +0800 | [diff] [blame] | 130 | SND_DEVICE_OUT_SPEAKER_WSA_AND_BT_SCO_SWB, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 131 | SND_DEVICE_OUT_VOICE_TTY_FULL_HEADPHONES, |
| 132 | SND_DEVICE_OUT_VOICE_TTY_VCO_HEADPHONES, |
| 133 | SND_DEVICE_OUT_VOICE_TTY_HCO_HANDSET, |
Aniket Kumar Lata | 9188659 | 2017-05-25 16:53:32 -0700 | [diff] [blame] | 134 | SND_DEVICE_OUT_VOICE_TTY_FULL_USB, |
| 135 | SND_DEVICE_OUT_VOICE_TTY_VCO_USB, |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 136 | SND_DEVICE_OUT_VOICE_HAC_HANDSET, |
Ravi Kumar Alamanda | 060bc5a | 2014-09-05 13:51:35 -0700 | [diff] [blame] | 137 | SND_DEVICE_OUT_VOICE_TX, |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 138 | SND_DEVICE_OUT_VOICE_MUSIC_TX, |
| 139 | SND_DEVICE_OUT_VOICE_SPEAKER_HFP, |
Apoorv Raghuvanshi | 5792d4b | 2013-10-07 18:40:05 -0700 | [diff] [blame] | 140 | SND_DEVICE_OUT_AFE_PROXY, |
| 141 | SND_DEVICE_OUT_USB_HEADSET, |
Ashish Jain | 3e37a70 | 2016-11-25 12:27:15 +0530 | [diff] [blame] | 142 | SND_DEVICE_OUT_USB_HEADPHONES, |
Apoorv Raghuvanshi | 5792d4b | 2013-10-07 18:40:05 -0700 | [diff] [blame] | 143 | SND_DEVICE_OUT_SPEAKER_AND_USB_HEADSET, |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 144 | SND_DEVICE_OUT_SPEAKER_SAFE_AND_USB_HEADSET, |
Aniket Kumar Lata | 3e2e123 | 2017-06-16 17:25:07 -0700 | [diff] [blame] | 145 | SND_DEVICE_OUT_VOICE_USB_HEADPHONES, |
| 146 | SND_DEVICE_OUT_VOICE_USB_HEADSET, |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 147 | SND_DEVICE_OUT_USB_HEADSET_SPEC, |
Apoorv Raghuvanshi | 6e26284 | 2013-10-06 14:39:35 -0700 | [diff] [blame] | 148 | SND_DEVICE_OUT_TRANSMISSION_FM, |
Apoorv Raghuvanshi | 9eaf94e | 2013-10-04 16:13:44 -0700 | [diff] [blame] | 149 | SND_DEVICE_OUT_ANC_HEADSET, |
| 150 | SND_DEVICE_OUT_ANC_FB_HEADSET, |
| 151 | SND_DEVICE_OUT_VOICE_ANC_HEADSET, |
| 152 | SND_DEVICE_OUT_VOICE_ANC_FB_HEADSET, |
| 153 | SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET, |
Meng Wang | 841d6c0 | 2017-01-24 12:34:36 +0800 | [diff] [blame] | 154 | SND_DEVICE_OUT_SPEAKER_AND_ANC_FB_HEADSET, |
Apoorv Raghuvanshi | 9eaf94e | 2013-10-04 16:13:44 -0700 | [diff] [blame] | 155 | SND_DEVICE_OUT_ANC_HANDSET, |
Gopikrishnaiah Anandan | f538cef | 2013-10-28 14:06:03 -0700 | [diff] [blame] | 156 | SND_DEVICE_OUT_SPEAKER_PROTECTED, |
Anish Kumar | 46c7b87 | 2014-09-09 01:49:44 -0700 | [diff] [blame] | 157 | SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED, |
Rohit kumar | f412040 | 2016-08-05 19:19:48 +0530 | [diff] [blame] | 158 | SND_DEVICE_OUT_VOICE_SPEAKER_2_PROTECTED, |
Vikram Panduranga | 8c68e86 | 2018-04-27 12:59:42 -0700 | [diff] [blame] | 159 | SND_DEVICE_OUT_VOICE_SPEAKER_STEREO_PROTECTED, |
Banajit Goswami | 20cdd21 | 2015-09-11 01:11:30 -0700 | [diff] [blame] | 160 | SND_DEVICE_OUT_SPEAKER_PROTECTED_VBAT, |
| 161 | SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED_VBAT, |
Rohit kumar | f412040 | 2016-08-05 19:19:48 +0530 | [diff] [blame] | 162 | SND_DEVICE_OUT_VOICE_SPEAKER_2_PROTECTED_VBAT, |
Preetam Singh Ranawat | 61716b1 | 2015-12-14 11:55:24 +0530 | [diff] [blame] | 163 | SND_DEVICE_OUT_SPEAKER_WSA, |
| 164 | SND_DEVICE_OUT_VOICE_SPEAKER_WSA, |
Rohit kumar | f412040 | 2016-08-05 19:19:48 +0530 | [diff] [blame] | 165 | SND_DEVICE_OUT_VOICE_SPEAKER_2_WSA, |
Srinivas Julakanti | 1ca769a | 2017-01-04 23:18:08 -0800 | [diff] [blame] | 166 | SND_DEVICE_OUT_SPEAKER_PROTECTED_RAS, |
| 167 | SND_DEVICE_OUT_SPEAKER_PROTECTED_VBAT_RAS, |
Sujin Panicker | b904fbe | 2019-04-04 13:28:07 +0530 | [diff] [blame] | 168 | SND_DEVICE_OUT_VOIP_HANDSET, |
| 169 | SND_DEVICE_OUT_VOIP_SPEAKER, |
| 170 | SND_DEVICE_OUT_VOIP_HEADPHONES, |
Preetam Singh Ranawat | 9113216 | 2017-03-13 20:32:03 +0530 | [diff] [blame] | 171 | SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_HEADPHONES, |
| 172 | SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_ANC_HEADSET, |
| 173 | SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_ANC_FB_HEADSET, |
Vikram Panduranga | 8c68e86 | 2018-04-27 12:59:42 -0700 | [diff] [blame] | 174 | SND_DEVICE_OUT_VOICE_SPEAKER_STEREO_AND_VOICE_HEADPHONES, |
| 175 | SND_DEVICE_OUT_VOICE_SPEAKER_STEREO_AND_VOICE_ANC_HEADSET, |
| 176 | SND_DEVICE_OUT_VOICE_SPEAKER_STEREO_AND_VOICE_ANC_FB_HEADSET, |
juyuchen | 2d41599 | 2018-11-16 14:15:16 +0800 | [diff] [blame] | 177 | SND_DEVICE_OUT_VOICE_HEARING_AID, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 178 | SND_DEVICE_OUT_END, |
| 179 | |
| 180 | /* |
| 181 | * Note: IN_BEGIN should be same as OUT_END because total number of devices |
| 182 | * SND_DEVICES_MAX should not exceed MAX_RX + MAX_TX devices. |
| 183 | */ |
| 184 | /* Capture devices */ |
| 185 | SND_DEVICE_IN_BEGIN = SND_DEVICE_OUT_END, |
| 186 | SND_DEVICE_IN_HANDSET_MIC = SND_DEVICE_IN_BEGIN, |
Vignesh Kulothungan | df9ed3c | 2019-01-23 17:44:01 -0800 | [diff] [blame] | 187 | SND_DEVICE_IN_HANDSET_MIC_SB, |
Tanya Finkel | 0013005 | 2014-07-14 04:26:56 -0700 | [diff] [blame] | 188 | SND_DEVICE_IN_HANDSET_MIC_EXTERNAL, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 189 | SND_DEVICE_IN_HANDSET_MIC_AEC, |
Vignesh Kulothungan | df9ed3c | 2019-01-23 17:44:01 -0800 | [diff] [blame] | 190 | SND_DEVICE_IN_HANDSET_MIC_AEC_SB, |
Ravi Kumar Alamanda | 198185e | 2013-11-07 15:42:19 -0800 | [diff] [blame] | 191 | SND_DEVICE_IN_HANDSET_MIC_NS, |
Vignesh Kulothungan | df9ed3c | 2019-01-23 17:44:01 -0800 | [diff] [blame] | 192 | SND_DEVICE_IN_HANDSET_MIC_NS_SB, |
Ravi Kumar Alamanda | 198185e | 2013-11-07 15:42:19 -0800 | [diff] [blame] | 193 | SND_DEVICE_IN_HANDSET_MIC_AEC_NS, |
Vignesh Kulothungan | df9ed3c | 2019-01-23 17:44:01 -0800 | [diff] [blame] | 194 | SND_DEVICE_IN_HANDSET_MIC_AEC_NS_SB, |
Ravi Kumar Alamanda | 198185e | 2013-11-07 15:42:19 -0800 | [diff] [blame] | 195 | SND_DEVICE_IN_HANDSET_DMIC, |
Ravi Kumar Alamanda | b034ddb | 2013-11-06 15:52:18 -0800 | [diff] [blame] | 196 | SND_DEVICE_IN_HANDSET_DMIC_AEC, |
Vignesh Kulothungan | df9ed3c | 2019-01-23 17:44:01 -0800 | [diff] [blame] | 197 | SND_DEVICE_IN_HANDSET_DMIC_AEC_SB, |
Ravi Kumar Alamanda | 198185e | 2013-11-07 15:42:19 -0800 | [diff] [blame] | 198 | SND_DEVICE_IN_HANDSET_DMIC_NS, |
Vignesh Kulothungan | df9ed3c | 2019-01-23 17:44:01 -0800 | [diff] [blame] | 199 | SND_DEVICE_IN_HANDSET_DMIC_NS_SB, |
Ravi Kumar Alamanda | 198185e | 2013-11-07 15:42:19 -0800 | [diff] [blame] | 200 | SND_DEVICE_IN_HANDSET_DMIC_AEC_NS, |
Vignesh Kulothungan | df9ed3c | 2019-01-23 17:44:01 -0800 | [diff] [blame] | 201 | SND_DEVICE_IN_HANDSET_DMIC_AEC_NS_SB, |
Ravi Kumar Alamanda | 198185e | 2013-11-07 15:42:19 -0800 | [diff] [blame] | 202 | SND_DEVICE_IN_SPEAKER_MIC, |
Vignesh Kulothungan | df9ed3c | 2019-01-23 17:44:01 -0800 | [diff] [blame] | 203 | SND_DEVICE_IN_SPEAKER_MIC_SB, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 204 | SND_DEVICE_IN_SPEAKER_MIC_AEC, |
Vignesh Kulothungan | df9ed3c | 2019-01-23 17:44:01 -0800 | [diff] [blame] | 205 | SND_DEVICE_IN_SPEAKER_MIC_AEC_SB, |
Ravi Kumar Alamanda | 198185e | 2013-11-07 15:42:19 -0800 | [diff] [blame] | 206 | SND_DEVICE_IN_SPEAKER_MIC_NS, |
Vignesh Kulothungan | df9ed3c | 2019-01-23 17:44:01 -0800 | [diff] [blame] | 207 | SND_DEVICE_IN_SPEAKER_MIC_NS_SB, |
Ravi Kumar Alamanda | 198185e | 2013-11-07 15:42:19 -0800 | [diff] [blame] | 208 | SND_DEVICE_IN_SPEAKER_MIC_AEC_NS, |
Vignesh Kulothungan | df9ed3c | 2019-01-23 17:44:01 -0800 | [diff] [blame] | 209 | SND_DEVICE_IN_SPEAKER_MIC_AEC_NS_SB, |
Ravi Kumar Alamanda | 198185e | 2013-11-07 15:42:19 -0800 | [diff] [blame] | 210 | SND_DEVICE_IN_SPEAKER_DMIC, |
Ravi Kumar Alamanda | b034ddb | 2013-11-06 15:52:18 -0800 | [diff] [blame] | 211 | SND_DEVICE_IN_SPEAKER_DMIC_AEC, |
Vignesh Kulothungan | df9ed3c | 2019-01-23 17:44:01 -0800 | [diff] [blame] | 212 | SND_DEVICE_IN_SPEAKER_DMIC_AEC_SB, |
Ravi Kumar Alamanda | 198185e | 2013-11-07 15:42:19 -0800 | [diff] [blame] | 213 | SND_DEVICE_IN_SPEAKER_DMIC_NS, |
Vignesh Kulothungan | df9ed3c | 2019-01-23 17:44:01 -0800 | [diff] [blame] | 214 | SND_DEVICE_IN_SPEAKER_DMIC_NS_SB, |
Ravi Kumar Alamanda | 198185e | 2013-11-07 15:42:19 -0800 | [diff] [blame] | 215 | SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS, |
Vignesh Kulothungan | df9ed3c | 2019-01-23 17:44:01 -0800 | [diff] [blame] | 216 | SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS_SB, |
Ravi Kumar Alamanda | 198185e | 2013-11-07 15:42:19 -0800 | [diff] [blame] | 217 | SND_DEVICE_IN_HEADSET_MIC, |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 218 | SND_DEVICE_IN_HEADSET_MIC_AEC, |
Ravi Kumar Alamanda | 198185e | 2013-11-07 15:42:19 -0800 | [diff] [blame] | 219 | SND_DEVICE_IN_HEADSET_MIC_FLUENCE, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 220 | SND_DEVICE_IN_VOICE_SPEAKER_MIC, |
Vignesh Kulothungan | df9ed3c | 2019-01-23 17:44:01 -0800 | [diff] [blame] | 221 | SND_DEVICE_IN_VOICE_SPEAKER_MIC_SB, |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 222 | SND_DEVICE_IN_VOICE_SPEAKER_MIC_HFP, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 223 | SND_DEVICE_IN_VOICE_HEADSET_MIC, |
Ralf Herz | afb164f | 2018-07-03 07:08:07 +0200 | [diff] [blame] | 224 | SND_DEVICE_IN_SPDIF, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 225 | SND_DEVICE_IN_HDMI_MIC, |
Ralf Herz | afb164f | 2018-07-03 07:08:07 +0200 | [diff] [blame] | 226 | SND_DEVICE_IN_HDMI_ARC, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 227 | SND_DEVICE_IN_BT_SCO_MIC, |
Vicky Sehrawat | e240e5d | 2014-08-12 17:17:04 -0700 | [diff] [blame] | 228 | SND_DEVICE_IN_BT_SCO_MIC_NREC, |
Shiv Maliyappanahalli | 34b585f | 2013-10-01 15:49:05 -0700 | [diff] [blame] | 229 | SND_DEVICE_IN_BT_SCO_MIC_WB, |
Vicky Sehrawat | e240e5d | 2014-08-12 17:17:04 -0700 | [diff] [blame] | 230 | SND_DEVICE_IN_BT_SCO_MIC_WB_NREC, |
Zhou Song | 12c2950 | 2019-03-16 10:37:18 +0800 | [diff] [blame] | 231 | SND_DEVICE_IN_BT_SCO_MIC_SWB, |
| 232 | SND_DEVICE_IN_BT_SCO_MIC_SWB_NREC, |
Florian Pfister | 1a84f31 | 2018-07-19 14:38:18 +0200 | [diff] [blame] | 233 | SND_DEVICE_IN_BT_A2DP, |
Eric Laurent | 4b08413 | 2018-10-19 17:33:43 -0700 | [diff] [blame] | 234 | SND_DEVICE_IN_CAMCORDER_LANDSCAPE, |
Mingming Yin | 8e5a4f6 | 2013-10-07 15:23:41 -0700 | [diff] [blame] | 235 | SND_DEVICE_IN_VOICE_DMIC, |
Vignesh Kulothungan | df9ed3c | 2019-01-23 17:44:01 -0800 | [diff] [blame] | 236 | SND_DEVICE_IN_VOICE_DMIC_SB, |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 237 | SND_DEVICE_IN_VOICE_DMIC_TMUS, |
Mingming Yin | 8e5a4f6 | 2013-10-07 15:23:41 -0700 | [diff] [blame] | 238 | SND_DEVICE_IN_VOICE_SPEAKER_DMIC, |
Vignesh Kulothungan | df9ed3c | 2019-01-23 17:44:01 -0800 | [diff] [blame] | 239 | SND_DEVICE_IN_VOICE_SPEAKER_DMIC_SB, |
Vikram Panduranga | f0ca0b1 | 2018-05-04 16:00:07 -0700 | [diff] [blame] | 240 | SND_DEVICE_IN_VOICE_SPEAKER_TMIC, |
Mingming Yin | 8e5a4f6 | 2013-10-07 15:23:41 -0700 | [diff] [blame] | 241 | SND_DEVICE_IN_VOICE_SPEAKER_QMIC, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 242 | SND_DEVICE_IN_VOICE_TTY_FULL_HEADSET_MIC, |
| 243 | SND_DEVICE_IN_VOICE_TTY_VCO_HANDSET_MIC, |
| 244 | SND_DEVICE_IN_VOICE_TTY_HCO_HEADSET_MIC, |
Aniket Kumar Lata | 9188659 | 2017-05-25 16:53:32 -0700 | [diff] [blame] | 245 | SND_DEVICE_IN_VOICE_TTY_FULL_USB_MIC, |
| 246 | SND_DEVICE_IN_VOICE_TTY_HCO_USB_MIC, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 247 | SND_DEVICE_IN_VOICE_REC_MIC, |
Ravi Kumar Alamanda | 198185e | 2013-11-07 15:42:19 -0800 | [diff] [blame] | 248 | SND_DEVICE_IN_VOICE_REC_MIC_NS, |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 249 | SND_DEVICE_IN_VOICE_REC_MIC_AEC, |
| 250 | SND_DEVICE_IN_VOICE_REC_MIC_AEC_NS, |
Ravi Kumar Alamanda | b034ddb | 2013-11-06 15:52:18 -0800 | [diff] [blame] | 251 | SND_DEVICE_IN_VOICE_REC_DMIC_STEREO, |
Mingming Yin | 8e5a4f6 | 2013-10-07 15:23:41 -0700 | [diff] [blame] | 252 | SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE, |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 253 | SND_DEVICE_IN_VOICE_REC_HEADSET_MIC, |
Ravi Kumar Alamanda | 060bc5a | 2014-09-05 13:51:35 -0700 | [diff] [blame] | 254 | SND_DEVICE_IN_VOICE_RX, |
Apoorv Raghuvanshi | 5792d4b | 2013-10-07 18:40:05 -0700 | [diff] [blame] | 255 | SND_DEVICE_IN_USB_HEADSET_MIC, |
Aniket Kumar Lata | 3e2e123 | 2017-06-16 17:25:07 -0700 | [diff] [blame] | 256 | SND_DEVICE_IN_USB_HEADSET_MIC_AEC, |
| 257 | SND_DEVICE_IN_VOICE_USB_HEADSET_MIC, |
| 258 | SND_DEVICE_IN_UNPROCESSED_USB_HEADSET_MIC, |
| 259 | SND_DEVICE_IN_VOICE_RECOG_USB_HEADSET_MIC, |
Karthikeyan Mani | 07faa60 | 2018-08-20 11:01:32 -0700 | [diff] [blame] | 260 | SND_DEVICE_IN_USB_HEADSET_MULTI_CHANNEL_MIC, |
| 261 | SND_DEVICE_IN_USB_HEADSET_MULTI_CHANNEL_MIC_AEC, |
| 262 | SND_DEVICE_IN_UNPROCESSED_USB_HEADSET_MULTI_CHANNEL_MIC, |
| 263 | SND_DEVICE_IN_VOICE_RECOG_USB_HEADSET_MULTI_CHANNEL_MIC, |
Apoorv Raghuvanshi | 6e26284 | 2013-10-06 14:39:35 -0700 | [diff] [blame] | 264 | SND_DEVICE_IN_CAPTURE_FM, |
Apoorv Raghuvanshi | 9eaf94e | 2013-10-04 16:13:44 -0700 | [diff] [blame] | 265 | SND_DEVICE_IN_AANC_HANDSET_MIC, |
Apoorv Raghuvanshi | 6178a3f | 2013-10-19 12:38:54 -0700 | [diff] [blame] | 266 | SND_DEVICE_IN_QUAD_MIC, |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 267 | SND_DEVICE_IN_HANDSET_DMIC_STEREO, |
| 268 | SND_DEVICE_IN_SPEAKER_DMIC_STEREO, |
Gopikrishnaiah Anandan | f538cef | 2013-10-28 14:06:03 -0700 | [diff] [blame] | 269 | SND_DEVICE_IN_CAPTURE_VI_FEEDBACK, |
Rohit kumar | f412040 | 2016-08-05 19:19:48 +0530 | [diff] [blame] | 270 | SND_DEVICE_IN_CAPTURE_VI_FEEDBACK_MONO_1, |
| 271 | SND_DEVICE_IN_CAPTURE_VI_FEEDBACK_MONO_2, |
Narsinga Rao Chella | 61e0f9b | 2014-03-06 21:25:22 -0800 | [diff] [blame] | 272 | SND_DEVICE_IN_VOICE_SPEAKER_DMIC_BROADSIDE, |
| 273 | SND_DEVICE_IN_SPEAKER_DMIC_BROADSIDE, |
| 274 | SND_DEVICE_IN_SPEAKER_DMIC_AEC_BROADSIDE, |
| 275 | SND_DEVICE_IN_SPEAKER_DMIC_NS_BROADSIDE, |
| 276 | SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS_BROADSIDE, |
Shiv Maliyappanahalli | dd28726 | 2016-01-08 15:57:07 -0800 | [diff] [blame] | 277 | SND_DEVICE_IN_VOICE_FLUENCE_DMIC_AANC, |
Narsinga Rao Chella | 975572e | 2014-10-21 11:49:00 -0700 | [diff] [blame] | 278 | SND_DEVICE_IN_HANDSET_QMIC, |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 279 | SND_DEVICE_IN_HANDSET_QMIC_AEC, |
Narsinga Rao Chella | 975572e | 2014-10-21 11:49:00 -0700 | [diff] [blame] | 280 | SND_DEVICE_IN_SPEAKER_QMIC_AEC, |
| 281 | SND_DEVICE_IN_SPEAKER_QMIC_NS, |
| 282 | SND_DEVICE_IN_SPEAKER_QMIC_AEC_NS, |
Ben Romberger | 182c825 | 2016-07-18 16:54:54 -0700 | [diff] [blame] | 283 | SND_DEVICE_IN_VOICE_REC_QMIC_FLUENCE, |
Shiv Maliyappanahalli | 5a10aea | 2015-07-02 10:36:23 -0700 | [diff] [blame] | 284 | SND_DEVICE_IN_THREE_MIC, |
Aditya Bavanari | 4051c8d | 2017-12-13 13:31:26 +0530 | [diff] [blame] | 285 | SND_DEVICE_IN_HANDSET_TMIC_FLUENCE_PRO, |
Chaithanya Krishna Bacharaju | 9955b16 | 2016-05-25 16:25:53 +0530 | [diff] [blame] | 286 | SND_DEVICE_IN_HANDSET_TMIC, |
Aditya Bavanari | 4051c8d | 2017-12-13 13:31:26 +0530 | [diff] [blame] | 287 | SND_DEVICE_IN_HANDSET_TMIC_AEC, |
| 288 | SND_DEVICE_IN_HANDSET_TMIC_NS, |
| 289 | SND_DEVICE_IN_HANDSET_TMIC_AEC_NS, |
Vikram Panduranga | f0ca0b1 | 2018-05-04 16:00:07 -0700 | [diff] [blame] | 290 | SND_DEVICE_IN_SPEAKER_TMIC_AEC, |
| 291 | SND_DEVICE_IN_SPEAKER_TMIC_NS, |
| 292 | SND_DEVICE_IN_SPEAKER_TMIC_AEC_NS, |
Ben Romberger | a4d76db | 2016-10-13 15:26:02 -0700 | [diff] [blame] | 293 | SND_DEVICE_IN_VOICE_REC_TMIC, |
Chaithanya Krishna Bacharaju | 24f86f3 | 2016-05-26 16:34:53 +0530 | [diff] [blame] | 294 | SND_DEVICE_IN_UNPROCESSED_MIC, |
| 295 | SND_DEVICE_IN_UNPROCESSED_STEREO_MIC, |
| 296 | SND_DEVICE_IN_UNPROCESSED_THREE_MIC, |
| 297 | SND_DEVICE_IN_UNPROCESSED_QUAD_MIC, |
| 298 | SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC, |
Garmond Leung | e2433c3 | 2017-09-28 21:51:22 -0700 | [diff] [blame] | 299 | SND_DEVICE_IN_HANDSET_6MIC, |
| 300 | SND_DEVICE_IN_HANDSET_8MIC, |
| 301 | SND_DEVICE_IN_EC_REF_LOOPBACK_MONO, |
| 302 | SND_DEVICE_IN_EC_REF_LOOPBACK_STEREO, |
Dhananjay Kumar | 704ce6f | 2017-09-28 22:08:00 +0530 | [diff] [blame] | 303 | SND_DEVICE_IN_HANDSET_GENERIC_QMIC, |
Divya Narayanan Poojary | 85d0a59 | 2018-02-06 14:25:16 +0530 | [diff] [blame] | 304 | SND_DEVICE_IN_INCALL_REC_RX, |
| 305 | SND_DEVICE_IN_INCALL_REC_TX, |
| 306 | SND_DEVICE_IN_INCALL_REC_RX_TX, |
Ramu Gottipati | 813ae98 | 2018-07-25 14:14:48 +0530 | [diff] [blame] | 307 | SND_DEVICE_IN_LINE, |
Eric Laurent | 4b08413 | 2018-10-19 17:33:43 -0700 | [diff] [blame] | 308 | SND_DEVICE_IN_CAMCORDER_INVERT_LANDSCAPE, |
| 309 | SND_DEVICE_IN_CAMCORDER_PORTRAIT, |
| 310 | SND_DEVICE_IN_CAMCORDER_SELFIE_LANDSCAPE, |
| 311 | SND_DEVICE_IN_CAMCORDER_SELFIE_INVERT_LANDSCAPE, |
| 312 | SND_DEVICE_IN_CAMCORDER_SELFIE_PORTRAIT, |
juyuchen | 2d41599 | 2018-11-16 14:15:16 +0800 | [diff] [blame] | 313 | SND_DEVICE_IN_VOICE_HEARING_AID, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 314 | SND_DEVICE_IN_END, |
| 315 | |
| 316 | SND_DEVICE_MAX = SND_DEVICE_IN_END, |
Eric Laurent | 4b08413 | 2018-10-19 17:33:43 -0700 | [diff] [blame] | 317 | /* For legacy xml file parsing */ |
| 318 | SND_DEVICE_IN_CAMCORDER_MIC = SND_DEVICE_IN_CAMCORDER_LANDSCAPE, |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 319 | }; |
Preetam Singh Ranawat | cb6212e | 2016-07-19 18:33:53 +0530 | [diff] [blame] | 320 | #define INPUT_SAMPLING_RATE_DSD64 2822400 |
| 321 | #define INPUT_SAMPLING_RATE_DSD128 5644800 |
Apoorv Raghuvanshi | f59bb22 | 2015-02-18 12:23:23 -0800 | [diff] [blame] | 322 | #define DEFAULT_OUTPUT_SAMPLING_RATE 48000 |
| 323 | #define OUTPUT_SAMPLING_RATE_44100 44100 |
Preetam Singh Ranawat | cb6212e | 2016-07-19 18:33:53 +0530 | [diff] [blame] | 324 | #define OUTPUT_SAMPLING_RATE_DSD64 176400 |
| 325 | #define OUTPUT_SAMPLING_RATE_DSD128 352800 |
Apoorv Raghuvanshi | 2149216 | 2015-02-19 18:19:36 -0800 | [diff] [blame] | 326 | enum { |
| 327 | DEFAULT_CODEC_BACKEND, |
Sidipotu Ashok | 9f0b16e | 2016-04-28 13:48:28 +0530 | [diff] [blame] | 328 | SLIMBUS_0_RX = DEFAULT_CODEC_BACKEND, |
Preetam Singh Ranawat | cb6212e | 2016-07-19 18:33:53 +0530 | [diff] [blame] | 329 | DSD_NATIVE_BACKEND, |
| 330 | SLIMBUS_2_RX = DSD_NATIVE_BACKEND, |
Apoorv Raghuvanshi | 2149216 | 2015-02-19 18:19:36 -0800 | [diff] [blame] | 331 | HEADPHONE_44_1_BACKEND, |
Sidipotu Ashok | 9f0b16e | 2016-04-28 13:48:28 +0530 | [diff] [blame] | 332 | SLIMBUS_5_RX = HEADPHONE_44_1_BACKEND, |
| 333 | HEADPHONE_BACKEND, |
| 334 | SLIMBUS_6_RX = HEADPHONE_BACKEND, |
| 335 | HDMI_RX_BACKEND, |
Shiv Maliyappanahalli | c065640 | 2016-09-03 14:13:26 -0700 | [diff] [blame] | 336 | DISP_PORT_RX_BACKEND, |
Kuirong Wang | a9f7cee | 2016-03-07 11:21:52 -0800 | [diff] [blame] | 337 | USB_AUDIO_RX_BACKEND, |
Kuirong Wang | 0b947f7 | 2016-09-29 11:03:09 -0700 | [diff] [blame] | 338 | MAX_RX_CODEC_BACKENDS = USB_AUDIO_RX_BACKEND, |
| 339 | /* TX BE follows RX BE */ |
| 340 | SLIMBUS_0_TX, |
| 341 | DEFAULT_CODEC_TX_BACKEND = SLIMBUS_0_TX, |
Kuirong Wang | e989416 | 2016-08-26 15:16:39 -0700 | [diff] [blame] | 342 | USB_AUDIO_TX_BACKEND, |
Dhanalakshmi Siddani | b678a80 | 2016-12-03 11:51:41 +0530 | [diff] [blame] | 343 | BT_SCO_TX_BACKEND, |
Ralf Herz | afb164f | 2018-07-03 07:08:07 +0200 | [diff] [blame] | 344 | SPDIF_TX_BACKEND, |
Siddartha Shaik | 44dd770 | 2017-06-14 12:13:25 +0530 | [diff] [blame] | 345 | HDMI_TX_BACKEND, |
Ralf Herz | afb164f | 2018-07-03 07:08:07 +0200 | [diff] [blame] | 346 | HDMI_ARC_TX_BACKEND, |
Samyak Jain | b3f3ca5 | 2019-01-02 18:24:35 +0530 | [diff] [blame] | 347 | HEADSET_TX_BACKEND, |
Kuirong Wang | 0b947f7 | 2016-09-29 11:03:09 -0700 | [diff] [blame] | 348 | MAX_CODEC_BACKENDS |
Kuirong Wang | e989416 | 2016-08-26 15:16:39 -0700 | [diff] [blame] | 349 | }; |
| 350 | |
Apoorv Raghuvanshi | 2149216 | 2015-02-19 18:19:36 -0800 | [diff] [blame] | 351 | #define AUDIO_PARAMETER_KEY_NATIVE_AUDIO "audio.nat.codec.enabled" |
Sidipotu Ashok | e6f78cb | 2015-11-05 14:42:20 +0530 | [diff] [blame] | 352 | #define AUDIO_PARAMETER_KEY_NATIVE_AUDIO_MODE "native_audio_mode" |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 353 | |
Ashish Jain | f1eaa58 | 2016-05-23 20:54:24 +0530 | [diff] [blame] | 354 | #define AUDIO_PARAMETER_KEY_TRUE_32_BIT "true_32_bit" |
| 355 | |
Dieter Luecking | 5d57def | 2018-09-07 14:23:37 +0200 | [diff] [blame] | 356 | #define AUDIO_MAX_DSP_CHANNELS 32 |
| 357 | |
Shiv Maliyappanahalli | 34b585f | 2013-10-01 15:49:05 -0700 | [diff] [blame] | 358 | #define ALL_SESSION_VSID 0xFFFFFFFF |
Vidyakumar Athota | c37f42a | 2014-03-11 11:57:48 -0700 | [diff] [blame] | 359 | #define DEFAULT_MUTE_RAMP_DURATION_MS 20 |
sangwoo | 53b2cf0 | 2013-07-25 19:18:44 -0700 | [diff] [blame] | 360 | #define DEFAULT_VOLUME_RAMP_DURATION_MS 20 |
Apoorv Raghuvanshi | 6e26284 | 2013-10-06 14:39:35 -0700 | [diff] [blame] | 361 | #define MIXER_PATH_MAX_LENGTH 100 |
Sidipotu Ashok | e6f78cb | 2015-11-05 14:42:20 +0530 | [diff] [blame] | 362 | #define CODEC_VERSION_MAX_LENGTH 100 |
sangwoo | 53b2cf0 | 2013-07-25 19:18:44 -0700 | [diff] [blame] | 363 | |
Narsinga Rao Chella | 05573b7 | 2013-11-15 15:21:40 -0800 | [diff] [blame] | 364 | #define MAX_VOL_INDEX 5 |
| 365 | #define MIN_VOL_INDEX 0 |
| 366 | #define percent_to_index(val, min, max) \ |
| 367 | ((val) * ((max) - (min)) * 0.01 + (min) + .5) |
| 368 | |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 369 | /* |
| 370 | * tinyAlsa library interprets period size as number of frames |
| 371 | * one frame = channel_count * sizeof (pcm sample) |
| 372 | * so if format = 16-bit PCM and channels = Stereo, frame size = 2 ch * 2 = 4 bytes |
| 373 | * DEEP_BUFFER_OUTPUT_PERIOD_SIZE = 1024 means 1024 * 4 = 4096 bytes |
| 374 | * We should take care of returning proper size when AudioFlinger queries for |
| 375 | * the buffer size of an input/output stream |
| 376 | */ |
Ashish Jain | 058165c | 2016-09-28 23:18:48 +0530 | [diff] [blame] | 377 | |
| 378 | /* for 384Khz output below period size corresponds to 20ms worth duration of buffer, |
| 379 | * current implementation can support buffer size of 40ms duration |
| 380 | * for 32b/384Khz/stereo output. |
| 381 | */ |
Alexy Joseph | 029faa2 | 2015-06-18 14:22:14 -0700 | [diff] [blame] | 382 | #define DEEP_BUFFER_OUTPUT_PERIOD_SIZE 1920 |
Ashish Jain | 058165c | 2016-09-28 23:18:48 +0530 | [diff] [blame] | 383 | #define DEEP_BUFFER_OUTPUT_PERIOD_DURATION 40 /* 40 milisecs */ |
| 384 | |
Alexy Joseph | 029faa2 | 2015-06-18 14:22:14 -0700 | [diff] [blame] | 385 | #define DEEP_BUFFER_OUTPUT_PERIOD_COUNT 2 |
Ravi Kumar Alamanda | 33d3306 | 2013-06-11 14:40:01 -0700 | [diff] [blame] | 386 | #define LOW_LATENCY_OUTPUT_PERIOD_SIZE 240 |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 387 | #define LOW_LATENCY_OUTPUT_PERIOD_COUNT 2 |
| 388 | |
| 389 | #define HDMI_MULTI_PERIOD_SIZE 336 |
| 390 | #define HDMI_MULTI_PERIOD_COUNT 8 |
| 391 | #define HDMI_MULTI_DEFAULT_CHANNEL_COUNT 6 |
| 392 | #define HDMI_MULTI_PERIOD_BYTES (HDMI_MULTI_PERIOD_SIZE * HDMI_MULTI_DEFAULT_CHANNEL_COUNT * 2) |
| 393 | |
Haynes Mathew George | 484e8d2 | 2017-07-31 18:55:17 -0700 | [diff] [blame] | 394 | #define HIFI_BUFFER_OUTPUT_PERIOD_SIZE 1920 |
| 395 | #define HIFI_BUFFER_OUTPUT_PERIOD_DURATION 40 /* 40 milisecs */ |
| 396 | #define HIFI_BUFFER_OUTPUT_PERIOD_COUNT 2 |
Ashish Jain | f1eaa58 | 2016-05-23 20:54:24 +0530 | [diff] [blame] | 397 | |
| 398 | /* Used in calculating fragment size for pcm offload */ |
Sujin Panicker | b904fbe | 2019-04-04 13:28:07 +0530 | [diff] [blame] | 399 | #ifdef PLATFORM_MSMFALCON |
| 400 | #define PCM_OFFLOAD_BUFFER_DURATION 40 /* 40 millisecs */ |
| 401 | #else |
Aniket Kumar Lata | f0531e0 | 2017-09-07 15:14:46 -0700 | [diff] [blame] | 402 | #define PCM_OFFLOAD_BUFFER_DURATION 80 /* 80 millisecs */ |
Sujin Panicker | b904fbe | 2019-04-04 13:28:07 +0530 | [diff] [blame] | 403 | #endif |
Ashish Jain | f1eaa58 | 2016-05-23 20:54:24 +0530 | [diff] [blame] | 404 | |
| 405 | /* MAX PCM fragment size cannot be increased further due |
| 406 | * to flinger's cblk size of 1mb,and it has to be a multiple of |
| 407 | * 24 - lcm of channels supported by DSP |
| 408 | */ |
| 409 | #define MAX_PCM_OFFLOAD_FRAGMENT_SIZE (240 * 1024) |
| 410 | #define MIN_PCM_OFFLOAD_FRAGMENT_SIZE 512 |
| 411 | |
Ravi Kumar Alamanda | 33d3306 | 2013-06-11 14:40:01 -0700 | [diff] [blame] | 412 | #define AUDIO_CAPTURE_PERIOD_DURATION_MSEC 20 |
| 413 | #define AUDIO_CAPTURE_PERIOD_COUNT 2 |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 414 | |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 415 | #define VOIP_CAPTURE_PERIOD_DURATION_MSEC 20 |
| 416 | #define VOIP_CAPTURE_PERIOD_COUNT 2 |
| 417 | |
| 418 | #define VOIP_PLAYBACK_PERIOD_DURATION_MSEC 20 |
| 419 | #define VOIP_PLAYBACK_PERIOD_COUNT 2 |
| 420 | |
Ravi Kumar Alamanda | dc9bb15 | 2014-09-08 15:59:58 -0700 | [diff] [blame] | 421 | #define LOW_LATENCY_CAPTURE_SAMPLE_RATE 48000 |
| 422 | #define LOW_LATENCY_CAPTURE_PERIOD_SIZE 240 |
| 423 | #define LOW_LATENCY_CAPTURE_USE_CASE 1 |
| 424 | |
Vidyakumar Athota | d9d9ff3 | 2013-11-13 11:46:52 -0800 | [diff] [blame] | 425 | #define DEVICE_NAME_MAX_SIZE 128 |
| 426 | #define HW_INFO_ARRAY_MAX_SIZE 32 |
| 427 | |
Mingming Yin | 8e5a4f6 | 2013-10-07 15:23:41 -0700 | [diff] [blame] | 428 | #define DEEP_BUFFER_PCM_DEVICE 0 |
Shiv Maliyappanahalli | da10764 | 2013-10-17 11:16:13 -0700 | [diff] [blame] | 429 | #define AUDIO_RECORD_PCM_DEVICE 0 |
Preetam Singh Ranawat | de84f1a | 2013-11-01 14:58:16 -0700 | [diff] [blame] | 430 | #define MULTIMEDIA2_PCM_DEVICE 1 |
Ravi Kumar Alamanda | 474de5a | 2015-06-25 20:08:01 -0700 | [diff] [blame] | 431 | #define MULTIMEDIA3_PCM_DEVICE 4 |
Shiv Maliyappanahalli | c065640 | 2016-09-03 14:13:26 -0700 | [diff] [blame] | 432 | #define MULTIMEDIA9_PCM_DEVICE 32 |
Apoorv Raghuvanshi | 6e26284 | 2013-10-06 14:39:35 -0700 | [diff] [blame] | 433 | #define FM_PLAYBACK_PCM_DEVICE 5 |
| 434 | #define FM_CAPTURE_PCM_DEVICE 6 |
Vimal Puthanveed | 5b4d3f1 | 2013-11-05 15:57:39 -0800 | [diff] [blame] | 435 | #define HFP_PCM_RX 5 |
Vimal Puthanveed | 5b4d3f1 | 2013-11-05 15:57:39 -0800 | [diff] [blame] | 436 | |
Shiv Maliyappanahalli | f3b9a42 | 2013-10-22 16:38:08 -0700 | [diff] [blame] | 437 | #define INCALL_MUSIC_UPLINK_PCM_DEVICE 1 |
Avinash Vaish | a3886d2 | 2014-03-14 18:51:53 +0530 | [diff] [blame] | 438 | |
| 439 | #ifdef PLATFORM_MSM8610 |
| 440 | #define INCALL_MUSIC_UPLINK2_PCM_DEVICE 14 |
| 441 | #elif PLATFORM_MSM8x26 |
Shiv Maliyappanahalli | f3b9a42 | 2013-10-22 16:38:08 -0700 | [diff] [blame] | 442 | #define INCALL_MUSIC_UPLINK2_PCM_DEVICE 16 |
Preetam Singh Ranawat | d770a36 | 2017-05-24 19:07:15 +0530 | [diff] [blame] | 443 | #elif PLATFORM_BEAR_FAMILY |
| 444 | #define INCALL_MUSIC_UPLINK2_PCM_DEVICE 16 |
Vidyakumar Athota | 21b3bb9 | 2014-04-25 11:08:08 -0700 | [diff] [blame] | 445 | #elif PLATFORM_APQ8084 |
| 446 | #define INCALL_MUSIC_UPLINK2_PCM_DEVICE 34 |
Avinash Vaish | a3886d2 | 2014-03-14 18:51:53 +0530 | [diff] [blame] | 447 | #else |
Karthik Reddy Katta | d2e89ee | 2014-04-01 20:26:34 +0530 | [diff] [blame] | 448 | #define INCALL_MUSIC_UPLINK2_PCM_DEVICE 35 |
Avinash Vaish | a3886d2 | 2014-03-14 18:51:53 +0530 | [diff] [blame] | 449 | #endif |
| 450 | |
Gopikrishnaiah Anandan | f538cef | 2013-10-28 14:06:03 -0700 | [diff] [blame] | 451 | #define SPKR_PROT_CALIB_RX_PCM_DEVICE 5 |
Phani Kumar Uppalapati | 9da60a2 | 2014-03-19 18:59:39 -0700 | [diff] [blame] | 452 | #ifdef PLATFORM_APQ8084 |
Vidyakumar Athota | 21b3bb9 | 2014-04-25 11:08:08 -0700 | [diff] [blame] | 453 | #define SPKR_PROT_CALIB_TX_PCM_DEVICE 35 |
Sudheer Papothi | d2b182f | 2015-07-09 09:18:52 +0530 | [diff] [blame] | 454 | #elif PLATFORM_MSM8996 |
| 455 | #define SPKR_PROT_CALIB_TX_PCM_DEVICE 42 |
Preetam Singh Ranawat | d770a36 | 2017-05-24 19:07:15 +0530 | [diff] [blame] | 456 | #elif PLATFORM_BEAR_FAMILY |
| 457 | #define SPKR_PROT_CALIB_TX_PCM_DEVICE 26 |
Phani Kumar Uppalapati | 9da60a2 | 2014-03-19 18:59:39 -0700 | [diff] [blame] | 458 | #else |
Gopikrishnaiah Anandan | 29b4fd5 | 2014-01-23 19:31:38 -0800 | [diff] [blame] | 459 | #define SPKR_PROT_CALIB_TX_PCM_DEVICE 25 |
Phani Kumar Uppalapati | 9da60a2 | 2014-03-19 18:59:39 -0700 | [diff] [blame] | 460 | #endif |
Krishnankutty Kolathappilly | a43f96e | 2013-11-01 12:17:53 -0700 | [diff] [blame] | 461 | #define PLAYBACK_OFFLOAD_DEVICE 9 |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 462 | #define QUAT_MI2S_PCM_DEVICE 44 |
Subhash Chandra Bose Naripeddy | 16ff4f8 | 2014-04-01 21:03:10 -0700 | [diff] [blame] | 463 | |
vivek mehta | 446c396 | 2015-09-14 10:57:35 -0700 | [diff] [blame] | 464 | // Direct_PCM |
Meng Wang | ef2f6e1 | 2018-10-08 13:06:05 +0800 | [diff] [blame] | 465 | #if defined (PLATFORM_MSM8994) || defined (PLATFORM_MSM8996) || \ |
| 466 | defined (PLATFORM_APQ8084) || defined (PLATFORM_MSM8998) || \ |
| 467 | defined (PLATFORM_SDM845) || defined (PLATFORM_SDM710) || \ |
| 468 | defined (PLATFORM_QCS605) ||defined (PLATFORM_SDX24) || \ |
| 469 | defined (PLATFORM_MSMNILE) || defined (PLATFORM_KONA) || \ |
Hari Veerubhotla | e56a5fa | 2018-10-14 16:52:10 +0530 | [diff] [blame] | 470 | defined (PLATFORM_MSMSTEPPE) || defined (PLATFORM_QCS405) || \ |
Manisha Agarwal | 888e976 | 2019-02-27 22:18:49 +0530 | [diff] [blame] | 471 | defined (PLATFORM_TRINKET) || defined (PLATFORM_LITO) |
vivek mehta | 446c396 | 2015-09-14 10:57:35 -0700 | [diff] [blame] | 472 | #define PLAYBACK_OFFLOAD_DEVICE2 17 |
Sujin Panicker | b904fbe | 2019-04-04 13:28:07 +0530 | [diff] [blame] | 473 | #elif defined (PLATFORM_MSMFALCON) || defined (PLATFORM_MSM8937) |
| 474 | #define PLAYBACK_OFFLOAD_DEVICE2 24 |
vivek mehta | 446c396 | 2015-09-14 10:57:35 -0700 | [diff] [blame] | 475 | #endif |
| 476 | |
Meng Wang | ef2f6e1 | 2018-10-08 13:06:05 +0800 | [diff] [blame] | 477 | #if defined (PLATFORM_APQ8084) || defined (PLATFORM_MSM8996) || \ |
| 478 | defined (PLATFORM_MSM8998) || defined (PLATFORM_SDM845) || \ |
| 479 | defined (PLATFORM_SDM710) || defined(PLATFORM_QCS605) || \ |
| 480 | defined (PLATFORM_SDX24) || defined (PLATFORM_MSMNILE) || \ |
| 481 | defined (PLATFORM_KONA) || defined (PLATFORM_MSMSTEPPE) || \ |
Manisha Agarwal | 888e976 | 2019-02-27 22:18:49 +0530 | [diff] [blame] | 482 | defined (PLATFORM_QCS405) || defined (PLATFORM_TRINKET) || \ |
Sujin Panicker | b904fbe | 2019-04-04 13:28:07 +0530 | [diff] [blame] | 483 | defined (PLATFORM_LITO) || defined (PLATFORM_MSMFALCON) || \ |
| 484 | defined (PLATFORM_MSM8937) |
Subhash Chandra Bose Naripeddy | 16ff4f8 | 2014-04-01 21:03:10 -0700 | [diff] [blame] | 485 | #define PLAYBACK_OFFLOAD_DEVICE3 18 |
| 486 | #define PLAYBACK_OFFLOAD_DEVICE4 34 |
| 487 | #define PLAYBACK_OFFLOAD_DEVICE5 35 |
| 488 | #define PLAYBACK_OFFLOAD_DEVICE6 36 |
| 489 | #define PLAYBACK_OFFLOAD_DEVICE7 37 |
| 490 | #define PLAYBACK_OFFLOAD_DEVICE8 38 |
| 491 | #define PLAYBACK_OFFLOAD_DEVICE9 39 |
| 492 | #endif |
Vidyakumar Athota | 46025ef | 2015-12-08 10:47:12 -0800 | [diff] [blame] | 493 | #ifdef PLATFORM_MSM8994 |
Subhash Chandra Bose Naripeddy | 1691081 | 2014-05-27 14:01:47 -0700 | [diff] [blame] | 494 | #define PLAYBACK_OFFLOAD_DEVICE3 18 |
| 495 | #define PLAYBACK_OFFLOAD_DEVICE4 37 |
| 496 | #define PLAYBACK_OFFLOAD_DEVICE5 38 |
| 497 | #define PLAYBACK_OFFLOAD_DEVICE6 39 |
| 498 | #define PLAYBACK_OFFLOAD_DEVICE7 40 |
| 499 | #define PLAYBACK_OFFLOAD_DEVICE8 41 |
| 500 | #define PLAYBACK_OFFLOAD_DEVICE9 42 |
| 501 | #endif |
Subhash Chandra Bose Naripeddy | 16ff4f8 | 2014-04-01 21:03:10 -0700 | [diff] [blame] | 502 | |
Narsinga Rao Chella | 05573b7 | 2013-11-15 15:21:40 -0800 | [diff] [blame] | 503 | #define COMPRESS_VOIP_CALL_PCM_DEVICE 3 |
Vikram Panduranga | 93f080e | 2017-06-07 18:16:14 -0700 | [diff] [blame] | 504 | #define AUDIO_PLAYBACK_VOIP_PCM_DEVICE 16 |
| 505 | #define AUDIO_RECORD_VOIP_PCM_DEVICE 16 |
Krishnankutty Kolathappilly | a43f96e | 2013-11-01 12:17:53 -0700 | [diff] [blame] | 506 | |
Vignesh Kulothungan | a692727 | 2019-02-20 15:17:07 -0800 | [diff] [blame] | 507 | // Update based on haptic device id |
| 508 | #define AUDIO_HAPTICS_PCM_DEVICE 43 |
| 509 | #define HAPTICS_PCM_DEVICE 44 |
| 510 | |
Mingming Yin | 8e5a4f6 | 2013-10-07 15:23:41 -0700 | [diff] [blame] | 511 | #ifdef PLATFORM_MSM8610 |
| 512 | #define LOWLATENCY_PCM_DEVICE 12 |
Venkata Narendra Kumar Gutta | 65d5126 | 2014-04-14 21:18:52 +0530 | [diff] [blame] | 513 | #define EC_REF_RX "SEC_I2S_RX" |
Sujin Panicker | b904fbe | 2019-04-04 13:28:07 +0530 | [diff] [blame] | 514 | #elif defined (PLATFORM_MSMFALCON) || defined (PLATFORM_MSM8937) |
| 515 | #define LOWLATENCY_PCM_DEVICE 12 |
| 516 | #define EC_REF_RX "I2S_RX" |
| 517 | #define MMAP_PLAYBACK_PCM_DEVICE 2 |
| 518 | #define MMAP_RECORD_PCM_DEVICE 2 |
Preetam Singh Ranawat | d770a36 | 2017-05-24 19:07:15 +0530 | [diff] [blame] | 519 | #elif PLATFORM_BEAR_FAMILY |
| 520 | #define EC_REF_RX "I2S_RX" |
Mingming Yin | 8e5a4f6 | 2013-10-07 15:23:41 -0700 | [diff] [blame] | 521 | #else |
| 522 | #define LOWLATENCY_PCM_DEVICE 15 |
Haynes Mathew George | 1608104 | 2017-05-31 17:16:49 -0700 | [diff] [blame] | 523 | #define MMAP_PLAYBACK_PCM_DEVICE 18 |
| 524 | #define MMAP_RECORD_PCM_DEVICE 18 |
Laxminath Kasam | 7294f52 | 2013-12-11 05:07:00 +0530 | [diff] [blame] | 525 | #define EC_REF_RX "SLIM_RX" |
Mingming Yin | 8e5a4f6 | 2013-10-07 15:23:41 -0700 | [diff] [blame] | 526 | #endif |
Preetam Singh Ranawat | d770a36 | 2017-05-24 19:07:15 +0530 | [diff] [blame] | 527 | |
Krishnankutty Kolathappilly | 11806db | 2013-11-20 10:39:32 -0800 | [diff] [blame] | 528 | #ifdef PLATFORM_MSM8x26 |
| 529 | #define COMPRESS_CAPTURE_DEVICE 20 |
| 530 | #else |
Mingming Yin | e62d784 | 2013-10-25 16:26:03 -0700 | [diff] [blame] | 531 | #define COMPRESS_CAPTURE_DEVICE 19 |
Krishnankutty Kolathappilly | 11806db | 2013-11-20 10:39:32 -0800 | [diff] [blame] | 532 | #endif |
Mingming Yin | 8e5a4f6 | 2013-10-07 15:23:41 -0700 | [diff] [blame] | 533 | |
Vidyakumar Athota | d9d9ff3 | 2013-11-13 11:46:52 -0800 | [diff] [blame] | 534 | #ifdef PLATFORM_MSM8x26 |
| 535 | #define VOICE_CALL_PCM_DEVICE 2 |
| 536 | #define VOICE2_CALL_PCM_DEVICE 14 |
| 537 | #define VOLTE_CALL_PCM_DEVICE 17 |
| 538 | #define QCHAT_CALL_PCM_DEVICE 18 |
Vicky Sehrawat | 7e4fc15 | 2014-02-12 17:58:59 -0800 | [diff] [blame] | 539 | #define VOWLAN_CALL_PCM_DEVICE 30 |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 540 | #elif defined (PLATFORM_APQ8084) || defined (PLATFORM_MSM8084) |
Vidyakumar Athota | d9d9ff3 | 2013-11-13 11:46:52 -0800 | [diff] [blame] | 541 | #define VOICE_CALL_PCM_DEVICE 20 |
Phani Kumar Uppalapati | 9da60a2 | 2014-03-19 18:59:39 -0700 | [diff] [blame] | 542 | #define VOICE2_CALL_PCM_DEVICE 25 |
Vidyakumar Athota | d9d9ff3 | 2013-11-13 11:46:52 -0800 | [diff] [blame] | 543 | #define VOLTE_CALL_PCM_DEVICE 21 |
Banajit Goswami | bb2002f | 2014-03-27 13:51:33 -0700 | [diff] [blame] | 544 | #define QCHAT_CALL_PCM_DEVICE 33 |
Vicky Sehrawat | 7e4fc15 | 2014-02-12 17:58:59 -0800 | [diff] [blame] | 545 | #define VOWLAN_CALL_PCM_DEVICE -1 |
Vicky Sehrawat | f55b03c | 2013-12-09 14:56:18 -0800 | [diff] [blame] | 546 | #elif PLATFORM_MSM8610 |
Vidyakumar Athota | d9d9ff3 | 2013-11-13 11:46:52 -0800 | [diff] [blame] | 547 | #define VOICE_CALL_PCM_DEVICE 2 |
| 548 | #define VOICE2_CALL_PCM_DEVICE 13 |
Venkata Narendra Kumar Gutta | 8f84e9f | 2013-12-30 19:30:46 +0530 | [diff] [blame] | 549 | #define VOLTE_CALL_PCM_DEVICE 15 |
| 550 | #define QCHAT_CALL_PCM_DEVICE 14 |
Vicky Sehrawat | 7e4fc15 | 2014-02-12 17:58:59 -0800 | [diff] [blame] | 551 | #define VOWLAN_CALL_PCM_DEVICE -1 |
Narsinga Rao Chella | c2b9999 | 2014-05-15 22:45:59 -0700 | [diff] [blame] | 552 | #elif PLATFORM_MSM8994 |
| 553 | #define VOICE_CALL_PCM_DEVICE 2 |
| 554 | #define VOICE2_CALL_PCM_DEVICE 22 |
| 555 | #define VOLTE_CALL_PCM_DEVICE 14 |
| 556 | #define QCHAT_CALL_PCM_DEVICE 20 |
| 557 | #define VOWLAN_CALL_PCM_DEVICE 36 |
Vidyakumar Athota | 0e10935 | 2015-02-12 17:38:22 -0800 | [diff] [blame] | 558 | #elif PLATFORM_MSM8996 |
| 559 | #define VOICE_CALL_PCM_DEVICE 40 |
| 560 | #define VOICE2_CALL_PCM_DEVICE 41 |
| 561 | #define VOLTE_CALL_PCM_DEVICE 14 |
| 562 | #define QCHAT_CALL_PCM_DEVICE 20 |
| 563 | #define VOWLAN_CALL_PCM_DEVICE 33 |
Preetam Singh Ranawat | d770a36 | 2017-05-24 19:07:15 +0530 | [diff] [blame] | 564 | #elif PLATFORM_BEAR_FAMILY |
| 565 | #define VOICE_CALL_PCM_DEVICE 2 |
| 566 | #define VOICE2_CALL_PCM_DEVICE 13 |
| 567 | #define VOLTE_CALL_PCM_DEVICE 15 |
| 568 | #define QCHAT_CALL_PCM_DEVICE 37 |
| 569 | #define VOWLAN_CALL_PCM_DEVICE 16 |
Sujin Panicker | b904fbe | 2019-04-04 13:28:07 +0530 | [diff] [blame] | 570 | #elif PLATFORM_MSMFALCON |
| 571 | #define VOICE_CALL_PCM_DEVICE 2 |
| 572 | #define VOICE2_CALL_PCM_DEVICE 13 |
| 573 | #define VOLTE_CALL_PCM_DEVICE 15 |
| 574 | #define QCHAT_CALL_PCM_DEVICE 37 |
| 575 | #define VOWLAN_CALL_PCM_DEVICE 16 |
Vicky Sehrawat | f55b03c | 2013-12-09 14:56:18 -0800 | [diff] [blame] | 576 | #else |
| 577 | #define VOICE_CALL_PCM_DEVICE 2 |
| 578 | #define VOICE2_CALL_PCM_DEVICE 22 |
| 579 | #define VOLTE_CALL_PCM_DEVICE 14 |
| 580 | #define QCHAT_CALL_PCM_DEVICE 20 |
Vicky Sehrawat | 8456ae0 | 2014-05-09 16:28:40 -0700 | [diff] [blame] | 581 | #define VOWLAN_CALL_PCM_DEVICE 36 |
Vidyakumar Athota | d9d9ff3 | 2013-11-13 11:46:52 -0800 | [diff] [blame] | 582 | #endif |
| 583 | |
Vidyakumar Athota | 0e10935 | 2015-02-12 17:38:22 -0800 | [diff] [blame] | 584 | #ifdef PLATFORM_MSM8996 |
| 585 | #define VOICEMMODE1_CALL_PCM_DEVICE 2 |
| 586 | #define VOICEMMODE2_CALL_PCM_DEVICE 22 |
| 587 | #else |
| 588 | #define VOICEMMODE1_CALL_PCM_DEVICE 44 |
| 589 | #define VOICEMMODE2_CALL_PCM_DEVICE 45 |
| 590 | #endif |
| 591 | |
Ravi Kumar Alamanda | 060bc5a | 2014-09-05 13:51:35 -0700 | [diff] [blame] | 592 | #define AFE_PROXY_PLAYBACK_PCM_DEVICE 7 |
| 593 | #define AFE_PROXY_RECORD_PCM_DEVICE 8 |
| 594 | |
Satya Krishna Pindiproli | 813feda | 2014-02-11 15:59:58 +0530 | [diff] [blame] | 595 | #ifdef PLATFORM_MSM8x26 |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 596 | #ifdef EXTERNAL_BT_SUPPORTED |
| 597 | #define HFP_SCO_RX 10 // AUXPCM Hostless |
| 598 | #else |
Satya Krishna Pindiproli | 813feda | 2014-02-11 15:59:58 +0530 | [diff] [blame] | 599 | #define HFP_SCO_RX 28 |
Aalique Grahame | 22e4910 | 2018-12-18 14:23:57 -0800 | [diff] [blame] | 600 | #endif |
Satya Krishna Pindiproli | 813feda | 2014-02-11 15:59:58 +0530 | [diff] [blame] | 601 | #define HFP_ASM_RX_TX 29 |
Preetam Singh Ranawat | d770a36 | 2017-05-24 19:07:15 +0530 | [diff] [blame] | 602 | #elif PLATFORM_BEAR_FAMILY |
| 603 | #define HFP_SCO_RX 17 |
| 604 | #define HFP_ASM_RX_TX 18 |
Derek Chen | 3e5b30a | 2018-10-24 01:04:25 -0700 | [diff] [blame] | 605 | #elif PLATFORM_AUTO |
| 606 | #define HFP_SCO_RX 36 |
| 607 | #define HFP_ASM_RX_TX 29 |
Sujin Panicker | b904fbe | 2019-04-04 13:28:07 +0530 | [diff] [blame] | 608 | #elif defined (PLATFORM_MSMFALCON) || defined (PLATFORM_MSM8937) |
| 609 | #define HFP_SCO_RX 17 |
| 610 | #define HFP_ASM_RX_TX 18 |
Satya Krishna Pindiproli | 813feda | 2014-02-11 15:59:58 +0530 | [diff] [blame] | 611 | #else |
| 612 | #define HFP_SCO_RX 23 |
| 613 | #define HFP_ASM_RX_TX 24 |
| 614 | #endif |
| 615 | |
Siddartha Shaik | 31b530e | 2017-05-19 15:26:33 +0530 | [diff] [blame] | 616 | #define TRANSCODE_LOOPBACK_RX_DEV_ID 43 |
| 617 | #define TRANSCODE_LOOPBACK_TX_DEV_ID 44 |
| 618 | |
Varun Balaraj | e49253e | 2017-07-06 19:48:56 +0530 | [diff] [blame] | 619 | #define PLAYBACK_INTERACTIVE_STRM_DEVICE1 0 |
| 620 | #define PLAYBACK_INTERACTIVE_STRM_DEVICE2 1 |
| 621 | #define PLAYBACK_INTERACTIVE_STRM_DEVICE3 27 |
| 622 | #define PLAYBACK_INTERACTIVE_STRM_DEVICE4 45 |
| 623 | #define PLAYBACK_INTERACTIVE_STRM_DEVICE5 46 |
| 624 | #define PLAYBACK_INTERACTIVE_STRM_DEVICE6 47 |
| 625 | #define PLAYBACK_INTERACTIVE_STRM_DEVICE7 48 |
| 626 | #define PLAYBACK_INTERACTIVE_STRM_DEVICE8 49 |
| 627 | |
Banajit Goswami | 88d6cc5 | 2014-04-10 17:59:02 -0700 | [diff] [blame] | 628 | #ifdef PLATFORM_APQ8084 |
| 629 | #define FM_RX_VOLUME "Quat MI2S FM RX Volume" |
Sudheer Papothi | cd99424 | 2014-07-11 00:50:19 +0530 | [diff] [blame] | 630 | #elif PLATFORM_MSM8994 |
| 631 | #define FM_RX_VOLUME "PRI MI2S LOOPBACK Volume" |
Manisha Agarwal | 888e976 | 2019-02-27 22:18:49 +0530 | [diff] [blame] | 632 | #elif defined (PLATFORM_MSM8996) || defined (PLATFORM_KONA) || defined (PLATFORM_LITO) |
Banajit Goswami | 22582e7 | 2014-10-15 18:29:34 -0700 | [diff] [blame] | 633 | #define FM_RX_VOLUME "Tert MI2S LOOPBACK Volume" |
Hari Veerubhotla | e56a5fa | 2018-10-14 16:52:10 +0530 | [diff] [blame] | 634 | #elif defined (PLATFORM_MSM8998) || defined (PLATFORM_SDM845) || defined (PLATFORM_MSMFALCON) || defined (PLATFORM_SDM710) || defined (PLATFORM_QCS605) || defined (PLATFORM_MSMNILE) || defined (PLATFORM_MSMSTEPPE) || defined (PLATFORM_QCS405) || defined (PLATFORM_TRINKET) |
Banajit Goswami | 4c0dff2 | 2016-03-04 18:31:22 -0800 | [diff] [blame] | 635 | #define FM_RX_VOLUME "SLIMBUS_8 LOOPBACK Volume" |
Banajit Goswami | 88d6cc5 | 2014-04-10 17:59:02 -0700 | [diff] [blame] | 636 | #else |
| 637 | #define FM_RX_VOLUME "Internal FM RX Volume" |
| 638 | #endif |
| 639 | |
Chaithanya Krishna Bacharaju | 9955b16 | 2016-05-25 16:25:53 +0530 | [diff] [blame] | 640 | #define PLATFORM_MAX_MIC_COUNT "input_mic_max_count" |
| 641 | #define PLATFORM_DEFAULT_MIC_COUNT 2 |
| 642 | |
Vikram Panduranga | df59cae | 2017-08-03 18:04:55 -0700 | [diff] [blame] | 643 | #define TX_VOICE_FLUENCE_PROV2 0x10F17 |
Vignesh Kulothungan | 80d87ee | 2018-07-17 11:59:25 -0700 | [diff] [blame] | 644 | #define TX_VOICE_TM_FLUENCE_PRO_VC 0x10F35 |
| 645 | #define TX_VOICE_TM_FLUENCE_EF 0x10F33 |
Vikram Panduranga | df59cae | 2017-08-03 18:04:55 -0700 | [diff] [blame] | 646 | #define TX_VOICE_DM_FV5_BROADSIDE 0x10F18 |
| 647 | #define TX_VOICE_FV5ECNS_SM 0x10F09 |
Vignesh Kulothungan | 033c7cb | 2018-07-12 11:35:57 -0700 | [diff] [blame] | 648 | #define TX_VOICE_SMECNS_V2 0x10F31 |
Vikram Panduranga | df59cae | 2017-08-03 18:04:55 -0700 | [diff] [blame] | 649 | #define TX_VOICE_FV5ECNS_DM 0x10F0A |
Vignesh Kulothungan | 033fd43 | 2019-04-16 18:43:38 -0700 | [diff] [blame] | 650 | #define TX_VOICE_FLUENCE_SM_SB 0x10F38 |
| 651 | #define TX_VOICE_FLUENCE_MM_SB 0x10F39 |
Vikram Panduranga | df59cae | 2017-08-03 18:04:55 -0700 | [diff] [blame] | 652 | |
Vidyakumar Athota | d9d9ff3 | 2013-11-13 11:46:52 -0800 | [diff] [blame] | 653 | #define LIB_CSD_CLIENT "libcsd-client.so" |
Naresh Tanniru | dcb47c5 | 2018-06-25 16:23:32 +0530 | [diff] [blame] | 654 | |
| 655 | #define AUDIO_MAKE_STRING_FROM_ENUM(X) { #X, X } |
| 656 | |
Vidyakumar Athota | d9d9ff3 | 2013-11-13 11:46:52 -0800 | [diff] [blame] | 657 | /* CSD-CLIENT related functions */ |
Helen Zeng | 6a16ad7 | 2014-02-23 22:04:44 -0800 | [diff] [blame] | 658 | typedef int (*init_t)(bool); |
Vidyakumar Athota | d9d9ff3 | 2013-11-13 11:46:52 -0800 | [diff] [blame] | 659 | typedef int (*deinit_t)(); |
| 660 | typedef int (*disable_device_t)(); |
Vidyakumar Athota | 545dbd3 | 2013-11-13 17:30:53 -0800 | [diff] [blame] | 661 | typedef int (*enable_device_config_t)(int, int); |
Vidyakumar Athota | d9d9ff3 | 2013-11-13 11:46:52 -0800 | [diff] [blame] | 662 | typedef int (*enable_device_t)(int, int, uint32_t); |
Vidyakumar Athota | c37f42a | 2014-03-11 11:57:48 -0700 | [diff] [blame] | 663 | typedef int (*volume_t)(uint32_t, int, uint16_t); |
| 664 | typedef int (*mic_mute_t)(uint32_t, int, uint16_t); |
Vidyakumar Athota | d9d9ff3 | 2013-11-13 11:46:52 -0800 | [diff] [blame] | 665 | typedef int (*slow_talk_t)(uint32_t, uint8_t); |
| 666 | typedef int (*start_voice_t)(uint32_t); |
| 667 | typedef int (*stop_voice_t)(uint32_t); |
| 668 | typedef int (*start_playback_t)(uint32_t); |
| 669 | typedef int (*stop_playback_t)(uint32_t); |
Vidyakumar Athota | 21b3bb9 | 2014-04-25 11:08:08 -0700 | [diff] [blame] | 670 | typedef int (*set_lch_t)(uint32_t, enum voice_lch_mode); |
Vidyakumar Athota | d9d9ff3 | 2013-11-13 11:46:52 -0800 | [diff] [blame] | 671 | typedef int (*start_record_t)(uint32_t, int); |
Vidyakumar Athota | 2850d53 | 2013-11-19 16:02:12 -0800 | [diff] [blame] | 672 | typedef int (*stop_record_t)(uint32_t); |
Helen Zeng | 6a16ad7 | 2014-02-23 22:04:44 -0800 | [diff] [blame] | 673 | typedef int (*get_sample_rate_t)(uint32_t *); |
Vidyakumar Athota | d9d9ff3 | 2013-11-13 11:46:52 -0800 | [diff] [blame] | 674 | /* CSD Client structure */ |
| 675 | struct csd_data { |
| 676 | void *csd_client; |
| 677 | init_t init; |
| 678 | deinit_t deinit; |
| 679 | disable_device_t disable_device; |
Vidyakumar Athota | 545dbd3 | 2013-11-13 17:30:53 -0800 | [diff] [blame] | 680 | enable_device_config_t enable_device_config; |
Vidyakumar Athota | d9d9ff3 | 2013-11-13 11:46:52 -0800 | [diff] [blame] | 681 | enable_device_t enable_device; |
| 682 | volume_t volume; |
| 683 | mic_mute_t mic_mute; |
| 684 | slow_talk_t slow_talk; |
| 685 | start_voice_t start_voice; |
| 686 | stop_voice_t stop_voice; |
| 687 | start_playback_t start_playback; |
| 688 | stop_playback_t stop_playback; |
Vidyakumar Athota | 21b3bb9 | 2014-04-25 11:08:08 -0700 | [diff] [blame] | 689 | set_lch_t set_lch; |
Vidyakumar Athota | d9d9ff3 | 2013-11-13 11:46:52 -0800 | [diff] [blame] | 690 | start_record_t start_record; |
| 691 | stop_record_t stop_record; |
Helen Zeng | 6a16ad7 | 2014-02-23 22:04:44 -0800 | [diff] [blame] | 692 | get_sample_rate_t get_sample_rate; |
Vidyakumar Athota | d9d9ff3 | 2013-11-13 11:46:52 -0800 | [diff] [blame] | 693 | }; |
| 694 | |
Pradnya Chaphekar | 80a8cfb | 2014-10-20 16:17:01 -0700 | [diff] [blame] | 695 | /* HDMI Passthrough defines */ |
| 696 | enum { |
| 697 | LEGACY_PCM = 0, |
| 698 | PASSTHROUGH, |
Preetam Singh Ranawat | cb6212e | 2016-07-19 18:33:53 +0530 | [diff] [blame] | 699 | PASSTHROUGH_CONVERT, |
Naresh Tanniru | 928f086 | 2017-04-07 16:44:23 -0700 | [diff] [blame] | 700 | PASSTHROUGH_DSD, |
| 701 | LISTEN, |
| 702 | PASSTHROUGH_GEN, |
| 703 | PASSTHROUGH_IEC61937 |
Pradnya Chaphekar | 80a8cfb | 2014-10-20 16:17:01 -0700 | [diff] [blame] | 704 | }; |
| 705 | /* |
| 706 | * ID for setting mute and lateny on the device side |
| 707 | * through Device PP Params mixer control. |
| 708 | */ |
| 709 | #define DEVICE_PARAM_MUTE_ID 0 |
| 710 | #define DEVICE_PARAM_LATENCY_ID 1 |
Ben Romberger | 6c4d381 | 2017-06-13 17:46:45 -0700 | [diff] [blame] | 711 | #define DEVICE_PARAM_LIMITER_ID 2 |
Narsinga Rao Chella | f928a98 | 2015-03-06 14:57:35 -0800 | [diff] [blame] | 712 | |
| 713 | #define ENUM_TO_STRING(X) #X |
| 714 | |
| 715 | struct audio_device_to_audio_interface { |
| 716 | audio_devices_t device; |
| 717 | char device_name[100]; |
| 718 | char interface_name[100]; |
| 719 | }; |
Ashish Jain | d84fd6a | 2016-07-27 12:33:25 +0530 | [diff] [blame] | 720 | |
Eric Laurent | b23d528 | 2013-05-14 15:27:20 -0700 | [diff] [blame] | 721 | #endif // QCOM_AUDIO_PLATFORM_H |