Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: fsi: bugfix for DMAEngine
@ 2012-05-29  6:26 Kuninori Morimoto
  2012-05-29  6:27 ` [PATCH 1/2] ASoC: fsi: bugfix: correct dma area Kuninori Morimoto
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kuninori Morimoto @ 2012-05-29  6:26 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood, Kuninori Morimoto


Hi Mark, Liam

These are bugfix for FSI DMAEngine.
Without these patches, FSI playback includes noise.
These are for v3.5 kernel

Kuninori Morimoto (2):
      ASoC: fsi: bugfix: correct dma area
      ASoC: fsi: bugfix: ensure dma is terminated


Best regards
---
Kuninori Morimoto

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

* [PATCH 1/2] ASoC: fsi: bugfix: correct dma area
  2012-05-29  6:26 [PATCH 0/2] ASoC: fsi: bugfix for DMAEngine Kuninori Morimoto
@ 2012-05-29  6:27 ` Kuninori Morimoto
  2012-05-29  6:28 ` [PATCH 2/2] ASoC: fsi: bugfix: ensure dma is terminated Kuninori Morimoto
  2012-05-30 10:04 ` [PATCH 0/2] ASoC: fsi: bugfix for DMAEngine Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Kuninori Morimoto @ 2012-05-29  6:27 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood, Kuninori Morimoto

FSI driver is using dma_sync_single_xxx(),
but the dma area was not correct.
This patch fix it up.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
-- this is v3.5 bugfix

 sound/soc/sh/fsi.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 0da021a..02ffe79 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -1052,6 +1052,13 @@ static int fsi_dma_quit(struct fsi_priv *fsi, struct fsi_stream *io)
 	return 0;
 }
 
+static dma_addr_t fsi_dma_get_area(struct fsi_stream *io)
+{
+	struct snd_pcm_runtime *runtime = io->substream->runtime;
+
+	return io->dma + samples_to_bytes(runtime, io->buff_sample_pos);
+}
+
 static void fsi_dma_complete(void *data)
 {
 	struct fsi_stream *io = (struct fsi_stream *)data;
@@ -1061,7 +1068,7 @@ static void fsi_dma_complete(void *data)
 	enum dma_data_direction dir = fsi_stream_is_play(fsi, io) ?
 		DMA_TO_DEVICE : DMA_FROM_DEVICE;
 
-	dma_sync_single_for_cpu(dai->dev, io->dma,
+	dma_sync_single_for_cpu(dai->dev, fsi_dma_get_area(io),
 			samples_to_bytes(runtime, io->period_samples), dir);
 
 	io->buff_sample_pos += io->period_samples;
@@ -1078,13 +1085,6 @@ static void fsi_dma_complete(void *data)
 	snd_pcm_period_elapsed(io->substream);
 }
 
-static dma_addr_t fsi_dma_get_area(struct fsi_stream *io)
-{
-	struct snd_pcm_runtime *runtime = io->substream->runtime;
-
-	return io->dma + samples_to_bytes(runtime, io->buff_sample_pos);
-}
-
 static void fsi_dma_do_tasklet(unsigned long data)
 {
 	struct fsi_stream *io = (struct fsi_stream *)data;
@@ -1110,7 +1110,7 @@ static void fsi_dma_do_tasklet(unsigned long data)
 	len	= samples_to_bytes(runtime, io->period_samples);
 	buf	= fsi_dma_get_area(io);
 
-	dma_sync_single_for_device(dai->dev, io->dma, len, dir);
+	dma_sync_single_for_device(dai->dev, buf, len, dir);
 
 	sg_init_table(&sg, 1);
 	sg_set_page(&sg, pfn_to_page(PFN_DOWN(buf)),
-- 
1.7.5.4

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

* [PATCH 2/2] ASoC: fsi: bugfix: ensure dma is terminated
  2012-05-29  6:26 [PATCH 0/2] ASoC: fsi: bugfix for DMAEngine Kuninori Morimoto
  2012-05-29  6:27 ` [PATCH 1/2] ASoC: fsi: bugfix: correct dma area Kuninori Morimoto
@ 2012-05-29  6:28 ` Kuninori Morimoto
  2012-05-30 10:04 ` [PATCH 0/2] ASoC: fsi: bugfix for DMAEngine Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Kuninori Morimoto @ 2012-05-29  6:28 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood, Kuninori Morimoto

FSI DMAEngine has to be stopped certainly at the start/stop time.
Without this patch, it will include noise on playback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
this is v3.5 bugfix

 sound/soc/sh/fsi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 02ffe79..18c920f 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -1178,6 +1178,8 @@ static void fsi_dma_push_start_stop(struct fsi_priv *fsi, struct fsi_stream *io,
 
 	fsi_reg_mask_set(fsi, OUT_DMAC, DMA_ON, enable);
 
+	dmaengine_terminate_all(io->chan);
+
 	if (fsi_is_clk_master(fsi))
 		fsi_master_mask_set(master, CLK_RST, clk, (enable) ? clk : 0);
 }
-- 
1.7.5.4

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

* Re: [PATCH 0/2] ASoC: fsi: bugfix for DMAEngine
  2012-05-29  6:26 [PATCH 0/2] ASoC: fsi: bugfix for DMAEngine Kuninori Morimoto
  2012-05-29  6:27 ` [PATCH 1/2] ASoC: fsi: bugfix: correct dma area Kuninori Morimoto
  2012-05-29  6:28 ` [PATCH 2/2] ASoC: fsi: bugfix: ensure dma is terminated Kuninori Morimoto
@ 2012-05-30 10:04 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2012-05-30 10:04 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Liam Girdwood, Kuninori Morimoto


[-- Attachment #1.1: Type: text/plain, Size: 211 bytes --]

On Mon, May 28, 2012 at 11:26:41PM -0700, Kuninori Morimoto wrote:

> These are bugfix for FSI DMAEngine.
> Without these patches, FSI playback includes noise.
> These are for v3.5 kernel

Applied both, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

end of thread, other threads:[~2012-05-30 10:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-29  6:26 [PATCH 0/2] ASoC: fsi: bugfix for DMAEngine Kuninori Morimoto
2012-05-29  6:27 ` [PATCH 1/2] ASoC: fsi: bugfix: correct dma area Kuninori Morimoto
2012-05-29  6:28 ` [PATCH 2/2] ASoC: fsi: bugfix: ensure dma is terminated Kuninori Morimoto
2012-05-30 10:04 ` [PATCH 0/2] ASoC: fsi: bugfix for DMAEngine Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox