ASoC: Intel: Skylake: Fix default dma_buffer_size
[muen/linux.git] / sound / soc / intel / skylake / skl-messages.c
index eca85827dbd2af68f1bece9718650023dd91fbd4..fb2f1f603f3c9ef955f35c61e2b21d964f666be8 100644 (file)
@@ -540,6 +540,14 @@ static void skl_setup_cpr_gateway_cfg(struct skl_sst *ctx,
        cpr_mconfig->gtw_cfg.dma_buffer_size =
                                mconfig->dma_buffer_size * dma_io_buf;
 
+       /* fallback to 2ms default value */
+       if (!cpr_mconfig->gtw_cfg.dma_buffer_size) {
+               if (mconfig->hw_conn_type == SKL_CONN_SOURCE)
+                       cpr_mconfig->gtw_cfg.dma_buffer_size = 2 * mconfig->obs;
+               else
+                       cpr_mconfig->gtw_cfg.dma_buffer_size = 2 * mconfig->ibs;
+       }
+
        cpr_mconfig->cpr_feature_mask = 0;
        cpr_mconfig->gtw_cfg.config_length  = 0;