linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: fsl_sai: Two bug fixes for fsl_sai driver
@ 2014-07-17 13:21 Nicolin Chen
  2014-07-17 13:21 ` [PATCH 1/2] ASoC: fsl_sai: Reset FIFOs after disabling TE/RE Nicolin Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Nicolin Chen @ 2014-07-17 13:21 UTC (permalink / raw)
  To: broonie
  Cc: linux-kernel, linuxppc-dev, alsa-devel, timur, Li.Xiubo, b02247, b42378

Nicolin Chen (2):
  ASoC: fsl_sai: Reset FIFOs after disabling TE/RE
  ASoC: fsl_sai: Fix incorrect register writing in fsl_sai_isr()

 sound/soc/fsl/fsl_sai.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

-- 
1.8.4


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ASoC: fsl_sai: Reset FIFOs after disabling TE/RE
  2014-07-17 13:21 [PATCH 0/2] ASoC: fsl_sai: Two bug fixes for fsl_sai driver Nicolin Chen
@ 2014-07-17 13:21 ` Nicolin Chen
  2014-07-18 10:18   ` Nicolin Chen
  2014-07-17 13:21 ` [PATCH 2/2] ASoC: fsl_sai: Fix incorrect register writing in fsl_sai_isr() Nicolin Chen
  2014-07-18  2:38 ` [PATCH 0/2] ASoC: fsl_sai: Two bug fixes for fsl_sai driver Li.Xiubo
  2 siblings, 1 reply; 8+ messages in thread
From: Nicolin Chen @ 2014-07-17 13:21 UTC (permalink / raw)
  To: broonie
  Cc: linux-kernel, linuxppc-dev, alsa-devel, timur, Li.Xiubo, b02247, b42378

SAI will not clear their FIFOs after disabling TE/RE. Therfore, the driver
should take care the task so as not to let useless data remain in the FIFO.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
---
 sound/soc/fsl/fsl_sai.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index c5a0e8a..b10dbd8 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -371,10 +371,13 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd,
 
 		/* Check if the opposite FRDE is also disabled */
 		if (!(tx ? rcsr & FSL_SAI_CSR_FRDE : tcsr & FSL_SAI_CSR_FRDE)) {
+			/* Disable both directions and reset their FIFOs */
 			regmap_update_bits(sai->regmap, FSL_SAI_TCSR,
-					   FSL_SAI_CSR_TERE, 0);
+					   FSL_SAI_CSR_TERE | FSL_SAI_CSR_FR,
+					   FSL_SAI_CSR_FR);
 			regmap_update_bits(sai->regmap, FSL_SAI_RCSR,
-					   FSL_SAI_CSR_TERE, 0);
+					   FSL_SAI_CSR_TERE | FSL_SAI_CSR_FR,
+					   FSL_SAI_CSR_FR);
 		}
 		break;
 	default:
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] ASoC: fsl_sai: Fix incorrect register writing in fsl_sai_isr()
  2014-07-17 13:21 [PATCH 0/2] ASoC: fsl_sai: Two bug fixes for fsl_sai driver Nicolin Chen
  2014-07-17 13:21 ` [PATCH 1/2] ASoC: fsl_sai: Reset FIFOs after disabling TE/RE Nicolin Chen
@ 2014-07-17 13:21 ` Nicolin Chen
  2014-07-18  2:38 ` [PATCH 0/2] ASoC: fsl_sai: Two bug fixes for fsl_sai driver Li.Xiubo
  2 siblings, 0 replies; 8+ messages in thread
From: Nicolin Chen @ 2014-07-17 13:21 UTC (permalink / raw)
  To: broonie
  Cc: linux-kernel, linuxppc-dev, alsa-devel, timur, Li.Xiubo, b02247, b42378

In the rx irq handling part, we should clear the flags in RCSR not TCSR.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
---
 sound/soc/fsl/fsl_sai.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index b10dbd8..1b6ee2c 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -106,7 +106,7 @@ irq_rx:
 	xcsr &= ~FSL_SAI_CSR_xF_MASK;
 
 	if (flags)
-		regmap_write(sai->regmap, FSL_SAI_TCSR, flags | xcsr);
+		regmap_write(sai->regmap, FSL_SAI_RCSR, flags | xcsr);
 
 out:
 	if (irq_none)
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* RE: [PATCH 0/2] ASoC: fsl_sai: Two bug fixes for fsl_sai driver
  2014-07-17 13:21 [PATCH 0/2] ASoC: fsl_sai: Two bug fixes for fsl_sai driver Nicolin Chen
  2014-07-17 13:21 ` [PATCH 1/2] ASoC: fsl_sai: Reset FIFOs after disabling TE/RE Nicolin Chen
  2014-07-17 13:21 ` [PATCH 2/2] ASoC: fsl_sai: Fix incorrect register writing in fsl_sai_isr() Nicolin Chen
@ 2014-07-18  2:38 ` Li.Xiubo
  2 siblings, 0 replies; 8+ messages in thread
From: Li.Xiubo @ 2014-07-18  2:38 UTC (permalink / raw)
  To: Nicolin Chen, broonie
  Cc: linux-kernel, linuxppc-dev, alsa-devel, timur, shengjiu.wang,
	guangyu.chen

> -----Original Message-----
> From: Nicolin Chen [mailto:nicoleotsuka@gmail.com]
> Sent: Thursday, July 17, 2014 9:22 PM
> To: broonie@kernel.org
> Cc: linux-kernel@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; alsa-
> devel@alsa-project.org; timur@tabi.org; Xiubo Li-B47053; Wang Shengjiu-B02247;
> Chen Guangyu-B42378
> Subject: [PATCH 0/2] ASoC: fsl_sai: Two bug fixes for fsl_sai driver
> 
> Nicolin Chen (2):
>   ASoC: fsl_sai: Reset FIFOs after disabling TE/RE
>   ASoC: fsl_sai: Fix incorrect register writing in fsl_sai_isr()
> 

Yes, they are all looks good to me.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>

Thanks,

BRs
Xiubo


>  sound/soc/fsl/fsl_sai.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> --
> 1.8.4


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] ASoC: fsl_sai: Reset FIFOs after disabling TE/RE
  2014-07-17 13:21 ` [PATCH 1/2] ASoC: fsl_sai: Reset FIFOs after disabling TE/RE Nicolin Chen
@ 2014-07-18 10:18   ` Nicolin Chen
  2014-07-23  9:52     ` Nicolin Chen
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolin Chen @ 2014-07-18 10:18 UTC (permalink / raw)
  To: Nicolin Chen
  Cc: broonie, linux-kernel, linuxppc-dev, alsa-devel, timur, Li.Xiubo,
	b02247, b42378

Mark,

	Please disregard this single patch. 

On Thu, Jul 17, 2014 at 09:21:37PM +0800, Nicolin Chen wrote:
> SAI will not clear their FIFOs after disabling TE/RE. Therfore, the driver
> should take care the task so as not to let useless data remain in the FIFO.
> 
> Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
> ---
>  sound/soc/fsl/fsl_sai.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
> index c5a0e8a..b10dbd8 100644
> --- a/sound/soc/fsl/fsl_sai.c
> +++ b/sound/soc/fsl/fsl_sai.c
> @@ -371,10 +371,13 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd,
>  
>  		/* Check if the opposite FRDE is also disabled */
>  		if (!(tx ? rcsr & FSL_SAI_CSR_FRDE : tcsr & FSL_SAI_CSR_FRDE)) {
> +			/* Disable both directions and reset their FIFOs */
>  			regmap_update_bits(sai->regmap, FSL_SAI_TCSR,
> -					   FSL_SAI_CSR_TERE, 0);
> +					   FSL_SAI_CSR_TERE | FSL_SAI_CSR_FR,
> +					   FSL_SAI_CSR_FR);
>  			regmap_update_bits(sai->regmap, FSL_SAI_RCSR,
> -					   FSL_SAI_CSR_TERE, 0);
> +					   FSL_SAI_CSR_TERE | FSL_SAI_CSR_FR,
> +					   FSL_SAI_CSR_FR);


The FR should be set _after_ clear TERE, not at the same time because it
still may have tiny possibility to remain data.

I'll send another version later for this patch.

The other patch for isr() should be still fine.

Thank you,
Nicolin

>  		}
>  		break;
>  	default:
> -- 
> 1.8.4
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] ASoC: fsl_sai: Reset FIFOs after disabling TE/RE
  2014-07-18 10:18   ` Nicolin Chen
@ 2014-07-23  9:52     ` Nicolin Chen
  2014-07-23 10:07       ` Mark Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolin Chen @ 2014-07-23  9:52 UTC (permalink / raw)
  To: broonie
  Cc: linux-kernel, linuxppc-dev, alsa-devel, timur, Li.Xiubo, b02247, b42378

Sir,

I found this two patches are merged into for-next branch, although I haven't
got the 'applied' email. 

Is that possible for you to drop this one? If not, I'll send another patch
to fix this.

Thank you,
Nicolin

On Fri, Jul 18, 2014 at 06:18:12PM +0800, Nicolin Chen wrote:
> Mark,
> 
> 	Please disregard this single patch. 
> 
> On Thu, Jul 17, 2014 at 09:21:37PM +0800, Nicolin Chen wrote:
> > SAI will not clear their FIFOs after disabling TE/RE. Therfore, the driver
> > should take care the task so as not to let useless data remain in the FIFO.
> > 
> > Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
> > ---
> >  sound/soc/fsl/fsl_sai.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
> > index c5a0e8a..b10dbd8 100644
> > --- a/sound/soc/fsl/fsl_sai.c
> > +++ b/sound/soc/fsl/fsl_sai.c
> > @@ -371,10 +371,13 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd,
> >  
> >  		/* Check if the opposite FRDE is also disabled */
> >  		if (!(tx ? rcsr & FSL_SAI_CSR_FRDE : tcsr & FSL_SAI_CSR_FRDE)) {
> > +			/* Disable both directions and reset their FIFOs */
> >  			regmap_update_bits(sai->regmap, FSL_SAI_TCSR,
> > -					   FSL_SAI_CSR_TERE, 0);
> > +					   FSL_SAI_CSR_TERE | FSL_SAI_CSR_FR,
> > +					   FSL_SAI_CSR_FR);
> >  			regmap_update_bits(sai->regmap, FSL_SAI_RCSR,
> > -					   FSL_SAI_CSR_TERE, 0);
> > +					   FSL_SAI_CSR_TERE | FSL_SAI_CSR_FR,
> > +					   FSL_SAI_CSR_FR);
> 
> 
> The FR should be set _after_ clear TERE, not at the same time because it
> still may have tiny possibility to remain data.
> 
> I'll send another version later for this patch.
> 
> The other patch for isr() should be still fine.
> 
> Thank you,
> Nicolin
> 
> >  		}
> >  		break;
> >  	default:
> > -- 
> > 1.8.4
> > 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] ASoC: fsl_sai: Reset FIFOs after disabling TE/RE
  2014-07-23 10:07       ` Mark Brown
@ 2014-07-23  9:59         ` Nicolin Chen
  0 siblings, 0 replies; 8+ messages in thread
From: Nicolin Chen @ 2014-07-23  9:59 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel, linuxppc-dev, alsa-devel, timur, Li.Xiubo, b02247, b42378

On Wed, Jul 23, 2014 at 11:07:46AM +0100, Mark Brown wrote:
> On Wed, Jul 23, 2014 at 05:52:32PM +0800, Nicolin Chen wrote:
> 
> > I found this two patches are merged into for-next branch, although I haven't
> > got the 'applied' email. 
> 
> > Is that possible for you to drop this one? If not, I'll send another patch
> > to fix this.
> 
> Please send a patch, I'd already applied it by the time you asked me to
> drop it.

Got it. Thank you.
Nicolin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] ASoC: fsl_sai: Reset FIFOs after disabling TE/RE
  2014-07-23  9:52     ` Nicolin Chen
@ 2014-07-23 10:07       ` Mark Brown
  2014-07-23  9:59         ` Nicolin Chen
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2014-07-23 10:07 UTC (permalink / raw)
  To: Nicolin Chen
  Cc: linux-kernel, linuxppc-dev, alsa-devel, timur, Li.Xiubo, b02247, b42378

[-- Attachment #1: Type: text/plain, Size: 355 bytes --]

On Wed, Jul 23, 2014 at 05:52:32PM +0800, Nicolin Chen wrote:

> I found this two patches are merged into for-next branch, although I haven't
> got the 'applied' email. 

> Is that possible for you to drop this one? If not, I'll send another patch
> to fix this.

Please send a patch, I'd already applied it by the time you asked me to
drop it.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-07-23 10:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-17 13:21 [PATCH 0/2] ASoC: fsl_sai: Two bug fixes for fsl_sai driver Nicolin Chen
2014-07-17 13:21 ` [PATCH 1/2] ASoC: fsl_sai: Reset FIFOs after disabling TE/RE Nicolin Chen
2014-07-18 10:18   ` Nicolin Chen
2014-07-23  9:52     ` Nicolin Chen
2014-07-23 10:07       ` Mark Brown
2014-07-23  9:59         ` Nicolin Chen
2014-07-17 13:21 ` [PATCH 2/2] ASoC: fsl_sai: Fix incorrect register writing in fsl_sai_isr() Nicolin Chen
2014-07-18  2:38 ` [PATCH 0/2] ASoC: fsl_sai: Two bug fixes for fsl_sai driver Li.Xiubo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).