Skip to content

Commit

Permalink
ASoC: soc-pcm: Allow to specify unidirectional dai_link
Browse files Browse the repository at this point in the history
Add 'playback_only' and 'capture_only' fields that can be used for specifying
that a dai_link has a unidirectional capability.

The motivation for this is for the cases of systems, such as Freescale MX28,
that has two unidirectional DAIs.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Fabio Estevam authored and Mark Brown committed Sep 1, 2013
1 parent 6b4c80f commit d6bead0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,10 @@ struct snd_soc_dai_link {
/* machine stream operations */
const struct snd_soc_ops *ops;
const struct snd_soc_compr_ops *compr_ops;

/* For unidirectional dai links */
bool playback_only;
bool capture_only;
};

struct snd_soc_codec_conf {
Expand Down
10 changes: 10 additions & 0 deletions sound/soc/soc-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2027,6 +2027,16 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
capture = 1;
}

if (rtd->dai_link->playback_only) {
playback = 1;
capture = 0;
}

if (rtd->dai_link->capture_only) {
playback = 0;
capture = 1;
}

/* create the PCM */
if (rtd->dai_link->no_pcm) {
snprintf(new_name, sizeof(new_name), "(%s)",
Expand Down

0 comments on commit d6bead0

Please sign in to comment.