audio: modify lanemask for tdmout
authorShuai Li <shuai.li@amlogic.com>
Fri, 11 Aug 2017 11:09:44 +0000 (19:09 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Mon, 14 Aug 2017 07:29:22 +0000 (00:29 -0700)
PD#149114: S420 V03 speaker no sound when playing 2-ch wav

S400 & S420 modify the lineout and speaker out on TDMC dataIO2.
This commit make the speaker output available
by the output lanemask setting:

    "dai-tdm-lane-slot-mask-out = <0 0 1 0>;"

It masks the third lane as data output when playing two channel
PCM waves.

Change-Id: Id1627c06f24f3fb57cc645247ca8183f197656db
Signed-off-by: Shuai Li <shuai.li@amlogic.com>
sound/soc/amlogic/auge/tdm.c

index 6dbd44a..731c327 100644 (file)
@@ -529,18 +529,12 @@ static int aml_tdm_set_lanes(struct aml_tdm *p_tdm,
                // set lanes mask acordingly
                lane_mask = setting->lane_mask_out;
                for (i = 0; i < 4; i++) {
-                       unsigned int ch = i * 2;
-
-                       if (i < lanes)
+                       if (((1 << i) & lane_mask) && lanes--) {
                                aml_tdm_set_channel_mask(p_tdm->actrl,
                                        stream, p_tdm->id, i, setting->tx_mask);
-
-                       if ((1 << i) & lane_mask) {
-                               // each lane only L/R swap
-                               swap_val |= set_num++ << (ch++ * 4);
-                               swap_val |= set_num++ << (ch * 4);
                        }
                }
+               swap_val = 0x76543210;
                aml_tdm_set_lane_channel_swap(p_tdm->actrl,
                        stream, p_tdm->id, swap_val);
        } else {