aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/sh/fsi.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 4a9da6b5f4e1..702588577f59 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -344,16 +344,15 @@ static u32 fsi_get_port_shift(struct fsi_priv *fsi, int is_play)
344 344
345static void fsi_stream_push(struct fsi_priv *fsi, 345static void fsi_stream_push(struct fsi_priv *fsi,
346 int is_play, 346 int is_play,
347 struct snd_pcm_substream *substream, 347 struct snd_pcm_substream *substream)
348 u32 buffer_len,
349 u32 period_len)
350{ 348{
351 struct fsi_stream *io = fsi_get_stream(fsi, is_play); 349 struct fsi_stream *io = fsi_get_stream(fsi, is_play);
350 struct snd_pcm_runtime *runtime = substream->runtime;
352 351
353 io->substream = substream; 352 io->substream = substream;
354 io->buff_len = buffer_len; 353 io->buff_len = frames_to_bytes(runtime, runtime->buffer_size);
355 io->buff_offset = 0; 354 io->buff_offset = 0;
356 io->period_len = period_len; 355 io->period_len = frames_to_bytes(runtime, runtime->period_size);
357 io->period_num = 0; 356 io->period_num = 0;
358 io->oerr_num = -1; /* ignore 1st err */ 357 io->oerr_num = -1; /* ignore 1st err */
359 io->uerr_num = -1; /* ignore 1st err */ 358 io->uerr_num = -1; /* ignore 1st err */
@@ -844,15 +843,12 @@ static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
844 struct snd_soc_dai *dai) 843 struct snd_soc_dai *dai)
845{ 844{
846 struct fsi_priv *fsi = fsi_get_priv(substream); 845 struct fsi_priv *fsi = fsi_get_priv(substream);
847 struct snd_pcm_runtime *runtime = substream->runtime;
848 int is_play = fsi_is_play(substream); 846 int is_play = fsi_is_play(substream);
849 int ret = 0; 847 int ret = 0;
850 848
851 switch (cmd) { 849 switch (cmd) {
852 case SNDRV_PCM_TRIGGER_START: 850 case SNDRV_PCM_TRIGGER_START:
853 fsi_stream_push(fsi, is_play, substream, 851 fsi_stream_push(fsi, is_play, substream);
854 frames_to_bytes(runtime, runtime->buffer_size),
855 frames_to_bytes(runtime, runtime->period_size));
856 ret = is_play ? fsi_data_push(fsi) : fsi_data_pop(fsi); 852 ret = is_play ? fsi_data_push(fsi) : fsi_data_pop(fsi);
857 fsi_irq_enable(fsi, is_play); 853 fsi_irq_enable(fsi, is_play);
858 fsi_port_start(fsi); 854 fsi_port_start(fsi);