Skip to content

Commit

Permalink
ASoC: pcm: Require both CODEC and CPU support when declaring stream caps
Browse files Browse the repository at this point in the history
When declaring playback and capture capabilities check for both CODEC
side and CPU side support rather than only checking for CODEC side
support.  While it is unusual some CPUs do have unidirectional DAIs.

Reported-by: Fabio Estevam <[email protected]>
Tested-by: Fabio Estevam <[email protected]>
Acked-by: Liam Girdwood <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
broonie committed Jun 3, 2013
1 parent e4aa937 commit 0567909
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sound/soc/soc-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2011,9 +2011,11 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
if (cpu_dai->driver->capture.channels_min)
capture = 1;
} else {
if (codec_dai->driver->playback.channels_min)
if (codec_dai->driver->playback.channels_min &&
cpu_dai->driver->playback.channels_min)
playback = 1;
if (codec_dai->driver->capture.channels_min)
if (codec_dai->driver->capture.channels_min &&
cpu_dai->driver->capture.channels_min)
capture = 1;
}

Expand Down

0 comments on commit 0567909

Please sign in to comment.