diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2010-10-11 22:39:25 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-10-12 06:02:33 -0400 |
commit | cca1b2353a364fd51619d0f304dd9681282b864c (patch) | |
tree | e2a075433a2f793cf65f59f40e6b087fbe2443f0 | |
parent | 1422408b34fd27ac7ab4a42e72d4b61553b6f631 (diff) |
ASoC: fsi: Add fsi_get_frame_width function
It is not so important for now.
But will be used in future.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/sh/fsi.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index dd9963345b93..aa2cbb1ea988 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c | |||
@@ -368,6 +368,14 @@ static int fsi_num2len(int num, int width) | |||
368 | return num * width; | 368 | return num * width; |
369 | } | 369 | } |
370 | 370 | ||
371 | static int fsi_get_frame_width(struct fsi_priv *fsi) | ||
372 | { | ||
373 | struct snd_pcm_substream *substream = fsi->substream; | ||
374 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
375 | |||
376 | return frames_to_bytes(runtime, 1) / fsi->chan_num; | ||
377 | } | ||
378 | |||
371 | /* | 379 | /* |
372 | * dma function | 380 | * dma function |
373 | */ | 381 | */ |
@@ -596,7 +604,7 @@ static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, int startup, int is_play) | |||
596 | } | 604 | } |
597 | 605 | ||
598 | /* get 1 channel data width */ | 606 | /* get 1 channel data width */ |
599 | ch_width = frames_to_bytes(runtime, 1) / fsi->chan_num; | 607 | ch_width = fsi_get_frame_width(fsi); |
600 | 608 | ||
601 | /* get residue data number of alsa */ | 609 | /* get residue data number of alsa */ |
602 | data_residue_num = fsi_len2num(fsi->buff_len - fsi->buff_offset, | 610 | data_residue_num = fsi_len2num(fsi->buff_len - fsi->buff_offset, |