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>
This commit is contained in:

کامیت شده توسط
Mark Brown

والد
5cbad7d39a
کامیت
7c21a78104
@@ -834,17 +834,20 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
|
||||
int word_length;
|
||||
u8 fifo_level;
|
||||
u8 slots = dev->tdm_slots;
|
||||
u8 active_serializers;
|
||||
int channels;
|
||||
struct snd_interval *pcm_channels = hw_param_interval(params,
|
||||
SNDRV_PCM_HW_PARAM_CHANNELS);
|
||||
channels = pcm_channels->min;
|
||||
|
||||
active_serializers = (channels + slots - 1) / slots;
|
||||
|
||||
if (davinci_hw_common_param(dev, substream->stream, channels) == -EINVAL)
|
||||
return -EINVAL;
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
|
||||
fifo_level = dev->txnumevt;
|
||||
fifo_level = dev->txnumevt * active_serializers;
|
||||
else
|
||||
fifo_level = dev->rxnumevt;
|
||||
fifo_level = dev->rxnumevt * active_serializers;
|
||||
|
||||
if (dev->op_mode == DAVINCI_MCASP_DIT_MODE)
|
||||
davinci_hw_dit_param(dev);
|
||||
@@ -889,7 +892,6 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
|
||||
dma_params->acnt = dma_params->data_type;
|
||||
|
||||
dma_params->fifo_level = fifo_level;
|
||||
dma_params->active_serializers = (channels + slots - 1) / slots;
|
||||
davinci_config_channel_size(dev, word_length);
|
||||
|
||||
return 0;
|
||||
|
مرجع در شماره جدید
Block a user