drivers: imx: sai: Set SAI channel mode to output mode

CHMOD configures transmit data pins for:
  - 0b, TDM mode transmit data pins are tri-stated when slots are
        masked or channels are disabled.
  - 1b, Output mode, transmit data pins are never tri-stated and
        will output zero when slots are masked or channels are disabled.

We noticed that when data pins are tri-stated, there is noise on
some channels when FS clock value is high and data is read while
fsclk is transitioning from high to low.

So, select CHMOD to output mode so that pins will output 0.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This commit is contained in:
Daniel Baluta 2020-04-23 12:12:39 +03:00 committed by Liam Girdwood
parent 29414aa25e
commit 63b872f027
1 changed files with 4 additions and 1 deletions

View File

@ -213,6 +213,7 @@ static inline int sai_set_config(struct dai *dai,
/* TODO: set number of slots from config */
val_cr4 |= REG_SAI_CR4_FRSZ(SAI_TDM_SLOTS);
val_cr4 |= REG_SAI_CR4_CHMOD;
val_cr5 |= REG_SAI_CR5_WNW(sywd) | REG_SAI_CR5_W0W(sywd) |
REG_SAI_CR5_FBT(sywd);
@ -222,7 +223,9 @@ static inline int sai_set_config(struct dai *dai,
mask_cr4 = REG_SAI_CR4_MF | REG_SAI_CR4_FSE |
REG_SAI_CR4_FSP | REG_SAI_CR4_FSD_MSTR |
REG_SAI_CR4_FRSZ_MASK | REG_SAI_CR4_SYWD_MASK;
REG_SAI_CR4_FRSZ_MASK | REG_SAI_CR4_SYWD_MASK |
REG_SAI_CR4_CHMOD_MASK;
mask_cr5 = REG_SAI_CR5_WNW_MASK | REG_SAI_CR5_W0W_MASK |
REG_SAI_CR5_FBT_MASK;