diff mbox series

[RFC,6/7] ALSA: hda/hdmi - complete pcm_setup_pin without snd_pcm link

Message ID 20190829135348.23569-7-kai.vehmanen@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series adapt SOF to use snd-hda-codec-hdmi | expand

Commit Message

Kai Vehmanen Aug. 29, 2019, 1:53 p.m. UTC
When used with e.g. SOF, the PCM entity is handled by ASoC and
there is no direct link from the HDA codec to the snd_pcm_t
object. Remaining configuration steps of hdmi_pcm_setup_pin()
should still be done in this case.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/pci/hda/patch_hdmi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 4372c87c48f0..65afb833c125 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1386,8 +1386,6 @@  static void hdmi_pcm_setup_pin(struct hdmi_spec *spec,
 		pcm = get_pcm_rec(spec, per_pin->pcm_idx);
 	else
 		return;
-	if (!pcm->pcm)
-		return;
 	if (!test_bit(per_pin->pcm_idx, &spec->pcm_in_use))
 		return;
 
@@ -1408,8 +1406,10 @@  static void hdmi_pcm_setup_pin(struct hdmi_spec *spec,
 	snd_hda_spdif_ctls_assign(codec, per_pin->pcm_idx, hinfo->nid);
 
 	non_pcm = check_non_pcm_per_cvt(codec, hinfo->nid);
-	if (substream->runtime)
-		per_pin->channels = substream->runtime->channels;
+	if (pcm->pcm) {
+		if (substream->runtime)
+			per_pin->channels = substream->runtime->channels;
+	}
 	per_pin->setup = true;
 	per_pin->mux_idx = mux_idx;