summaryrefslogtreecommitdiffstats
path: root/sound/soc/dwc
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-01-25 09:43:43 +0300
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-26 15:37:09 +0800
commit0099d24c6bb584d3bac76ca81bb55f3fd8ddfb21 (patch)
treef0dfd12af9facc41567fdad2bedefd4a28c5d037 /sound/soc/dwc
parent949db153b6466c6f7cad5a427ecea94985927311 (diff)
downloadlinux-0099d24c6bb584d3bac76ca81bb55f3fd8ddfb21.tar.bz2
ASoC: dwc: fix support for more than two channels
There were missing break statements so everything used TWO_CHANNEL_SUPPORT. Also I added a return statement to silence a GCC warning: sound/soc/dwc/designware_i2s.c: In function ‘dw_i2s_hw_params’: sound/soc/dwc/designware_i2s.c:236:32: warning: ‘ch_reg’ may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Rajeev Kumar <rajeev-dlh.kumar@st.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/dwc')
-rw-r--r--sound/soc/dwc/designware_i2s.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c
index 1aa51300c564..deb30d59965e 100644
--- a/sound/soc/dwc/designware_i2s.c
+++ b/sound/soc/dwc/designware_i2s.c
@@ -210,15 +210,19 @@ static int dw_i2s_hw_params(struct snd_pcm_substream *substream,
switch (config->chan_nr) {
case EIGHT_CHANNEL_SUPPORT:
ch_reg = 3;
+ break;
case SIX_CHANNEL_SUPPORT:
ch_reg = 2;
+ break;
case FOUR_CHANNEL_SUPPORT:
ch_reg = 1;
+ break;
case TWO_CHANNEL_SUPPORT:
ch_reg = 0;
break;
default:
dev_err(dev->dev, "channel not supported\n");
+ return -EINVAL;
}
i2s_disable_channels(dev, substream->stream);