Skip to contentSkip to conversation

OMAP: McBSP: Always maintain McBSP fclk while active

PATCH In review [email protected] 3 participants 3 messages Mar 18, 2009 – Mar 26, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 OMAP: McBSP: Always maintain McBSP fclk while active

From: Eero Nurkkala <[email protected]>

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.

---
 arch/arm/plat-omap/include/mach/mcbsp.h |    1 +
 arch/arm/plat-omap/mcbsp.c              |    6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
arch/arm/plat-omap/include/mach/mcbsp.h +1 -0
index 26bde05..ec61b89 100644
@@ -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
arch/arm/plat-omap/mcbsp.c +3 -3
index a94d03e..02b3f2d 100644
@@ -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);
Signature · 1 line
1.5.2
Acked-by on v2 1/1
#1 lore raw
Quoted 15 lines · On Wed, 18 Mar 2009 12:31:02 +0100 "Nurkkala Eero.An (EXT-Offcode/Oulu)"…

From: Eero Nurkkala <[email protected]>

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.

---

...

Quoted 7 lines
arch/arm/plat-omap/mcbsp.c +1 -2
 		w = OMAP_MCBSP_READ(mcbsp->io_base, SYSCON);
-		w &= ~(ENAWAKEUP | SIDLEMODE(0x03));
-		w |= (ENAWAKEUP | SIDLEMODE(0x02));
+		w &= ~(ENAWAKEUP | SIDLEMODE(0x03) | CLOCKACTIVITY

(0x03));

(quoted diff) +1 -0
+		w |= (ENAWAKEUP | SIDLEMODE(0x02) | CLOCKACTIVITY

(0x02));

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