Merge "asoc: dsp: add support for aptx adaptive speech"
diff --git a/asoc/msm-dai-q6-v2.c b/asoc/msm-dai-q6-v2.c
index 336f974..d4f33c7 100644
--- a/asoc/msm-dai-q6-v2.c
+++ b/asoc/msm-dai-q6-v2.c
@@ -57,6 +57,8 @@
ENC_FMT_APTX_ADAPTIVE = ASM_MEDIA_FMT_APTX_ADAPTIVE,
DEC_FMT_APTX_ADAPTIVE = ASM_MEDIA_FMT_APTX_ADAPTIVE,
DEC_FMT_MP3 = ASM_MEDIA_FMT_MP3,
+ ENC_FMT_APTX_AD_SPEECH = ASM_MEDIA_FMT_APTX_AD_SPEECH,
+ DEC_FMT_APTX_AD_SPEECH = ASM_MEDIA_FMT_APTX_AD_SPEECH,
};
enum {
@@ -2833,6 +2835,12 @@
&dai_data->enc_config.data,
sizeof(struct asm_aptx_ad_enc_cfg_t));
break;
+ case ENC_FMT_APTX_AD_SPEECH:
+ memcpy(ucontrol->value.bytes.data + format_size,
+ &dai_data->enc_config.data,
+ sizeof(struct asm_aptx_ad_speech_enc_cfg_t));
+ break;
+
default:
pr_debug("%s: unknown format = %d\n",
__func__, dai_data->enc_config.format);
@@ -2896,6 +2904,12 @@
ucontrol->value.bytes.data + format_size,
sizeof(struct asm_aptx_ad_enc_cfg_t));
break;
+ case ENC_FMT_APTX_AD_SPEECH:
+ memcpy(&dai_data->enc_config.data,
+ ucontrol->value.bytes.data + format_size,
+ sizeof(struct asm_aptx_ad_speech_enc_cfg_t));
+ break;
+
default:
pr_debug("%s: Ignore enc config for unknown format = %d\n",
__func__, dai_data->enc_config.format);
@@ -3222,6 +3236,7 @@
{
struct msm_dai_q6_dai_data *dai_data = kcontrol->private_data;
u32 format_size = 0;
+ u32 abr_size = 0;
if (!dai_data) {
pr_err("%s: Invalid dai data\n", __func__);
@@ -3235,10 +3250,25 @@
pr_debug("%s: abr_dec_cfg for %d format\n",
__func__, dai_data->dec_config.format);
+ abr_size = sizeof(dai_data->dec_config.abr_dec_cfg.imc_info);
memcpy(ucontrol->value.bytes.data + format_size,
&dai_data->dec_config.abr_dec_cfg,
sizeof(struct afe_imc_dec_enc_info));
+ switch (dai_data->dec_config.format) {
+ case DEC_FMT_APTX_AD_SPEECH:
+ pr_debug("%s: afe_dec_cfg for %d format\n",
+ __func__, dai_data->dec_config.format);
+ memcpy(ucontrol->value.bytes.data + format_size + abr_size,
+ &dai_data->dec_config.data,
+ sizeof(struct asm_aptx_ad_speech_dec_cfg_t));
+ break;
+ default:
+ pr_debug("%s: no afe_dec_cfg for format %d\n",
+ __func__, dai_data->dec_config.format);
+ break;
+ }
+
return 0;
}
@@ -3247,6 +3277,7 @@
{
struct msm_dai_q6_dai_data *dai_data = kcontrol->private_data;
u32 format_size = 0;
+ u32 abr_size = 0;
if (!dai_data) {
pr_err("%s: Invalid dai data\n", __func__);
@@ -3262,10 +3293,25 @@
pr_debug("%s: abr_dec_cfg for %d format\n",
__func__, dai_data->dec_config.format);
+ abr_size = sizeof(dai_data->dec_config.abr_dec_cfg.imc_info);
memcpy(&dai_data->dec_config.abr_dec_cfg,
ucontrol->value.bytes.data + format_size,
sizeof(struct afe_imc_dec_enc_info));
dai_data->dec_config.abr_dec_cfg.is_abr_enabled = true;
+
+ switch (dai_data->dec_config.format) {
+ case DEC_FMT_APTX_AD_SPEECH:
+ pr_debug("%s: afe_dec_cfg for %d format\n",
+ __func__, dai_data->dec_config.format);
+ memcpy(&dai_data->dec_config.data,
+ ucontrol->value.bytes.data + format_size + abr_size,
+ sizeof(struct asm_aptx_ad_speech_dec_cfg_t));
+ break;
+ default:
+ pr_debug("%s: no afe_dec_cfg for format %d\n",
+ __func__, dai_data->dec_config.format);
+ break;
+ }
return 0;
}
diff --git a/asoc/msm-pcm-routing-v2.c b/asoc/msm-pcm-routing-v2.c
index d79682e..d5bad0f 100644
--- a/asoc/msm-pcm-routing-v2.c
+++ b/asoc/msm-pcm-routing-v2.c
@@ -57,6 +57,7 @@
static int fm_switch_enable;
static int hfp_switch_enable;
static int a2dp_switch_enable;
+static int sco_switch_enable;
static int int0_mi2s_switch_enable;
static int int4_mi2s_switch_enable;
static int pri_mi2s_switch_enable;
@@ -2559,6 +2560,34 @@
return 1;
}
+static int msm_routing_sco_switch_mixer_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ ucontrol->value.integer.value[0] = sco_switch_enable;
+ pr_debug("%s: SCO Switch enable %ld\n", __func__,
+ ucontrol->value.integer.value[0]);
+ return 0;
+}
+
+static int msm_routing_sco_switch_mixer_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_soc_dapm_widget *widget =
+ snd_soc_dapm_kcontrol_widget(kcontrol);
+ struct snd_soc_dapm_update *update = NULL;
+
+ pr_debug("%s: SCO Switch enable %ld\n", __func__,
+ ucontrol->value.integer.value[0]);
+ sco_switch_enable = ucontrol->value.integer.value[0];
+ if (sco_switch_enable)
+ snd_soc_dapm_mixer_update_power(widget->dapm, kcontrol,
+ 1, update);
+ else
+ snd_soc_dapm_mixer_update_power(widget->dapm, kcontrol,
+ 0, update);
+ return 1;
+}
+
static int msm_routing_get_int0_mi2s_switch_mixer(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
@@ -17592,6 +17621,11 @@
0, 1, 0, msm_routing_a2dp_switch_mixer_get,
msm_routing_a2dp_switch_mixer_put);
+static const struct snd_kcontrol_new sco_slim7_switch_mixer_controls =
+ SOC_SINGLE_EXT("Switch", SND_SOC_NOPM,
+ 0, 1, 0, msm_routing_sco_switch_mixer_get,
+ msm_routing_sco_switch_mixer_put);
+
static const struct soc_enum lsm_port_enum =
SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(lsm_port_text), lsm_port_text);
@@ -19736,6 +19770,8 @@
&quat_mi2s_rx_switch_mixer_controls),
SND_SOC_DAPM_SWITCH("QUIN_MI2S_RX_DL_HL", SND_SOC_NOPM, 0, 0,
&quin_mi2s_rx_switch_mixer_controls),
+ SND_SOC_DAPM_SWITCH("SCO_SLIM7_DL_HL", SND_SOC_NOPM, 0, 0,
+ &sco_slim7_switch_mixer_controls),
SND_SOC_DAPM_SWITCH("HFP_PRI_AUX_UL_HL", SND_SOC_NOPM, 0, 0,
&hfp_pri_aux_switch_mixer_controls),
SND_SOC_DAPM_SWITCH("HFP_AUX_UL_HL", SND_SOC_NOPM, 0, 0,
@@ -22806,6 +22842,8 @@
{"SLIMBUS_4_RX", NULL, "SLIMBUS4_DL_HL"},
{"SLIMBUS6_DL_HL", "Switch", "SLIM0_DL_HL"},
{"SLIMBUS_6_RX", NULL, "SLIMBUS6_DL_HL"},
+ {"SCO_SLIM7_DL_HL", "Switch", "SLIM7_DL_HL"},
+ {"SLIMBUS_7_RX", NULL, "SCO_SLIM7_DL_HL"},
{"SLIM0_UL_HL", NULL, "SLIMBUS_0_TX"},
{"SLIM1_UL_HL", NULL, "SLIMBUS_1_TX"},
{"SLIM3_UL_HL", NULL, "SLIMBUS_3_TX"},
diff --git a/dsp/q6afe.c b/dsp/q6afe.c
index c470ecf..6c188d7 100644
--- a/dsp/q6afe.c
+++ b/dsp/q6afe.c
@@ -91,6 +91,11 @@
APTX_AD_44_1 = 1
};
+enum {
+ AFE_MATCHED_PORT_DISABLE,
+ AFE_MATCHED_PORT_ENABLE
+};
+
struct wlock {
struct wakeup_source ws;
};
@@ -3656,6 +3661,8 @@
struct avs_dec_congestion_buffer_param_t dec_buffer_id_param;
struct afe_enc_dec_imc_info_param_t imc_info_param;
struct afe_port_media_type_t media_type;
+ struct afe_matched_port_t matched_port_param;
+ struct asm_aptx_ad_speech_mode_cfg_t speech_codec_init_param;
struct param_hdr_v3 param_hdr;
int ret;
u32 dec_fmt;
@@ -3664,6 +3671,8 @@
memset(&dec_media_fmt, 0, sizeof(dec_media_fmt));
memset(&imc_info_param, 0, sizeof(imc_info_param));
memset(&media_type, 0, sizeof(media_type));
+ memset(&matched_port_param, 0, sizeof(matched_port_param));
+ memset(&speech_codec_init_param, 0, sizeof(speech_codec_init_param));
memset(¶m_hdr, 0, sizeof(param_hdr));
param_hdr.module_id = AFE_MODULE_ID_DECODER;
@@ -3782,6 +3791,9 @@
break;
}
/* fall through for abr enabled case */
+ case ASM_MEDIA_FMT_APTX_AD_SPEECH:
+ media_type.sample_rate = AFE_PORT_SAMPLE_RATE_32K;
+ break;
default:
media_type.sample_rate =
afe_config.slim_sch.sample_rate;
@@ -3808,7 +3820,8 @@
}
if (format != ASM_MEDIA_FMT_SBC && format != ASM_MEDIA_FMT_AAC_V2 &&
- format != ASM_MEDIA_FMT_APTX_ADAPTIVE) {
+ format != ASM_MEDIA_FMT_APTX_ADAPTIVE &&
+ format != ASM_MEDIA_FMT_APTX_AD_SPEECH) {
pr_debug("%s:Unsuppported dec format. Ignore AFE config %u\n",
__func__, format);
goto exit;
@@ -3819,6 +3832,24 @@
pr_debug("%s: Ignore AFE config for abr case\n", __func__);
goto exit;
}
+ if (format == ASM_MEDIA_FMT_APTX_AD_SPEECH) {
+ pr_debug("%s: sending AFE_PARAM_ID_RATE_MATCHED_PORT to DSP payload\n",
+ __func__);
+ param_hdr.param_id = AFE_PARAM_ID_RATE_MATCHED_PORT;
+ param_hdr.param_size =
+ sizeof(struct afe_matched_port_t);
+ matched_port_param.minor_version = AFE_API_VERSION_PORT_MEDIA_TYPE;
+ matched_port_param.enable = AFE_MATCHED_PORT_ENABLE;
+ ret = q6afe_pack_and_set_param_in_band(port_id,
+ q6audio_get_port_index(port_id),
+ param_hdr,
+ (u8 *) &matched_port_param);
+ if (ret) {
+ pr_err("%s: AFE_PARAM_ID_RATE_MATCHED_PORT for port 0x%x failed %d\n",
+ __func__, port_id, ret);
+ goto exit;
+ }
+ }
pr_debug("%s: sending AFE_DECODER_PARAM_ID_DEC_MEDIA_FMT to DSP payload\n",
__func__);
@@ -3855,6 +3886,26 @@
goto exit;
}
break;
+ case ASM_MEDIA_FMT_APTX_AD_SPEECH:
+ param_hdr.param_size =
+ sizeof(struct asm_aptx_ad_speech_dec_cfg_t);
+
+ pr_debug("%s: send AVS_DECODER_PARAM_ID_APTX_AD_SPEECH_DEC_INIT to DSP payload\n",
+ __func__);
+ param_hdr.param_id =
+ AVS_DECODER_PARAM_ID_APTX_AD_SPEECH_DEC_INIT;
+ speech_codec_init_param =
+ cfg->data.aptx_ad_speech_config.speech_mode;
+ ret = q6afe_pack_and_set_param_in_band(port_id,
+ q6audio_get_port_index(port_id),
+ param_hdr,
+ (u8 *) &speech_codec_init_param);
+ if (ret) {
+ pr_err("%s: AVS_DECODER_PARAM_ID_APTX_ADAPTIVE_SPEECH_DEC_INIT for port 0x%x failed %d\n",
+ __func__, port_id, ret);
+ goto exit;
+ }
+ break;
default:
pr_debug("%s:No need to send DEC_MEDIA_FMT to DSP payload\n",
__func__);
@@ -3881,6 +3932,8 @@
struct asm_aac_frame_size_control_t frame_ctl_param;
struct afe_port_media_type_t media_type;
struct aptx_channel_mode_param_t channel_mode_param;
+ struct afe_matched_port_t matched_port_param;
+ struct asm_aptx_ad_speech_mode_cfg_t speech_codec_init_param;
struct param_hdr_v3 param_hdr;
int ret;
@@ -3895,12 +3948,15 @@
memset(&imc_info_param, 0, sizeof(imc_info_param));
memset(&frame_ctl_param, 0, sizeof(frame_ctl_param));
memset(&media_type, 0, sizeof(media_type));
+ memset(&matched_port_param, 0, sizeof(matched_port_param));
+ memset(&speech_codec_init_param, 0, sizeof(speech_codec_init_param));
memset(¶m_hdr, 0, sizeof(param_hdr));
if (format != ASM_MEDIA_FMT_SBC && format != ASM_MEDIA_FMT_AAC_V2 &&
format != ASM_MEDIA_FMT_APTX && format != ASM_MEDIA_FMT_APTX_HD &&
format != ASM_MEDIA_FMT_CELT && format != ASM_MEDIA_FMT_LDAC &&
- format != ASM_MEDIA_FMT_APTX_ADAPTIVE) {
+ format != ASM_MEDIA_FMT_APTX_ADAPTIVE &&
+ format != ASM_MEDIA_FMT_APTX_AD_SPEECH) {
pr_err("%s:Unsuppported enc format. Ignore AFE config\n",
__func__);
return 0;
@@ -3935,6 +3991,9 @@
enc_blk_param.enc_cfg_blk_size =
sizeof(enc_blk_param.enc_blk_config)
- sizeof(struct asm_aac_frame_size_control_t);
+ } else if (format == ASM_MEDIA_FMT_APTX_AD_SPEECH) {
+ param_hdr.param_size = sizeof(struct afe_enc_aptx_ad_speech_cfg_blk_param_t);
+ enc_blk_param.enc_cfg_blk_size = sizeof(struct asm_custom_enc_cfg_t);
} else {
param_hdr.param_size = sizeof(struct afe_enc_cfg_blk_param_t);
enc_blk_param.enc_cfg_blk_size =
@@ -4016,6 +4075,24 @@
goto exit;
}
}
+ if (format == ASM_MEDIA_FMT_APTX_AD_SPEECH) {
+ pr_debug("%s: sending AVS_DECODER_PARAM_ID_APTX_AD_SPEECH_ENC_INIT to DSP\n",
+ __func__);
+ param_hdr.param_id = AVS_DECODER_PARAM_ID_APTX_AD_SPEECH_ENC_INIT;
+ param_hdr.param_size =
+ sizeof(struct asm_aptx_ad_speech_dec_cfg_t);
+ speech_codec_init_param = cfg->aptx_ad_speech_config.speech_mode;
+ ret = q6afe_pack_and_set_param_in_band(port_id,
+ q6audio_get_port_index(port_id),
+ param_hdr,
+ (u8 *) &speech_codec_init_param);
+ if (ret) {
+ pr_err("%s: AFE_ID_APTX_ADAPTIVE_ENC_INIT for port 0x%x failed %d\n",
+ __func__, port_id, ret);
+ goto exit;
+ }
+ }
+
pr_debug("%s:sending AFE_ENCODER_PARAM_ID_PACKETIZER to DSP\n",
__func__);
param_hdr.param_id = AFE_ENCODER_PARAM_ID_PACKETIZER_ID;
@@ -4031,19 +4108,21 @@
goto exit;
}
- pr_debug("%s:sending AFE_ENCODER_PARAM_ID_ENABLE_SCRAMBLING mode= %d to DSP payload\n",
- __func__, scrambler_mode);
- param_hdr.param_id = AFE_ENCODER_PARAM_ID_ENABLE_SCRAMBLING;
- param_hdr.param_size = sizeof(struct avs_enc_set_scrambler_param_t);
- enc_set_scrambler_param.enable_scrambler = scrambler_mode;
- ret = q6afe_pack_and_set_param_in_band(port_id,
- q6audio_get_port_index(port_id),
- param_hdr,
- (u8 *) &enc_set_scrambler_param);
- if (ret) {
- pr_err("%s: AFE_ENCODER_PARAM_ID_ENABLE_SCRAMBLING for port 0x%x failed %d\n",
- __func__, port_id, ret);
- goto exit;
+ if (format != ASM_MEDIA_FMT_APTX_AD_SPEECH) {
+ pr_debug("%s:sending AFE_ENCODER_PARAM_ID_ENABLE_SCRAMBLING mode= %d to DSP payload\n",
+ __func__, scrambler_mode);
+ param_hdr.param_id = AFE_ENCODER_PARAM_ID_ENABLE_SCRAMBLING;
+ param_hdr.param_size = sizeof(struct avs_enc_set_scrambler_param_t);
+ enc_set_scrambler_param.enable_scrambler = scrambler_mode;
+ ret = q6afe_pack_and_set_param_in_band(port_id,
+ q6audio_get_port_index(port_id),
+ param_hdr,
+ (u8 *) &enc_set_scrambler_param);
+ if (ret) {
+ pr_err("%s: AFE_ENCODER_PARAM_ID_ENABLE_SCRAMBLING for port 0x%x failed %d\n",
+ __func__, port_id, ret);
+ goto exit;
+ }
}
if (format == ASM_MEDIA_FMT_APTX) {
@@ -4065,22 +4144,25 @@
if ((format == ASM_MEDIA_FMT_LDAC &&
cfg->ldac_config.abr_config.is_abr_enabled) ||
- format == ASM_MEDIA_FMT_APTX_ADAPTIVE) {
- pr_debug("%s:sending AFE_ENCODER_PARAM_ID_BIT_RATE_LEVEL_MAP to DSP payload",
- __func__);
- param_hdr.param_id = AFE_ENCODER_PARAM_ID_BIT_RATE_LEVEL_MAP;
- param_hdr.param_size =
- sizeof(struct afe_enc_level_to_bitrate_map_param_t);
- map_param.mapping_table =
- cfg->ldac_config.abr_config.mapping_info;
- ret = q6afe_pack_and_set_param_in_band(port_id,
- q6audio_get_port_index(port_id),
- param_hdr,
- (u8 *) &map_param);
- if (ret) {
- pr_err("%s: AFE_ENCODER_PARAM_ID_BIT_RATE_LEVEL_MAP for port 0x%x failed %d\n",
- __func__, port_id, ret);
- goto exit;
+ format == ASM_MEDIA_FMT_APTX_ADAPTIVE ||
+ format == ASM_MEDIA_FMT_APTX_AD_SPEECH) {
+ if (format != ASM_MEDIA_FMT_APTX_AD_SPEECH) {
+ pr_debug("%s:sending AFE_ENCODER_PARAM_ID_BIT_RATE_LEVEL_MAP to DSP payload",
+ __func__);
+ param_hdr.param_id = AFE_ENCODER_PARAM_ID_BIT_RATE_LEVEL_MAP;
+ param_hdr.param_size =
+ sizeof(struct afe_enc_level_to_bitrate_map_param_t);
+ map_param.mapping_table =
+ cfg->ldac_config.abr_config.mapping_info;
+ ret = q6afe_pack_and_set_param_in_band(port_id,
+ q6audio_get_port_index(port_id),
+ param_hdr,
+ (u8 *) &map_param);
+ if (ret) {
+ pr_err("%s: AFE_ENCODER_PARAM_ID_BIT_RATE_LEVEL_MAP for port 0x%x failed %d\n",
+ __func__, port_id, ret);
+ goto exit;
+ }
}
pr_debug("%s: sending AFE_ENCDEC_PARAM_ID_DEC_TO_ENC_COMMUNICATION to DSP payload",
@@ -4092,6 +4174,9 @@
if (format == ASM_MEDIA_FMT_APTX_ADAPTIVE)
imc_info_param.imc_info =
cfg->aptx_ad_config.abr_cfg.imc_info;
+ else if (format == ASM_MEDIA_FMT_APTX_AD_SPEECH)
+ imc_info_param.imc_info =
+ cfg->aptx_ad_speech_config.imc_info;
else
imc_info_param.imc_info =
cfg->ldac_config.abr_config.imc_info;
@@ -4117,6 +4202,9 @@
else if (format == ASM_MEDIA_FMT_APTX_ADAPTIVE)
media_type.sample_rate =
cfg->aptx_ad_config.custom_cfg.sample_rate;
+ else if (format == ASM_MEDIA_FMT_APTX_AD_SPEECH)
+ media_type.sample_rate =
+ cfg->aptx_ad_speech_config.custom_cfg.sample_rate;
else
media_type.sample_rate =
afe_config.slim_sch.sample_rate;
@@ -4142,6 +4230,25 @@
goto exit;
}
+ if (format == ASM_MEDIA_FMT_APTX_AD_SPEECH) {
+ pr_debug("%s: sending AFE_PARAM_ID_RATE_MATCHED_PORT to DSP payload",
+ __func__);
+ param_hdr.param_id = AFE_PARAM_ID_RATE_MATCHED_PORT;
+ param_hdr.param_size =
+ sizeof(struct afe_matched_port_t);
+ matched_port_param.minor_version = AFE_API_VERSION_PORT_MEDIA_TYPE;
+ matched_port_param.enable = AFE_MATCHED_PORT_ENABLE;
+ ret = q6afe_pack_and_set_param_in_band(port_id,
+ q6audio_get_port_index(port_id),
+ param_hdr,
+ (u8 *) &matched_port_param);
+ if (ret) {
+ pr_err("%s: AFE_PARAM_ID_RATE_MATCHED_PORT for port 0x%x failed %d\n",
+ __func__, port_id, ret);
+ goto exit;
+ }
+ }
+
exit:
return ret;
}
diff --git a/include/dsp/apr_audio-v2.h b/include/dsp/apr_audio-v2.h
index 0117492..e7c132a 100644
--- a/include/dsp/apr_audio-v2.h
+++ b/include/dsp/apr_audio-v2.h
@@ -2489,6 +2489,7 @@
#define AFE_MODULE_AUDIO_DEV_INTERFACE 0x0001020C
#define AFE_PORT_SAMPLE_RATE_8K 8000
#define AFE_PORT_SAMPLE_RATE_16K 16000
+#define AFE_PORT_SAMPLE_RATE_32K 32000
#define AFE_PORT_SAMPLE_RATE_44_1K 44100
#define AFE_PORT_SAMPLE_RATE_48K 48000
#define AFE_PORT_SAMPLE_RATE_96K 96000
@@ -3912,6 +3913,14 @@
#define AFE_ENCDEC_PARAM_ID_DEC_TO_ENC_COMMUNICATION 0x0001323D
/*
+ * This is needed to be used only for SWB voice call use case.
+ * This is needed to be issued for each direction (RX AFE and TX AFE)
+ * along with AFE_PARAM_ID_PORT_MEDIA_TYPE
+ * (Issuing AF_PARAM_ID_RATE_MATCHED_PORT param alone is not useful).
+ */
+#define AFE_PARAM_ID_RATE_MATCHED_PORT 0x000102BE
+
+/*
* Purpose of IMC set up between encoder and decoder.
* Communication instance and purpose together form the
* actual key used for IMC registration.
@@ -4151,6 +4160,9 @@
/* FMT ID for apt-X Adaptive */
#define ASM_MEDIA_FMT_APTX_ADAPTIVE 0x00013204
+/* FMT ID for apt-X Adaptive speech */
+#define ASM_MEDIA_FMT_APTX_AD_SPEECH 0x00013208
+
#define PCM_CHANNEL_L 1
#define PCM_CHANNEL_R 2
#define PCM_CHANNEL_C 3
@@ -4167,6 +4179,22 @@
uint32_t custom_size;
} __packed;
+struct asm_aptx_ad_speech_mode_cfg_t
+{
+ uint32_t speech_mode;
+ /*
+ * speech mode of codec.
+ *
+ * @values 0x0(swb), 0x4(sswb)
+ */
+ uint32_t swapping;
+ /*
+ * byte swapping of codec.
+ *
+ * @values 0x1, enable swapping
+ */
+} __packed;
+
struct asm_aptx_v2_enc_cfg_ext_t {
/*
* sync mode: 0x0 = stereo sync mode (default)
@@ -4188,6 +4216,19 @@
struct afe_abr_enc_cfg_t abr_cfg;
} __attribute__ ((packed));
+struct asm_aptx_ad_speech_enc_cfg_t
+{
+ struct asm_custom_enc_cfg_t custom_cfg;
+ struct afe_imc_dec_enc_info imc_info;
+ struct asm_aptx_ad_speech_mode_cfg_t speech_mode;
+} __attribute__ ((packed));
+
+struct afe_matched_port_t
+{
+ uint32_t minor_version;
+ uint32_t enable;
+} __attribute__ ((packed));
+
#define ASM_MEDIA_FMT_CELT 0x00013221
struct asm_celt_specific_enc_cfg_t {
/*
@@ -4464,6 +4505,10 @@
*/
} __packed;
+struct asm_aptx_ad_speech_dec_cfg_t {
+ struct asm_aptx_ad_speech_mode_cfg_t speech_mode;
+};
+
union afe_enc_config_data {
struct asm_sbc_enc_cfg_t sbc_config;
struct asm_aac_enc_cfg_t aac_config;
@@ -4472,6 +4517,7 @@
struct asm_aptx_enc_cfg_t aptx_config;
struct asm_ldac_enc_cfg_t ldac_config;
struct asm_aptx_ad_enc_cfg_t aptx_ad_config;
+ struct asm_aptx_ad_speech_enc_cfg_t aptx_ad_speech_config;
};
struct afe_enc_config {
@@ -4486,6 +4532,7 @@
struct asm_aac_dec_cfg_v2_t aac_config;
struct asm_mp3_dec_cfg_t mp3_config;
struct asm_aptx_ad_dec_cfg_t aptx_ad_config;
+ struct asm_aptx_ad_speech_dec_cfg_t aptx_ad_speech_config;
};
struct afe_dec_config {
@@ -4502,6 +4549,14 @@
union afe_enc_config_data enc_blk_config;
};
+struct afe_enc_aptx_ad_speech_cfg_blk_param_t {
+ uint32_t enc_cfg_blk_size;
+ /*
+ * Size of the encoder configuration block that follows this member
+ */
+ struct asm_custom_enc_cfg_t custom_cfg;
+};
+
/*
* Payload of the AVS_DECODER_PARAM_ID_DEC_MEDIA_FMT parameter used by
* AVS_MODULE_ID_DECODER.
@@ -4589,6 +4644,18 @@
*/
#define AVS_DECODER_PARAM_ID_DEC_MEDIA_FMT 0x00013232
+/*
+ * ID of the parameter used by #AVS_MODULE_ID_DECODER to configure
+ * the decoder mode of adaptive speech and byte swap mode
+ */
+#define AVS_DECODER_PARAM_ID_APTX_AD_SPEECH_DEC_INIT 0x0001334D
+
+/*
+ * ID of the parameter used by #AVS_MODULE_ID_ENCODER to configure
+ * the encoder mode of adaptive speech and byte swap mode
+ */
+#define AVS_DECODER_PARAM_ID_APTX_AD_SPEECH_ENC_INIT 0x0001332B
+
/* ID of the parameter used by #AFE_MODULE_AUDIO_DEV_INTERFACE to configure
* the island mode for a given AFE port.
*/