Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: S3C: Fix PCM RX FIFO settings
@ 2010-09-08  8:51 Seungwhan Youn
  2010-09-08  9:48 ` Jassi Brar
  0 siblings, 1 reply; 9+ messages in thread
From: Seungwhan Youn @ 2010-09-08  8:51 UTC (permalink / raw)
  To: alsa-devel
  Cc: Seungwhan Youn, Jassi Brar, Mark Brown, Seungwhan Youn,
	Liam Girdwood

When PCM capture, sound recorded abnormally because of RX FIFO
threshold settings are missing. So, This patch modify PCM RX FIFO
setting codes same as TX.

Signed-off-by: Seungwhan Youn <sw.youn@samsung.com>
---
 sound/soc/s3c24xx/s3c-pcm.c |    3 +++
 sound/soc/s3c24xx/s3c-pcm.h |    3 ++-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/sound/soc/s3c24xx/s3c-pcm.c b/sound/soc/s3c24xx/s3c-pcm.c
index 43dcc6b..deaa3f2 100644
--- a/sound/soc/s3c24xx/s3c-pcm.c
+++ b/sound/soc/s3c24xx/s3c-pcm.c
@@ -107,11 +107,14 @@ static void s3c_pcm_snd_rxctrl(struct s3c_pcm_info *pcm, int on)
 
 	ctl = readl(regs + S3C_PCM_CTL);
 	clkctl = readl(regs + S3C_PCM_CLKCTL);
+	ctl &= ~(S3C_PCM_CTL_RXDIPSTICK_MASK
+			 << S3C_PCM_CTL_RXDIPSTICK_SHIFT);
 
 	if (on) {
 		ctl |= S3C_PCM_CTL_RXDMA_EN;
 		ctl |= S3C_PCM_CTL_RXFIFO_EN;
 		ctl |= S3C_PCM_CTL_ENABLE;
+		ctl |= (0x20<<S3C_PCM_CTL_RXDIPSTICK_SHIFT);
 		clkctl |= S3C_PCM_CLKCTL_SERCLK_EN;
 	} else {
 		ctl &= ~S3C_PCM_CTL_RXDMA_EN;
diff --git a/sound/soc/s3c24xx/s3c-pcm.h b/sound/soc/s3c24xx/s3c-pcm.h
index 3e9bfc9..b85eaf2 100644
--- a/sound/soc/s3c24xx/s3c-pcm.h
+++ b/sound/soc/s3c24xx/s3c-pcm.h
@@ -22,7 +22,8 @@
 /* PCM_CTL Bit-Fields */
 #define S3C_PCM_CTL_TXDIPSTICK_MASK		(0x3f)
 #define S3C_PCM_CTL_TXDIPSTICK_SHIFT	(13)
-#define S3C_PCM_CTL_RXDIPSTICK_MSK		(0x3f<<7)
+#define S3C_PCM_CTL_RXDIPSTICK_MASK		(0x3f)
+#define S3C_PCM_CTL_RXDIPSTICK_SHIFT	(7)
 #define S3C_PCM_CTL_TXDMA_EN		(0x1<<6)
 #define S3C_PCM_CTL_RXDMA_EN		(0x1<<5)
 #define S3C_PCM_CTL_TXMSB_AFTER_FSYNC	(0x1<<4)
-- 
1.6.2.5

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

* Re: [PATCH] ASoC: S3C: Fix PCM RX FIFO settings
  2010-09-08  8:51 [PATCH] ASoC: S3C: Fix PCM RX FIFO settings Seungwhan Youn
@ 2010-09-08  9:48 ` Jassi Brar
  2010-09-09  1:47   ` Seungwhan Youn
  0 siblings, 1 reply; 9+ messages in thread
From: Jassi Brar @ 2010-09-08  9:48 UTC (permalink / raw)
  To: Seungwhan Youn; +Cc: alsa-devel, Mark Brown, Seungwhan Youn, Liam Girdwood

On Wed, Sep 8, 2010 at 5:51 PM, Seungwhan Youn <sw.youn@samsung.com> wrote:
> When PCM capture, sound recorded abnormally because of RX FIFO
> threshold settings are missing. So, This patch modify PCM RX FIFO
> setting codes same as TX.
>
> Signed-off-by: Seungwhan Youn <sw.youn@samsung.com>
> ---
>  sound/soc/s3c24xx/s3c-pcm.c |    3 +++
>  sound/soc/s3c24xx/s3c-pcm.h |    3 ++-
>  2 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/sound/soc/s3c24xx/s3c-pcm.c b/sound/soc/s3c24xx/s3c-pcm.c
> index 43dcc6b..deaa3f2 100644
> --- a/sound/soc/s3c24xx/s3c-pcm.c
> +++ b/sound/soc/s3c24xx/s3c-pcm.c
> @@ -107,11 +107,14 @@ static void s3c_pcm_snd_rxctrl(struct s3c_pcm_info *pcm, int on)
>
>        ctl = readl(regs + S3C_PCM_CTL);
>        clkctl = readl(regs + S3C_PCM_CLKCTL);
> +       ctl &= ~(S3C_PCM_CTL_RXDIPSTICK_MASK
> +                        << S3C_PCM_CTL_RXDIPSTICK_SHIFT);
>
>        if (on) {
>                ctl |= S3C_PCM_CTL_RXDMA_EN;
>                ctl |= S3C_PCM_CTL_RXFIFO_EN;
>                ctl |= S3C_PCM_CTL_ENABLE;
> +               ctl |= (0x20<<S3C_PCM_CTL_RXDIPSTICK_SHIFT);

Yes, the change is needed.
But I think we should use small value as fifo_dipstick (maybe 0x4 ?), because
Fifo is considered:-
    Almost_empty      when      fifo_depth < fifo_dipstick
   Almost_full             when      fifo_depth > (32 – fifo_dipstick)

And, please modify for TX as well.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [PATCH] ASoC: S3C: Fix PCM RX FIFO settings
  2010-09-08  9:48 ` Jassi Brar
@ 2010-09-09  1:47   ` Seungwhan Youn
  2010-09-10  8:20     ` [PATCHv2 1/2] " Seungwhan Youn
  2010-09-10  8:20     ` [PATCHv2 2/2] ASoC: S3C: Fix PCM TXFIFO_DIPSTICK value Seungwhan Youn
  0 siblings, 2 replies; 9+ messages in thread
From: Seungwhan Youn @ 2010-09-09  1:47 UTC (permalink / raw)
  To: Jassi Brar; +Cc: alsa-devel, Liam Girdwood, Mark Brown, Seungwhan Youn

On Wed, Sep 8, 2010 at 6:48 PM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
> On Wed, Sep 8, 2010 at 5:51 PM, Seungwhan Youn <sw.youn@samsung.com> wrote:
>> When PCM capture, sound recorded abnormally because of RX FIFO
>> threshold settings are missing. So, This patch modify PCM RX FIFO
>> setting codes same as TX.
>>
>> Signed-off-by: Seungwhan Youn <sw.youn@samsung.com>
>> ---
>>  sound/soc/s3c24xx/s3c-pcm.c |    3 +++
>>  sound/soc/s3c24xx/s3c-pcm.h |    3 ++-
>>  2 files changed, 5 insertions(+), 1 deletions(-)
>>
>> diff --git a/sound/soc/s3c24xx/s3c-pcm.c b/sound/soc/s3c24xx/s3c-pcm.c
>> index 43dcc6b..deaa3f2 100644
>> --- a/sound/soc/s3c24xx/s3c-pcm.c
>> +++ b/sound/soc/s3c24xx/s3c-pcm.c
>> @@ -107,11 +107,14 @@ static void s3c_pcm_snd_rxctrl(struct s3c_pcm_info *pcm, int on)
>>
>>        ctl = readl(regs + S3C_PCM_CTL);
>>        clkctl = readl(regs + S3C_PCM_CLKCTL);
>> +       ctl &= ~(S3C_PCM_CTL_RXDIPSTICK_MASK
>> +                        << S3C_PCM_CTL_RXDIPSTICK_SHIFT);
>>
>>        if (on) {
>>                ctl |= S3C_PCM_CTL_RXDMA_EN;
>>                ctl |= S3C_PCM_CTL_RXFIFO_EN;
>>                ctl |= S3C_PCM_CTL_ENABLE;
>> +               ctl |= (0x20<<S3C_PCM_CTL_RXDIPSTICK_SHIFT);
>
> Yes, the change is needed.
> But I think we should use small value as fifo_dipstick (maybe 0x4 ?), because
> Fifo is considered:-
>    Almost_empty      when      fifo_depth < fifo_dipstick
>   Almost_full             when      fifo_depth > (32 – fifo_dipstick)

Yes, you're right.

>
> And, please modify for TX as well.
>

I'll fix this fifo_dipstick value to be a suitable one and re-submit
with TX's fifo_dipstick.

Thanks for your opinion.
Claude.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* [PATCHv2 1/2] ASoC: S3C: Fix PCM RX FIFO settings
  2010-09-09  1:47   ` Seungwhan Youn
@ 2010-09-10  8:20     ` Seungwhan Youn
  2010-09-10 11:13       ` Liam Girdwood
  2010-09-10  8:20     ` [PATCHv2 2/2] ASoC: S3C: Fix PCM TXFIFO_DIPSTICK value Seungwhan Youn
  1 sibling, 1 reply; 9+ messages in thread
From: Seungwhan Youn @ 2010-09-10  8:20 UTC (permalink / raw)
  To: alsa-devel
  Cc: Seungwhan Youn, Jassi Brar, Mark Brown, Seungwhan Youn,
	Liam Girdwood

When PCM capture, sound recorded abnormally because of RX FIFO
threshold settings are missing. So, This patch modify PCM RX FIFO
setting codes same as TX.
And for DMA, if PCM RXFIFO_DIPSTICK is not '0', it doesn't effect
to DMA request, because DMA refer RX_FIFO_EMPTY flag as the DMA
request.

Signed-off-by: Seungwhan Youn <sw.youn@samsung.com>
---
 sound/soc/s3c24xx/s3c-pcm.c |    3 +++
 sound/soc/s3c24xx/s3c-pcm.h |    3 ++-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/sound/soc/s3c24xx/s3c-pcm.c b/sound/soc/s3c24xx/s3c-pcm.c
index 43dcc6b..deaa3f2 100644
--- a/sound/soc/s3c24xx/s3c-pcm.c
+++ b/sound/soc/s3c24xx/s3c-pcm.c
@@ -107,11 +107,14 @@ static void s3c_pcm_snd_rxctrl(struct s3c_pcm_info *pcm, int on)
 
 	ctl = readl(regs + S3C_PCM_CTL);
 	clkctl = readl(regs + S3C_PCM_CLKCTL);
+	ctl &= ~(S3C_PCM_CTL_RXDIPSTICK_MASK
+			 << S3C_PCM_CTL_RXDIPSTICK_SHIFT);
 
 	if (on) {
 		ctl |= S3C_PCM_CTL_RXDMA_EN;
 		ctl |= S3C_PCM_CTL_RXFIFO_EN;
 		ctl |= S3C_PCM_CTL_ENABLE;
+		ctl |= (0x20<<S3C_PCM_CTL_RXDIPSTICK_SHIFT);
 		clkctl |= S3C_PCM_CLKCTL_SERCLK_EN;
 	} else {
 		ctl &= ~S3C_PCM_CTL_RXDMA_EN;
diff --git a/sound/soc/s3c24xx/s3c-pcm.h b/sound/soc/s3c24xx/s3c-pcm.h
index 3e9bfc9..b85eaf2 100644
--- a/sound/soc/s3c24xx/s3c-pcm.h
+++ b/sound/soc/s3c24xx/s3c-pcm.h
@@ -22,7 +22,8 @@
 /* PCM_CTL Bit-Fields */
 #define S3C_PCM_CTL_TXDIPSTICK_MASK		(0x3f)
 #define S3C_PCM_CTL_TXDIPSTICK_SHIFT	(13)
-#define S3C_PCM_CTL_RXDIPSTICK_MSK		(0x3f<<7)
+#define S3C_PCM_CTL_RXDIPSTICK_MASK		(0x3f)
+#define S3C_PCM_CTL_RXDIPSTICK_SHIFT	(7)
 #define S3C_PCM_CTL_TXDMA_EN		(0x1<<6)
 #define S3C_PCM_CTL_RXDMA_EN		(0x1<<5)
 #define S3C_PCM_CTL_TXMSB_AFTER_FSYNC	(0x1<<4)
-- 
1.6.2.5

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

* [PATCHv2 2/2] ASoC: S3C: Fix PCM TXFIFO_DIPSTICK value
  2010-09-09  1:47   ` Seungwhan Youn
  2010-09-10  8:20     ` [PATCHv2 1/2] " Seungwhan Youn
@ 2010-09-10  8:20     ` Seungwhan Youn
  1 sibling, 0 replies; 9+ messages in thread
From: Seungwhan Youn @ 2010-09-10  8:20 UTC (permalink / raw)
  To: alsa-devel
  Cc: Seungwhan Youn, Jassi Brar, Mark Brown, Seungwhan Youn,
	Liam Girdwood

This patch modify FIFO_DIPSTICK value of PCM TX FIFO to be a optimal one.
Privious value (0x20) did not support 'Almost_full' of PCM FIFO for the DMA
request.

Signed-off-by: Seungwhan Youn <sw.youn@samsung.com>
---
 sound/soc/s3c24xx/s3c-pcm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/s3c24xx/s3c-pcm.c b/sound/soc/s3c24xx/s3c-pcm.c
index c5ca902..df6948f 100644
--- a/sound/soc/s3c24xx/s3c-pcm.c
+++ b/sound/soc/s3c24xx/s3c-pcm.c
@@ -78,7 +78,7 @@ static void s3c_pcm_snd_txctrl(struct s3c_pcm_info *pcm, int on)
 		ctl |= S3C_PCM_CTL_TXDMA_EN;
 		ctl |= S3C_PCM_CTL_TXFIFO_EN;
 		ctl |= S3C_PCM_CTL_ENABLE;
-		ctl |= (0x20<<S3C_PCM_CTL_TXDIPSTICK_SHIFT);
+		ctl |= (0x4<<S3C_PCM_CTL_TXDIPSTICK_SHIFT);
 		clkctl |= S3C_PCM_CLKCTL_SERCLK_EN;
 	} else {
 		ctl &= ~S3C_PCM_CTL_TXDMA_EN;
-- 
1.6.2.5

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

* Re: [PATCHv2 1/2] ASoC: S3C: Fix PCM RX FIFO settings
  2010-09-10  8:20     ` [PATCHv2 1/2] " Seungwhan Youn
@ 2010-09-10 11:13       ` Liam Girdwood
  2010-09-11 10:07         ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Liam Girdwood @ 2010-09-10 11:13 UTC (permalink / raw)
  To: Seungwhan Youn; +Cc: alsa-devel, Jassi Brar, Seungwhan Youn, Mark Brown

On Fri, 2010-09-10 at 17:20 +0900, Seungwhan Youn wrote:
> When PCM capture, sound recorded abnormally because of RX FIFO
> threshold settings are missing. So, This patch modify PCM RX FIFO
> setting codes same as TX.
> And for DMA, if PCM RXFIFO_DIPSTICK is not '0', it doesn't effect
> to DMA request, because DMA refer RX_FIFO_EMPTY flag as the DMA
> request.
> 
> Signed-off-by: Seungwhan Youn <sw.youn@samsung.com>

Both

Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

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

* Re: [PATCHv2 1/2] ASoC: S3C: Fix PCM RX FIFO settings
  2010-09-10 11:13       ` Liam Girdwood
@ 2010-09-11 10:07         ` Mark Brown
  2010-09-11 10:59           ` Jassi Brar
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2010-09-11 10:07 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: alsa-devel, Jassi Brar, Seungwhan Youn, Seungwhan Youn

On Fri, Sep 10, 2010 at 12:13:39PM +0100, Liam Girdwood wrote:
> On Fri, 2010-09-10 at 17:20 +0900, Seungwhan Youn wrote:

> > Signed-off-by: Seungwhan Youn <sw.youn@samsung.com>

> Both

> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>

Jassi, are you OK with these?

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

* Re: [PATCHv2 1/2] ASoC: S3C: Fix PCM RX FIFO settings
  2010-09-11 10:07         ` Mark Brown
@ 2010-09-11 10:59           ` Jassi Brar
  2010-09-11 11:12             ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Jassi Brar @ 2010-09-11 10:59 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Seungwhan Youn, Seungwhan Youn, Liam Girdwood

On Sat, Sep 11, 2010 at 7:07 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Fri, Sep 10, 2010 at 12:13:39PM +0100, Liam Girdwood wrote:
>> On Fri, 2010-09-10 at 17:20 +0900, Seungwhan Youn wrote:
>
>> > Signed-off-by: Seungwhan Youn <sw.youn@samsung.com>
>
>> Both
>
>> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
>
> Jassi, are you OK with these?

Acked-by: Jassi Brar <jassi.brar@samsung.com>

Thanks

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

* Re: [PATCHv2 1/2] ASoC: S3C: Fix PCM RX FIFO settings
  2010-09-11 10:59           ` Jassi Brar
@ 2010-09-11 11:12             ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2010-09-11 11:12 UTC (permalink / raw)
  To: Jassi Brar; +Cc: alsa-devel, Seungwhan Youn, Seungwhan Youn, Liam Girdwood

On Sat, Sep 11, 2010 at 07:59:01PM +0900, Jassi Brar wrote:

> Acked-by: Jassi Brar <jassi.brar@samsung.com>

Great, applied both now - thanks.

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

end of thread, other threads:[~2010-09-11 11:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-08  8:51 [PATCH] ASoC: S3C: Fix PCM RX FIFO settings Seungwhan Youn
2010-09-08  9:48 ` Jassi Brar
2010-09-09  1:47   ` Seungwhan Youn
2010-09-10  8:20     ` [PATCHv2 1/2] " Seungwhan Youn
2010-09-10 11:13       ` Liam Girdwood
2010-09-11 10:07         ` Mark Brown
2010-09-11 10:59           ` Jassi Brar
2010-09-11 11:12             ` Mark Brown
2010-09-10  8:20     ` [PATCHv2 2/2] ASoC: S3C: Fix PCM TXFIFO_DIPSTICK value Seungwhan Youn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox