OSDN Git Service

ASoC: soc-pcm.c: tidyup playback/capture_only at soc_get_playback_capture()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 30 May 2023 00:50:08 +0000 (00:50 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 31 May 2023 11:25:06 +0000 (12:25 +0100)
commite1f653ce847bab7285dd135cabe3ce544e574c75
treecd8e9df5984c461b719a2d11aa7062765d798de4
parentc3e9b6d6ef5a0a3e841c3aa29e7afc48a0b73806
ASoC: soc-pcm.c: tidyup playback/capture_only at soc_get_playback_capture()

soc_get_playback_capture() (A) returns number of substreams for
playback/capture, and then, we can use playback/capture_only flag (X)(Y).

(A)     static int soc_get_playback_capture(...)
{
...
(X) if (dai_link->playback_only) {
(*) *playback = 1;
*capture = 0;
}

(Y) if (dai_link->capture_only) {
*playback = 0;
(*) *capture = 1;
}
...
}

But this flag should not have effect to opposite side stream (*).
This patch tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87sfbezlq8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-pcm.c