Loading asoc/msm-dai-q6-v2.c +22 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include <sound/pcm_params.h> #include <dsp/apr_audio-v2.h> #include <dsp/q6afe-v2.h> #include <dsp/sp_params.h> #include <dsp/q6core.h> #include "msm-dai-q6-v2.h" #include <asoc/core.h> Loading Loading @@ -10538,6 +10539,17 @@ static void msm_dai_q6_cdc_dma_shutdown(struct snd_pcm_substream *substream, clear_bit(STATUS_PORT_STARTED, dai_data->hwfree_status); } /* all ports with same WSA requirement can use this digital mute API */ static int msm_dai_q6_spk_digital_mute(struct snd_soc_dai *dai, int mute) { int port_id = dai->id; if (mute) afe_get_sp_xt_logging_data(port_id); return 0; } static struct snd_soc_dai_ops msm_dai_q6_cdc_dma_ops = { .prepare = msm_dai_q6_cdc_dma_prepare, Loading @@ -10546,6 +10558,14 @@ static struct snd_soc_dai_ops msm_dai_q6_cdc_dma_ops = { .set_channel_map = msm_dai_q6_cdc_dma_set_channel_map, }; static struct snd_soc_dai_ops msm_dai_q6_cdc_wsa_dma_ops = { .prepare = msm_dai_q6_cdc_dma_prepare, .hw_params = msm_dai_q6_cdc_dma_hw_params, .shutdown = msm_dai_q6_cdc_dma_shutdown, .set_channel_map = msm_dai_q6_cdc_dma_set_channel_map, .digital_mute = msm_dai_q6_spk_digital_mute, }; static struct snd_soc_dai_driver msm_dai_q6_cdc_dma_dai[] = { { .playback = { Loading @@ -10568,7 +10588,7 @@ static struct snd_soc_dai_driver msm_dai_q6_cdc_dma_dai[] = { .rate_max = 384000, }, .name = "WSA_CDC_DMA_RX_0", .ops = &msm_dai_q6_cdc_dma_ops, .ops = &msm_dai_q6_cdc_wsa_dma_ops, .id = AFE_PORT_ID_WSA_CODEC_DMA_RX_0, .probe = msm_dai_q6_dai_cdc_dma_probe, .remove = msm_dai_q6_dai_cdc_dma_remove, Loading Loading @@ -10620,7 +10640,7 @@ static struct snd_soc_dai_driver msm_dai_q6_cdc_dma_dai[] = { .rate_max = 384000, }, .name = "WSA_CDC_DMA_RX_1", .ops = &msm_dai_q6_cdc_dma_ops, .ops = &msm_dai_q6_cdc_wsa_dma_ops, .id = AFE_PORT_ID_WSA_CODEC_DMA_RX_1, .probe = msm_dai_q6_dai_cdc_dma_probe, .remove = msm_dai_q6_dai_cdc_dma_remove, Loading dsp/Kbuild +5 −0 Original line number Diff line number Diff line Loading @@ -91,11 +91,16 @@ ifdef CONFIG_SND_SOC_MSM_QDSP6V2_INTF Q6_OBJS += msm_audio_ion.o Q6_OBJS += avtimer.o Q6_OBJS += q6_init.o endif ifdef CONFIG_XT_LOGGING Q6_OBJS += sp_params.o endif ifdef CONFIG_WCD9XXX_CODEC_CORE Q6_OBJS += audio_slimslave.o endif ifdef CONFIG_DTS_SRS_TM Q6_OBJS += msm-dts-srs-tm-config.o endif Loading dsp/q6_init.c +2 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ static int __init audio_q6_init(void) rtac_init(); adm_init(); afe_init(); spk_params_init(); q6asm_init(); q6lsm_init(); voice_init(); Loading @@ -37,6 +38,7 @@ static void __exit audio_q6_exit(void) q6lsm_exit(); q6asm_exit(); afe_exit(); spk_params_exit(); adm_exit(); rtac_exit(); audio_cal_exit(); Loading dsp/q6_init.h +12 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,18 @@ static inline void msm_mdf_exit(void) return; } #endif #ifdef CONFIG_XT_LOGGING int spk_params_init(void); void spk_params_exit(void); #else static inline int spk_params_init(void) { return 0; } static inline void spk_params_exit(void) { } #endif void avtimer_exit(void); void msm_audio_ion_exit(void); Loading dsp/q6afe.c +53 −3 Original line number Diff line number Diff line Loading @@ -158,6 +158,9 @@ struct afe_ctl { struct vad_config vad_cfg[AFE_MAX_PORTS]; struct work_struct afe_dc_work; struct notifier_block event_notifier; /* FTM spk params */ uint32_t initial_cal; uint32_t v_vali_flag; }; static atomic_t afe_ports_mad_type[SLIMBUS_PORT_LAST - SLIMBUS_0_RX]; Loading @@ -179,6 +182,51 @@ static int afe_get_cal_hw_delay(int32_t path, struct audio_cal_hw_delay_entry *entry); static int remap_cal_data(struct cal_block_data *cal_block, int cal_index); int afe_get_spk_initial_cal(void) { return this_afe.initial_cal; } void afe_get_spk_r0(int *spk_r0) { uint16_t i = 0; for (; i < SP_V2_NUM_MAX_SPKRS; i++) spk_r0[i] = this_afe.prot_cfg.r0[i]; } void afe_get_spk_t0(int *spk_t0) { uint16_t i = 0; for (; i < SP_V2_NUM_MAX_SPKRS; i++) spk_t0[i] = this_afe.prot_cfg.t0[i]; } int afe_get_spk_v_vali_flag(void) { return this_afe.v_vali_flag; } void afe_get_spk_v_vali_sts(int *spk_v_vali_sts) { uint16_t i = 0; for (; i < SP_V2_NUM_MAX_SPKRS; i++) spk_v_vali_sts[i] = this_afe.th_vi_v_vali_resp.param.status[i]; } void afe_set_spk_initial_cal(int initial_cal) { this_afe.initial_cal = initial_cal; } void afe_set_spk_v_vali_flag(int v_vali_flag) { this_afe.v_vali_flag = v_vali_flag; } int afe_get_topology(int port_id) { int topology; Loading Loading @@ -8223,6 +8271,7 @@ static int afe_get_cal_sp_th_vi_v_vali_param(int32_t cal_type, size_t data_size, } } } this_afe.v_vali_flag = 0; done: return ret; } Loading Loading @@ -8385,6 +8434,7 @@ static int afe_get_cal_fb_spkr_prot(int32_t cal_type, size_t data_size, cal_data->cal_info.r0[SP_V2_SPKR_1] = -1; cal_data->cal_info.r0[SP_V2_SPKR_2] = -1; } this_afe.initial_cal = 0; mutex_unlock(&this_afe.cal_data[AFE_FB_SPKR_PROT_CAL]->lock); __pm_relax(&wl.ws); done: Loading Loading
asoc/msm-dai-q6-v2.c +22 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include <sound/pcm_params.h> #include <dsp/apr_audio-v2.h> #include <dsp/q6afe-v2.h> #include <dsp/sp_params.h> #include <dsp/q6core.h> #include "msm-dai-q6-v2.h" #include <asoc/core.h> Loading Loading @@ -10538,6 +10539,17 @@ static void msm_dai_q6_cdc_dma_shutdown(struct snd_pcm_substream *substream, clear_bit(STATUS_PORT_STARTED, dai_data->hwfree_status); } /* all ports with same WSA requirement can use this digital mute API */ static int msm_dai_q6_spk_digital_mute(struct snd_soc_dai *dai, int mute) { int port_id = dai->id; if (mute) afe_get_sp_xt_logging_data(port_id); return 0; } static struct snd_soc_dai_ops msm_dai_q6_cdc_dma_ops = { .prepare = msm_dai_q6_cdc_dma_prepare, Loading @@ -10546,6 +10558,14 @@ static struct snd_soc_dai_ops msm_dai_q6_cdc_dma_ops = { .set_channel_map = msm_dai_q6_cdc_dma_set_channel_map, }; static struct snd_soc_dai_ops msm_dai_q6_cdc_wsa_dma_ops = { .prepare = msm_dai_q6_cdc_dma_prepare, .hw_params = msm_dai_q6_cdc_dma_hw_params, .shutdown = msm_dai_q6_cdc_dma_shutdown, .set_channel_map = msm_dai_q6_cdc_dma_set_channel_map, .digital_mute = msm_dai_q6_spk_digital_mute, }; static struct snd_soc_dai_driver msm_dai_q6_cdc_dma_dai[] = { { .playback = { Loading @@ -10568,7 +10588,7 @@ static struct snd_soc_dai_driver msm_dai_q6_cdc_dma_dai[] = { .rate_max = 384000, }, .name = "WSA_CDC_DMA_RX_0", .ops = &msm_dai_q6_cdc_dma_ops, .ops = &msm_dai_q6_cdc_wsa_dma_ops, .id = AFE_PORT_ID_WSA_CODEC_DMA_RX_0, .probe = msm_dai_q6_dai_cdc_dma_probe, .remove = msm_dai_q6_dai_cdc_dma_remove, Loading Loading @@ -10620,7 +10640,7 @@ static struct snd_soc_dai_driver msm_dai_q6_cdc_dma_dai[] = { .rate_max = 384000, }, .name = "WSA_CDC_DMA_RX_1", .ops = &msm_dai_q6_cdc_dma_ops, .ops = &msm_dai_q6_cdc_wsa_dma_ops, .id = AFE_PORT_ID_WSA_CODEC_DMA_RX_1, .probe = msm_dai_q6_dai_cdc_dma_probe, .remove = msm_dai_q6_dai_cdc_dma_remove, Loading
dsp/Kbuild +5 −0 Original line number Diff line number Diff line Loading @@ -91,11 +91,16 @@ ifdef CONFIG_SND_SOC_MSM_QDSP6V2_INTF Q6_OBJS += msm_audio_ion.o Q6_OBJS += avtimer.o Q6_OBJS += q6_init.o endif ifdef CONFIG_XT_LOGGING Q6_OBJS += sp_params.o endif ifdef CONFIG_WCD9XXX_CODEC_CORE Q6_OBJS += audio_slimslave.o endif ifdef CONFIG_DTS_SRS_TM Q6_OBJS += msm-dts-srs-tm-config.o endif Loading
dsp/q6_init.c +2 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ static int __init audio_q6_init(void) rtac_init(); adm_init(); afe_init(); spk_params_init(); q6asm_init(); q6lsm_init(); voice_init(); Loading @@ -37,6 +38,7 @@ static void __exit audio_q6_exit(void) q6lsm_exit(); q6asm_exit(); afe_exit(); spk_params_exit(); adm_exit(); rtac_exit(); audio_cal_exit(); Loading
dsp/q6_init.h +12 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,18 @@ static inline void msm_mdf_exit(void) return; } #endif #ifdef CONFIG_XT_LOGGING int spk_params_init(void); void spk_params_exit(void); #else static inline int spk_params_init(void) { return 0; } static inline void spk_params_exit(void) { } #endif void avtimer_exit(void); void msm_audio_ion_exit(void); Loading
dsp/q6afe.c +53 −3 Original line number Diff line number Diff line Loading @@ -158,6 +158,9 @@ struct afe_ctl { struct vad_config vad_cfg[AFE_MAX_PORTS]; struct work_struct afe_dc_work; struct notifier_block event_notifier; /* FTM spk params */ uint32_t initial_cal; uint32_t v_vali_flag; }; static atomic_t afe_ports_mad_type[SLIMBUS_PORT_LAST - SLIMBUS_0_RX]; Loading @@ -179,6 +182,51 @@ static int afe_get_cal_hw_delay(int32_t path, struct audio_cal_hw_delay_entry *entry); static int remap_cal_data(struct cal_block_data *cal_block, int cal_index); int afe_get_spk_initial_cal(void) { return this_afe.initial_cal; } void afe_get_spk_r0(int *spk_r0) { uint16_t i = 0; for (; i < SP_V2_NUM_MAX_SPKRS; i++) spk_r0[i] = this_afe.prot_cfg.r0[i]; } void afe_get_spk_t0(int *spk_t0) { uint16_t i = 0; for (; i < SP_V2_NUM_MAX_SPKRS; i++) spk_t0[i] = this_afe.prot_cfg.t0[i]; } int afe_get_spk_v_vali_flag(void) { return this_afe.v_vali_flag; } void afe_get_spk_v_vali_sts(int *spk_v_vali_sts) { uint16_t i = 0; for (; i < SP_V2_NUM_MAX_SPKRS; i++) spk_v_vali_sts[i] = this_afe.th_vi_v_vali_resp.param.status[i]; } void afe_set_spk_initial_cal(int initial_cal) { this_afe.initial_cal = initial_cal; } void afe_set_spk_v_vali_flag(int v_vali_flag) { this_afe.v_vali_flag = v_vali_flag; } int afe_get_topology(int port_id) { int topology; Loading Loading @@ -8223,6 +8271,7 @@ static int afe_get_cal_sp_th_vi_v_vali_param(int32_t cal_type, size_t data_size, } } } this_afe.v_vali_flag = 0; done: return ret; } Loading Loading @@ -8385,6 +8434,7 @@ static int afe_get_cal_fb_spkr_prot(int32_t cal_type, size_t data_size, cal_data->cal_info.r0[SP_V2_SPKR_1] = -1; cal_data->cal_info.r0[SP_V2_SPKR_2] = -1; } this_afe.initial_cal = 0; mutex_unlock(&this_afe.cal_data[AFE_FB_SPKR_PROT_CAL]->lock); __pm_relax(&wl.ws); done: Loading