Loading sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c +20 −0 Original line number Diff line number Diff line Loading @@ -1282,6 +1282,9 @@ static int msm_compr_configure_dsp_for_playback .step = SOFT_VOLUME_STEP, .rampingcurve = SOFT_VOLUME_CURVE_LINEAR, }; struct snd_kcontrol *kctl; struct snd_ctl_elem_value kctl_elem_value; uint16_t target_asm_bit_width = 0; pr_debug("%s: stream_id %d\n", __func__, ac->stream_id); stream_index = STREAM_ARRAY_INDEX(ac->stream_id); Loading @@ -1290,6 +1293,23 @@ static int msm_compr_configure_dsp_for_playback return -EINVAL; } kctl = snd_soc_card_get_kcontrol(soc_prtd->card, DSP_BIT_WIDTH_MIXER_CTL); if (kctl) { kctl->get(kctl, &kctl_elem_value); target_asm_bit_width = kctl_elem_value.value.integer.value[0]; if (target_asm_bit_width > 0) { pr_debug("%s enforce ASM bitwidth to %d from %d\n", __func__, target_asm_bit_width, bits_per_sample); bits_per_sample = target_asm_bit_width; } } else { pr_info("%s: failed to get mixer ctl for %s.\n", __func__, DSP_BIT_WIDTH_MIXER_CTL); } if ((prtd->codec_param.codec.format == SNDRV_PCM_FORMAT_S24_LE) || (prtd->codec_param.codec.format == SNDRV_PCM_FORMAT_S24_3LE)) bits_per_sample = 24; Loading sound/soc/msm/qdsp6v2/msm-qti-pp-config.c +41 −0 Original line number Diff line number Diff line Loading @@ -392,6 +392,7 @@ static int msm_afe_tert_mi2s_lb_vol_ctrl; static int msm_afe_quat_mi2s_lb_vol_ctrl; static int msm_afe_slimbus_7_lb_vol_ctrl; static int msm_afe_slimbus_8_lb_vol_ctrl; static int msm_asm_bit_width; static const DECLARE_TLV_DB_LINEAR(fm_rx_vol_gain, 0, INT_RX_VOL_MAX_STEPS); static const DECLARE_TLV_DB_LINEAR(afe_lb_vol_gain, 0, INT_RX_VOL_MAX_STEPS); Loading @@ -412,6 +413,38 @@ static int msm_qti_pp_set_fm_vol_mixer(struct snd_kcontrol *kcontrol, return 0; } static int msm_asm_bit_width_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { pr_debug("%s get ASM bitwidth = %d\n", __func__, msm_asm_bit_width); ucontrol->value.integer.value[0] = msm_asm_bit_width; return 0; } static int msm_asm_bit_width_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { switch (ucontrol->value.integer.value[0]) { case 16: msm_asm_bit_width = 16; break; case 24: msm_asm_bit_width = 24; break; case 32: msm_asm_bit_width = 32; break; default: msm_asm_bit_width = 0; break; } return 0; } static int msm_qti_pp_get_pri_mi2s_lb_vol_mixer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { Loading Loading @@ -1132,6 +1165,11 @@ static const struct snd_kcontrol_new int_fm_vol_mixer_controls[] = { msm_qti_pp_set_quat_mi2s_fm_vol_mixer, fm_rx_vol_gain), }; static const struct snd_kcontrol_new dsp_bit_width_controls[] = { SOC_SINGLE_EXT(DSP_BIT_WIDTH_MIXER_CTL, SND_SOC_NOPM, 0, 0x20, 0, msm_asm_bit_width_get, msm_asm_bit_width_put), }; static const struct snd_kcontrol_new pri_mi2s_lb_vol_mixer_controls[] = { SOC_SINGLE_EXT_TLV("PRI MI2S LOOPBACK Volume", SND_SOC_NOPM, 0, INT_RX_VOL_GAIN, 0, msm_qti_pp_get_pri_mi2s_lb_vol_mixer, Loading Loading @@ -1403,5 +1441,8 @@ void msm_qti_pp_add_controls(struct snd_soc_platform *platform) snd_soc_add_platform_controls(platform, msm_multichannel_ec_controls, ARRAY_SIZE(msm_multichannel_ec_controls)); snd_soc_add_platform_controls(platform, dsp_bit_width_controls, ARRAY_SIZE(dsp_bit_width_controls)); } #endif /* CONFIG_QTI_PP */ sound/soc/msm/qdsp6v2/msm-qti-pp-config.h +1 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ #define _MSM_QTI_PP_H_ #include <sound/soc.h> #define DSP_BIT_WIDTH_MIXER_CTL "ASM Bit Width" int msm_adsp_inform_mixer_ctl(struct snd_soc_pcm_runtime *rtd, uint32_t *payload); int msm_adsp_init_mixer_ctl_pp_event_queue(struct snd_soc_pcm_runtime *rtd); Loading Loading
sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c +20 −0 Original line number Diff line number Diff line Loading @@ -1282,6 +1282,9 @@ static int msm_compr_configure_dsp_for_playback .step = SOFT_VOLUME_STEP, .rampingcurve = SOFT_VOLUME_CURVE_LINEAR, }; struct snd_kcontrol *kctl; struct snd_ctl_elem_value kctl_elem_value; uint16_t target_asm_bit_width = 0; pr_debug("%s: stream_id %d\n", __func__, ac->stream_id); stream_index = STREAM_ARRAY_INDEX(ac->stream_id); Loading @@ -1290,6 +1293,23 @@ static int msm_compr_configure_dsp_for_playback return -EINVAL; } kctl = snd_soc_card_get_kcontrol(soc_prtd->card, DSP_BIT_WIDTH_MIXER_CTL); if (kctl) { kctl->get(kctl, &kctl_elem_value); target_asm_bit_width = kctl_elem_value.value.integer.value[0]; if (target_asm_bit_width > 0) { pr_debug("%s enforce ASM bitwidth to %d from %d\n", __func__, target_asm_bit_width, bits_per_sample); bits_per_sample = target_asm_bit_width; } } else { pr_info("%s: failed to get mixer ctl for %s.\n", __func__, DSP_BIT_WIDTH_MIXER_CTL); } if ((prtd->codec_param.codec.format == SNDRV_PCM_FORMAT_S24_LE) || (prtd->codec_param.codec.format == SNDRV_PCM_FORMAT_S24_3LE)) bits_per_sample = 24; Loading
sound/soc/msm/qdsp6v2/msm-qti-pp-config.c +41 −0 Original line number Diff line number Diff line Loading @@ -392,6 +392,7 @@ static int msm_afe_tert_mi2s_lb_vol_ctrl; static int msm_afe_quat_mi2s_lb_vol_ctrl; static int msm_afe_slimbus_7_lb_vol_ctrl; static int msm_afe_slimbus_8_lb_vol_ctrl; static int msm_asm_bit_width; static const DECLARE_TLV_DB_LINEAR(fm_rx_vol_gain, 0, INT_RX_VOL_MAX_STEPS); static const DECLARE_TLV_DB_LINEAR(afe_lb_vol_gain, 0, INT_RX_VOL_MAX_STEPS); Loading @@ -412,6 +413,38 @@ static int msm_qti_pp_set_fm_vol_mixer(struct snd_kcontrol *kcontrol, return 0; } static int msm_asm_bit_width_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { pr_debug("%s get ASM bitwidth = %d\n", __func__, msm_asm_bit_width); ucontrol->value.integer.value[0] = msm_asm_bit_width; return 0; } static int msm_asm_bit_width_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { switch (ucontrol->value.integer.value[0]) { case 16: msm_asm_bit_width = 16; break; case 24: msm_asm_bit_width = 24; break; case 32: msm_asm_bit_width = 32; break; default: msm_asm_bit_width = 0; break; } return 0; } static int msm_qti_pp_get_pri_mi2s_lb_vol_mixer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { Loading Loading @@ -1132,6 +1165,11 @@ static const struct snd_kcontrol_new int_fm_vol_mixer_controls[] = { msm_qti_pp_set_quat_mi2s_fm_vol_mixer, fm_rx_vol_gain), }; static const struct snd_kcontrol_new dsp_bit_width_controls[] = { SOC_SINGLE_EXT(DSP_BIT_WIDTH_MIXER_CTL, SND_SOC_NOPM, 0, 0x20, 0, msm_asm_bit_width_get, msm_asm_bit_width_put), }; static const struct snd_kcontrol_new pri_mi2s_lb_vol_mixer_controls[] = { SOC_SINGLE_EXT_TLV("PRI MI2S LOOPBACK Volume", SND_SOC_NOPM, 0, INT_RX_VOL_GAIN, 0, msm_qti_pp_get_pri_mi2s_lb_vol_mixer, Loading Loading @@ -1403,5 +1441,8 @@ void msm_qti_pp_add_controls(struct snd_soc_platform *platform) snd_soc_add_platform_controls(platform, msm_multichannel_ec_controls, ARRAY_SIZE(msm_multichannel_ec_controls)); snd_soc_add_platform_controls(platform, dsp_bit_width_controls, ARRAY_SIZE(dsp_bit_width_controls)); } #endif /* CONFIG_QTI_PP */
sound/soc/msm/qdsp6v2/msm-qti-pp-config.h +1 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ #define _MSM_QTI_PP_H_ #include <sound/soc.h> #define DSP_BIT_WIDTH_MIXER_CTL "ASM Bit Width" int msm_adsp_inform_mixer_ctl(struct snd_soc_pcm_runtime *rtd, uint32_t *payload); int msm_adsp_init_mixer_ctl_pp_event_queue(struct snd_soc_pcm_runtime *rtd); Loading