diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2012-02-03 03:55:26 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-02-03 06:55:39 -0500 |
commit | 7b1b3331e65e47b6abb32be0a3db46bcf423145a (patch) | |
tree | aff09fe5ad272e20d3c8beac8839b549f7d547cb /sound/soc/sh | |
parent | a449e46754616a13e1bee649e37bcdf10d1b794a (diff) |
ASoC: fsi: use fsi_stream in fsi_get_current_fifo_samples() parameter
fsi_get_current_fifo_samples() uses fsi_stream instead of is_play.
This is just prepare cleanup for DMAEngine support.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/sh')
-rw-r--r-- | sound/soc/sh/fsi.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index 1cbe474046f0..24dbe165eda8 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c | |||
@@ -210,6 +210,8 @@ struct fsi_master { | |||
210 | spinlock_t lock; | 210 | spinlock_t lock; |
211 | }; | 211 | }; |
212 | 212 | ||
213 | static int fsi_stream_is_play(struct fsi_priv *fsi, struct fsi_stream *io); | ||
214 | |||
213 | /* | 215 | /* |
214 | * basic read write function | 216 | * basic read write function |
215 | */ | 217 | */ |
@@ -366,8 +368,10 @@ static int fsi_sample2frame(struct fsi_priv *fsi, int samples) | |||
366 | return samples / fsi->chan_num; | 368 | return samples / fsi->chan_num; |
367 | } | 369 | } |
368 | 370 | ||
369 | static int fsi_get_current_fifo_samples(struct fsi_priv *fsi, int is_play) | 371 | static int fsi_get_current_fifo_samples(struct fsi_priv *fsi, |
372 | struct fsi_stream *io) | ||
370 | { | 373 | { |
374 | int is_play = fsi_stream_is_play(fsi, io); | ||
371 | u32 status; | 375 | u32 status; |
372 | int frames; | 376 | int frames; |
373 | 377 | ||
@@ -747,7 +751,7 @@ static int fsi_data_pop(struct fsi_priv *fsi) | |||
747 | int samples; | 751 | int samples; |
748 | struct fsi_stream *io = fsi_stream_get(fsi, is_play); | 752 | struct fsi_stream *io = fsi_stream_get(fsi, is_play); |
749 | 753 | ||
750 | sample_residues = fsi_get_current_fifo_samples(fsi, is_play); | 754 | sample_residues = fsi_get_current_fifo_samples(fsi, io); |
751 | sample_space = io->buff_sample_capa - io->buff_sample_pos; | 755 | sample_space = io->buff_sample_capa - io->buff_sample_pos; |
752 | 756 | ||
753 | samples = min(sample_residues, sample_space); | 757 | samples = min(sample_residues, sample_space); |
@@ -768,7 +772,7 @@ static int fsi_data_push(struct fsi_priv *fsi) | |||
768 | 772 | ||
769 | sample_residues = io->buff_sample_capa - io->buff_sample_pos; | 773 | sample_residues = io->buff_sample_capa - io->buff_sample_pos; |
770 | sample_space = io->fifo_sample_capa - | 774 | sample_space = io->fifo_sample_capa - |
771 | fsi_get_current_fifo_samples(fsi, is_play); | 775 | fsi_get_current_fifo_samples(fsi, io); |
772 | 776 | ||
773 | samples = min(sample_residues, sample_space); | 777 | samples = min(sample_residues, sample_space); |
774 | 778 | ||