From 430f796afbef590aa89c2f3577e62f7c44d4bd77 Mon Sep 17 00:00:00 2001 From: Shuai Li Date: Fri, 11 Aug 2017 19:09:44 +0800 Subject: [PATCH] audio: modify lanemask for tdmout 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 --- sound/soc/amlogic/auge/tdm.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sound/soc/amlogic/auge/tdm.c b/sound/soc/amlogic/auge/tdm.c index 6dbd44a21378..731c32707f2f 100644 --- a/sound/soc/amlogic/auge/tdm.c +++ b/sound/soc/amlogic/auge/tdm.c @@ -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 {