Commit 7b1b3331 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

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: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent a449e467
...@@ -210,6 +210,8 @@ struct fsi_master { ...@@ -210,6 +210,8 @@ struct fsi_master {
spinlock_t lock; spinlock_t lock;
}; };
static int fsi_stream_is_play(struct fsi_priv *fsi, struct fsi_stream *io);
/* /*
* basic read write function * basic read write function
*/ */
...@@ -366,8 +368,10 @@ static int fsi_sample2frame(struct fsi_priv *fsi, int samples) ...@@ -366,8 +368,10 @@ static int fsi_sample2frame(struct fsi_priv *fsi, int samples)
return samples / fsi->chan_num; return samples / fsi->chan_num;
} }
static int fsi_get_current_fifo_samples(struct fsi_priv *fsi, int is_play) static int fsi_get_current_fifo_samples(struct fsi_priv *fsi,
struct fsi_stream *io)
{ {
int is_play = fsi_stream_is_play(fsi, io);
u32 status; u32 status;
int frames; int frames;
...@@ -747,7 +751,7 @@ static int fsi_data_pop(struct fsi_priv *fsi) ...@@ -747,7 +751,7 @@ static int fsi_data_pop(struct fsi_priv *fsi)
int samples; int samples;
struct fsi_stream *io = fsi_stream_get(fsi, is_play); struct fsi_stream *io = fsi_stream_get(fsi, is_play);
sample_residues = fsi_get_current_fifo_samples(fsi, is_play); sample_residues = fsi_get_current_fifo_samples(fsi, io);
sample_space = io->buff_sample_capa - io->buff_sample_pos; sample_space = io->buff_sample_capa - io->buff_sample_pos;
samples = min(sample_residues, sample_space); samples = min(sample_residues, sample_space);
...@@ -768,7 +772,7 @@ static int fsi_data_push(struct fsi_priv *fsi) ...@@ -768,7 +772,7 @@ static int fsi_data_push(struct fsi_priv *fsi)
sample_residues = io->buff_sample_capa - io->buff_sample_pos; sample_residues = io->buff_sample_capa - io->buff_sample_pos;
sample_space = io->fifo_sample_capa - sample_space = io->fifo_sample_capa -
fsi_get_current_fifo_samples(fsi, is_play); fsi_get_current_fifo_samples(fsi, io);
samples = min(sample_residues, sample_space); samples = min(sample_residues, sample_space);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment