aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPC Liao <pc.liao@mediatek.com>2016-07-05 05:26:21 -0400
committerMark Brown <broonie@kernel.org>2016-07-14 12:31:18 -0400
commit97e1145a416e8bf0c00e7496e3522765437471ad (patch)
tree0201ceb72ed7e59c470a521185ba6201bdd8d084
parent25d01dc67894de03de463727633e72e1727b4f6d (diff)
ASoC: mediatek: Add HDMI dai-links to the mt8173-rt5650 machine driver
This patch adds HDMI audio output support to the MT8173 RT5650 machine driver. Signed-off-by: PC Liao <pc.liao@mediatek.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--Documentation/devicetree/bindings/sound/mt8173-rt5650.txt5
-rw-r--r--sound/soc/mediatek/Kconfig1
-rw-r--r--sound/soc/mediatek/mt8173/mt8173-rt5650.c26
3 files changed, 30 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/sound/mt8173-rt5650.txt b/Documentation/devicetree/bindings/sound/mt8173-rt5650.txt
index f250fc7c7acc..29dce2ac8773 100644
--- a/Documentation/devicetree/bindings/sound/mt8173-rt5650.txt
+++ b/Documentation/devicetree/bindings/sound/mt8173-rt5650.txt
@@ -1,8 +1,9 @@
1MT8173 with RT5650 CODECS 1MT8173 with RT5650 CODECS and HDMI via I2S
2 2
3Required properties: 3Required properties:
4- compatible : "mediatek,mt8173-rt5650" 4- compatible : "mediatek,mt8173-rt5650"
5- mediatek,audio-codec: the phandles of rt5650 codecs 5- mediatek,audio-codec: the phandles of rt5650 codecs
6 and of the hdmi encoder node
6- mediatek,platform: the phandle of MT8173 ASoC platform 7- mediatek,platform: the phandle of MT8173 ASoC platform
7 8
8Optional subnodes: 9Optional subnodes:
@@ -20,7 +21,7 @@ Example:
20 21
21 sound { 22 sound {
22 compatible = "mediatek,mt8173-rt5650"; 23 compatible = "mediatek,mt8173-rt5650";
23 mediatek,audio-codec = <&rt5650>; 24 mediatek,audio-codec = <&rt5650 &hdmi0>;
24 mediatek,platform = <&afe>; 25 mediatek,platform = <&afe>;
25 mediatek,mclk = <0>; 26 mediatek,mclk = <0>;
26 codec-capture { 27 codec-capture {
diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig
index 2fbe5434f03b..05cf809cf9e1 100644
--- a/sound/soc/mediatek/Kconfig
+++ b/sound/soc/mediatek/Kconfig
@@ -46,6 +46,7 @@ config SND_SOC_MT8173_RT5650
46 tristate "ASoC Audio driver for MT8173 with RT5650 codec" 46 tristate "ASoC Audio driver for MT8173 with RT5650 codec"
47 depends on SND_SOC_MT8173 && I2C 47 depends on SND_SOC_MT8173 && I2C
48 select SND_SOC_RT5645 48 select SND_SOC_RT5645
49 select SND_SOC_HDMI_CODEC
49 help 50 help
50 This adds ASoC driver for Mediatek MT8173 boards 51 This adds ASoC driver for Mediatek MT8173 boards
51 with the RT5650 audio codec. 52 with the RT5650 audio codec.
diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650.c b/sound/soc/mediatek/mt8173/mt8173-rt5650.c
index d47897618cb5..ba65f4157a7e 100644
--- a/sound/soc/mediatek/mt8173/mt8173-rt5650.c
+++ b/sound/soc/mediatek/mt8173/mt8173-rt5650.c
@@ -169,7 +169,9 @@ static struct snd_soc_dai_link_component mt8173_rt5650_codecs[] = {
169enum { 169enum {
170 DAI_LINK_PLAYBACK, 170 DAI_LINK_PLAYBACK,
171 DAI_LINK_CAPTURE, 171 DAI_LINK_CAPTURE,
172 DAI_LINK_HDMI,
172 DAI_LINK_CODEC_I2S, 173 DAI_LINK_CODEC_I2S,
174 DAI_LINK_HDMI_I2S,
173}; 175};
174 176
175/* Digital audio interface glue - connects codec <---> CPU */ 177/* Digital audio interface glue - connects codec <---> CPU */
@@ -195,6 +197,16 @@ static struct snd_soc_dai_link mt8173_rt5650_dais[] = {
195 .dynamic = 1, 197 .dynamic = 1,
196 .dpcm_capture = 1, 198 .dpcm_capture = 1,
197 }, 199 },
200 [DAI_LINK_HDMI] = {
201 .name = "HDMI",
202 .stream_name = "HDMI PCM",
203 .cpu_dai_name = "HDMI",
204 .codec_name = "snd-soc-dummy",
205 .codec_dai_name = "snd-soc-dummy-dai",
206 .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
207 .dynamic = 1,
208 .dpcm_playback = 1,
209 },
198 /* Back End DAI links */ 210 /* Back End DAI links */
199 [DAI_LINK_CODEC_I2S] = { 211 [DAI_LINK_CODEC_I2S] = {
200 .name = "Codec", 212 .name = "Codec",
@@ -210,6 +222,13 @@ static struct snd_soc_dai_link mt8173_rt5650_dais[] = {
210 .dpcm_playback = 1, 222 .dpcm_playback = 1,
211 .dpcm_capture = 1, 223 .dpcm_capture = 1,
212 }, 224 },
225 [DAI_LINK_HDMI_I2S] = {
226 .name = "HDMI BE",
227 .cpu_dai_name = "HDMIO",
228 .no_pcm = 1,
229 .codec_dai_name = "i2s-hifi",
230 .dpcm_playback = 1,
231 },
213}; 232};
214 233
215static struct snd_soc_card mt8173_rt5650_card = { 234static struct snd_soc_card mt8173_rt5650_card = {
@@ -284,6 +303,13 @@ static int mt8173_rt5650_dev_probe(struct platform_device *pdev)
284 } 303 }
285 } 304 }
286 305
306 mt8173_rt5650_dais[DAI_LINK_HDMI_I2S].codec_of_node =
307 of_parse_phandle(pdev->dev.of_node, "mediatek,audio-codec", 1);
308 if (!mt8173_rt5650_dais[DAI_LINK_HDMI_I2S].codec_of_node) {
309 dev_err(&pdev->dev,
310 "Property 'audio-codec' missing or invalid\n");
311 return -EINVAL;
312 }
287 card->dev = &pdev->dev; 313 card->dev = &pdev->dev;
288 platform_set_drvdata(pdev, card); 314 platform_set_drvdata(pdev, card);
289 315