diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2009-11-07 11:34:31 +0300 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-11-07 15:40:09 +0300 |
commit | 1d8222e8df07ce4f86fb7fa80b02bdee03b57985 (patch) | |
tree | 5a82aa6b88862e0c08aa001876a5f4a1615388da /sound/soc/fsl/mpc5200_dma.h | |
parent | c4878274750ae0bb90c351a737ac6cdcb608e546 (diff) | |
download | linux-1d8222e8df07ce4f86fb7fa80b02bdee03b57985.tar.xz |
ASoC/mpc5200: add to_psc_dma_stream() helper
Move the resolving of the psc_dma_stream pointer to a helper function
to reduce duplicate code
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/fsl/mpc5200_dma.h')
-rw-r--r-- | sound/soc/fsl/mpc5200_dma.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/soc/fsl/mpc5200_dma.h b/sound/soc/fsl/mpc5200_dma.h index c6f29e4d093c..956d6a5f5a8c 100644 --- a/sound/soc/fsl/mpc5200_dma.h +++ b/sound/soc/fsl/mpc5200_dma.h @@ -68,6 +68,15 @@ struct psc_dma { } stats; }; +/* Utility for retrieving psc_dma_stream structure from a substream */ +inline struct psc_dma_stream * +to_psc_dma_stream(struct snd_pcm_substream *substream, struct psc_dma *psc_dma) +{ + if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) + return &psc_dma->capture; + return &psc_dma->playback; +} + int mpc5200_audio_dma_create(struct of_device *op); int mpc5200_audio_dma_destroy(struct of_device *op); |