aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/davinci/davinci-mcasp.c
diff options
context:
space:
mode:
authorMichal Bachraty <michal.bachraty@streamunlimited.com>2013-04-19 09:28:03 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-23 09:50:21 -0400
commit7c21a78104d7f2c155e2c12279282f659d773d05 (patch)
treed8fc167baff5147da84de35266535714550a27c4 /sound/soc/davinci/davinci-mcasp.c
parent5cbad7d39ad229c68a724e5e139fd845b93766b2 (diff)
ASoC: davinci-pcm, davinci-mcasp: Clean up active_serializers
As pointed of by Vaibhav, commit message: "ASoC: davinci-mcasp: Add support for multichannel playback" number of active serializers can be hidden into fifo_level variable, which is set in davimci-mcasp. Signed-off-by: Michal Bachraty <michal.bachraty@streamunlimited.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/davinci/davinci-mcasp.c')
-rw-r--r--sound/soc/davinci/davinci-mcasp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index aeb3a6627d6a..59143373afc6 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -834,17 +834,20 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
834 int word_length; 834 int word_length;
835 u8 fifo_level; 835 u8 fifo_level;
836 u8 slots = dev->tdm_slots; 836 u8 slots = dev->tdm_slots;
837 u8 active_serializers;
837 int channels; 838 int channels;
838 struct snd_interval *pcm_channels = hw_param_interval(params, 839 struct snd_interval *pcm_channels = hw_param_interval(params,
839 SNDRV_PCM_HW_PARAM_CHANNELS); 840 SNDRV_PCM_HW_PARAM_CHANNELS);
840 channels = pcm_channels->min; 841 channels = pcm_channels->min;
841 842
843 active_serializers = (channels + slots - 1) / slots;
844
842 if (davinci_hw_common_param(dev, substream->stream, channels) == -EINVAL) 845 if (davinci_hw_common_param(dev, substream->stream, channels) == -EINVAL)
843 return -EINVAL; 846 return -EINVAL;
844 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 847 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
845 fifo_level = dev->txnumevt; 848 fifo_level = dev->txnumevt * active_serializers;
846 else 849 else
847 fifo_level = dev->rxnumevt; 850 fifo_level = dev->rxnumevt * active_serializers;
848 851
849 if (dev->op_mode == DAVINCI_MCASP_DIT_MODE) 852 if (dev->op_mode == DAVINCI_MCASP_DIT_MODE)
850 davinci_hw_dit_param(dev); 853 davinci_hw_dit_param(dev);
@@ -889,7 +892,6 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
889 dma_params->acnt = dma_params->data_type; 892 dma_params->acnt = dma_params->data_type;
890 893
891 dma_params->fifo_level = fifo_level; 894 dma_params->fifo_level = fifo_level;
892 dma_params->active_serializers = (channels + slots - 1) / slots;
893 davinci_config_channel_size(dev, word_length); 895 davinci_config_channel_size(dev, word_length);
894 896
895 return 0; 897 return 0;