]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: ti: davinci-mcasp: Fix slot mask settings when using multiple AXRs
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Thu, 20 Jun 2019 09:20:02 +0000 (12:20 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 20 Jun 2019 11:59:38 +0000 (12:59 +0100)
If multiple serializers are connected in the system and the number of
channels will need to use more than one serializer the mask to enable the
serializers were left to 0 if tdm_mask is provided

Fixes: dd55ff8346a97 ("ASoC: davinci-mcasp: Add set_tdm_slots() support")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/ti/davinci-mcasp.c

index 8bec0dc4f75489018bc51877c311c5f5b31862c6..62222915d632b149aa32ef9759f5187731b2df93 100644 (file)
@@ -946,14 +946,13 @@ static int mcasp_i2s_hw_param(struct davinci_mcasp *mcasp, int stream,
                active_slots = hweight32(mcasp->tdm_mask[stream]);
                active_serializers = (channels + active_slots - 1) /
                        active_slots;
-               if (active_serializers == 1) {
+               if (active_serializers == 1)
                        active_slots = channels;
-                       for (i = 0; i < total_slots; i++) {
-                               if ((1 << i) & mcasp->tdm_mask[stream]) {
-                                       mask |= (1 << i);
-                                       if (--active_slots <= 0)
-                                               break;
-                               }
+               for (i = 0; i < total_slots; i++) {
+                       if ((1 << i) & mcasp->tdm_mask[stream]) {
+                               mask |= (1 << i);
+                               if (--active_slots <= 0)
+                                       break;
                        }
                }
        } else {