diff options
-rw-r--r-- | include/sound/soc.h | 4 | ||||
-rw-r--r-- | sound/soc/soc-pcm.c | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index c0ac3bc7b7f4..65414e82c762 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -936,6 +936,10 @@ struct snd_soc_dai_link { | |||
936 | /* machine stream operations */ | 936 | /* machine stream operations */ |
937 | const struct snd_soc_ops *ops; | 937 | const struct snd_soc_ops *ops; |
938 | const struct snd_soc_compr_ops *compr_ops; | 938 | const struct snd_soc_compr_ops *compr_ops; |
939 | |||
940 | /* For unidirectional dai links */ | ||
941 | bool playback_only; | ||
942 | bool capture_only; | ||
939 | }; | 943 | }; |
940 | 944 | ||
941 | struct snd_soc_codec_conf { | 945 | struct snd_soc_codec_conf { |
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index b6c640332a17..9abaa52efb2e 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
@@ -2027,6 +2027,16 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) | |||
2027 | capture = 1; | 2027 | capture = 1; |
2028 | } | 2028 | } |
2029 | 2029 | ||
2030 | if (rtd->dai_link->playback_only) { | ||
2031 | playback = 1; | ||
2032 | capture = 0; | ||
2033 | } | ||
2034 | |||
2035 | if (rtd->dai_link->capture_only) { | ||
2036 | playback = 0; | ||
2037 | capture = 1; | ||
2038 | } | ||
2039 | |||
2030 | /* create the PCM */ | 2040 | /* create the PCM */ |
2031 | if (rtd->dai_link->no_pcm) { | 2041 | if (rtd->dai_link->no_pcm) { |
2032 | snprintf(new_name, sizeof(new_name), "(%s)", | 2042 | snprintf(new_name, sizeof(new_name), "(%s)", |