From 90edd0856e9dcc50f84b0012fec5d56980bfbd1e Mon Sep 17 00:00:00 2001 From: Mohan Kumar Date: Wed, 2 Nov 2016 15:24:22 +0530 Subject: [PATCH] ASoC: tegra-alt: use ch select value for no of ch Use the channel select control input to decide on the no of channels for the dmic configuration, this way we can capture more than 2 channels using tinycap which wont effect the dmic configuration, which will sole depends on ch select mixer control value. Bug 1833091 Change-Id: I3233913c62a311f3ff08116ebccea0a807e6efb4 Signed-off-by: Mohan Kumar Reviewed-on: http://git-master/r/1246322 GVS: Gerrit_Virtual_Submit Reviewed-by: Sameer Pujar Reviewed-by: Viswanath L Reviewed-by: Ravindra Lokhande --- sound/soc/tegra-alt/tegra210_dmic_alt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sound/soc/tegra-alt/tegra210_dmic_alt.c b/sound/soc/tegra-alt/tegra210_dmic_alt.c index 26514356..08393d4d 100644 --- a/sound/soc/tegra-alt/tegra210_dmic_alt.c +++ b/sound/soc/tegra-alt/tegra210_dmic_alt.c @@ -158,10 +158,13 @@ static int tegra210_dmic_hw_params(struct snd_pcm_substream *substream, srate = params_rate(params); dmic_clk = (1 << (6+osr)) * srate; - if (channels < 2) + if (dmic->ch_select == DMIC_CH_SELECT_NONE) { + channels = 2; + channel_select = DMIC_CH_SELECT_STEREO; + } else { + channels = 1; channel_select = dmic->ch_select; - else - channel_select = (1 << channels) - 1; + } if ((tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) { program_dmic_gpio();