Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b1c926e authored by Bhalchandra Gajare's avatar Bhalchandra Gajare Committed by Gerrit - the friendly Code Review server
Browse files

asoc: msm-pcm-routing: add msm_pcm_routing_get_pp_ch_cnt



Based on the type of pre/post processing, it is possible that
the processed channel count could be different from the input
channel count. As an example, the FFECNS processing block
could accept 3 channel input and has the ability to output
upto 9 channels of processed data. In cases like these, the
stream side needs to know the processed channel count to set
up its own configuration. Change adds functionality in
routing driver to read the processed channel count.

Change-Id: I06c365f8c53270712709631bc23649d37434f405
Signed-off-by: default avatarBhalchandra Gajare <gajare@codeaurora.org>
parent eed46bd5
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
@@ -1197,6 +1197,39 @@ static bool route_check_fe_id_adm_support(int fe_id)
	return rc;
}
/*
 * msm_pcm_routing_get_pp_ch_cnt:
 *	Read the processed channel count
 *
 * @fe_id: Front end ID
 * @session_type: Inidicates RX or TX session type
 */
int msm_pcm_routing_get_pp_ch_cnt(int fe_id, int session_type)
{
	struct msm_pcm_stream_app_type_cfg cfg_data;
	int be_id = 0, app_type_idx = 0, app_type = 0;
	int ret;
	memset(&cfg_data, 0, sizeof(cfg_data));
	if (!is_mm_lsm_fe_id(fe_id)) {
		pr_err("%s: bad MM ID\n", __func__);
		return -EINVAL;
	}
	ret = msm_pcm_routing_get_stream_app_type_cfg(fe_id, session_type,
						      &be_id, &cfg_data);
	if (ret) {
		pr_err("%s: cannot get stream app type cfg\n");
		return ret;
	}
	app_type = cfg_data.app_type;
	app_type_idx = msm_pcm_routing_get_lsm_app_type_idx(app_type);
	return lsm_app_type_cfg[app_type_idx].num_out_channels;
}
EXPORT_SYMBOL(msm_pcm_routing_get_pp_ch_cnt);
int msm_pcm_routing_reg_phy_compr_stream(int fe_id, int perf_mode,
					  int dspst_id, int stream_type,
					  uint32_t passthr_mode)
+1 −0
Original line number Diff line number Diff line
@@ -549,4 +549,5 @@ int msm_pcm_routing_get_stream_app_type_cfg(
int msm_pcm_routing_send_chmix_cfg(int fe_id, int ip_channel_cnt,
	int op_channel_cnt, int *ch_wght_coeff,
	int session_type, int stream_type);
int msm_pcm_routing_get_pp_ch_cnt(int fe_id, int session_type);
#endif /*_MSM_PCM_H*/