clear-pkgs-linux-iot-lts2018/0218-REVERTME-SKL-PCM-Enabl...

79 lines
2.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Hardik Shah <hardik.t.shah@intel.com>
Date: Fri, 20 May 2016 15:02:36 +0530
Subject: [PATCH] REVERTME:SKL:PCM: Enable aggregation for the Maxim codec.
Set the aggregation parameters if Maxim codec is enabled.
Aggregation parameters should ideally come from ITT topology.
ITT change is still not done, so hardcoding in driver for now.
Change-Id: I9d8d7ee9f1740b0fa4bc6f20f275272a9577f733
Signed-off-by: Hardik Shah <hardik.t.shah@intel.com>
Reviewed-on:
---
sound/soc/intel/skylake/skl-sdw-pcm.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/sound/soc/intel/skylake/skl-sdw-pcm.c b/sound/soc/intel/skylake/skl-sdw-pcm.c
index 504228e2cba5..e41a3b38aa81 100644
--- a/sound/soc/intel/skylake/skl-sdw-pcm.c
+++ b/sound/soc/intel/skylake/skl-sdw-pcm.c
@@ -46,7 +46,10 @@ struct sdw_dma_data {
int mstr_nr;
};
-
+#ifdef CONFIG_SND_SOC_MXFPGA
+static char uuid_playback[] = "Agg_p";
+static char uuid_capture[] = "Agg_c";
+#endif
int cnl_sdw_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
@@ -98,6 +101,12 @@ int cnl_sdw_startup(struct snd_pcm_substream *substream,
dma->mstr_nr = sdw_ctrl_nr;
snd_soc_dai_set_dma_data(dai, substream, dma);
+#ifdef CONFIG_SND_SOC_MXFPGA
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ uuid = uuid_playback;
+ else
+ uuid = uuid_capture;
+#endif
ret = sdw_alloc_stream_tag(uuid, &dma->stream_tag);
if (ret) {
dev_err(dai->dev, "Unable to allocate stream tag");
@@ -115,6 +124,18 @@ int cnl_sdw_startup(struct snd_pcm_substream *substream,
return ret;
}
+#ifdef CONFIG_SND_SOC_MXFPGA
+static void skl_set_agg(struct skl_module_cfg *m_cfg, int be_id) {
+ m_cfg->sdw_agg_enable = true;
+ m_cfg->sdw_agg.num_masters = 2;
+ if (be_id > SDW_BE_DAI_ID_MSTR0)
+ m_cfg->sdw_agg.agg_data[1].ch_mask = 0x2;
+ else
+ m_cfg->sdw_agg.agg_data[0].ch_mask = 0x1;
+
+}
+#endif
+
int cnl_sdw_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
@@ -159,6 +180,10 @@ int cnl_sdw_hw_params(struct snd_pcm_substream *substream,
dev_err(dai->dev, "BE Copier not found\n");
return -EINVAL;
}
+#ifdef CONFIG_SND_SOC_MXFPGA
+ /* Ideally this will come from DFW */
+ skl_set_agg(m_cfg, dai->id);
+#endif
if (!m_cfg->sdw_agg_enable)
m_cfg->sdw_stream_num = dma->port->pdi_stream->sdw_pdi_num;
--
https://clearlinux.org