2013-05-14 22:27:20 +00:00
/*
2019-11-15 05:43:55 +00:00
* Copyright ( c ) 2013 - 2020 , The Linux Foundation . All rights reserved .
2013-10-04 23:13:44 +00:00
* Not a Contribution .
*
2013-05-14 22:27:20 +00:00
* Copyright ( C ) 2013 The Android Open Source Project
*
* Licensed under the Apache License , Version 2.0 ( the " License " ) ;
* you may not use this file except in compliance with the License .
* You may obtain a copy of the License at
*
* http : //www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing , software
* distributed under the License is distributed on an " AS IS " BASIS ,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied .
* See the License for the specific language governing permissions and
* limitations under the License .
*/
# ifndef QCOM_AUDIO_PLATFORM_H
# define QCOM_AUDIO_PLATFORM_H
2014-04-25 18:08:08 +00:00
# include <sound/voice_params.h>
2013-05-14 22:27:20 +00:00
2019-02-22 12:09:41 +00:00
# define TRUMPET_TOPOLOGY 0x11000099
# define ACDB_ID_STEREO_SPEAKER_DEVICE 15
2013-10-07 22:23:41 +00:00
enum {
FLUENCE_NONE ,
2013-11-06 23:52:18 +00:00
FLUENCE_DUAL_MIC = 0x1 ,
2017-12-13 08:01:26 +00:00
FLUENCE_TRI_MIC = 0x2 ,
FLUENCE_QUAD_MIC = 0x4 ,
FLUENCE_HEX_MIC = 0x8 ,
2013-10-07 22:23:41 +00:00
} ;
2014-03-07 05:25:22 +00:00
enum {
FLUENCE_ENDFIRE = 0x1 ,
FLUENCE_BROADSIDE = 0x2 ,
} ;
2016-05-25 10:55:53 +00:00
enum {
SOURCE_MONO_MIC = 0x1 , /* Target contains 1 mic */
SOURCE_DUAL_MIC = 0x2 , /* Target contains 2 mics */
SOURCE_THREE_MIC = 0x4 , /* Target contains 3 mics */
SOURCE_QUAD_MIC = 0x8 , /* Target contains 4 mics */
2017-09-29 04:51:22 +00:00
SOURCE_HEX_MIC = 0x16 , /* Target contains 6 mics */
2016-05-25 10:55:53 +00:00
} ;
2016-08-05 13:49:48 +00:00
enum {
SPKR_1 ,
SPKR_2
} ;
2013-05-14 22:27:20 +00:00
/* Sound devices specific to the platform
* The DEVICE_OUT_ * and DEVICE_IN_ * should be mapped to these sound
* devices to enable corresponding mixer paths
*/
enum {
SND_DEVICE_NONE = 0 ,
/* Playback devices */
SND_DEVICE_MIN ,
SND_DEVICE_OUT_BEGIN = SND_DEVICE_MIN ,
SND_DEVICE_OUT_HANDSET = SND_DEVICE_OUT_BEGIN ,
SND_DEVICE_OUT_SPEAKER ,
2014-07-14 11:26:56 +00:00
SND_DEVICE_OUT_SPEAKER_EXTERNAL_1 ,
SND_DEVICE_OUT_SPEAKER_EXTERNAL_2 ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_OUT_SPEAKER_REVERSE ,
2018-12-18 22:23:57 +00:00
SND_DEVICE_OUT_SPEAKER_SAFE ,
2015-09-11 08:11:30 +00:00
SND_DEVICE_OUT_SPEAKER_VBAT ,
2015-10-18 05:21:52 +00:00
SND_DEVICE_OUT_LINE ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_OUT_HEADPHONES ,
2016-07-19 13:03:53 +00:00
SND_DEVICE_OUT_HEADPHONES_DSD ,
2019-08-08 13:32:35 +00:00
SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER ,
2015-02-18 20:23:23 +00:00
SND_DEVICE_OUT_HEADPHONES_44_1 ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES ,
2019-08-08 13:32:35 +00:00
SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_HIFI_FILTER ,
2018-12-18 22:23:57 +00:00
SND_DEVICE_OUT_SPEAKER_SAFE_AND_HEADPHONES ,
2015-10-18 05:21:52 +00:00
SND_DEVICE_OUT_SPEAKER_AND_LINE ,
2018-12-18 22:23:57 +00:00
SND_DEVICE_OUT_SPEAKER_SAFE_AND_LINE ,
2014-07-14 11:26:56 +00:00
SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_1 ,
SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_2 ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_OUT_VOICE_HANDSET ,
SND_DEVICE_OUT_VOICE_SPEAKER ,
2018-04-27 19:59:42 +00:00
SND_DEVICE_OUT_VOICE_SPEAKER_STEREO ,
2015-09-11 08:11:30 +00:00
SND_DEVICE_OUT_VOICE_SPEAKER_VBAT ,
2016-08-05 13:49:48 +00:00
SND_DEVICE_OUT_VOICE_SPEAKER_2 ,
SND_DEVICE_OUT_VOICE_SPEAKER_2_VBAT ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_OUT_VOICE_HEADPHONES ,
2019-04-30 06:28:43 +00:00
SND_DEVICE_OUT_VOICE_HEADSET ,
2015-10-18 05:21:52 +00:00
SND_DEVICE_OUT_VOICE_LINE ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_OUT_HDMI ,
SND_DEVICE_OUT_SPEAKER_AND_HDMI ,
2016-09-03 21:13:26 +00:00
SND_DEVICE_OUT_DISPLAY_PORT ,
2019-08-01 07:55:59 +00:00
SND_DEVICE_OUT_DISPLAY_PORT1 ,
2016-09-03 21:13:26 +00:00
SND_DEVICE_OUT_SPEAKER_AND_DISPLAY_PORT ,
2019-08-01 07:55:59 +00:00
SND_DEVICE_OUT_SPEAKER_AND_DISPLAY_PORT1 ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_OUT_BT_SCO ,
2013-10-01 22:49:05 +00:00
SND_DEVICE_OUT_BT_SCO_WB ,
2019-03-16 02:37:18 +00:00
SND_DEVICE_OUT_BT_SCO_SWB ,
2015-03-12 20:02:10 +00:00
SND_DEVICE_OUT_BT_A2DP ,
SND_DEVICE_OUT_SPEAKER_AND_BT_A2DP ,
2018-12-18 22:23:57 +00:00
SND_DEVICE_OUT_SPEAKER_SAFE_AND_BT_A2DP ,
SND_DEVICE_OUT_VOICE_HANDSET_TMUS ,
2017-08-08 09:11:35 +00:00
SND_DEVICE_OUT_SPEAKER_AND_BT_SCO ,
2018-12-18 22:23:57 +00:00
SND_DEVICE_OUT_SPEAKER_SAFE_AND_BT_SCO ,
2017-08-08 09:11:35 +00:00
SND_DEVICE_OUT_SPEAKER_AND_BT_SCO_WB ,
2018-12-18 22:23:57 +00:00
SND_DEVICE_OUT_SPEAKER_SAFE_AND_BT_SCO_WB ,
2019-03-16 02:37:18 +00:00
SND_DEVICE_OUT_SPEAKER_AND_BT_SCO_SWB ,
SND_DEVICE_OUT_SPEAKER_SAFE_AND_BT_SCO_SWB ,
2019-04-04 07:58:07 +00:00
SND_DEVICE_OUT_SPEAKER_WSA_AND_BT_SCO ,
SND_DEVICE_OUT_SPEAKER_WSA_AND_BT_SCO_WB ,
2019-03-16 02:37:18 +00:00
SND_DEVICE_OUT_SPEAKER_WSA_AND_BT_SCO_SWB ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_OUT_VOICE_TTY_FULL_HEADPHONES ,
2019-06-14 06:49:28 +00:00
SND_DEVICE_OUT_VOICE_TTY_FULL_HEADSET ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_OUT_VOICE_TTY_VCO_HEADPHONES ,
2019-06-14 06:49:28 +00:00
SND_DEVICE_OUT_VOICE_TTY_VCO_HEADSET ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_OUT_VOICE_TTY_HCO_HANDSET ,
2017-05-25 23:53:32 +00:00
SND_DEVICE_OUT_VOICE_TTY_FULL_USB ,
SND_DEVICE_OUT_VOICE_TTY_VCO_USB ,
2018-12-18 22:23:57 +00:00
SND_DEVICE_OUT_VOICE_HAC_HANDSET ,
2014-09-05 20:51:35 +00:00
SND_DEVICE_OUT_VOICE_TX ,
2018-12-18 22:23:57 +00:00
SND_DEVICE_OUT_VOICE_MUSIC_TX ,
SND_DEVICE_OUT_VOICE_SPEAKER_HFP ,
2013-10-08 01:40:05 +00:00
SND_DEVICE_OUT_AFE_PROXY ,
SND_DEVICE_OUT_USB_HEADSET ,
2016-11-25 06:57:15 +00:00
SND_DEVICE_OUT_USB_HEADPHONES ,
2013-10-08 01:40:05 +00:00
SND_DEVICE_OUT_SPEAKER_AND_USB_HEADSET ,
2018-12-18 22:23:57 +00:00
SND_DEVICE_OUT_SPEAKER_SAFE_AND_USB_HEADSET ,
2017-06-17 00:25:07 +00:00
SND_DEVICE_OUT_VOICE_USB_HEADPHONES ,
SND_DEVICE_OUT_VOICE_USB_HEADSET ,
2018-12-18 22:23:57 +00:00
SND_DEVICE_OUT_USB_HEADSET_SPEC ,
2013-10-06 21:39:35 +00:00
SND_DEVICE_OUT_TRANSMISSION_FM ,
2013-10-04 23:13:44 +00:00
SND_DEVICE_OUT_ANC_HEADSET ,
SND_DEVICE_OUT_ANC_FB_HEADSET ,
SND_DEVICE_OUT_VOICE_ANC_HEADSET ,
SND_DEVICE_OUT_VOICE_ANC_FB_HEADSET ,
SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET ,
2017-01-24 04:34:36 +00:00
SND_DEVICE_OUT_SPEAKER_AND_ANC_FB_HEADSET ,
2013-10-04 23:13:44 +00:00
SND_DEVICE_OUT_ANC_HANDSET ,
2013-10-28 21:06:03 +00:00
SND_DEVICE_OUT_SPEAKER_PROTECTED ,
2014-09-09 08:49:44 +00:00
SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED ,
2016-08-05 13:49:48 +00:00
SND_DEVICE_OUT_VOICE_SPEAKER_2_PROTECTED ,
2018-04-27 19:59:42 +00:00
SND_DEVICE_OUT_VOICE_SPEAKER_STEREO_PROTECTED ,
2015-09-11 08:11:30 +00:00
SND_DEVICE_OUT_SPEAKER_PROTECTED_VBAT ,
SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED_VBAT ,
2016-08-05 13:49:48 +00:00
SND_DEVICE_OUT_VOICE_SPEAKER_2_PROTECTED_VBAT ,
2015-12-14 06:25:24 +00:00
SND_DEVICE_OUT_SPEAKER_WSA ,
SND_DEVICE_OUT_VOICE_SPEAKER_WSA ,
2016-08-05 13:49:48 +00:00
SND_DEVICE_OUT_VOICE_SPEAKER_2_WSA ,
2017-01-05 07:18:08 +00:00
SND_DEVICE_OUT_SPEAKER_PROTECTED_RAS ,
SND_DEVICE_OUT_SPEAKER_PROTECTED_VBAT_RAS ,
2019-04-04 07:58:07 +00:00
SND_DEVICE_OUT_VOIP_HANDSET ,
SND_DEVICE_OUT_VOIP_SPEAKER ,
SND_DEVICE_OUT_VOIP_HEADPHONES ,
2017-03-13 15:02:03 +00:00
SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_HEADPHONES ,
SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_ANC_HEADSET ,
SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_ANC_FB_HEADSET ,
2018-04-27 19:59:42 +00:00
SND_DEVICE_OUT_VOICE_SPEAKER_STEREO_AND_VOICE_HEADPHONES ,
SND_DEVICE_OUT_VOICE_SPEAKER_STEREO_AND_VOICE_ANC_HEADSET ,
SND_DEVICE_OUT_VOICE_SPEAKER_STEREO_AND_VOICE_ANC_FB_HEADSET ,
2018-11-16 06:15:16 +00:00
SND_DEVICE_OUT_VOICE_HEARING_AID ,
2017-06-12 21:16:24 +00:00
SND_DEVICE_OUT_BUS_MEDIA ,
SND_DEVICE_OUT_BUS_SYS ,
SND_DEVICE_OUT_BUS_NAV ,
SND_DEVICE_OUT_BUS_PHN ,
2019-08-01 20:57:49 +00:00
SND_DEVICE_OUT_BUS_RSE ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_OUT_END ,
/*
* Note : IN_BEGIN should be same as OUT_END because total number of devices
* SND_DEVICES_MAX should not exceed MAX_RX + MAX_TX devices .
*/
/* Capture devices */
SND_DEVICE_IN_BEGIN = SND_DEVICE_OUT_END ,
SND_DEVICE_IN_HANDSET_MIC = SND_DEVICE_IN_BEGIN ,
2019-01-24 01:44:01 +00:00
SND_DEVICE_IN_HANDSET_MIC_SB ,
2014-07-14 11:26:56 +00:00
SND_DEVICE_IN_HANDSET_MIC_EXTERNAL ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_IN_HANDSET_MIC_AEC ,
2019-01-24 01:44:01 +00:00
SND_DEVICE_IN_HANDSET_MIC_AEC_SB ,
2013-11-07 23:42:19 +00:00
SND_DEVICE_IN_HANDSET_MIC_NS ,
2019-01-24 01:44:01 +00:00
SND_DEVICE_IN_HANDSET_MIC_NS_SB ,
2013-11-07 23:42:19 +00:00
SND_DEVICE_IN_HANDSET_MIC_AEC_NS ,
2019-01-24 01:44:01 +00:00
SND_DEVICE_IN_HANDSET_MIC_AEC_NS_SB ,
2013-11-07 23:42:19 +00:00
SND_DEVICE_IN_HANDSET_DMIC ,
2013-11-06 23:52:18 +00:00
SND_DEVICE_IN_HANDSET_DMIC_AEC ,
2019-01-24 01:44:01 +00:00
SND_DEVICE_IN_HANDSET_DMIC_AEC_SB ,
2013-11-07 23:42:19 +00:00
SND_DEVICE_IN_HANDSET_DMIC_NS ,
2019-01-24 01:44:01 +00:00
SND_DEVICE_IN_HANDSET_DMIC_NS_SB ,
2013-11-07 23:42:19 +00:00
SND_DEVICE_IN_HANDSET_DMIC_AEC_NS ,
2019-01-24 01:44:01 +00:00
SND_DEVICE_IN_HANDSET_DMIC_AEC_NS_SB ,
2013-11-07 23:42:19 +00:00
SND_DEVICE_IN_SPEAKER_MIC ,
2019-01-24 01:44:01 +00:00
SND_DEVICE_IN_SPEAKER_MIC_SB ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_IN_SPEAKER_MIC_AEC ,
2019-01-24 01:44:01 +00:00
SND_DEVICE_IN_SPEAKER_MIC_AEC_SB ,
2013-11-07 23:42:19 +00:00
SND_DEVICE_IN_SPEAKER_MIC_NS ,
2019-01-24 01:44:01 +00:00
SND_DEVICE_IN_SPEAKER_MIC_NS_SB ,
2013-11-07 23:42:19 +00:00
SND_DEVICE_IN_SPEAKER_MIC_AEC_NS ,
2019-01-24 01:44:01 +00:00
SND_DEVICE_IN_SPEAKER_MIC_AEC_NS_SB ,
2013-11-07 23:42:19 +00:00
SND_DEVICE_IN_SPEAKER_DMIC ,
2013-11-06 23:52:18 +00:00
SND_DEVICE_IN_SPEAKER_DMIC_AEC ,
2019-01-24 01:44:01 +00:00
SND_DEVICE_IN_SPEAKER_DMIC_AEC_SB ,
2013-11-07 23:42:19 +00:00
SND_DEVICE_IN_SPEAKER_DMIC_NS ,
2019-01-24 01:44:01 +00:00
SND_DEVICE_IN_SPEAKER_DMIC_NS_SB ,
2013-11-07 23:42:19 +00:00
SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS ,
2019-01-24 01:44:01 +00:00
SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS_SB ,
2013-11-07 23:42:19 +00:00
SND_DEVICE_IN_HEADSET_MIC ,
2018-12-18 22:23:57 +00:00
SND_DEVICE_IN_HEADSET_MIC_AEC ,
2013-11-07 23:42:19 +00:00
SND_DEVICE_IN_HEADSET_MIC_FLUENCE ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_IN_VOICE_SPEAKER_MIC ,
2019-01-24 01:44:01 +00:00
SND_DEVICE_IN_VOICE_SPEAKER_MIC_SB ,
2018-12-18 22:23:57 +00:00
SND_DEVICE_IN_VOICE_SPEAKER_MIC_HFP ,
2019-06-24 10:42:03 +00:00
SND_DEVICE_IN_VOICE_SPEAKER_MIC_HFP_MMSECNS ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_IN_VOICE_HEADSET_MIC ,
2018-07-03 05:08:07 +00:00
SND_DEVICE_IN_SPDIF ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_IN_HDMI_MIC ,
2018-07-03 05:08:07 +00:00
SND_DEVICE_IN_HDMI_ARC ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_IN_BT_SCO_MIC ,
2014-08-13 00:17:04 +00:00
SND_DEVICE_IN_BT_SCO_MIC_NREC ,
2013-10-01 22:49:05 +00:00
SND_DEVICE_IN_BT_SCO_MIC_WB ,
2014-08-13 00:17:04 +00:00
SND_DEVICE_IN_BT_SCO_MIC_WB_NREC ,
2019-03-16 02:37:18 +00:00
SND_DEVICE_IN_BT_SCO_MIC_SWB ,
SND_DEVICE_IN_BT_SCO_MIC_SWB_NREC ,
2018-07-19 12:38:18 +00:00
SND_DEVICE_IN_BT_A2DP ,
2018-10-20 00:33:43 +00:00
SND_DEVICE_IN_CAMCORDER_LANDSCAPE ,
2013-10-07 22:23:41 +00:00
SND_DEVICE_IN_VOICE_DMIC ,
2019-01-24 01:44:01 +00:00
SND_DEVICE_IN_VOICE_DMIC_SB ,
2018-12-18 22:23:57 +00:00
SND_DEVICE_IN_VOICE_DMIC_TMUS ,
2013-10-07 22:23:41 +00:00
SND_DEVICE_IN_VOICE_SPEAKER_DMIC ,
2019-01-24 01:44:01 +00:00
SND_DEVICE_IN_VOICE_SPEAKER_DMIC_SB ,
2018-05-04 23:00:07 +00:00
SND_DEVICE_IN_VOICE_SPEAKER_TMIC ,
2013-10-07 22:23:41 +00:00
SND_DEVICE_IN_VOICE_SPEAKER_QMIC ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_IN_VOICE_TTY_FULL_HEADSET_MIC ,
SND_DEVICE_IN_VOICE_TTY_VCO_HANDSET_MIC ,
SND_DEVICE_IN_VOICE_TTY_HCO_HEADSET_MIC ,
2017-05-25 23:53:32 +00:00
SND_DEVICE_IN_VOICE_TTY_FULL_USB_MIC ,
SND_DEVICE_IN_VOICE_TTY_HCO_USB_MIC ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_IN_VOICE_REC_MIC ,
2013-11-07 23:42:19 +00:00
SND_DEVICE_IN_VOICE_REC_MIC_NS ,
2018-12-18 22:23:57 +00:00
SND_DEVICE_IN_VOICE_REC_MIC_AEC ,
SND_DEVICE_IN_VOICE_REC_MIC_AEC_NS ,
2013-11-06 23:52:18 +00:00
SND_DEVICE_IN_VOICE_REC_DMIC_STEREO ,
2013-10-07 22:23:41 +00:00
SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE ,
2018-12-18 22:23:57 +00:00
SND_DEVICE_IN_VOICE_REC_HEADSET_MIC ,
2014-09-05 20:51:35 +00:00
SND_DEVICE_IN_VOICE_RX ,
2013-10-08 01:40:05 +00:00
SND_DEVICE_IN_USB_HEADSET_MIC ,
2017-06-17 00:25:07 +00:00
SND_DEVICE_IN_USB_HEADSET_MIC_AEC ,
SND_DEVICE_IN_VOICE_USB_HEADSET_MIC ,
SND_DEVICE_IN_UNPROCESSED_USB_HEADSET_MIC ,
SND_DEVICE_IN_VOICE_RECOG_USB_HEADSET_MIC ,
2018-08-20 18:01:32 +00:00
SND_DEVICE_IN_USB_HEADSET_MULTI_CHANNEL_MIC ,
SND_DEVICE_IN_USB_HEADSET_MULTI_CHANNEL_MIC_AEC ,
SND_DEVICE_IN_UNPROCESSED_USB_HEADSET_MULTI_CHANNEL_MIC ,
SND_DEVICE_IN_VOICE_RECOG_USB_HEADSET_MULTI_CHANNEL_MIC ,
2013-10-06 21:39:35 +00:00
SND_DEVICE_IN_CAPTURE_FM ,
2013-10-04 23:13:44 +00:00
SND_DEVICE_IN_AANC_HANDSET_MIC ,
2013-10-19 19:38:54 +00:00
SND_DEVICE_IN_QUAD_MIC ,
2018-12-18 22:23:57 +00:00
SND_DEVICE_IN_HANDSET_DMIC_STEREO ,
SND_DEVICE_IN_SPEAKER_DMIC_STEREO ,
2013-10-28 21:06:03 +00:00
SND_DEVICE_IN_CAPTURE_VI_FEEDBACK ,
2016-08-05 13:49:48 +00:00
SND_DEVICE_IN_CAPTURE_VI_FEEDBACK_MONO_1 ,
SND_DEVICE_IN_CAPTURE_VI_FEEDBACK_MONO_2 ,
2014-03-07 05:25:22 +00:00
SND_DEVICE_IN_VOICE_SPEAKER_DMIC_BROADSIDE ,
SND_DEVICE_IN_SPEAKER_DMIC_BROADSIDE ,
SND_DEVICE_IN_SPEAKER_DMIC_AEC_BROADSIDE ,
SND_DEVICE_IN_SPEAKER_DMIC_NS_BROADSIDE ,
SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS_BROADSIDE ,
2016-01-08 23:57:07 +00:00
SND_DEVICE_IN_VOICE_FLUENCE_DMIC_AANC ,
2014-10-21 18:49:00 +00:00
SND_DEVICE_IN_HANDSET_QMIC ,
2018-12-18 22:23:57 +00:00
SND_DEVICE_IN_HANDSET_QMIC_AEC ,
2014-10-21 18:49:00 +00:00
SND_DEVICE_IN_SPEAKER_QMIC_AEC ,
SND_DEVICE_IN_SPEAKER_QMIC_NS ,
SND_DEVICE_IN_SPEAKER_QMIC_AEC_NS ,
2016-07-18 23:54:54 +00:00
SND_DEVICE_IN_VOICE_REC_QMIC_FLUENCE ,
2015-07-02 17:36:23 +00:00
SND_DEVICE_IN_THREE_MIC ,
2017-12-13 08:01:26 +00:00
SND_DEVICE_IN_HANDSET_TMIC_FLUENCE_PRO ,
2016-05-25 10:55:53 +00:00
SND_DEVICE_IN_HANDSET_TMIC ,
2017-12-13 08:01:26 +00:00
SND_DEVICE_IN_HANDSET_TMIC_AEC ,
SND_DEVICE_IN_HANDSET_TMIC_NS ,
SND_DEVICE_IN_HANDSET_TMIC_AEC_NS ,
2018-05-04 23:00:07 +00:00
SND_DEVICE_IN_SPEAKER_TMIC_AEC ,
SND_DEVICE_IN_SPEAKER_TMIC_NS ,
SND_DEVICE_IN_SPEAKER_TMIC_AEC_NS ,
2016-10-13 22:26:02 +00:00
SND_DEVICE_IN_VOICE_REC_TMIC ,
2016-05-26 11:04:53 +00:00
SND_DEVICE_IN_UNPROCESSED_MIC ,
SND_DEVICE_IN_UNPROCESSED_STEREO_MIC ,
SND_DEVICE_IN_UNPROCESSED_THREE_MIC ,
SND_DEVICE_IN_UNPROCESSED_QUAD_MIC ,
SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC ,
2017-09-29 04:51:22 +00:00
SND_DEVICE_IN_HANDSET_6MIC ,
SND_DEVICE_IN_HANDSET_8MIC ,
SND_DEVICE_IN_EC_REF_LOOPBACK_MONO ,
SND_DEVICE_IN_EC_REF_LOOPBACK_STEREO ,
2017-09-28 16:38:00 +00:00
SND_DEVICE_IN_HANDSET_GENERIC_QMIC ,
2018-02-06 08:55:16 +00:00
SND_DEVICE_IN_INCALL_REC_RX ,
SND_DEVICE_IN_INCALL_REC_TX ,
SND_DEVICE_IN_INCALL_REC_RX_TX ,
2018-07-25 08:44:48 +00:00
SND_DEVICE_IN_LINE ,
2018-10-20 00:33:43 +00:00
SND_DEVICE_IN_CAMCORDER_INVERT_LANDSCAPE ,
SND_DEVICE_IN_CAMCORDER_PORTRAIT ,
SND_DEVICE_IN_CAMCORDER_SELFIE_LANDSCAPE ,
SND_DEVICE_IN_CAMCORDER_SELFIE_INVERT_LANDSCAPE ,
SND_DEVICE_IN_CAMCORDER_SELFIE_PORTRAIT ,
2018-11-16 06:15:16 +00:00
SND_DEVICE_IN_VOICE_HEARING_AID ,
2017-06-12 21:16:24 +00:00
SND_DEVICE_IN_BUS ,
2019-04-16 10:02:52 +00:00
SND_DEVICE_IN_EC_REF_LOOPBACK ,
SND_DEVICE_IN_HANDSET_DMIC_AND_EC_REF_LOOPBACK ,
SND_DEVICE_IN_HANDSET_QMIC_AND_EC_REF_LOOPBACK ,
SND_DEVICE_IN_HANDSET_6MIC_AND_EC_REF_LOOPBACK ,
SND_DEVICE_IN_HANDSET_8MIC_AND_EC_REF_LOOPBACK ,
2013-05-14 22:27:20 +00:00
SND_DEVICE_IN_END ,
SND_DEVICE_MAX = SND_DEVICE_IN_END ,
2018-10-20 00:33:43 +00:00
/* For legacy xml file parsing */
SND_DEVICE_IN_CAMCORDER_MIC = SND_DEVICE_IN_CAMCORDER_LANDSCAPE ,
2013-05-14 22:27:20 +00:00
} ;
2016-07-19 13:03:53 +00:00
# define INPUT_SAMPLING_RATE_DSD64 2822400
# define INPUT_SAMPLING_RATE_DSD128 5644800
2015-02-18 20:23:23 +00:00
# define DEFAULT_OUTPUT_SAMPLING_RATE 48000
# define OUTPUT_SAMPLING_RATE_44100 44100
2016-07-19 13:03:53 +00:00
# define OUTPUT_SAMPLING_RATE_DSD64 176400
# define OUTPUT_SAMPLING_RATE_DSD128 352800
2015-02-20 02:19:36 +00:00
enum {
DEFAULT_CODEC_BACKEND ,
2016-04-28 08:18:28 +00:00
SLIMBUS_0_RX = DEFAULT_CODEC_BACKEND ,
2016-07-19 13:03:53 +00:00
DSD_NATIVE_BACKEND ,
SLIMBUS_2_RX = DSD_NATIVE_BACKEND ,
2015-02-20 02:19:36 +00:00
HEADPHONE_44_1_BACKEND ,
2016-04-28 08:18:28 +00:00
SLIMBUS_5_RX = HEADPHONE_44_1_BACKEND ,
HEADPHONE_BACKEND ,
SLIMBUS_6_RX = HEADPHONE_BACKEND ,
HDMI_RX_BACKEND ,
2016-09-03 21:13:26 +00:00
DISP_PORT_RX_BACKEND ,
2019-08-01 07:55:59 +00:00
DISP_PORT1_RX_BACKEND ,
2016-03-07 19:21:52 +00:00
USB_AUDIO_RX_BACKEND ,
2016-09-29 18:03:09 +00:00
MAX_RX_CODEC_BACKENDS = USB_AUDIO_RX_BACKEND ,
/* TX BE follows RX BE */
SLIMBUS_0_TX ,
DEFAULT_CODEC_TX_BACKEND = SLIMBUS_0_TX ,
2016-08-26 22:16:39 +00:00
USB_AUDIO_TX_BACKEND ,
2016-12-03 06:21:41 +00:00
BT_SCO_TX_BACKEND ,
2018-07-03 05:08:07 +00:00
SPDIF_TX_BACKEND ,
2017-06-14 06:43:25 +00:00
HDMI_TX_BACKEND ,
2018-07-03 05:08:07 +00:00
HDMI_ARC_TX_BACKEND ,
2019-01-02 12:54:35 +00:00
HEADSET_TX_BACKEND ,
2016-09-29 18:03:09 +00:00
MAX_CODEC_BACKENDS
2016-08-26 22:16:39 +00:00
} ;
2015-02-20 02:19:36 +00:00
# define AUDIO_PARAMETER_KEY_NATIVE_AUDIO "audio.nat.codec.enabled"
2015-11-05 09:12:20 +00:00
# define AUDIO_PARAMETER_KEY_NATIVE_AUDIO_MODE "native_audio_mode"
2013-05-14 22:27:20 +00:00
2016-05-23 15:24:24 +00:00
# define AUDIO_PARAMETER_KEY_TRUE_32_BIT "true_32_bit"
2018-09-07 12:23:37 +00:00
# define AUDIO_MAX_DSP_CHANNELS 32
2013-10-01 22:49:05 +00:00
# define ALL_SESSION_VSID 0xFFFFFFFF
2014-03-11 18:57:48 +00:00
# define DEFAULT_MUTE_RAMP_DURATION_MS 20
2013-07-26 02:18:44 +00:00
# define DEFAULT_VOLUME_RAMP_DURATION_MS 20
2013-10-06 21:39:35 +00:00
# define MIXER_PATH_MAX_LENGTH 100
2015-11-05 09:12:20 +00:00
# define CODEC_VERSION_MAX_LENGTH 100
2019-07-15 06:57:25 +00:00
# define CODEC_VARIANT_MAX_LENGTH 100
2013-07-26 02:18:44 +00:00
2013-11-15 23:21:40 +00:00
# define MAX_VOL_INDEX 5
# define MIN_VOL_INDEX 0
# define percent_to_index(val, min, max) \
( ( val ) * ( ( max ) - ( min ) ) * 0.01 + ( min ) + .5 )
2013-05-14 22:27:20 +00:00
/*
* tinyAlsa library interprets period size as number of frames
* one frame = channel_count * sizeof ( pcm sample )
* so if format = 16 - bit PCM and channels = Stereo , frame size = 2 ch * 2 = 4 bytes
* DEEP_BUFFER_OUTPUT_PERIOD_SIZE = 1024 means 1024 * 4 = 4096 bytes
* We should take care of returning proper size when AudioFlinger queries for
* the buffer size of an input / output stream
*/
2016-09-28 17:48:48 +00:00
/* for 384Khz output below period size corresponds to 20ms worth duration of buffer,
* current implementation can support buffer size of 40 ms duration
* for 32 b / 384 Khz / stereo output .
*/
2015-06-18 21:22:14 +00:00
# define DEEP_BUFFER_OUTPUT_PERIOD_SIZE 1920
2016-09-28 17:48:48 +00:00
# define DEEP_BUFFER_OUTPUT_PERIOD_DURATION 40 /* 40 milisecs */
2015-06-18 21:22:14 +00:00
# define DEEP_BUFFER_OUTPUT_PERIOD_COUNT 2
2013-06-11 21:40:01 +00:00
# define LOW_LATENCY_OUTPUT_PERIOD_SIZE 240
2013-05-14 22:27:20 +00:00
# define LOW_LATENCY_OUTPUT_PERIOD_COUNT 2
# define HDMI_MULTI_PERIOD_SIZE 336
# define HDMI_MULTI_PERIOD_COUNT 8
# define HDMI_MULTI_DEFAULT_CHANNEL_COUNT 6
# define HDMI_MULTI_PERIOD_BYTES (HDMI_MULTI_PERIOD_SIZE * HDMI_MULTI_DEFAULT_CHANNEL_COUNT * 2)
2017-08-01 01:55:17 +00:00
# define HIFI_BUFFER_OUTPUT_PERIOD_SIZE 1920
# define HIFI_BUFFER_OUTPUT_PERIOD_DURATION 40 /* 40 milisecs */
# define HIFI_BUFFER_OUTPUT_PERIOD_COUNT 2
2016-05-23 15:24:24 +00:00
/* Used in calculating fragment size for pcm offload */
2019-12-23 13:26:54 +00:00
# if defined (PLATFORM_MSMFALCON) || defined (PLATFORM_MSM8937) || \
defined ( PLATFORM_MSM8953 )
2019-04-04 07:58:07 +00:00
# define PCM_OFFLOAD_BUFFER_DURATION 40 /* 40 millisecs */
# else
2017-09-07 22:14:46 +00:00
# define PCM_OFFLOAD_BUFFER_DURATION 80 /* 80 millisecs */
2019-04-04 07:58:07 +00:00
# endif
2016-05-23 15:24:24 +00:00
/* MAX PCM fragment size cannot be increased further due
* to flinger ' s cblk size of 1 mb , and it has to be a multiple of
* 24 - lcm of channels supported by DSP
*/
# define MAX_PCM_OFFLOAD_FRAGMENT_SIZE (240 * 1024)
# define MIN_PCM_OFFLOAD_FRAGMENT_SIZE 512
2013-06-11 21:40:01 +00:00
# define AUDIO_CAPTURE_PERIOD_DURATION_MSEC 20
# define AUDIO_CAPTURE_PERIOD_COUNT 2
2013-05-14 22:27:20 +00:00
2018-12-18 22:23:57 +00:00
# define VOIP_CAPTURE_PERIOD_DURATION_MSEC 20
# define VOIP_CAPTURE_PERIOD_COUNT 2
# define VOIP_PLAYBACK_PERIOD_DURATION_MSEC 20
# define VOIP_PLAYBACK_PERIOD_COUNT 2
2014-09-08 22:59:58 +00:00
# define LOW_LATENCY_CAPTURE_SAMPLE_RATE 48000
# define LOW_LATENCY_CAPTURE_PERIOD_SIZE 240
# define LOW_LATENCY_CAPTURE_USE_CASE 1
2013-11-13 19:46:52 +00:00
# define DEVICE_NAME_MAX_SIZE 128
# define HW_INFO_ARRAY_MAX_SIZE 32
2013-10-07 22:23:41 +00:00
# define DEEP_BUFFER_PCM_DEVICE 0
2013-10-17 18:16:13 +00:00
# define AUDIO_RECORD_PCM_DEVICE 0
2013-11-01 21:58:16 +00:00
# define MULTIMEDIA2_PCM_DEVICE 1
2015-06-26 03:08:01 +00:00
# define MULTIMEDIA3_PCM_DEVICE 4
2016-09-03 21:13:26 +00:00
# define MULTIMEDIA9_PCM_DEVICE 32
2013-10-06 21:39:35 +00:00
# define FM_PLAYBACK_PCM_DEVICE 5
# define FM_CAPTURE_PCM_DEVICE 6
2019-06-23 08:05:27 +00:00
# ifdef PLATFORM_AUTO
2017-05-23 16:23:53 +00:00
# define HFP_PCM_RX 29
2019-06-23 08:05:27 +00:00
# else
2013-11-05 23:57:39 +00:00
# define HFP_PCM_RX 5
2019-06-23 08:05:27 +00:00
# endif
2013-11-05 23:57:39 +00:00
2013-10-22 23:38:08 +00:00
# define INCALL_MUSIC_UPLINK_PCM_DEVICE 1
2014-03-14 13:21:53 +00:00
# ifdef PLATFORM_MSM8610
# define INCALL_MUSIC_UPLINK2_PCM_DEVICE 14
# elif PLATFORM_MSM8x26
2013-10-22 23:38:08 +00:00
# define INCALL_MUSIC_UPLINK2_PCM_DEVICE 16
2017-05-24 13:37:15 +00:00
# elif PLATFORM_BEAR_FAMILY
# define INCALL_MUSIC_UPLINK2_PCM_DEVICE 16
2014-04-25 18:08:08 +00:00
# elif PLATFORM_APQ8084
# define INCALL_MUSIC_UPLINK2_PCM_DEVICE 34
2018-09-13 01:36:10 +00:00
# elif PLATFORM_MSMNILE
# define INCALL_MUSIC_UPLINK2_PCM_DEVICE 27
# elif PLATFORM_KONA
# define INCALL_MUSIC_UPLINK2_PCM_DEVICE 23
2014-03-14 13:21:53 +00:00
# else
2014-04-01 14:56:34 +00:00
# define INCALL_MUSIC_UPLINK2_PCM_DEVICE 35
2014-03-14 13:21:53 +00:00
# endif
2013-10-28 21:06:03 +00:00
# define SPKR_PROT_CALIB_RX_PCM_DEVICE 5
2014-03-20 01:59:39 +00:00
# ifdef PLATFORM_APQ8084
2014-04-25 18:08:08 +00:00
# define SPKR_PROT_CALIB_TX_PCM_DEVICE 35
2015-07-09 03:48:52 +00:00
# elif PLATFORM_MSM8996
# define SPKR_PROT_CALIB_TX_PCM_DEVICE 42
2017-05-24 13:37:15 +00:00
# elif PLATFORM_BEAR_FAMILY
# define SPKR_PROT_CALIB_TX_PCM_DEVICE 26
2014-03-20 01:59:39 +00:00
# else
2014-01-24 03:31:38 +00:00
# define SPKR_PROT_CALIB_TX_PCM_DEVICE 25
2014-03-20 01:59:39 +00:00
# endif
2013-11-13 19:46:52 +00:00
# define PLAYBACK_OFFLOAD_DEVICE 9
2018-12-18 22:23:57 +00:00
# define QUAT_MI2S_PCM_DEVICE 44
2014-04-02 04:03:10 +00:00
2015-09-14 17:57:35 +00:00
// Direct_PCM
2018-10-08 05:06:05 +00:00
# if defined (PLATFORM_MSM8994) || defined (PLATFORM_MSM8996) || \
defined ( PLATFORM_APQ8084 ) | | defined ( PLATFORM_MSM8998 ) | | \
defined ( PLATFORM_SDM845 ) | | defined ( PLATFORM_SDM710 ) | | \
defined ( PLATFORM_QCS605 ) | | defined ( PLATFORM_SDX24 ) | | \
defined ( PLATFORM_MSMNILE ) | | defined ( PLATFORM_KONA ) | | \
2018-10-14 11:22:10 +00:00
defined ( PLATFORM_MSMSTEPPE ) | | defined ( PLATFORM_QCS405 ) | | \
2019-05-16 02:48:28 +00:00
defined ( PLATFORM_TRINKET ) | | defined ( PLATFORM_LITO ) | | \
2019-09-26 05:24:04 +00:00
defined ( PLATFORM_ATOLL ) | | defined ( PLATFORM_BENGAL )
2015-09-14 17:57:35 +00:00
# define PLAYBACK_OFFLOAD_DEVICE2 17
2019-12-23 13:26:54 +00:00
# elif defined (PLATFORM_MSMFALCON) || defined (PLATFORM_MSM8937) || \
defined ( PLATFORM_MSM8953 )
2019-04-04 07:58:07 +00:00
# define PLAYBACK_OFFLOAD_DEVICE2 24
2015-09-14 17:57:35 +00:00
# endif
2018-10-08 05:06:05 +00:00
# if defined (PLATFORM_APQ8084) || defined (PLATFORM_MSM8996) || \
defined ( PLATFORM_MSM8998 ) | | defined ( PLATFORM_SDM845 ) | | \
defined ( PLATFORM_SDM710 ) | | defined ( PLATFORM_QCS605 ) | | \
defined ( PLATFORM_SDX24 ) | | defined ( PLATFORM_MSMNILE ) | | \
defined ( PLATFORM_KONA ) | | defined ( PLATFORM_MSMSTEPPE ) | | \
2019-02-27 16:48:49 +00:00
defined ( PLATFORM_QCS405 ) | | defined ( PLATFORM_TRINKET ) | | \
2019-04-04 07:58:07 +00:00
defined ( PLATFORM_LITO ) | | defined ( PLATFORM_MSMFALCON ) | | \
2019-09-26 05:24:04 +00:00
defined ( PLATFORM_MSM8937 ) | | defined ( PLATFORM_ATOLL ) | | \
2019-12-23 13:26:54 +00:00
defined ( PLATFORM_BENGAL ) | | defined ( PLATFORM_MSM8953 )
2014-04-02 04:03:10 +00:00
# define PLAYBACK_OFFLOAD_DEVICE3 18
# define PLAYBACK_OFFLOAD_DEVICE4 34
# define PLAYBACK_OFFLOAD_DEVICE5 35
# define PLAYBACK_OFFLOAD_DEVICE6 36
# define PLAYBACK_OFFLOAD_DEVICE7 37
# define PLAYBACK_OFFLOAD_DEVICE8 38
# define PLAYBACK_OFFLOAD_DEVICE9 39
# endif
2015-12-08 18:47:12 +00:00
# ifdef PLATFORM_MSM8994
2014-05-27 21:01:47 +00:00
# define PLAYBACK_OFFLOAD_DEVICE3 18
# define PLAYBACK_OFFLOAD_DEVICE4 37
# define PLAYBACK_OFFLOAD_DEVICE5 38
# define PLAYBACK_OFFLOAD_DEVICE6 39
# define PLAYBACK_OFFLOAD_DEVICE7 40
# define PLAYBACK_OFFLOAD_DEVICE8 41
# define PLAYBACK_OFFLOAD_DEVICE9 42
# endif
2014-04-02 04:03:10 +00:00
2013-11-15 23:21:40 +00:00
# define COMPRESS_VOIP_CALL_PCM_DEVICE 3
2017-06-08 01:16:14 +00:00
# define AUDIO_PLAYBACK_VOIP_PCM_DEVICE 16
# define AUDIO_RECORD_VOIP_PCM_DEVICE 16
2013-11-13 19:46:52 +00:00
2019-02-20 23:17:07 +00:00
// Update based on haptic device id
# define AUDIO_HAPTICS_PCM_DEVICE 43
# define HAPTICS_PCM_DEVICE 44
2013-11-13 19:46:52 +00:00
# ifdef PLATFORM_MSM8610
# define LOWLATENCY_PCM_DEVICE 12
2014-04-14 15:48:52 +00:00
# define EC_REF_RX "SEC_I2S_RX"
2019-12-23 13:26:54 +00:00
# elif defined (PLATFORM_MSMFALCON) || defined (PLATFORM_MSM8937) || \
defined ( PLATFORM_MSM8953 )
2019-04-04 07:58:07 +00:00
# define LOWLATENCY_PCM_DEVICE 12
# define EC_REF_RX "I2S_RX"
# define MMAP_PLAYBACK_PCM_DEVICE 2
# define MMAP_RECORD_PCM_DEVICE 2
2017-05-24 13:37:15 +00:00
# elif PLATFORM_BEAR_FAMILY
# define EC_REF_RX "I2S_RX"
2013-11-13 19:46:52 +00:00
# else
# define LOWLATENCY_PCM_DEVICE 15
2017-06-01 00:16:49 +00:00
# define MMAP_PLAYBACK_PCM_DEVICE 18
# define MMAP_RECORD_PCM_DEVICE 18
2013-12-10 23:37:00 +00:00
# define EC_REF_RX "SLIM_RX"
2013-11-13 19:46:52 +00:00
# endif
2017-05-24 13:37:15 +00:00
2013-11-20 18:39:32 +00:00
# ifdef PLATFORM_MSM8x26
# define COMPRESS_CAPTURE_DEVICE 20
# else
2013-10-25 23:26:03 +00:00
# define COMPRESS_CAPTURE_DEVICE 19
2013-11-20 18:39:32 +00:00
# endif
2013-10-07 22:23:41 +00:00
2013-10-01 22:49:05 +00:00
# ifdef PLATFORM_MSM8x26
2013-11-13 19:46:52 +00:00
# define VOICE_CALL_PCM_DEVICE 2
2013-10-01 22:49:05 +00:00
# define VOICE2_CALL_PCM_DEVICE 14
# define VOLTE_CALL_PCM_DEVICE 17
# define QCHAT_CALL_PCM_DEVICE 18
2014-02-13 01:58:59 +00:00
# define VOWLAN_CALL_PCM_DEVICE 30
2018-12-18 22:23:57 +00:00
# elif defined (PLATFORM_APQ8084) || defined (PLATFORM_MSM8084)
2013-11-13 19:46:52 +00:00
# define VOICE_CALL_PCM_DEVICE 20
2014-03-20 01:59:39 +00:00
# define VOICE2_CALL_PCM_DEVICE 25
2013-11-13 19:46:52 +00:00
# define VOLTE_CALL_PCM_DEVICE 21
2014-03-27 20:51:33 +00:00
# define QCHAT_CALL_PCM_DEVICE 33
2014-02-13 01:58:59 +00:00
# define VOWLAN_CALL_PCM_DEVICE -1
2013-12-09 22:56:18 +00:00
# elif PLATFORM_MSM8610
2013-11-13 19:46:52 +00:00
# define VOICE_CALL_PCM_DEVICE 2
2013-10-01 22:49:05 +00:00
# define VOICE2_CALL_PCM_DEVICE 13
2013-12-30 14:00:46 +00:00
# define VOLTE_CALL_PCM_DEVICE 15
# define QCHAT_CALL_PCM_DEVICE 14
2014-02-13 01:58:59 +00:00
# define VOWLAN_CALL_PCM_DEVICE -1
2014-05-16 05:45:59 +00:00
# elif PLATFORM_MSM8994
# define VOICE_CALL_PCM_DEVICE 2
# define VOICE2_CALL_PCM_DEVICE 22
# define VOLTE_CALL_PCM_DEVICE 14
# define QCHAT_CALL_PCM_DEVICE 20
# define VOWLAN_CALL_PCM_DEVICE 36
2015-02-13 01:38:22 +00:00
# elif PLATFORM_MSM8996
# define VOICE_CALL_PCM_DEVICE 40
# define VOICE2_CALL_PCM_DEVICE 41
# define VOLTE_CALL_PCM_DEVICE 14
# define QCHAT_CALL_PCM_DEVICE 20
# define VOWLAN_CALL_PCM_DEVICE 33
2017-05-24 13:37:15 +00:00
# elif PLATFORM_BEAR_FAMILY
# define VOICE_CALL_PCM_DEVICE 2
# define VOICE2_CALL_PCM_DEVICE 13
# define VOLTE_CALL_PCM_DEVICE 15
# define QCHAT_CALL_PCM_DEVICE 37
# define VOWLAN_CALL_PCM_DEVICE 16
2019-12-23 13:26:54 +00:00
# elif defined (PLATFORM_MSMFALCON) || defined (PLATFORM_MSM8937) || \
defined ( PLATFORM_MSM8953 )
2019-04-04 07:58:07 +00:00
# define VOICE_CALL_PCM_DEVICE 2
# define VOICE2_CALL_PCM_DEVICE 13
# define VOLTE_CALL_PCM_DEVICE 15
# define QCHAT_CALL_PCM_DEVICE 37
# define VOWLAN_CALL_PCM_DEVICE 16
2019-03-22 14:18:44 +00:00
# elif PLATFORM_AUTO
# define HOST_LESS_RX_ID 41
# define HOST_LESS_TX_ID 42
# define VOICE_CALL_PCM_DEVICE 8
# define VOICE2_CALL_PCM_DEVICE -1
# define VOLTE_CALL_PCM_DEVICE -1
# define QCHAT_CALL_PCM_DEVICE -1
# define VOWLAN_CALL_PCM_DEVICE -1
2013-12-09 22:56:18 +00:00
# else
# define VOICE_CALL_PCM_DEVICE 2
# define VOICE2_CALL_PCM_DEVICE 22
# define VOLTE_CALL_PCM_DEVICE 14
# define QCHAT_CALL_PCM_DEVICE 20
2014-05-09 23:28:40 +00:00
# define VOWLAN_CALL_PCM_DEVICE 36
2013-10-01 22:49:05 +00:00
# endif
2015-02-13 01:38:22 +00:00
# ifdef PLATFORM_MSM8996
# define VOICEMMODE1_CALL_PCM_DEVICE 2
# define VOICEMMODE2_CALL_PCM_DEVICE 22
# else
# define VOICEMMODE1_CALL_PCM_DEVICE 44
# define VOICEMMODE2_CALL_PCM_DEVICE 45
# endif
2014-09-05 20:51:35 +00:00
# define AFE_PROXY_PLAYBACK_PCM_DEVICE 7
# define AFE_PROXY_RECORD_PCM_DEVICE 8
2014-02-11 10:29:58 +00:00
# ifdef PLATFORM_MSM8x26
2018-12-18 22:23:57 +00:00
# ifdef EXTERNAL_BT_SUPPORTED
# define HFP_SCO_RX 10 // AUXPCM Hostless
# else
2014-02-11 10:29:58 +00:00
# define HFP_SCO_RX 28
2018-12-18 22:23:57 +00:00
# endif
2014-02-11 10:29:58 +00:00
# define HFP_ASM_RX_TX 29
2017-05-24 13:37:15 +00:00
# elif PLATFORM_BEAR_FAMILY
# define HFP_SCO_RX 17
# define HFP_ASM_RX_TX 18
2018-10-24 08:04:25 +00:00
# elif PLATFORM_AUTO
2017-05-23 16:23:53 +00:00
# define HFP_SCO_RX 29
# define HFP_ASM_RX_TX 36
2019-06-24 10:42:03 +00:00
# define HFP_EXT_EC_REF_TX 1
2019-12-23 13:26:54 +00:00
# elif defined (PLATFORM_MSMFALCON) || defined (PLATFORM_MSM8937) || \
defined ( PLATFORM_MSM8953 )
2019-04-04 07:58:07 +00:00
# define HFP_SCO_RX 17
# define HFP_ASM_RX_TX 18
2014-02-11 10:29:58 +00:00
# else
# define HFP_SCO_RX 23
# define HFP_ASM_RX_TX 24
# endif
2017-05-19 09:56:33 +00:00
# define TRANSCODE_LOOPBACK_RX_DEV_ID 43
# define TRANSCODE_LOOPBACK_TX_DEV_ID 44
2017-07-06 14:18:56 +00:00
# define PLAYBACK_INTERACTIVE_STRM_DEVICE1 0
# define PLAYBACK_INTERACTIVE_STRM_DEVICE2 1
# define PLAYBACK_INTERACTIVE_STRM_DEVICE3 27
# define PLAYBACK_INTERACTIVE_STRM_DEVICE4 45
# define PLAYBACK_INTERACTIVE_STRM_DEVICE5 46
# define PLAYBACK_INTERACTIVE_STRM_DEVICE6 47
# define PLAYBACK_INTERACTIVE_STRM_DEVICE7 48
# define PLAYBACK_INTERACTIVE_STRM_DEVICE8 49
2017-06-12 21:16:24 +00:00
# define MEDIA_PCM_DEVICE DEEP_BUFFER_PCM_DEVICE
# define SYS_NOTIFICATION_PCM_DEVICE 9
# define NAV_GUIDANCE_PCM_DEVICE MULTIMEDIA2_PCM_DEVICE
# define PHONE_PCM_DEVICE 12
2019-08-01 20:57:49 +00:00
# define REAR_SEAT_PCM_DEVICE 54
2017-06-12 21:16:24 +00:00
2014-04-11 00:59:02 +00:00
# ifdef PLATFORM_APQ8084
# define FM_RX_VOLUME "Quat MI2S FM RX Volume"
2014-07-10 19:20:19 +00:00
# elif PLATFORM_MSM8994
# define FM_RX_VOLUME "PRI MI2S LOOPBACK Volume"
2019-06-06 16:30:56 +00:00
# elif defined (PLATFORM_MSM8996) || defined (PLATFORM_KONA)
2014-10-16 01:29:34 +00:00
# define FM_RX_VOLUME "Tert MI2S LOOPBACK Volume"
2019-09-26 05:24:04 +00:00
# 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) || defined (PLATFORM_LITO) || defined (PLATFORM_ATOLL) ||defined (PLATFORM_BENGAL)
2016-03-05 02:31:22 +00:00
# define FM_RX_VOLUME "SLIMBUS_8 LOOPBACK Volume"
2014-04-11 00:59:02 +00:00
# else
# define FM_RX_VOLUME "Internal FM RX Volume"
# endif
2016-05-25 10:55:53 +00:00
# define PLATFORM_MAX_MIC_COUNT "input_mic_max_count"
# define PLATFORM_DEFAULT_MIC_COUNT 2
2017-08-04 01:04:55 +00:00
# define TX_VOICE_FLUENCE_PROV2 0x10F17
2018-07-17 18:59:25 +00:00
# define TX_VOICE_TM_FLUENCE_PRO_VC 0x10F35
# define TX_VOICE_TM_FLUENCE_EF 0x10F33
2017-08-04 01:04:55 +00:00
# define TX_VOICE_DM_FV5_BROADSIDE 0x10F18
# define TX_VOICE_FV5ECNS_SM 0x10F09
2018-07-12 18:35:57 +00:00
# define TX_VOICE_SMECNS_V2 0x10F31
2017-08-04 01:04:55 +00:00
# define TX_VOICE_FV5ECNS_DM 0x10F0A
2019-04-17 01:43:38 +00:00
# define TX_VOICE_FLUENCE_SM_SB 0x10F38
# define TX_VOICE_FLUENCE_MM_SB 0x10F39
2017-08-04 01:04:55 +00:00
2019-06-28 08:57:30 +00:00
/* multi-mic surround ECNS zone control */
# define TOPOLOGY_ID_MM_HFP_ECNS 0x1FFF0002
# define MODULE_ID_MM_HFP_ECNS 0x10F3B
# define PARAM_ID_MM_HFP_ZONE 0x109F0
# define INSTANCE_ID_MM_HFP_ECNS 0x8000
2013-11-13 19:46:52 +00:00
# define LIB_CSD_CLIENT "libcsd-client.so"
2018-06-25 10:53:32 +00:00
# define AUDIO_MAKE_STRING_FROM_ENUM(X) { #X, X }
2013-11-13 19:46:52 +00:00
/* CSD-CLIENT related functions */
2014-02-24 06:04:44 +00:00
typedef int ( * init_t ) ( bool ) ;
2013-11-13 19:46:52 +00:00
typedef int ( * deinit_t ) ( ) ;
typedef int ( * disable_device_t ) ( ) ;
2013-11-14 01:30:53 +00:00
typedef int ( * enable_device_config_t ) ( int , int ) ;
2013-11-13 19:46:52 +00:00
typedef int ( * enable_device_t ) ( int , int , uint32_t ) ;
2014-03-11 18:57:48 +00:00
typedef int ( * volume_t ) ( uint32_t , int , uint16_t ) ;
typedef int ( * mic_mute_t ) ( uint32_t , int , uint16_t ) ;
2013-11-13 19:46:52 +00:00
typedef int ( * slow_talk_t ) ( uint32_t , uint8_t ) ;
typedef int ( * start_voice_t ) ( uint32_t ) ;
typedef int ( * stop_voice_t ) ( uint32_t ) ;
typedef int ( * start_playback_t ) ( uint32_t ) ;
typedef int ( * stop_playback_t ) ( uint32_t ) ;
2014-04-25 18:08:08 +00:00
typedef int ( * set_lch_t ) ( uint32_t , enum voice_lch_mode ) ;
2013-11-13 19:46:52 +00:00
typedef int ( * start_record_t ) ( uint32_t , int ) ;
2013-11-20 00:02:12 +00:00
typedef int ( * stop_record_t ) ( uint32_t ) ;
2014-02-24 06:04:44 +00:00
typedef int ( * get_sample_rate_t ) ( uint32_t * ) ;
2013-11-13 19:46:52 +00:00
/* CSD Client structure */
struct csd_data {
void * csd_client ;
init_t init ;
deinit_t deinit ;
disable_device_t disable_device ;
2013-11-14 01:30:53 +00:00
enable_device_config_t enable_device_config ;
2013-11-13 19:46:52 +00:00
enable_device_t enable_device ;
volume_t volume ;
mic_mute_t mic_mute ;
slow_talk_t slow_talk ;
start_voice_t start_voice ;
stop_voice_t stop_voice ;
start_playback_t start_playback ;
stop_playback_t stop_playback ;
2014-04-25 18:08:08 +00:00
set_lch_t set_lch ;
2013-11-13 19:46:52 +00:00
start_record_t start_record ;
stop_record_t stop_record ;
2014-02-24 06:04:44 +00:00
get_sample_rate_t get_sample_rate ;
2013-11-13 19:46:52 +00:00
} ;
2013-10-07 22:23:41 +00:00
2014-10-20 23:17:01 +00:00
/* HDMI Passthrough defines */
enum {
LEGACY_PCM = 0 ,
PASSTHROUGH ,
2016-07-19 13:03:53 +00:00
PASSTHROUGH_CONVERT ,
2017-04-07 23:44:23 +00:00
PASSTHROUGH_DSD ,
LISTEN ,
PASSTHROUGH_GEN ,
PASSTHROUGH_IEC61937
2014-10-20 23:17:01 +00:00
} ;
/*
* ID for setting mute and lateny on the device side
* through Device PP Params mixer control .
*/
# define DEVICE_PARAM_MUTE_ID 0
# define DEVICE_PARAM_LATENCY_ID 1
2017-06-14 00:46:45 +00:00
# define DEVICE_PARAM_LIMITER_ID 2
2015-03-06 22:57:35 +00:00
# define ENUM_TO_STRING(X) #X
struct audio_device_to_audio_interface {
audio_devices_t device ;
char device_name [ 100 ] ;
char interface_name [ 100 ] ;
} ;
2016-07-27 07:03:25 +00:00
2013-05-14 22:27:20 +00:00
# endif // QCOM_AUDIO_PLATFORM_H