aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2010-10-12 05:30:14 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-10-12 06:03:14 -0400
commit00545785d7e355b0b1b9fb820ec70cb2ae51b409 (patch)
treeadd919d88688db201590e605da3be0d956c43f5d /sound
parentcf6edd007b6c371613a2f48e58f3a4238d9775c8 (diff)
ASoC: Add fsi_is_play function
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>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/sh/fsi.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 685bb7c4f039..dfc04bc2809e 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -294,6 +294,11 @@ static u32 fsi_get_info_flags(struct fsi_priv *fsi)
294 master->info->portb_flags; 294 master->info->portb_flags;
295} 295}
296 296
297static inline int fsi_is_play(struct snd_pcm_substream *substream)
298{
299 return substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
300}
301
297static int fsi_is_master_mode(struct fsi_priv *fsi, int is_play) 302static int fsi_is_master_mode(struct fsi_priv *fsi, int is_play)
298{ 303{
299 u32 mode; 304 u32 mode;
@@ -726,7 +731,7 @@ static int fsi_dai_startup(struct snd_pcm_substream *substream,
726 u32 fmt; 731 u32 fmt;
727 u32 reg; 732 u32 reg;
728 u32 data; 733 u32 data;
729 int is_play = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); 734 int is_play = fsi_is_play(substream);
730 int is_master; 735 int is_master;
731 736
732 pm_runtime_get_sync(dai->dev); 737 pm_runtime_get_sync(dai->dev);
@@ -813,7 +818,7 @@ static void fsi_dai_shutdown(struct snd_pcm_substream *substream,
813 struct snd_soc_dai *dai) 818 struct snd_soc_dai *dai)
814{ 819{
815 struct fsi_priv *fsi = fsi_get_priv(substream); 820 struct fsi_priv *fsi = fsi_get_priv(substream);
816 int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; 821 int is_play = fsi_is_play(substream);
817 822
818 fsi_irq_disable(fsi, is_play); 823 fsi_irq_disable(fsi, is_play);
819 fsi_clk_ctrl(fsi, 0); 824 fsi_clk_ctrl(fsi, 0);
@@ -826,7 +831,7 @@ static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
826{ 831{
827 struct fsi_priv *fsi = fsi_get_priv(substream); 832 struct fsi_priv *fsi = fsi_get_priv(substream);
828 struct snd_pcm_runtime *runtime = substream->runtime; 833 struct snd_pcm_runtime *runtime = substream->runtime;
829 int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; 834 int is_play = fsi_is_play(substream);
830 int ret = 0; 835 int ret = 0;
831 836
832 switch (cmd) { 837 switch (cmd) {
@@ -853,7 +858,7 @@ static int fsi_dai_hw_params(struct snd_pcm_substream *substream,
853 struct fsi_master *master = fsi_get_master(fsi); 858 struct fsi_master *master = fsi_get_master(fsi);
854 int (*set_rate)(int is_porta, int rate) = master->info->set_rate; 859 int (*set_rate)(int is_porta, int rate) = master->info->set_rate;
855 int fsi_ver = master->core->ver; 860 int fsi_ver = master->core->ver;
856 int is_play = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); 861 int is_play = fsi_is_play(substream);
857 int ret; 862 int ret;
858 863
859 /* if slave mode, set_rate is not needed */ 864 /* if slave mode, set_rate is not needed */