diff options
Diffstat (limited to 'sound')
-rw-r--r-- | 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 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 | ||
1055 | static 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 | |||
1055 | static void fsi_dma_complete(void *data) | 1062 | static 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 | ||
1081 | static 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 | |||
1088 | static void fsi_dma_do_tasklet(unsigned long data) | 1088 | static 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)), |