@@ -346,20 +346,21 @@ static int hda_trigger(struct snd_sof_dev *sdev, struct snd_soc_dai *cpu_dai,
346
346
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE :
347
347
snd_hdac_ext_stream_start (hext_stream );
348
348
break ;
349
- case SNDRV_PCM_TRIGGER_SUSPEND :
350
- case SNDRV_PCM_TRIGGER_STOP :
351
349
case SNDRV_PCM_TRIGGER_PAUSE_PUSH :
352
- snd_hdac_ext_stream_clear (hext_stream );
353
-
354
350
/*
355
- * Save the LLP registers in case the stream is
356
- * restarting due PAUSE_RELEASE, or START without a pcm
357
- * close/open since in this case the LLP register is not reset
358
- * to 0 and the delay calculation will return with invalid
359
- * results.
351
+ * Save the LLP registers since in case of PAUSE the LLP
352
+ * register are not reset to 0, the delay calculation will use
353
+ * the saved offsets for compensating the delay calculation.
360
354
*/
361
355
hext_stream -> pplcllpl = readl (hext_stream -> pplc_addr + AZX_REG_PPLCLLPL );
362
356
hext_stream -> pplcllpu = readl (hext_stream -> pplc_addr + AZX_REG_PPLCLLPU );
357
+ snd_hdac_ext_stream_clear (hext_stream );
358
+ break ;
359
+ case SNDRV_PCM_TRIGGER_SUSPEND :
360
+ case SNDRV_PCM_TRIGGER_STOP :
361
+ hext_stream -> pplcllpl = 0 ;
362
+ hext_stream -> pplcllpu = 0 ;
363
+ snd_hdac_ext_stream_clear (hext_stream );
363
364
break ;
364
365
default :
365
366
dev_err (sdev -> dev , "unknown trigger command %d\n" , cmd );
@@ -512,7 +513,6 @@ static const struct hda_dai_widget_dma_ops sdw_ipc4_chain_dma_ops = {
512
513
static int hda_ipc3_post_trigger (struct snd_sof_dev * sdev , struct snd_soc_dai * cpu_dai ,
513
514
struct snd_pcm_substream * substream , int cmd )
514
515
{
515
- struct hdac_ext_stream * hext_stream = hda_get_hext_stream (sdev , cpu_dai , substream );
516
516
struct snd_soc_dapm_widget * w = snd_soc_dai_get_widget (cpu_dai , substream -> stream );
517
517
518
518
switch (cmd ) {
@@ -527,9 +527,6 @@ static int hda_ipc3_post_trigger(struct snd_sof_dev *sdev, struct snd_soc_dai *c
527
527
if (ret < 0 )
528
528
return ret ;
529
529
530
- if (cmd == SNDRV_PCM_TRIGGER_STOP )
531
- return hda_link_dma_cleanup (substream , hext_stream , cpu_dai );
532
-
533
530
break ;
534
531
}
535
532
case SNDRV_PCM_TRIGGER_PAUSE_PUSH :
0 commit comments