diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2012-02-03 03:54:02 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-02-03 06:55:39 -0500 |
commit | a449e46754616a13e1bee649e37bcdf10d1b794a (patch) | |
tree | e79081700829f1327748f65d20c5f0691bdaca97 /sound/soc/sh/fsi.c | |
parent | 95b0cf05976b7d0571e283b1fcd4c32095018cd6 (diff) |
ASoC: fsi: re-define fsi_is_play() and fsi_stream_is_play()
This patch re-define fsi_is_play() and fsi_stream_is_play().
fsi_data_pop/push() function keeps direct value of "is_play" at this point,
but it will be removed soon.
This is just prepare cleanup for DMAEngine support.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/sh/fsi.c')
-rw-r--r-- | sound/soc/sh/fsi.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index c814d8a7cece..1cbe474046f0 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c | |||
@@ -296,6 +296,11 @@ static int fsi_is_spdif(struct fsi_priv *fsi) | |||
296 | return fsi->spdif; | 296 | return fsi->spdif; |
297 | } | 297 | } |
298 | 298 | ||
299 | static int fsi_is_play(struct snd_pcm_substream *substream) | ||
300 | { | ||
301 | return substream->stream == SNDRV_PCM_STREAM_PLAYBACK; | ||
302 | } | ||
303 | |||
299 | static struct snd_soc_dai *fsi_get_dai(struct snd_pcm_substream *substream) | 304 | static struct snd_soc_dai *fsi_get_dai(struct snd_pcm_substream *substream) |
300 | { | 305 | { |
301 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 306 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
@@ -399,10 +404,10 @@ static void fsi_count_fifo_err(struct fsi_priv *fsi) | |||
399 | /* | 404 | /* |
400 | * fsi_stream_xx() function | 405 | * fsi_stream_xx() function |
401 | */ | 406 | */ |
402 | #define fsi_is_play(substream) fsi_stream_is_play(substream->stream) | 407 | static inline int fsi_stream_is_play(struct fsi_priv *fsi, |
403 | static inline int fsi_stream_is_play(int stream) | 408 | struct fsi_stream *io) |
404 | { | 409 | { |
405 | return stream == SNDRV_PCM_STREAM_PLAYBACK; | 410 | return &fsi->playback == io; |
406 | } | 411 | } |
407 | 412 | ||
408 | static inline struct fsi_stream *fsi_stream_get(struct fsi_priv *fsi, | 413 | static inline struct fsi_stream *fsi_stream_get(struct fsi_priv *fsi, |
@@ -736,7 +741,7 @@ static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, struct fsi_stream *io, | |||
736 | 741 | ||
737 | static int fsi_data_pop(struct fsi_priv *fsi) | 742 | static int fsi_data_pop(struct fsi_priv *fsi) |
738 | { | 743 | { |
739 | int is_play = fsi_stream_is_play(SNDRV_PCM_STREAM_CAPTURE); | 744 | int is_play = 0; |
740 | int sample_residues; /* samples in FSI fifo */ | 745 | int sample_residues; /* samples in FSI fifo */ |
741 | int sample_space; /* ALSA free samples space */ | 746 | int sample_space; /* ALSA free samples space */ |
742 | int samples; | 747 | int samples; |
@@ -755,7 +760,7 @@ static int fsi_data_pop(struct fsi_priv *fsi) | |||
755 | 760 | ||
756 | static int fsi_data_push(struct fsi_priv *fsi) | 761 | static int fsi_data_push(struct fsi_priv *fsi) |
757 | { | 762 | { |
758 | int is_play = fsi_stream_is_play(SNDRV_PCM_STREAM_PLAYBACK); | 763 | int is_play = 1; |
759 | int sample_residues; /* ALSA residue samples */ | 764 | int sample_residues; /* ALSA residue samples */ |
760 | int sample_space; /* FSI fifo free samples space */ | 765 | int sample_space; /* FSI fifo free samples space */ |
761 | int samples; | 766 | int samples; |