All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: DaVinci: Fix McASP hardware FIFO configuration
@ 2010-06-14  6:14 Sudhakar Rajashekhara
  2010-06-14 13:43 ` Liam Girdwood
  0 siblings, 1 reply; 4+ messages in thread
From: Sudhakar Rajashekhara @ 2010-06-14  6:14 UTC (permalink / raw)
  To: alsa-devel; +Cc: Sudhakar Rajashekhara

On DA830/OMAP-L137 and DA850/OMAP-L138 SoCs, the McASP peripheral
has FIFO support. This FIFO provides additional data buffering. It
also provides tolerance to variation in host/DMA controller response
times. More details of the FIFO operation can be found at

http://focus.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=sprufm1&fileType=pdf

Existing sequence of steps for audio playback/capture are:
a. DMA configuration
b. McASP configuration (configures and enables FIFO)
c. Start DMA
d. Start McASP (enables FIFO)

During McASP configuration, while FIFO was being configured, FIFO
was being enabled in davinci_hw_common_param() function of
sound/soc/davinci/davinci-mcasp.c file. This generated a transmit
DMA event, which gets serviced when DMA is started.

https://patchwork.kernel.org/patch/84611/ patch clears the DMA
events before starting DMA, which is the right thing to do. But
this resulted in a state where DMA was waiting for an event from
McASP (after step c above), but the event which was already there,
has got cleared (because of step b above).

The fix is not to enable the FIFO during McASP configuration as
FIFO was being enabled as part of McASP start.

Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
---
Applies to latest of Linus's tree.

 sound/soc/davinci/davinci-mcasp.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 79f0f4a..d395509 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -612,7 +612,6 @@ static void davinci_hw_common_param(struct davinci_audio_dev *dev, int stream)
 								NUMDMA_MASK);
 		mcasp_mod_bits(dev->base + DAVINCI_MCASP_WFIFOCTL,
 				((dev->txnumevt * tx_ser) << 8), NUMEVT_MASK);
-		mcasp_set_bits(dev->base + DAVINCI_MCASP_WFIFOCTL, FIFO_ENABLE);
 	}
 
 	if (dev->rxnumevt && stream == SNDRV_PCM_STREAM_CAPTURE) {
@@ -623,7 +622,6 @@ static void davinci_hw_common_param(struct davinci_audio_dev *dev, int stream)
 								NUMDMA_MASK);
 		mcasp_mod_bits(dev->base + DAVINCI_MCASP_RFIFOCTL,
 				((dev->rxnumevt * rx_ser) << 8), NUMEVT_MASK);
-		mcasp_set_bits(dev->base + DAVINCI_MCASP_RFIFOCTL, FIFO_ENABLE);
 	}
 }
 
-- 
1.5.6

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

* Re: [PATCH] ASoC: DaVinci: Fix McASP hardware FIFO configuration
  2010-06-14  6:14 [PATCH] ASoC: DaVinci: Fix McASP hardware FIFO configuration Sudhakar Rajashekhara
@ 2010-06-14 13:43 ` Liam Girdwood
  0 siblings, 0 replies; 4+ messages in thread
From: Liam Girdwood @ 2010-06-14 13:43 UTC (permalink / raw)
  To: Sudhakar Rajashekhara; +Cc: alsa-devel

On Mon, 2010-06-14 at 11:44 +0530, Sudhakar Rajashekhara wrote:
> On DA830/OMAP-L137 and DA850/OMAP-L138 SoCs, the McASP peripheral
> has FIFO support. This FIFO provides additional data buffering. It
> also provides tolerance to variation in host/DMA controller response
> times. More details of the FIFO operation can be found at
> 
> http://focus.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=sprufm1&fileType=pdf
> 
> Existing sequence of steps for audio playback/capture are:
> a. DMA configuration
> b. McASP configuration (configures and enables FIFO)
> c. Start DMA
> d. Start McASP (enables FIFO)
> 
> During McASP configuration, while FIFO was being configured, FIFO
> was being enabled in davinci_hw_common_param() function of
> sound/soc/davinci/davinci-mcasp.c file. This generated a transmit
> DMA event, which gets serviced when DMA is started.
> 
> https://patchwork.kernel.org/patch/84611/ patch clears the DMA
> events before starting DMA, which is the right thing to do. But
> this resulted in a state where DMA was waiting for an event from
> McASP (after step c above), but the event which was already there,
> has got cleared (because of step b above).
> 
> The fix is not to enable the FIFO during McASP configuration as
> FIFO was being enabled as part of McASP start.
> 
> Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>

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] 4+ messages in thread

* Re: [PATCH] ASoC: DaVinci: Fix McASP hardware FIFO configuration
  2010-06-11 13:54 Sudhakar Rajashekhara
@ 2010-06-15 10:16 ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2010-06-15 10:16 UTC (permalink / raw)
  To: Sudhakar Rajashekhara; +Cc: alsa-devel, davinci-linux-open-source

On Fri, Jun 11, 2010 at 07:24:51PM +0530, Sudhakar Rajashekhara wrote:
> On DA830/OMAP-L137 and DA850/OMAP-L138 SoCs, the McASP peripheral
> has FIFO support. This FIFO provides additional data buffering. It
> also provides tolerance to variation in host/DMA controller response
> times. More details of the FIFO operation can be found at

Applied, thanks.

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

* [PATCH] ASoC: DaVinci: Fix McASP hardware FIFO configuration
@ 2010-06-11 13:54 Sudhakar Rajashekhara
  2010-06-15 10:16 ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Sudhakar Rajashekhara @ 2010-06-11 13:54 UTC (permalink / raw)
  To: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw
  Cc: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/,
	broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E

On DA830/OMAP-L137 and DA850/OMAP-L138 SoCs, the McASP peripheral
has FIFO support. This FIFO provides additional data buffering. It
also provides tolerance to variation in host/DMA controller response
times. More details of the FIFO operation can be found at

http://focus.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=sprufm1&fileType=pdf

Existing sequence of steps for audio playback/capture are:
a. DMA configuration
b. McASP configuration (configures and enables FIFO)
c. Start DMA
d. Start McASP (enables FIFO)

During McASP configuration, while FIFO was being configured, FIFO
was being enabled in davinci_hw_common_param() function of
sound/soc/davinci/davinci-mcasp.c file. This generated a transmit
DMA event, which gets serviced when DMA is started.

https://patchwork.kernel.org/patch/84611/ patch clears the DMA
events before starting DMA, which is the right thing to do. But
this resulted in a state where DMA was waiting for an event from
McASP (after step c above), but the event which was already there,
has got cleared (because of step b above).

The fix is not to enable the FIFO during McASP configuration as
FIFO was being enabled as part of McASP start.

Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj-l0cyMroinI0@public.gmane.org>
---
Applies to latest of Linus's tree.

 sound/soc/davinci/davinci-mcasp.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 79f0f4a..d395509 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -612,7 +612,6 @@ static void davinci_hw_common_param(struct davinci_audio_dev *dev, int stream)
 								NUMDMA_MASK);
 		mcasp_mod_bits(dev->base + DAVINCI_MCASP_WFIFOCTL,
 				((dev->txnumevt * tx_ser) << 8), NUMEVT_MASK);
-		mcasp_set_bits(dev->base + DAVINCI_MCASP_WFIFOCTL, FIFO_ENABLE);
 	}
 
 	if (dev->rxnumevt && stream == SNDRV_PCM_STREAM_CAPTURE) {
@@ -623,7 +622,6 @@ static void davinci_hw_common_param(struct davinci_audio_dev *dev, int stream)
 								NUMDMA_MASK);
 		mcasp_mod_bits(dev->base + DAVINCI_MCASP_RFIFOCTL,
 				((dev->rxnumevt * rx_ser) << 8), NUMEVT_MASK);
-		mcasp_set_bits(dev->base + DAVINCI_MCASP_RFIFOCTL, FIFO_ENABLE);
 	}
 }
 
-- 
1.5.6

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

end of thread, other threads:[~2010-06-15 10:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-14  6:14 [PATCH] ASoC: DaVinci: Fix McASP hardware FIFO configuration Sudhakar Rajashekhara
2010-06-14 13:43 ` Liam Girdwood
  -- strict thread matches above, loose matches on Subject: below --
2010-06-11 13:54 Sudhakar Rajashekhara
2010-06-15 10:16 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.