Skip to content

Commit 68eaed3

Browse files
committed
ASoC: SOF: Intel: Make sure that link and host DMA is coupled after use
Couple the Host and Link DMA when the stream is put. When the hda_dsp_stream_hw_free() is called the Link DMA might be still locked and we would leave the DMAs decoupled. Signed-off-by: Peter Ujfalusi <[email protected]>
1 parent f9c0e38 commit 68eaed3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sound/soc/sof/intel/hda-stream.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ int hda_dsp_stream_put(struct snd_sof_dev *sdev, int direction, int stream_tag)
275275
struct hdac_stream *s;
276276
bool dmi_l1_enable = true;
277277
bool found = false;
278+
u32 mask;
278279

279280
spin_lock_irq(&bus->reg_lock);
280281

@@ -290,13 +291,21 @@ int hda_dsp_stream_put(struct snd_sof_dev *sdev, int direction, int stream_tag)
290291
continue;
291292

292293
if (s->direction == direction && s->stream_tag == stream_tag) {
294+
mask = BIT(hext_stream->hstream.index);
293295
s->opened = false;
294296
found = true;
295297
} else if (!(hda_stream->flags & SOF_HDA_STREAM_DMI_L1_COMPATIBLE)) {
296298
dmi_l1_enable = false;
297299
}
298300
}
299301

302+
if (!sdev->dspless_mode_selected && found) {
303+
/* couple host and link DMA if link DMA channel is idle */
304+
if (!hext_stream->link_locked)
305+
snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR,
306+
SOF_HDA_REG_PP_PPCTL, mask, 0);
307+
}
308+
300309
spin_unlock_irq(&bus->reg_lock);
301310

302311
/* Enable DMI L1 if permitted */

0 commit comments

Comments
 (0)