Commit 90d561bed9619fc08c31eab9315ebe811d41149a

Authored by Mark Brown

Merge remote-tracking branch 'asoc/topic/fsl' into tmp

Showing 5 changed files Side-by-side Diff

... ... @@ -930,6 +930,10 @@
930 930 /* machine stream operations */
931 931 const struct snd_soc_ops *ops;
932 932 const struct snd_soc_compr_ops *compr_ops;
  933 +
  934 + /* For unidirectional dai links */
  935 + bool playback_only;
  936 + bool capture_only;
933 937 };
934 938  
935 939 struct snd_soc_codec_conf {
sound/soc/fsl/Makefile
... ... @@ -45,7 +45,7 @@
45 45 snd-soc-wm1133-ev1-objs := wm1133-ev1.o
46 46 snd-soc-imx-sgtl5000-objs := imx-sgtl5000.o
47 47 snd-soc-imx-wm8962-objs := imx-wm8962.o
48   -snd-soc-imx-spdif-objs :=imx-spdif.o
  48 +snd-soc-imx-spdif-objs := imx-spdif.o
49 49 snd-soc-imx-mc13783-objs := imx-mc13783.o
50 50  
51 51 obj-$(CONFIG_SND_SOC_EUKREA_TLV320) += snd-soc-eukrea-tlv320.o
sound/soc/fsl/fsl_spdif.c
... ... @@ -411,8 +411,8 @@
411 411 return 0;
412 412 }
413 413  
414   -int fsl_spdif_startup(struct snd_pcm_substream *substream,
415   - struct snd_soc_dai *cpu_dai)
  414 +static int fsl_spdif_startup(struct snd_pcm_substream *substream,
  415 + struct snd_soc_dai *cpu_dai)
416 416 {
417 417 struct snd_soc_pcm_runtime *rtd = substream->private_data;
418 418 struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(rtd->cpu_dai);
... ... @@ -546,7 +546,7 @@
546 546 return 0;
547 547 }
548 548  
549   -struct snd_soc_dai_ops fsl_spdif_dai_ops = {
  549 +static struct snd_soc_dai_ops fsl_spdif_dai_ops = {
550 550 .startup = fsl_spdif_startup,
551 551 .hw_params = fsl_spdif_hw_params,
552 552 .trigger = fsl_spdif_trigger,
... ... @@ -919,7 +919,7 @@
919 919 return 0;
920 920 }
921 921  
922   -struct snd_soc_dai_driver fsl_spdif_dai = {
  922 +static struct snd_soc_dai_driver fsl_spdif_dai = {
923 923 .probe = &fsl_spdif_dai_probe,
924 924 .playback = {
925 925 .channels_min = 2,
926 926  
... ... @@ -1071,9 +1071,9 @@
1071 1071 break;
1072 1072 }
1073 1073  
1074   - dev_dbg(&pdev->dev, "use rxtx%d as tx clock source for %dHz sample rate",
  1074 + dev_dbg(&pdev->dev, "use rxtx%d as tx clock source for %dHz sample rate\n",
1075 1075 spdif_priv->txclk_src[index], rate[index]);
1076   - dev_dbg(&pdev->dev, "use divisor %d for %dHz sample rate",
  1076 + dev_dbg(&pdev->dev, "use divisor %d for %dHz sample rate\n",
1077 1077 spdif_priv->txclk_div[index], rate[index]);
1078 1078  
1079 1079 return 0;
sound/soc/mxs/mxs-sgtl5000.c
... ... @@ -105,11 +105,13 @@
105 105 .stream_name = "HiFi Playback",
106 106 .codec_dai_name = "sgtl5000",
107 107 .ops = &mxs_sgtl5000_hifi_ops,
  108 + .playback_only = true,
108 109 }, {
109 110 .name = "HiFi Rx",
110 111 .stream_name = "HiFi Capture",
111 112 .codec_dai_name = "sgtl5000",
112 113 .ops = &mxs_sgtl5000_hifi_ops,
  114 + .capture_only = true,
113 115 },
114 116 };
115 117  
... ... @@ -2020,6 +2020,16 @@
2020 2020 capture = 1;
2021 2021 }
2022 2022  
  2023 + if (rtd->dai_link->playback_only) {
  2024 + playback = 1;
  2025 + capture = 0;
  2026 + }
  2027 +
  2028 + if (rtd->dai_link->capture_only) {
  2029 + playback = 0;
  2030 + capture = 1;
  2031 + }
  2032 +
2023 2033 /* create the PCM */
2024 2034 if (rtd->dai_link->no_pcm) {
2025 2035 snprintf(new_name, sizeof(new_name), "(%s)",