[PATCH 4/4] ALSA: hda: check if stream is stopped in snd_hdac_stream_clear

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Pardha Saradhi K <pardha.saradhi.kesapragada@xxxxxxxxx>

Check if the DMA Channel is already stopped. There is no need
to stop it again if stopped.

Signed-off-by: Pardha Saradhi K <pardha.saradhi.kesapragada@xxxxxxxxx>
Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@xxxxxxxxx>
---
 sound/hda/hdac_stream.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c
index aa8a2884289f..c1810eb7212b 100644
--- a/sound/hda/hdac_stream.c
+++ b/sound/hda/hdac_stream.c
@@ -89,6 +89,11 @@ void snd_hdac_stream_clear(struct hdac_stream *azx_dev)
 	int timeout = 300;
 	unsigned char val;
 
+	/* check if the DMA is already stopped */
+	val = snd_hdac_stream_readb(azx_dev, SD_CTL) & SD_CTL_DMA_START;
+	if (!val)
+		return;
+
 	snd_hdac_stream_updateb(azx_dev, SD_CTL,
 				SD_CTL_DMA_START | SD_INT_MASK, 0);
 
-- 
2.7.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux