* [PATCH v2] ASoC: fsl_sai: Fix one bug for hardware limitation.
@ 2013-12-31 7:33 Xiubo Li
2013-12-31 7:33 ` [PATCH] ASoC: fsl_sai: fix the endianess for SAI fifo data Xiubo Li
2013-12-31 12:23 ` [PATCH v2] ASoC: fsl_sai: Fix one bug for hardware limitation Mark Brown
0 siblings, 2 replies; 4+ messages in thread
From: Xiubo Li @ 2013-12-31 7:33 UTC (permalink / raw)
To: broonie; +Cc: alsa-devel, linux-kernel
This is maybe one bug or a limitation of the hardware that the {T,R}CR2's
Synchronous Mode bits must be set as late as possible, or the SAI device
maybe hanged up, and there has not any explaination about this limitation
in the SAI Data Sheet.
And the {T,R}CR2's Synchronous Mode bits must be set at the same time whether
for Tx or Rx stream.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
sound/soc/fsl/fsl_sai.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index af80246..2ece147 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -145,7 +145,6 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai,
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_I2S:
val_cr4 |= FSL_SAI_CR4_FSE;
- val_cr4 |= FSL_SAI_CR4_FSP;
break;
default:
return -EINVAL;
@@ -185,9 +184,6 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai,
return -EINVAL;
}
- if (fsl_dir == FSL_FMT_RECEIVER)
- val_cr2 |= FSL_SAI_CR2_SYNC;
-
sai_writel(sai, val_cr2, sai->base + reg_cr2);
sai_writel(sai, val_cr4, sai->base + reg_cr4);
@@ -253,6 +249,7 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream,
val_cr5 |= FSL_SAI_CR5_WNW(word_width);
val_cr5 |= FSL_SAI_CR5_W0W(word_width);
+ val_cr5 &= ~FSL_SAI_CR5_FBT_MASK;
if (sai->big_endian_data)
val_cr5 |= FSL_SAI_CR5_FBT(word_width - 1);
else
@@ -272,7 +269,15 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *cpu_dai)
{
struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
- u32 tcsr, rcsr, val_cr3, reg_cr3;
+ u32 tcsr, rcsr, val_cr2, val_cr3, reg_cr3;
+
+ val_cr2 = sai_readl(sai, sai->base + FSL_SAI_TCR2);
+ val_cr2 &= ~FSL_SAI_CR2_SYNC;
+ sai_writel(sai, val_cr2, sai->base + FSL_SAI_TCR2);
+
+ val_cr2 = sai_readl(sai, sai->base + FSL_SAI_RCR2);
+ val_cr2 |= FSL_SAI_CR2_SYNC;
+ sai_writel(sai, val_cr2, sai->base + FSL_SAI_RCR2);
tcsr = sai_readl(sai, sai->base + FSL_SAI_TCSR);
rcsr = sai_readl(sai, sai->base + FSL_SAI_RCSR);
--
1.8.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ASoC: fsl_sai: fix the endianess for SAI fifo data.
2013-12-31 7:33 [PATCH v2] ASoC: fsl_sai: Fix one bug for hardware limitation Xiubo Li
@ 2013-12-31 7:33 ` Xiubo Li
2013-12-31 12:24 ` Mark Brown
2013-12-31 12:23 ` [PATCH v2] ASoC: fsl_sai: Fix one bug for hardware limitation Mark Brown
1 sibling, 1 reply; 4+ messages in thread
From: Xiubo Li @ 2013-12-31 7:33 UTC (permalink / raw)
To: broonie; +Cc: alsa-devel, linux-kernel
Revert the SAI's endianess for fifo data to/from DMA engine.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
sound/soc/fsl/fsl_sai.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 2ece147..5d38a67 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -138,9 +138,9 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai,
val_cr4 = sai_readl(sai, sai->base + reg_cr4);
if (sai->big_endian_data)
- val_cr4 |= FSL_SAI_CR4_MF;
- else
val_cr4 &= ~FSL_SAI_CR4_MF;
+ else
+ val_cr4 |= FSL_SAI_CR4_MF;
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_I2S:
@@ -251,9 +251,9 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream,
val_cr5 &= ~FSL_SAI_CR5_FBT_MASK;
if (sai->big_endian_data)
- val_cr5 |= FSL_SAI_CR5_FBT(word_width - 1);
- else
val_cr5 |= FSL_SAI_CR5_FBT(0);
+ else
+ val_cr5 |= FSL_SAI_CR5_FBT(word_width - 1);
val_cr4 |= FSL_SAI_CR4_FRSZ(channels);
val_mr = ~0UL - ((1 << channels) - 1);
--
1.8.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] ASoC: fsl_sai: Fix one bug for hardware limitation.
2013-12-31 7:33 [PATCH v2] ASoC: fsl_sai: Fix one bug for hardware limitation Xiubo Li
2013-12-31 7:33 ` [PATCH] ASoC: fsl_sai: fix the endianess for SAI fifo data Xiubo Li
@ 2013-12-31 12:23 ` Mark Brown
1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2013-12-31 12:23 UTC (permalink / raw)
To: Xiubo Li; +Cc: alsa-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 328 bytes --]
On Tue, Dec 31, 2013 at 03:33:21PM +0800, Xiubo Li wrote:
> This is maybe one bug or a limitation of the hardware that the {T,R}CR2's
> Synchronous Mode bits must be set as late as possible, or the SAI device
> maybe hanged up, and there has not any explaination about this limitation
> in the SAI Data Sheet.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: fsl_sai: fix the endianess for SAI fifo data.
2013-12-31 7:33 ` [PATCH] ASoC: fsl_sai: fix the endianess for SAI fifo data Xiubo Li
@ 2013-12-31 12:24 ` Mark Brown
0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2013-12-31 12:24 UTC (permalink / raw)
To: Xiubo Li; +Cc: alsa-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 139 bytes --]
On Tue, Dec 31, 2013 at 03:33:22PM +0800, Xiubo Li wrote:
> Revert the SAI's endianess for fifo data to/from DMA engine.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-12-31 12:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-31 7:33 [PATCH v2] ASoC: fsl_sai: Fix one bug for hardware limitation Xiubo Li
2013-12-31 7:33 ` [PATCH] ASoC: fsl_sai: fix the endianess for SAI fifo data Xiubo Li
2013-12-31 12:24 ` Mark Brown
2013-12-31 12:23 ` [PATCH v2] ASoC: fsl_sai: Fix one bug for hardware limitation Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®