aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/hdmi-codec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/hdmi-codec.c')
-rw-r--r--sound/soc/codecs/hdmi-codec.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index 38e4a8515709..d00734d31e04 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -291,10 +291,6 @@ static const struct snd_soc_dapm_widget hdmi_widgets[] = {
291 SND_SOC_DAPM_OUTPUT("TX"), 291 SND_SOC_DAPM_OUTPUT("TX"),
292}; 292};
293 293
294static const struct snd_soc_dapm_route hdmi_routes[] = {
295 { "TX", NULL, "Playback" },
296};
297
298enum { 294enum {
299 DAI_ID_I2S = 0, 295 DAI_ID_I2S = 0,
300 DAI_ID_SPDIF, 296 DAI_ID_SPDIF,
@@ -689,9 +685,23 @@ static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd,
689 return snd_ctl_add(rtd->card->snd_card, kctl); 685 return snd_ctl_add(rtd->card->snd_card, kctl);
690} 686}
691 687
688static int hdmi_dai_probe(struct snd_soc_dai *dai)
689{
690 struct snd_soc_dapm_context *dapm;
691 struct snd_soc_dapm_route route = {
692 .sink = "TX",
693 .source = dai->driver->playback.stream_name,
694 };
695
696 dapm = snd_soc_component_get_dapm(dai->component);
697
698 return snd_soc_dapm_add_routes(dapm, &route, 1);
699}
700
692static const struct snd_soc_dai_driver hdmi_i2s_dai = { 701static const struct snd_soc_dai_driver hdmi_i2s_dai = {
693 .name = "i2s-hifi", 702 .name = "i2s-hifi",
694 .id = DAI_ID_I2S, 703 .id = DAI_ID_I2S,
704 .probe = hdmi_dai_probe,
695 .playback = { 705 .playback = {
696 .stream_name = "I2S Playback", 706 .stream_name = "I2S Playback",
697 .channels_min = 2, 707 .channels_min = 2,
@@ -707,6 +717,7 @@ static const struct snd_soc_dai_driver hdmi_i2s_dai = {
707static const struct snd_soc_dai_driver hdmi_spdif_dai = { 717static const struct snd_soc_dai_driver hdmi_spdif_dai = {
708 .name = "spdif-hifi", 718 .name = "spdif-hifi",
709 .id = DAI_ID_SPDIF, 719 .id = DAI_ID_SPDIF,
720 .probe = hdmi_dai_probe,
710 .playback = { 721 .playback = {
711 .stream_name = "SPDIF Playback", 722 .stream_name = "SPDIF Playback",
712 .channels_min = 2, 723 .channels_min = 2,
@@ -733,8 +744,6 @@ static int hdmi_of_xlate_dai_id(struct snd_soc_component *component,
733static const struct snd_soc_component_driver hdmi_driver = { 744static const struct snd_soc_component_driver hdmi_driver = {
734 .dapm_widgets = hdmi_widgets, 745 .dapm_widgets = hdmi_widgets,
735 .num_dapm_widgets = ARRAY_SIZE(hdmi_widgets), 746 .num_dapm_widgets = ARRAY_SIZE(hdmi_widgets),
736 .dapm_routes = hdmi_routes,
737 .num_dapm_routes = ARRAY_SIZE(hdmi_routes),
738 .of_xlate_dai_id = hdmi_of_xlate_dai_id, 747 .of_xlate_dai_id = hdmi_of_xlate_dai_id,
739 .idle_bias_on = 1, 748 .idle_bias_on = 1,
740 .use_pmdown_time = 1, 749 .use_pmdown_time = 1,