All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: dwc: add a quirk DW_I2S_QUIRK_STOP_ON_SHUTDOWN to dwc driver
@ 2021-04-23 16:24 ` Vijendar Mukunda
  0 siblings, 0 replies; 26+ messages in thread
From: Vijendar Mukunda @ 2021-04-23 16:24 UTC (permalink / raw)
  To: broonie, alsa-devel
  Cc: amistry, nartemiev, Alexander.Deucher, Basavaraj.Hiregoudar,
	Sunil-kumar.Dommati, Vijendar Mukunda, Jaroslav Kysela,
	Takashi Iwai, Liam Girdwood, Ranjani Sridharan,
	Kuninori Morimoto, open list

For CZ/StoneyRidge platforms, ACP DMA between ACP SRAM and
I2S FIFO should be stopped before stopping I2S Controller DMA.

When DMA is progressing and stop request received, while DMA transfer
ongoing between ACP SRAM and I2S FIFO, Stopping I2S DMA prior to ACP DMA
stop resulting DMA Channel stop failure.

This issue can't be fixed in ACP DMA driver due to design constraint.

Add a quirk DW_I2S_QUIRK_STOP_ON_SHUTDOWN in dwc driver to fix DMA stop
failure by invoking i2s_stop() sequence in shutdown() callback.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
 include/sound/designware_i2s.h | 1 +
 sound/soc/dwc/dwc-i2s.c        | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/sound/designware_i2s.h b/include/sound/designware_i2s.h
index 80d275b..a700d20 100644
--- a/include/sound/designware_i2s.h
+++ b/include/sound/designware_i2s.h
@@ -34,6 +34,7 @@ struct i2s_platform_data {
 	#define DW_I2S_QUIRK_COMP_REG_OFFSET	(1 << 0)
 	#define DW_I2S_QUIRK_COMP_PARAM1	(1 << 1)
 	#define DW_I2S_QUIRK_16BIT_IDX_OVERRIDE (1 << 2)
+	#define DW_I2S_QUIRK_STOP_ON_SHUTDOWN   (1 << 3)
 	unsigned int quirks;
 	unsigned int i2s_reg_comp1;
 	unsigned int i2s_reg_comp2;
diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c
index fd41602..f3a681f 100644
--- a/sound/soc/dwc/dwc-i2s.c
+++ b/sound/soc/dwc/dwc-i2s.c
@@ -308,6 +308,10 @@ static int dw_i2s_hw_params(struct snd_pcm_substream *substream,
 static void dw_i2s_shutdown(struct snd_pcm_substream *substream,
 		struct snd_soc_dai *dai)
 {
+	struct dw_i2s_dev *dev = snd_soc_dai_get_drvdata(dai);
+
+	if (dev->quirks & DW_I2S_QUIRK_STOP_ON_SHUTDOWN)
+		i2s_stop(dev, substream);
 	snd_soc_dai_set_dma_data(dai, substream, NULL);
 }
 
@@ -342,7 +346,8 @@ static int dw_i2s_trigger(struct snd_pcm_substream *substream,
 	case SNDRV_PCM_TRIGGER_SUSPEND:
 	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
 		dev->active--;
-		i2s_stop(dev, substream);
+		if (!(dev->quirks & DW_I2S_QUIRK_STOP_ON_SHUTDOWN))
+			i2s_stop(dev, substream);
 		break;
 	default:
 		ret = -EINVAL;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2021-05-17  8:08 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 16:24 [PATCH 1/2] ASoC: dwc: add a quirk DW_I2S_QUIRK_STOP_ON_SHUTDOWN to dwc driver Vijendar Mukunda
2021-04-23 16:24 ` Vijendar Mukunda
2021-04-23 16:24 ` [PATCH 2/2] drm/amd/amdgpu: Add dwc quirk for Stoney/CZ platforms Vijendar Mukunda
2021-04-23 16:24   ` Vijendar Mukunda
2021-04-23 16:24   ` Vijendar Mukunda
2021-04-23 16:24   ` Vijendar Mukunda
2021-04-23 16:46 ` [PATCH 1/2] ASoC: dwc: add a quirk DW_I2S_QUIRK_STOP_ON_SHUTDOWN to dwc driver Mark Brown
2021-04-23 16:46   ` Mark Brown
2021-04-26  6:19   ` Péter Ujfalusi
2021-04-26  6:19     ` Péter Ujfalusi
2021-04-26 12:21     ` Mukunda,Vijendar
2021-04-26 12:21       ` Mukunda,Vijendar
2021-04-27  6:40       ` Péter Ujfalusi
2021-04-27  6:40         ` Péter Ujfalusi
2021-04-28 15:35         ` Mukunda,Vijendar
2021-04-28 15:35           ` Mukunda,Vijendar
2021-04-30  5:42           ` Péter Ujfalusi
2021-04-30  5:42             ` Péter Ujfalusi
2021-04-30 18:35             ` Mukunda,Vijendar
2021-04-30 18:35               ` Mukunda,Vijendar
2021-05-10 17:27               ` Mukunda,Vijendar
2021-05-10 17:27                 ` Mukunda,Vijendar
2021-05-13 14:05                 ` Mark Brown
2021-05-13 14:05                   ` Mark Brown
2021-05-17  8:07                 ` Péter Ujfalusi
2021-05-17  8:07                   ` Péter Ujfalusi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.