clear-pkgs-linux-iot-lts2018/0221-ASoC-CNL-Add-DAIS-for-...

114 lines
3.5 KiB
Diff

From 3cf3b542a9d790dd909d93cb61df04a192c18ff8 Mon Sep 17 00:00:00 2001
From: Hardik Shah <hardik.t.shah@intel.com>
Date: Mon, 2 May 2016 15:12:59 +0530
Subject: [PATCH 221/743] ASoC:CNL: Add DAIS for SoundWire masters.
Add new DAIs for SoundWire master for aggregation.
Add DAI IDs to find the master controller from DAI.
Earlier DAI was found from the copier vbus, but with
aggregation, copier is linked to multiple DAIs which
are aggregated. So add be_ids range to idendify
SDW master controller from DAIs.
Change-Id: Ida7bd5893e073c3ec5d7ab7dda0c94306c42051b
Signed-off-by: Hardik Shah <hardik.t.shah@intel.com>
Reviewed-on:
---
sound/soc/intel/skylake/skl-pcm.c | 46 ++++++++++++++++++++++++++-
sound/soc/intel/skylake/skl-sdw-pcm.h | 7 ++++
2 files changed, 52 insertions(+), 1 deletion(-)
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index da4461762c4e..f27b7188b7c8 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -1096,6 +1096,7 @@ static struct snd_soc_dai_driver skl_platform_dai[] = {
* should be coming from CLT based on endpoints to be supported
*/
.name = "SDW Pin",
+ .id = SDW_BE_DAI_ID_MSTR0,
.ops = &skl_sdw_dai_ops,
.playback = {
.stream_name = "SDW Tx",
@@ -1118,6 +1119,7 @@ static struct snd_soc_dai_driver skl_platform_dai[] = {
*/
.name = "SDW PDM Pin",
.ops = &skl_sdw_dai_ops,
+ .id = SDW_BE_DAI_ID_MSTR0 + 1,
.capture = {
.stream_name = "SDW Rx1",
.channels_min = HDA_MONO,
@@ -1125,8 +1127,50 @@ static struct snd_soc_dai_driver skl_platform_dai[] = {
.rates = SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
+},
+{
+ /* Currently adding 1 playback and 1 capture pin, ideally it
+ * should be coming from CLT based on endpoints to be supported
+ */
+ .name = "SDW1 Pin",
+ .id = SDW_BE_DAI_ID_MSTR1,
+ .ops = &skl_sdw_dai_ops,
+ .playback = {
+ .stream_name = "SDW1 Tx",
+ .channels_min = HDA_STEREO,
+ .channels_max = HDA_STEREO,
+ .rates = SNDRV_PCM_RATE_48000,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE,
+ },
+ .capture = {
+ .stream_name = "SDW1 Rx",
+ .channels_min = HDA_STEREO,
+ .channels_max = HDA_STEREO,
+ .rates = SNDRV_PCM_RATE_48000,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE,
+ },
-
+},
+{
+ /* Currently adding 1 playback and 1 capture pin, ideally it
+ * should be coming from CLT based on endpoints to be supported
+ */
+ .name = "SDW3 Pin",
+ .ops = &skl_sdw_dai_ops,
+ .playback = {
+ .stream_name = "SDW3 Tx",
+ .channels_min = HDA_STEREO,
+ .channels_max = HDA_STEREO,
+ .rates = SNDRV_PCM_RATE_48000,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE,
+ },
+ .capture = {
+ .stream_name = "SDW3 Rx",
+ .channels_min = HDA_STEREO,
+ .channels_max = HDA_STEREO,
+ .rates = SNDRV_PCM_RATE_48000,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE,
+ },
},
};
diff --git a/sound/soc/intel/skylake/skl-sdw-pcm.h b/sound/soc/intel/skylake/skl-sdw-pcm.h
index ab1314a6f408..7166ef9992ab 100644
--- a/sound/soc/intel/skylake/skl-sdw-pcm.h
+++ b/sound/soc/intel/skylake/skl-sdw-pcm.h
@@ -24,6 +24,13 @@
#include <sound/soc.h>
#include <sound/pcm_params.h>
+#define SDW_BE_DAI_ID_BASE 256
+#define SDW_BE_DAI_ID_MSTR0 256
+#define SDW_BE_DAI_ID_MSTR1 (SDW_BE_DAI_ID_MSTR0 + 32)
+#define SDW_BE_DAI_ID_MSTR2 (SDW_BE_DAI_ID_MSTR1 + 32)
+#define SDW_BE_DAI_ID_MSTR3 (SDW_BE_DAI_ID_MSTR2 + 32)
+
+
int cnl_sdw_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai);
int cnl_sdw_hw_params(struct snd_pcm_substream *substream,
--
2.19.2