Skip to content

Commit

Permalink
byt: fix sporadic channel swap
Browse files Browse the repository at this point in the history
Commit 05e1c26 ("byt-ssp: fixes for DSP modes") removed a
work-around for known hardware bugs, causing channel swapping
in I2S mode. Restore the work-around but make sure it's only
enabled in I2S and LEFT_J modes.

Fixes: #3699, #3520

Signed-off-by: Guennadi Liakhovetski <[email protected]>
  • Loading branch information
lyakh authored and keyonjie committed Jan 25, 2021
1 parent 385cf89 commit f3b87b4
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/drivers/intel/baytrail/ssp.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,6 @@ static int ssp_set_config(struct dai *dai,
* I2S_TX_EN, I2S_RX_EN, I2S_CLK_MST
*/
sscr3 = SSCR3_SYN_FIX_EN;
#ifdef ENABLE_SSRC3_FIXES
/*
* this seems to prevent DSP modes from working but is harmless for
* I2S and LEFT_J. Keep with ifdef in case it's ever needed.
*/
sscr3 |= SSCR3_I2S_TX_SS_FIX_EN | SSCR3_I2S_RX_SS_FIX_EN |
SSCR3_STRETCH_TX | SSCR3_STRETCH_RX;
#endif

#ifdef ENABLE_CLK_EDGE_SEL /* FIXME: is this needed ? */
sscr3 |= SSCR3_CLK_EDGE_SEL;
Expand Down Expand Up @@ -331,7 +323,9 @@ static int ssp_set_config(struct dai *dai,

/* handle frame polarity, I2S default is falling/active low */
sspsp |= SSPSP_SFRMP(!inverted_frame);
sscr3 |= SSCR3_I2S_FRM_POL(!inverted_frame);
sscr3 |= SSCR3_I2S_FRM_POL(!inverted_frame) |
SSCR3_I2S_TX_SS_FIX_EN | SSCR3_I2S_RX_SS_FIX_EN |
SSCR3_STRETCH_TX | SSCR3_STRETCH_RX;

if (cbs) {
/*
Expand Down Expand Up @@ -361,7 +355,9 @@ static int ssp_set_config(struct dai *dai,

/* LEFT_J default is rising/active high, opposite of I2S */
sspsp |= SSPSP_SFRMP(inverted_frame);
sscr3 |= SSCR3_I2S_FRM_POL(inverted_frame);
sscr3 |= SSCR3_I2S_FRM_POL(inverted_frame) |
SSCR3_I2S_TX_SS_FIX_EN | SSCR3_I2S_RX_SS_FIX_EN |
SSCR3_STRETCH_TX | SSCR3_STRETCH_RX;

if (cbs) {
/*
Expand Down

0 comments on commit f3b87b4

Please sign in to comment.