diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-01-28 08:41:48 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-01-28 08:41:47 -0800 |
| commit | 8f716987eb006ec727a0c98ed72b50aa4286d0a7 (patch) | |
| tree | 0c2488a4e5b497e6e0e7a1b080d19f9a7397abd6 /include | |
| parent | 82325068878803676a814bc631eb370868e86a7d (diff) | |
| parent | 5ccf5cf5f8ed9036baf609fccc837f1b9ff530a2 (diff) | |
Merge "ASoC: msm: qdsp6v2: Add support for AFE sidetone"
Diffstat (limited to 'include')
| -rw-r--r-- | include/sound/apr_audio-v2.h | 52 | ||||
| -rw-r--r-- | include/sound/q6afe-v2.h | 4 | ||||
| -rw-r--r-- | include/uapi/linux/msm_audio_calibration.h | 27 |
3 files changed, 81 insertions, 2 deletions
diff --git a/include/sound/apr_audio-v2.h b/include/sound/apr_audio-v2.h index 38d49a2af8be..19893da9dda0 100644 --- a/include/sound/apr_audio-v2.h +++ b/include/sound/apr_audio-v2.h @@ -1349,6 +1349,8 @@ struct afe_mod_enable_param { * #AFE_MODULE_SIDETONE_IIR_FILTER module. */ #define AFE_PARAM_ID_SIDETONE_IIR_FILTER_CONFIG 0x00010204 +#define MAX_SIDETONE_IIR_DATA_SIZE 224 +#define MAX_NO_IIR_FILTER_STAGE 10 struct afe_sidetone_iir_filter_config_params { u16 num_biquad_stages; @@ -1360,6 +1362,7 @@ struct afe_sidetone_iir_filter_config_params { /* Pregain for the compensating filter response. * Supported values: Any number in Q13 format */ + uint8_t iir_config[MAX_SIDETONE_IIR_DATA_SIZE]; } __packed; #define AFE_MODULE_LOOPBACK 0x00010205 @@ -1511,6 +1514,55 @@ struct afe_loopback_cfg_v1 { } __packed; +struct afe_loopback_sidetone_gain { + u16 rx_port_id; + u16 gain; +} __packed; + +struct loopback_cfg_data { + u32 loopback_cfg_minor_version; +/* Minor version used for tracking the version of the RMC module + * configuration interface. + * Supported values: #AFE_API_VERSION_LOOPBACK_CONFIG + */ + u16 dst_port_id; + /* Destination Port Id. */ + u16 routing_mode; +/* Specifies data path type from src to dest port. + * Supported values: + * #LB_MODE_DEFAULT + * #LB_MODE_SIDETONE + * #LB_MODE_EC_REF_VOICE_AUDIO + * #LB_MODE_EC_REF_VOICE_A + * #LB_MODE_EC_REF_VOICE + */ + + u16 enable; +/* Specifies whether to enable (1) or + * disable (0) an AFE loopback. + */ + u16 reserved; +/* Reserved for 32-bit alignment. This field must be set to 0. + */ +} __packed; + +struct afe_st_loopback_cfg_v1 { + struct apr_hdr hdr; + struct afe_port_cmd_set_param_v2 param; + struct afe_port_param_data_v2 gain_pdata; + struct afe_loopback_sidetone_gain gain_data; + struct afe_port_param_data_v2 cfg_pdata; + struct loopback_cfg_data cfg_data; +} __packed; + +struct afe_loopback_iir_cfg_v2 { + struct apr_hdr hdr; + struct afe_port_cmd_set_param_v2 param; + struct afe_port_param_data_v2 st_iir_enable_pdata; + struct afe_mod_enable_param st_iir_mode_enable_data; + struct afe_port_param_data_v2 st_iir_filter_config_pdata; + struct afe_sidetone_iir_filter_config_params st_iir_filter_config_data; +} __packed; #define AFE_MODULE_SPEAKER_PROTECTION 0x00010209 #define AFE_PARAM_ID_SPKR_PROT_CONFIG 0x0001020a #define AFE_API_VERSION_SPKR_PROT_CONFIG 0x1 diff --git a/include/sound/q6afe-v2.h b/include/sound/q6afe-v2.h index e0da428fa52f..a47d2805b9c5 100644 --- a/include/sound/q6afe-v2.h +++ b/include/sound/q6afe-v2.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -265,7 +265,7 @@ struct aanc_data { int afe_open(u16 port_id, union afe_port_config *afe_config, int rate); int afe_close(int port_id); int afe_loopback(u16 enable, u16 rx_port, u16 tx_port); -int afe_sidetone(u16 tx_port_id, u16 rx_port_id, u16 enable, uint16_t gain); +int afe_sidetone_enable(u16 tx_port_id, u16 rx_port_id, bool enable); int afe_loopback_gain(u16 port_id, u16 volume); int afe_validate_port(u16 port_id); int afe_get_port_index(u16 port_id); diff --git a/include/uapi/linux/msm_audio_calibration.h b/include/uapi/linux/msm_audio_calibration.h index 3c6ab13ca470..f05f9aaddb70 100644 --- a/include/uapi/linux/msm_audio_calibration.h +++ b/include/uapi/linux/msm_audio_calibration.h @@ -98,12 +98,15 @@ enum { ULP_LSM_TOPOLOGY_ID_CAL_TYPE, AFE_FB_SPKR_PROT_TH_VI_CAL_TYPE, AFE_FB_SPKR_PROT_EX_VI_CAL_TYPE, + AFE_SIDETONE_IIR_CAL_TYPE, MAX_CAL_TYPES, }; #define AFE_FB_SPKR_PROT_TH_VI_CAL_TYPE AFE_FB_SPKR_PROT_TH_VI_CAL_TYPE #define AFE_FB_SPKR_PROT_EX_VI_CAL_TYPE AFE_FB_SPKR_PROT_EX_VI_CAL_TYPE +#define AFE_SIDETONE_IIR_CAL_TYPE AFE_SIDETONE_IIR_CAL_TYPE + enum { VERSION_0_0, }; @@ -346,6 +349,19 @@ struct audio_cal_info_sidetone { int32_t pid; }; +#define MAX_SIDETONE_IIR_DATA_SIZE 224 +#define MAX_NO_IIR_FILTER_STAGE 10 + +struct audio_cal_info_sidetone_iir { + uint16_t iir_enable; + uint16_t num_biquad_stages; + uint16_t pregain; + int32_t tx_acdb_id; + int32_t rx_acdb_id; + int32_t mid; + int32_t pid; + uint8_t iir_config[MAX_SIDETONE_IIR_DATA_SIZE]; +}; struct audio_cal_info_lsm_top { int32_t topology; int32_t acdb_id; @@ -580,6 +596,17 @@ struct audio_cal_sidetone { struct audio_cal_type_sidetone cal_type; }; +struct audio_cal_type_sidetone_iir { + struct audio_cal_type_header cal_hdr; + struct audio_cal_data cal_data; + struct audio_cal_info_sidetone_iir cal_info; +}; + +struct audio_cal_sidetone_iir { + struct audio_cal_header hdr; + struct audio_cal_type_sidetone_iir cal_type; +}; + struct audio_cal_type_lsm_top { struct audio_cal_type_header cal_hdr; struct audio_cal_data cal_data; |
