diff options
| -rw-r--r-- | include/sound/soc.h | 4 | ||||
| -rw-r--r-- | sound/soc/fsl/Makefile | 2 | ||||
| -rw-r--r-- | sound/soc/fsl/fsl_spdif.c | 12 | ||||
| -rw-r--r-- | sound/soc/mxs/mxs-sgtl5000.c | 2 | ||||
| -rw-r--r-- | sound/soc/soc-pcm.c | 10 |
5 files changed, 23 insertions, 7 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 71848058ffd4..d22cb0a06feb 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
| @@ -930,6 +930,10 @@ struct snd_soc_dai_link { | |||
| 930 | /* machine stream operations */ | 930 | /* machine stream operations */ |
| 931 | const struct snd_soc_ops *ops; | 931 | const struct snd_soc_ops *ops; |
| 932 | const struct snd_soc_compr_ops *compr_ops; | 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 | struct snd_soc_codec_conf { | 939 | struct snd_soc_codec_conf { |
diff --git a/sound/soc/fsl/Makefile b/sound/soc/fsl/Makefile index e2aaff717f8a..8db705b0fdf9 100644 --- a/sound/soc/fsl/Makefile +++ b/sound/soc/fsl/Makefile | |||
| @@ -45,7 +45,7 @@ snd-soc-mx27vis-aic32x4-objs := mx27vis-aic32x4.o | |||
| 45 | snd-soc-wm1133-ev1-objs := wm1133-ev1.o | 45 | snd-soc-wm1133-ev1-objs := wm1133-ev1.o |
| 46 | snd-soc-imx-sgtl5000-objs := imx-sgtl5000.o | 46 | snd-soc-imx-sgtl5000-objs := imx-sgtl5000.o |
| 47 | snd-soc-imx-wm8962-objs := imx-wm8962.o | 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 | snd-soc-imx-mc13783-objs := imx-mc13783.o | 49 | snd-soc-imx-mc13783-objs := imx-mc13783.o |
| 50 | 50 | ||
| 51 | obj-$(CONFIG_SND_SOC_EUKREA_TLV320) += snd-soc-eukrea-tlv320.o | 51 | obj-$(CONFIG_SND_SOC_EUKREA_TLV320) += snd-soc-eukrea-tlv320.o |
diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index e93dc0dfb0d9..3920c3e849ce 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c | |||
| @@ -411,8 +411,8 @@ static int spdif_set_sample_rate(struct snd_pcm_substream *substream, | |||
| 411 | return 0; | 411 | return 0; |
| 412 | } | 412 | } |
| 413 | 413 | ||
| 414 | int fsl_spdif_startup(struct snd_pcm_substream *substream, | 414 | static int fsl_spdif_startup(struct snd_pcm_substream *substream, |
| 415 | struct snd_soc_dai *cpu_dai) | 415 | struct snd_soc_dai *cpu_dai) |
| 416 | { | 416 | { |
| 417 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 417 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
| 418 | struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(rtd->cpu_dai); | 418 | struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(rtd->cpu_dai); |
| @@ -546,7 +546,7 @@ static int fsl_spdif_trigger(struct snd_pcm_substream *substream, | |||
| 546 | return 0; | 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 | .startup = fsl_spdif_startup, | 550 | .startup = fsl_spdif_startup, |
| 551 | .hw_params = fsl_spdif_hw_params, | 551 | .hw_params = fsl_spdif_hw_params, |
| 552 | .trigger = fsl_spdif_trigger, | 552 | .trigger = fsl_spdif_trigger, |
| @@ -919,7 +919,7 @@ static int fsl_spdif_dai_probe(struct snd_soc_dai *dai) | |||
| 919 | return 0; | 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 | .probe = &fsl_spdif_dai_probe, | 923 | .probe = &fsl_spdif_dai_probe, |
| 924 | .playback = { | 924 | .playback = { |
| 925 | .channels_min = 2, | 925 | .channels_min = 2, |
| @@ -1071,9 +1071,9 @@ static int fsl_spdif_probe_txclk(struct fsl_spdif_priv *spdif_priv, | |||
| 1071 | break; | 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 | spdif_priv->txclk_src[index], rate[index]); | 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 | spdif_priv->txclk_div[index], rate[index]); | 1077 | spdif_priv->txclk_div[index], rate[index]); |
| 1078 | 1078 | ||
| 1079 | return 0; | 1079 | return 0; |
diff --git a/sound/soc/mxs/mxs-sgtl5000.c b/sound/soc/mxs/mxs-sgtl5000.c index ce084eb10c49..4bb273786ff3 100644 --- a/sound/soc/mxs/mxs-sgtl5000.c +++ b/sound/soc/mxs/mxs-sgtl5000.c | |||
| @@ -105,11 +105,13 @@ static struct snd_soc_dai_link mxs_sgtl5000_dai[] = { | |||
| 105 | .stream_name = "HiFi Playback", | 105 | .stream_name = "HiFi Playback", |
| 106 | .codec_dai_name = "sgtl5000", | 106 | .codec_dai_name = "sgtl5000", |
| 107 | .ops = &mxs_sgtl5000_hifi_ops, | 107 | .ops = &mxs_sgtl5000_hifi_ops, |
| 108 | .playback_only = true, | ||
| 108 | }, { | 109 | }, { |
| 109 | .name = "HiFi Rx", | 110 | .name = "HiFi Rx", |
| 110 | .stream_name = "HiFi Capture", | 111 | .stream_name = "HiFi Capture", |
| 111 | .codec_dai_name = "sgtl5000", | 112 | .codec_dai_name = "sgtl5000", |
| 112 | .ops = &mxs_sgtl5000_hifi_ops, | 113 | .ops = &mxs_sgtl5000_hifi_ops, |
| 114 | .capture_only = true, | ||
| 113 | }, | 115 | }, |
| 114 | }; | 116 | }; |
| 115 | 117 | ||
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index fb70fbe26862..330c9a6b5cb5 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
| @@ -2020,6 +2020,16 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) | |||
| 2020 | capture = 1; | 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 | /* create the PCM */ | 2033 | /* create the PCM */ |
| 2024 | if (rtd->dai_link->no_pcm) { | 2034 | if (rtd->dai_link->no_pcm) { |
| 2025 | snprintf(new_name, sizeof(new_name), "(%s)", | 2035 | snprintf(new_name, sizeof(new_name), "(%s)", |
