aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDharageswari.R <dharageswari.r@intel.com>2016-02-05 01:49:05 -0500
committerMark Brown <broonie@kernel.org>2016-02-08 11:44:17 -0500
commit4fdf810fc5c82f57aa7c54ac9384f1201087724a (patch)
tree88d840541b3c13c1d8e477293cf1f51cc4fc49ef
parent33420d66354134b9369d0984a6ca418752c781a6 (diff)
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 <dharageswari.r@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/intel/skylake/skl-messages.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c
index 4629372d7c8e..60f9fe389887 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,
238 * Calculate the gatewat settings required for copier module, type of 238 * Calculate the gatewat settings required for copier module, type of
239 * gateway and index of gateway to use 239 * gateway and index of gateway to use
240 */ 240 */
241static void skl_setup_cpr_gateway_cfg(struct skl_sst *ctx, 241static u32 skl_get_node_id(struct skl_sst *ctx,
242 struct skl_module_cfg *mconfig, 242 struct skl_module_cfg *mconfig)
243 struct skl_cpr_cfg *cpr_mconfig)
244{ 243{
245 union skl_connector_node_id node_id = {0}; 244 union skl_connector_node_id node_id = {0};
246 union skl_ssp_dma_node ssp_node = {0}; 245 union skl_ssp_dma_node ssp_node = {0};
@@ -289,13 +288,24 @@ static void skl_setup_cpr_gateway_cfg(struct skl_sst *ctx,
289 break; 288 break;
290 289
291 default: 290 default:
292 cpr_mconfig->gtw_cfg.node_id = SKL_NON_GATEWAY_CPR_NODE_ID; 291 node_id.val = 0xFFFFFFFF;
292 break;
293 }
294
295 return node_id.val;
296}
297
298static void skl_setup_cpr_gateway_cfg(struct skl_sst *ctx,
299 struct skl_module_cfg *mconfig,
300 struct skl_cpr_cfg *cpr_mconfig)
301{
302 cpr_mconfig->gtw_cfg.node_id = skl_get_node_id(ctx, mconfig);
303
304 if (cpr_mconfig->gtw_cfg.node_id == SKL_NON_GATEWAY_CPR_NODE_ID) {
293 cpr_mconfig->cpr_feature_mask = 0; 305 cpr_mconfig->cpr_feature_mask = 0;
294 return; 306 return;
295 } 307 }
296 308
297 cpr_mconfig->gtw_cfg.node_id = node_id.val;
298
299 if (SKL_CONN_SOURCE == mconfig->hw_conn_type) 309 if (SKL_CONN_SOURCE == mconfig->hw_conn_type)
300 cpr_mconfig->gtw_cfg.dma_buffer_size = 2 * mconfig->obs; 310 cpr_mconfig->gtw_cfg.dma_buffer_size = 2 * mconfig->obs;
301 else 311 else