From 2d84e4aedc0b8207e1f5637de73c26f491d2524f Mon Sep 17 00:00:00 2001 From: Mangesh Kunchamwar Date: Tue, 10 Jul 2018 17:50:35 +0530 Subject: [PATCH] asoc: Enable VAD in QCS405 Add AFE HW CAL dep node in config and fix the set sampling rate for codec dma interface Change-Id: I9165a80da00bfb5b61bbf4f0391ff794d8fba352 Signed-off-by: Mangesh Kunchamwar --- asoc/msm-dai-q6-v2.c | 5 ++--- asoc/qcs405.c | 32 +++++++++++++++++++++++++++++++- config/qcs405auto.conf | 1 + config/qcs405autoconf.h | 1 + dsp/q6afe.c | 3 ++- 5 files changed, 37 insertions(+), 5 deletions(-) diff --git a/asoc/msm-dai-q6-v2.c b/asoc/msm-dai-q6-v2.c index 5d43547d2476..c7faf296a431 100644 --- a/asoc/msm-dai-q6-v2.c +++ b/asoc/msm-dai-q6-v2.c @@ -1127,7 +1127,6 @@ static int msm_dai_q6_dai_auxpcm_remove(struct snd_soc_dai *dai) return 0; } - static int msm_dai_q6_island_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { @@ -1155,6 +1154,7 @@ static struct snd_kcontrol_new island_config_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "?", + .info = snd_ctl_boolean_mono_info, .get = msm_dai_q6_island_mode_get, .put = msm_dai_q6_island_mode_put, .private_value = SOC_SINGLE_VALUE(0, 0, 1, 0, 0) @@ -1178,8 +1178,7 @@ static int msm_dai_q6_add_island_mx_ctls(struct snd_card *card, if (!mixer_str) return -ENOMEM; - snprintf(mixer_str, ctl_len + strlen(mx_ctl_name) + 1, - "%s %s", dai_name, mx_ctl_name); + snprintf(mixer_str, ctl_len, "%s %s", dai_name, mx_ctl_name); island_config_controls[0].name = mixer_str; ((struct soc_enum *) island_config_controls[0].private_value)->reg = dai_id; diff --git a/asoc/qcs405.c b/asoc/qcs405.c index 73b743d32e74..f1f4df711955 100644 --- a/asoc/qcs405.c +++ b/asoc/qcs405.c @@ -462,7 +462,8 @@ static const char *const cdc_dma_rx_ch_text[] = {"One", "Two"}; static const char *const cdc_dma_tx_ch_text[] = {"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight"}; -static char const *cdc_dma_sample_rate_text[] = {"KHZ_8", "KHZ_16", +static char const *cdc_dma_sample_rate_text[] = {"KHZ_8", "KHZ_11P025", + "KHZ_16", "KHZ_22P05", "KHZ_32", "KHZ_44P1", "KHZ_48", "KHZ_88P2", "KHZ_96", "KHZ_176P4", "KHZ_192", "KHZ_352P8", "KHZ_384"}; @@ -6034,6 +6035,35 @@ static struct snd_soc_dai_link msm_common_be_dai_links[] = { .ops = &qcs405_tdm_be_ops, .ignore_suspend = 1, }, + { + .name = LPASS_BE_QUIN_TDM_RX_0, + .stream_name = "Quinary TDM0 Playback", + .cpu_dai_name = "msm-dai-q6-tdm.36928", + .platform_name = "msm-pcm-routing", + .codec_name = "msm-stub-codec.1", + .codec_dai_name = "msm-stub-rx", + .no_pcm = 1, + .dpcm_playback = 1, + .id = MSM_BACKEND_DAI_QUIN_TDM_RX_0, + .be_hw_params_fixup = msm_tdm_be_hw_params_fixup, + .ops = &qcs405_tdm_be_ops, + .ignore_suspend = 1, + .ignore_pmdown_time = 1, + }, + { + .name = LPASS_BE_QUIN_TDM_TX_0, + .stream_name = "Quinary TDM0 Capture", + .cpu_dai_name = "msm-dai-q6-tdm.36929", + .platform_name = "msm-pcm-routing", + .codec_name = "msm-stub-codec.1", + .codec_dai_name = "msm-stub-tx", + .no_pcm = 1, + .dpcm_capture = 1, + .id = MSM_BACKEND_DAI_QUIN_TDM_TX_0, + .be_hw_params_fixup = msm_be_hw_params_fixup, + .ops = &qcs405_tdm_be_ops, + .ignore_suspend = 1, + }, }; static struct snd_soc_dai_link msm_tasha_be_dai_links[] = { diff --git a/config/qcs405auto.conf b/config/qcs405auto.conf index b2c80cd7ce4e..a30f01a635c3 100644 --- a/config/qcs405auto.conf +++ b/config/qcs405auto.conf @@ -26,6 +26,7 @@ CONFIG_SND_SOC_WCD_MBHC_LEGACY=m CONFIG_SND_SOC_QDSP6V2=m CONFIG_QTI_PP=m CONFIG_SND_HWDEP_ROUTING=m +CONFIG_AFE_HWDEP=m CONFIG_DTS_EAGLE=m CONFIG_DOLBY_DS2=m CONFIG_DOLBY_LICENSE=m diff --git a/config/qcs405autoconf.h b/config/qcs405autoconf.h index 039b67baf9e9..75332935ea6e 100644 --- a/config/qcs405autoconf.h +++ b/config/qcs405autoconf.h @@ -38,6 +38,7 @@ #define CONFIG_SND_SOC_QDSP6V2 1 #define CONFIG_QTI_PP 1 #define CONFIG_SND_HWDEP_ROUTING 1 +#define CONFIG_AFE_HWDEP 1 #define CONFIG_DTS_EAGLE 1 #define CONFIG_DOLBY_DS2 1 #define CONFIG_DOLBY_LICENSE 1 diff --git a/dsp/q6afe.c b/dsp/q6afe.c index 5320ef4937c7..a2f4046b41b0 100644 --- a/dsp/q6afe.c +++ b/dsp/q6afe.c @@ -3513,10 +3513,11 @@ static int __afe_port_start(u16 port_id, union afe_port_config *afe_config, /* send VAD configuration if is enabled */ if (this_afe.vad_cfg[port_index].is_enable) { ret = afe_send_port_vad_cfg_params(port_id); - if (ret) + if (ret) { pr_err("%s: afe send VAD config failed %d\n", __func__, ret); goto fail_cmd; + } } }