diff options
author | Ashish Jain <ashishj@codeaurora.org> | 2016-10-24 15:08:06 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-10-24 03:27:13 -0700 |
commit | 9c4a39fcd614e6fc29fd8c66d4fa37ea2b65a520 (patch) | |
tree | 1ce9f34d51faac1633e8b0d9ed28af263807a075 /sound | |
parent | 46aa49c1188a77f52dc4969f82292c176d8f399b (diff) |
ASoC: msm: Enable Media Format converter for all resampling usecases
With support of playback for native 384kHz, it is recommended to avoid
resampling in afe even for non fractional rates, hence enable media
format converter in all usecases whenever resampling is needed.
Change-Id: I94b9091b8349d6388fbe5c29eabe3666c86e5cce
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c | 14 | ||||
-rw-r--r-- | sound/soc/msm/qdsp6v2/q6adm.c | 2 |
2 files changed, 7 insertions, 9 deletions
diff --git a/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c b/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c index 547af163c5c0..ec3c2671c797 100644 --- a/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c +++ b/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c @@ -121,14 +121,14 @@ static int msm_routing_get_bit_width(unsigned int format) return bit_width; } -static bool msm_is_fractional_resample_needed(int input_sr, int output_sr) +static bool msm_is_resample_needed(int input_sr, int output_sr) { bool rc = false; - if ((input_sr % output_sr != 0) && (output_sr % input_sr != 0)) + if (input_sr != output_sr) rc = true; - pr_debug("performing fractional resample (%s) for copp rate (%d)afe rate (%d)", + pr_debug("perform resampling (%s) for copp rate (%d)afe rate (%d)", (rc ? "oh yes" : "not really"), input_sr, output_sr); @@ -901,7 +901,7 @@ int msm_pcm_routing_reg_phy_compr_stream(int fe_id, int perf_mode, set_bit(copp_idx, &session_copp_map[fe_id][session_type][i]); - if (msm_is_fractional_resample_needed( + if (msm_is_resample_needed( sample_rate, msm_bedais[i].sample_rate)) adm_copp_mfc_cfg( @@ -1057,7 +1057,7 @@ int msm_pcm_routing_reg_phy_stream(int fedai_id, int perf_mode, set_bit(copp_idx, &session_copp_map[fedai_id][session_type][i]); - if (msm_is_fractional_resample_needed( + if (msm_is_resample_needed( sample_rate, msm_bedais[i].sample_rate)) adm_copp_mfc_cfg( @@ -1284,7 +1284,7 @@ static void msm_pcm_routing_process_audio(u16 reg, u16 val, int set) set_bit(copp_idx, &session_copp_map[val][session_type][reg]); - if (msm_is_fractional_resample_needed( + if (msm_is_resample_needed( sample_rate, msm_bedais[reg].sample_rate)) adm_copp_mfc_cfg( @@ -10381,7 +10381,7 @@ static int msm_pcm_routing_prepare(struct snd_pcm_substream *substream) set_bit(copp_idx, &session_copp_map[i][session_type][be_id]); - if (msm_is_fractional_resample_needed( + if (msm_is_resample_needed( sample_rate, bedai->sample_rate)) adm_copp_mfc_cfg( diff --git a/sound/soc/msm/qdsp6v2/q6adm.c b/sound/soc/msm/qdsp6v2/q6adm.c index e30a4efa6e60..564b67c9f76b 100644 --- a/sound/soc/msm/qdsp6v2/q6adm.c +++ b/sound/soc/msm/qdsp6v2/q6adm.c @@ -2508,8 +2508,6 @@ void adm_copp_mfc_cfg(int port_id, int copp_idx, int dst_sample_rate) mfc_cfg.sampling_rate = dst_sample_rate; mfc_cfg.bits_per_sample = atomic_read(&this_adm.copp.bit_width[port_idx][copp_idx]); - if (24 == mfc_cfg.bits_per_sample) - mfc_cfg.bits_per_sample = 32; open.dev_num_channel = mfc_cfg.num_channels = atomic_read(&this_adm.copp.channels[port_idx][copp_idx]); |