ASoC: pcm3168a: Allow all channels in case of parallel DIN/DOUT setup
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Thu, 25 Jul 2019 08:33:21 +0000 (11:33 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 25 Jul 2019 12:57:59 +0000 (13:57 +0100)
If multi DIN/DOUT mode is selected (tdm_slots == 2) then configure the
channel constraint to allow all channels.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20190725083321.6776-1-peter.ujfalusi@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/pcm3168a.c

index 5d59ce254821bbf2dafbe9f35147b33b88c94250..e84a1509fe65d9245b5a704dcff3f051a700ac46 100644 (file)
@@ -599,6 +599,10 @@ static int pcm3168a_startup(struct snd_pcm_substream *substream,
                                     SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
                                     sample_min, 32);
 
+       /* Allow all channels in multi DIN/DOUT mode */
+       if (pcm3168a->tdm_slots == 2)
+               channel_max = channel_maxs[tx];
+
        snd_pcm_hw_constraint_minmax(substream->runtime,
                                     SNDRV_PCM_HW_PARAM_CHANNELS,
                                     2, channel_max);