aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-05-23 07:45:57 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-05-24 06:41:32 -0400
commit0ffe296addcfb8414ebad3d399859f9bf8f955d2 (patch)
treea738be17f3956d7600fdd56d92f2955bdf2b30f0 /sound/soc/sh
parent60c655e62f1ee85b9144fa259b3d1064ddbbe847 (diff)
ASoC: sh: fsi: tidyup parameter of fsi_stream_push
It is possible to create buff_len and period_len from substream->runtime. This patch is preparation of tidyup unclear variable naming patch. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/sh')
-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);