summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2019-02-12 19:03:24 +0100
committerSylwester Nawrocki <s.nawrocki@samsung.com>2019-03-04 18:05:33 +0100
commit182f052dd8ce2c7f48bd97064e8ad0ecb747460f (patch)
treea939307e7517cc7cd844b286819be6b7ec1248ed
parent4f907b21186e3d9cb0779815440058c73d81157d (diff)
downloadlinux-exynos-182f052dd8ce2c7f48bd97064e8ad0ecb747460f.tar.gz
linux-exynos-182f052dd8ce2c7f48bd97064e8ad0ecb747460f.tar.bz2
linux-exynos-182f052dd8ce2c7f48bd97064e8ad0ecb747460f.zip
ASoC: samsung: i2s: Add widgets and routes for DPCM support
This patch adds DAPM widgets required to model the internal mixer of the I2S controller merging audio streams from the primary and from the secondary PCM interface. Change-Id: I3cb7b1b17f0c6891f6edb638db97ca6a482cec4b Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/samsung/i2s.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index c39349adc3a8..fc65621b51a7 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -1115,8 +1115,31 @@ static const struct snd_soc_dai_ops samsung_i2s_dai_ops = {
.delay = i2s_delay,
};
+static const struct snd_soc_dapm_widget samsung_i2s_widgets[] = {
+ /* Backend DAI */
+ SND_SOC_DAPM_AIF_OUT("Mixer DAI TX", NULL, 0, SND_SOC_NOPM, 0, 0),
+ SND_SOC_DAPM_AIF_IN("Mixer DAI RX", NULL, 0, SND_SOC_NOPM, 0, 0),
+
+ /* Playback Mixer */
+ SND_SOC_DAPM_MIXER("Playback Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
+};
+
+static const struct snd_soc_dapm_route samsung_i2s_dapm_routes[] = {
+ { "Playback Mixer", NULL, "Primary" },
+ { "Playback Mixer", NULL, "Secondary" },
+
+ { "Mixer DAI TX", NULL, "Playback Mixer" },
+ { "Playback Mixer", NULL, "Mixer DAI RX" },
+};
+
static const struct snd_soc_component_driver samsung_i2s_component = {
- .name = "samsung-i2s",
+ .name = "samsung-i2s",
+
+ .dapm_widgets = samsung_i2s_widgets,
+ .num_dapm_widgets = ARRAY_SIZE(samsung_i2s_widgets),
+
+ .dapm_routes = samsung_i2s_dapm_routes,
+ .num_dapm_routes = ARRAY_SIZE(samsung_i2s_dapm_routes),
};
#define SAMSUNG_I2S_FMTS (SNDRV_PCM_FMTBIT_S8 | \
@@ -1128,6 +1151,7 @@ static int i2s_alloc_dais(struct samsung_i2s_priv *priv,
int num_dais)
{
static const char *dai_names[] = { "samsung-i2s", "samsung-i2s-sec" };
+ static const char *stream_names[] = { "Primary", "Secondary" };
struct snd_soc_dai_driver *dai_drv;
struct i2s_dai *dai;
int i;
@@ -1157,6 +1181,7 @@ static int i2s_alloc_dais(struct samsung_i2s_priv *priv,
dai_drv->playback.channels_max = 2;
dai_drv->playback.rates = i2s_dai_data->pcm_rates;
dai_drv->playback.formats = SAMSUNG_I2S_FMTS;
+ dai_drv->playback.stream_name = stream_names[i];
dai_drv->id = i + 1;
dai_drv->name = dai_names[i];