From 4fdf810fc5c82f57aa7c54ac9384f1201087724a Mon Sep 17 00:00:00 2001 From: "Dharageswari.R" Date: Fri, 5 Feb 2016 12:19:05 +0530 Subject: [PATCH] ASoC: Intel: Skylake: Get node id using helper skl_setup_cpr_gateway_cfg() retrieves gateway settings which are required for copier module configuration. For upcoming DMA control IPC we need similar retrieval, so separate this piece into skl_get_node_id() helper which will be common for these functions Signed-off-by: Dharageswari R Signed-off-by: Vinod Koul Signed-off-by: Mark Brown --- sound/soc/intel/skylake/skl-messages.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c index 4629372..60f9fe3 100644 --- a/sound/soc/intel/skylake/skl-messages.c +++ b/sound/soc/intel/skylake/skl-messages.c @@ -238,9 +238,8 @@ static void skl_copy_copier_caps(struct skl_module_cfg *mconfig, * Calculate the gatewat settings required for copier module, type of * gateway and index of gateway to use */ -static void skl_setup_cpr_gateway_cfg(struct skl_sst *ctx, - struct skl_module_cfg *mconfig, - struct skl_cpr_cfg *cpr_mconfig) +static u32 skl_get_node_id(struct skl_sst *ctx, + struct skl_module_cfg *mconfig) { union skl_connector_node_id node_id = {0}; union skl_ssp_dma_node ssp_node = {0}; @@ -289,13 +288,24 @@ static void skl_setup_cpr_gateway_cfg(struct skl_sst *ctx, break; default: - cpr_mconfig->gtw_cfg.node_id = SKL_NON_GATEWAY_CPR_NODE_ID; + node_id.val = 0xFFFFFFFF; + break; + } + + return node_id.val; +} + +static void skl_setup_cpr_gateway_cfg(struct skl_sst *ctx, + struct skl_module_cfg *mconfig, + struct skl_cpr_cfg *cpr_mconfig) +{ + cpr_mconfig->gtw_cfg.node_id = skl_get_node_id(ctx, mconfig); + + if (cpr_mconfig->gtw_cfg.node_id == SKL_NON_GATEWAY_CPR_NODE_ID) { cpr_mconfig->cpr_feature_mask = 0; return; } - cpr_mconfig->gtw_cfg.node_id = node_id.val; - if (SKL_CONN_SOURCE == mconfig->hw_conn_type) cpr_mconfig->gtw_cfg.dma_buffer_size = 2 * mconfig->obs; else -- 2.7.4