Skip to content

Commit

Permalink
ASoC: fsl_sai: Enable 'FIFO continue on error' FCONT bit
Browse files Browse the repository at this point in the history
FCONT=1 means On FIFO error, the SAI will continue from the
same word that caused the FIFO error to set after the FIFO
warning flag has been cleared.

Set FCONT bit in control register to avoid the channel swap
issue after SAI xrun.

Signed-off-by: Shengjiu Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
TE-N-ShengjiuWang authored and broonie committed Sep 30, 2024
1 parent a36614b commit 72455e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sound/soc/fsl/fsl_sai.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,9 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream,

val_cr4 |= FSL_SAI_CR4_FRSZ(slots);

/* Set to avoid channel swap */
val_cr4 |= FSL_SAI_CR4_FCONT;

/* Set to output mode to avoid tri-stated data pins */
if (tx)
val_cr4 |= FSL_SAI_CR4_CHMOD;
Expand Down Expand Up @@ -699,7 +702,7 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream,

regmap_update_bits(sai->regmap, FSL_SAI_xCR4(tx, ofs),
FSL_SAI_CR4_SYWD_MASK | FSL_SAI_CR4_FRSZ_MASK |
FSL_SAI_CR4_CHMOD_MASK,
FSL_SAI_CR4_CHMOD_MASK | FSL_SAI_CR4_FCONT_MASK,
val_cr4);
regmap_update_bits(sai->regmap, FSL_SAI_xCR5(tx, ofs),
FSL_SAI_CR5_WNW_MASK | FSL_SAI_CR5_W0W_MASK |
Expand Down
1 change: 1 addition & 0 deletions sound/soc/fsl/fsl_sai.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@

/* SAI Transmit and Receive Configuration 4 Register */

#define FSL_SAI_CR4_FCONT_MASK BIT(28)
#define FSL_SAI_CR4_FCONT BIT(28)
#define FSL_SAI_CR4_FCOMB_SHIFT BIT(26)
#define FSL_SAI_CR4_FCOMB_SOFT BIT(27)
Expand Down

0 comments on commit 72455e3

Please sign in to comment.