diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index 5e68357c293b..028d60c196ae 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -154,9 +154,13 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream, { struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); int ret; + bool playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); dev_dbg(dai->dev, "%s()\n", __func__); + if (!playback) + return 0; + ret = hdmi_codec_new_stream(substream, dai); if (ret) return ret; @@ -188,9 +192,13 @@ static void hdmi_codec_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); + bool playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); dev_dbg(dai->dev, "%s()\n", __func__); + if (!playback) + return; + WARN_ON(hcp->current_stream != substream); hcp->hcd.ops->audio_shutdown(dai->dev->parent, hcp->hcd.data);