@@ -432,7 +432,7 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream,
bool has_playback = !hcp->hcd.no_i2s_playback;
int ret = 0;
- if (!((has_playback && !tx) || (has_capture && tx)))
+ if (!((has_playback && tx) || (has_capture && !tx)))
return 0;
mutex_lock(&hcp->lock);
@@ -477,7 +477,7 @@ static void hdmi_codec_shutdown(struct snd_pcm_substream *substream,
bool has_capture = !hcp->hcd.no_i2s_capture;
bool has_playback = !hcp->hcd.no_i2s_playback;
- if (!((has_playback && !tx) || (has_capture && tx)))
+ if (!((has_playback && tx) || (has_capture && !tx)))
return;
hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN;
Fix ignore logic on shutdown and startup. It broke single cpu single hdmi-codec with a single supported stream direction. Inverting TX fixes it. Truth table for when to ignore. +--------------+----+--------+-----+ +--------+-----+ | has_playback | has_capture | TX | | Before | Now | +--------------+-------------+-----+ +--------+-----+ | 0 | 0 | 0 | | 1 | 1 | +--------------+-------------+-----+ +--------+-----+ | 0 | 0 | 1 | | 1 | 1 | +--------------+-------------+-----+ +--------+-----+ | 0 | 1 | 0 | | 1 | 0 | +--------------+-------------+-----+ +--------+-----+ | 0 | 1 | 1 | | 0 | 1 | +--------------+-------------+-----+ +--------+-----+ | 1 | 0 | 0 | | 0 | 1 | +--------------+-------------+-----+ +--------+-----+ | 1 | 0 | 1 | | 1 | 0 | +--------------+-------------+-----+ +--------+-----+ | 1 | 1 | 0 | | 0 | 0 | +--------------+-------------+-----+ +--------+-----+ | 1 | 1 | 1 | | 0 | 0 | +--------------+-------------+-----+ +--------+-----+ Signed-off-by: Emil Svendsen <emas@bang-olufsen.dk> Link: https://lore.kernel.org/r/20230308125503.3917903-1-emas@bang-olufsen.dk --- sound/soc/codecs/hdmi-codec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)