linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2] OMAP: McBSP: Always maintain McBSP fclk while active
@ 2009-03-18 11:31 ext-eero.nurkkala
  2009-03-19 12:29 ` Jarkko Nikula
  2009-03-26 22:47 ` [APPLIED] " Tony Lindgren
  0 siblings, 2 replies; 3+ messages in thread
From: ext-eero.nurkkala @ 2009-03-18 11:31 UTC (permalink / raw)
  To: linux-omap; +Cc: Eero Nurkkala

From: Eero Nurkkala <ext-eero.nurkkala@nokia.com>

McBSP fclk must be maintained for the duration of
audio playback or recording. Otherwise the fclk
may get autogated when the PER96M clk is no longer
required by other modules. This results in audio
activity being hang. Also, if the McBSP is run
as a slave, it is possible that words are
randomly missed from the playback. Fix all this
phenomenom by enabling the McBSP fclk
clockactivity bit for the entire active duration
of the McBSP usage.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
---
 arch/arm/plat-omap/include/mach/mcbsp.h |    1 +
 arch/arm/plat-omap/mcbsp.c              |    6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-omap/include/mach/mcbsp.h b/arch/arm/plat-omap/include/mach/mcbsp.h
index 26bde05..ec61b89 100644
--- a/arch/arm/plat-omap/include/mach/mcbsp.h
+++ b/arch/arm/plat-omap/include/mach/mcbsp.h
@@ -252,6 +252,7 @@
 #define RDISABLE		0x0001
 
 /********************** McBSP SYSCONFIG bit definitions ********************/
+#define CLOCKACTIVITY(value)	((value)<<8)
 #define SIDLEMODE(value)	((value)<<3)
 #define ENAWAKEUP		0x0004
 #define SOFTRST			0x0002
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index a94d03e..02b3f2d 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -248,8 +248,8 @@ int omap_mcbsp_request(unsigned int id)
 		u16 w;
 
 		w = OMAP_MCBSP_READ(mcbsp->io_base, SYSCON);
-		w &= ~(ENAWAKEUP | SIDLEMODE(0x03));
-		w |= (ENAWAKEUP | SIDLEMODE(0x02));
+		w &= ~(ENAWAKEUP | SIDLEMODE(0x03) | CLOCKACTIVITY(0x03));
+		w |= (ENAWAKEUP | SIDLEMODE(0x02) | CLOCKACTIVITY(0x02));
 		OMAP_MCBSP_WRITE(mcbsp->io_base, SYSCON, w);
 
 		OMAP_MCBSP_WRITE(mcbsp->io_base, WAKEUPEN, WAKEUPEN_ALL);
@@ -308,7 +308,7 @@ void omap_mcbsp_free(unsigned int id)
 		u16 w;
 
 		w = OMAP_MCBSP_READ(mcbsp->io_base, SYSCON);
-		w &= ~(ENAWAKEUP | SIDLEMODE(0x03));
+		w &= ~(ENAWAKEUP | SIDLEMODE(0x03) | CLOCKACTIVITY(0x03));
 		OMAP_MCBSP_WRITE(mcbsp->io_base, SYSCON, w);
 
 		w = OMAP_MCBSP_READ(mcbsp->io_base, WAKEUPEN);
-- 
1.5.2


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

* Re: [PATCHv2] OMAP: McBSP: Always maintain McBSP fclk while active
  2009-03-18 11:31 [PATCHv2] OMAP: McBSP: Always maintain McBSP fclk while active ext-eero.nurkkala
@ 2009-03-19 12:29 ` Jarkko Nikula
  2009-03-26 22:47 ` [APPLIED] " Tony Lindgren
  1 sibling, 0 replies; 3+ messages in thread
From: Jarkko Nikula @ 2009-03-19 12:29 UTC (permalink / raw)
  To: Nurkkala Eero.An (EXT-Offcode/Oulu); +Cc: linux-omap

On Wed, 18 Mar 2009 12:31:02 +0100
"Nurkkala Eero.An (EXT-Offcode/Oulu)" <ext-Eero.Nurkkala@nokia.com>
wrote:

> From: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
> 
> McBSP fclk must be maintained for the duration of
> audio playback or recording. Otherwise the fclk
> may get autogated when the PER96M clk is no longer
> required by other modules. This results in audio
> activity being hang. Also, if the McBSP is run
> as a slave, it is possible that words are
> randomly missed from the playback. Fix all this
> phenomenom by enabling the McBSP fclk
> clockactivity bit for the entire active duration
> of the McBSP usage.
> 
> Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
> ---
...
>  		w = OMAP_MCBSP_READ(mcbsp->io_base, SYSCON);
> -		w &= ~(ENAWAKEUP | SIDLEMODE(0x03));
> -		w |= (ENAWAKEUP | SIDLEMODE(0x02));
> +		w &= ~(ENAWAKEUP | SIDLEMODE(0x03) | CLOCKACTIVITY
> (0x03));
> +		w |= (ENAWAKEUP | SIDLEMODE(0x02) | CLOCKACTIVITY
> (0x02));

Based on updated TRM info:
http://marc.info/?l=linux-omap&m=123674373120880&w=2

Acked-by: Jarkko Nikula <jarkko.nikula@nokia.com>

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

* [APPLIED] [PATCHv2] OMAP: McBSP: Always maintain McBSP fclk while active
  2009-03-18 11:31 [PATCHv2] OMAP: McBSP: Always maintain McBSP fclk while active ext-eero.nurkkala
  2009-03-19 12:29 ` Jarkko Nikula
@ 2009-03-26 22:47 ` Tony Lindgren
  1 sibling, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2009-03-26 22:47 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Commit: bd0d1794e9897e65d9443b8b7ba897d93f3deab8

PatchWorks
http://patchwork.kernel.org/patch/12818/

Git
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=bd0d1794e9897e65d9443b8b7ba897d93f3deab8



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

end of thread, other threads:[~2009-03-26 22:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-18 11:31 [PATCHv2] OMAP: McBSP: Always maintain McBSP fclk while active ext-eero.nurkkala
2009-03-19 12:29 ` Jarkko Nikula
2009-03-26 22:47 ` [APPLIED] " Tony Lindgren

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).