aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2012-05-29 02:27:49 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-05-30 06:04:12 -0400
commit4a1b09b79b07cf70c72a091e8fe0660f68541f30 (patch)
treeebbd974aa56f5f8808fb242b08311ee3937c65d3 /sound/soc
parente42bb9bfbb43366cd1899c9564d043c41ebd8852 (diff)
ASoC: fsi: bugfix: correct dma area
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> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/sh/fsi.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 05582c12b902..6e750a8ae2a9 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)
1052 return 0; 1052 return 0;
1053} 1053}
1054 1054
1055static dma_addr_t fsi_dma_get_area(struct fsi_stream *io)
1056{
1057 struct snd_pcm_runtime *runtime = io->substream->runtime;
1058
1059 return io->dma + samples_to_bytes(runtime, io->buff_sample_pos);
1060}
1061
1055static void fsi_dma_complete(void *data) 1062static void fsi_dma_complete(void *data)
1056{ 1063{
1057 struct fsi_stream *io = (struct fsi_stream *)data; 1064 struct fsi_stream *io = (struct fsi_stream *)data;
@@ -1061,7 +1068,7 @@ static void fsi_dma_complete(void *data)
1061 enum dma_data_direction dir = fsi_stream_is_play(fsi, io) ? 1068 enum dma_data_direction dir = fsi_stream_is_play(fsi, io) ?
1062 DMA_TO_DEVICE : DMA_FROM_DEVICE; 1069 DMA_TO_DEVICE : DMA_FROM_DEVICE;
1063 1070
1064 dma_sync_single_for_cpu(dai->dev, io->dma, 1071 dma_sync_single_for_cpu(dai->dev, fsi_dma_get_area(io),
1065 samples_to_bytes(runtime, io->period_samples), dir); 1072 samples_to_bytes(runtime, io->period_samples), dir);
1066 1073
1067 io->buff_sample_pos += io->period_samples; 1074 io->buff_sample_pos += io->period_samples;
@@ -1078,13 +1085,6 @@ static void fsi_dma_complete(void *data)
1078 snd_pcm_period_elapsed(io->substream); 1085 snd_pcm_period_elapsed(io->substream);
1079} 1086}
1080 1087
1081static dma_addr_t fsi_dma_get_area(struct fsi_stream *io)
1082{
1083 struct snd_pcm_runtime *runtime = io->substream->runtime;
1084
1085 return io->dma + samples_to_bytes(runtime, io->buff_sample_pos);
1086}
1087
1088static void fsi_dma_do_tasklet(unsigned long data) 1088static void fsi_dma_do_tasklet(unsigned long data)
1089{ 1089{
1090 struct fsi_stream *io = (struct fsi_stream *)data; 1090 struct fsi_stream *io = (struct fsi_stream *)data;
@@ -1110,7 +1110,7 @@ static void fsi_dma_do_tasklet(unsigned long data)
1110 len = samples_to_bytes(runtime, io->period_samples); 1110 len = samples_to_bytes(runtime, io->period_samples);
1111 buf = fsi_dma_get_area(io); 1111 buf = fsi_dma_get_area(io);
1112 1112
1113 dma_sync_single_for_device(dai->dev, io->dma, len, dir); 1113 dma_sync_single_for_device(dai->dev, buf, len, dir);
1114 1114
1115 sg_init_table(&sg, 1); 1115 sg_init_table(&sg, 1);
1116 sg_set_page(&sg, pfn_to_page(PFN_DOWN(buf)), 1116 sg_set_page(&sg, pfn_to_page(PFN_DOWN(buf)),