aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKoro Chen <koro.chen@mediatek.com>2016-04-20 04:59:56 -0400
committerMark Brown <broonie@kernel.org>2016-04-21 12:15:14 -0400
commitc0133e3b0265341e7d62e150df18709af33c3a30 (patch)
tree0370369b945a162f145d8f9efd632da7a7f7814a /sound
parentd349caeb05104ef01392abc6c7cfc8ab516c7be4 (diff)
ASoC: mediatek: Add HDMI dai-links in the mt8173-rt5650-rt5676 machine driver
This creates pcmC0D2p for the HDMI playback in the same card. Signed-off-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/mediatek/Kconfig1
-rw-r--r--sound/soc/mediatek/mt8173-rt5650-rt5676.c27
2 files changed, 28 insertions, 0 deletions
diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig
index f7e789e97fbc..3abf51c07851 100644
--- a/sound/soc/mediatek/Kconfig
+++ b/sound/soc/mediatek/Kconfig
@@ -43,6 +43,7 @@ config SND_SOC_MT8173_RT5650_RT5676
43 depends on SND_SOC_MEDIATEK && I2C 43 depends on SND_SOC_MEDIATEK && I2C
44 select SND_SOC_RT5645 44 select SND_SOC_RT5645
45 select SND_SOC_RT5677 45 select SND_SOC_RT5677
46 select SND_SOC_HDMI_CODEC
46 help 47 help
47 This adds ASoC driver for Mediatek MT8173 boards 48 This adds ASoC driver for Mediatek MT8173 boards
48 with the RT5650 and RT5676 codecs. 49 with the RT5650 and RT5676 codecs.
diff --git a/sound/soc/mediatek/mt8173-rt5650-rt5676.c b/sound/soc/mediatek/mt8173-rt5650-rt5676.c
index 5c4c58c69c51..bb593926c62d 100644
--- a/sound/soc/mediatek/mt8173-rt5650-rt5676.c
+++ b/sound/soc/mediatek/mt8173-rt5650-rt5676.c
@@ -134,7 +134,9 @@ static struct snd_soc_dai_link_component mt8173_rt5650_rt5676_codecs[] = {
134enum { 134enum {
135 DAI_LINK_PLAYBACK, 135 DAI_LINK_PLAYBACK,
136 DAI_LINK_CAPTURE, 136 DAI_LINK_CAPTURE,
137 DAI_LINK_HDMI,
137 DAI_LINK_CODEC_I2S, 138 DAI_LINK_CODEC_I2S,
139 DAI_LINK_HDMI_I2S,
138 DAI_LINK_INTERCODEC 140 DAI_LINK_INTERCODEC
139}; 141};
140 142
@@ -161,6 +163,16 @@ static struct snd_soc_dai_link mt8173_rt5650_rt5676_dais[] = {
161 .dynamic = 1, 163 .dynamic = 1,
162 .dpcm_capture = 1, 164 .dpcm_capture = 1,
163 }, 165 },
166 [DAI_LINK_HDMI] = {
167 .name = "HDMI",
168 .stream_name = "HDMI PCM",
169 .cpu_dai_name = "HDMI",
170 .codec_name = "snd-soc-dummy",
171 .codec_dai_name = "snd-soc-dummy-dai",
172 .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
173 .dynamic = 1,
174 .dpcm_playback = 1,
175 },
164 176
165 /* Back End DAI links */ 177 /* Back End DAI links */
166 [DAI_LINK_CODEC_I2S] = { 178 [DAI_LINK_CODEC_I2S] = {
@@ -177,6 +189,13 @@ static struct snd_soc_dai_link mt8173_rt5650_rt5676_dais[] = {
177 .dpcm_playback = 1, 189 .dpcm_playback = 1,
178 .dpcm_capture = 1, 190 .dpcm_capture = 1,
179 }, 191 },
192 [DAI_LINK_HDMI_I2S] = {
193 .name = "HDMI BE",
194 .cpu_dai_name = "HDMIO",
195 .no_pcm = 1,
196 .codec_dai_name = "i2s-hifi",
197 .dpcm_playback = 1,
198 },
180 /* rt5676 <-> rt5650 intercodec link: Sets rt5676 I2S2 as master */ 199 /* rt5676 <-> rt5650 intercodec link: Sets rt5676 I2S2 as master */
181 [DAI_LINK_INTERCODEC] = { 200 [DAI_LINK_INTERCODEC] = {
182 .name = "rt5650_rt5676 intercodec", 201 .name = "rt5650_rt5676 intercodec",
@@ -251,6 +270,14 @@ static int mt8173_rt5650_rt5676_dev_probe(struct platform_device *pdev)
251 mt8173_rt5650_rt5676_dais[DAI_LINK_INTERCODEC].codec_of_node = 270 mt8173_rt5650_rt5676_dais[DAI_LINK_INTERCODEC].codec_of_node =
252 mt8173_rt5650_rt5676_codecs[1].of_node; 271 mt8173_rt5650_rt5676_codecs[1].of_node;
253 272
273 mt8173_rt5650_rt5676_dais[DAI_LINK_HDMI_I2S].codec_of_node =
274 of_parse_phandle(pdev->dev.of_node, "mediatek,audio-codec", 2);
275 if (!mt8173_rt5650_rt5676_dais[DAI_LINK_HDMI_I2S].codec_of_node) {
276 dev_err(&pdev->dev,
277 "Property 'audio-codec' missing or invalid\n");
278 return -EINVAL;
279 }
280
254 card->dev = &pdev->dev; 281 card->dev = &pdev->dev;
255 platform_set_drvdata(pdev, card); 282 platform_set_drvdata(pdev, card);
256 283