Commit 3b5b516f authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown

ASoC: omap-mcpdm: Correct the supported number of channels

OMAP4 McPDM supports 5 downlink (playback), and
3 uplink (capture) channels.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent ebca813c
...@@ -299,15 +299,17 @@ static int omap_mcpdm_dai_hw_params(struct snd_pcm_substream *substream, ...@@ -299,15 +299,17 @@ static int omap_mcpdm_dai_hw_params(struct snd_pcm_substream *substream,
channels = params_channels(params); channels = params_channels(params);
switch (channels) { switch (channels) {
case 5:
if (stream == SNDRV_PCM_STREAM_CAPTURE)
/* up to 3 channels for capture */
return -EINVAL;
link_mask |= 1 << 4;
case 4: case 4:
if (stream == SNDRV_PCM_STREAM_CAPTURE) if (stream == SNDRV_PCM_STREAM_CAPTURE)
/* up to 2 channels for capture */ /* up to 3 channels for capture */
return -EINVAL; return -EINVAL;
link_mask |= 1 << 3; link_mask |= 1 << 3;
case 3: case 3:
if (stream == SNDRV_PCM_STREAM_CAPTURE)
/* up to 2 channels for capture */
return -EINVAL;
link_mask |= 1 << 2; link_mask |= 1 << 2;
case 2: case 2:
link_mask |= 1 << 1; link_mask |= 1 << 1;
...@@ -403,13 +405,13 @@ static struct snd_soc_dai_driver omap_mcpdm_dai = { ...@@ -403,13 +405,13 @@ static struct snd_soc_dai_driver omap_mcpdm_dai = {
.remove_order = SND_SOC_COMP_ORDER_EARLY, .remove_order = SND_SOC_COMP_ORDER_EARLY,
.playback = { .playback = {
.channels_min = 1, .channels_min = 1,
.channels_max = 4, .channels_max = 5,
.rates = OMAP_MCPDM_RATES, .rates = OMAP_MCPDM_RATES,
.formats = OMAP_MCPDM_FORMATS, .formats = OMAP_MCPDM_FORMATS,
}, },
.capture = { .capture = {
.channels_min = 1, .channels_min = 1,
.channels_max = 2, .channels_max = 3,
.rates = OMAP_MCPDM_RATES, .rates = OMAP_MCPDM_RATES,
.formats = OMAP_MCPDM_FORMATS, .formats = OMAP_MCPDM_FORMATS,
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment