From patchwork Wed Mar 18 11:31:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ext-eero.nurkkala@nokia.com X-Patchwork-Id: 12818 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2IBYiF7002083 for ; Wed, 18 Mar 2009 11:34:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753453AbZCRLeo (ORCPT ); Wed, 18 Mar 2009 07:34:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755118AbZCRLeo (ORCPT ); Wed, 18 Mar 2009 07:34:44 -0400 Received: from smtp.nokia.com ([192.100.122.233]:19526 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751625AbZCRLen (ORCPT ); Wed, 18 Mar 2009 07:34:43 -0400 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx06.nokia.com (Switch-3.2.6/Switch-3.2.6) with ESMTP id n2IBYD9a019231 for ; Wed, 18 Mar 2009 13:34:38 +0200 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 18 Mar 2009 13:34:30 +0200 Received: from mgw-int01.ntc.nokia.com ([172.21.143.96]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Wed, 18 Mar 2009 13:34:29 +0200 Received: from localhost.localdomain (ouped118146.nmp.nokia.com [172.23.118.146]) by mgw-int01.ntc.nokia.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id n2IBYSLJ012992; Wed, 18 Mar 2009 13:34:28 +0200 From: ext-eero.nurkkala@nokia.com To: linux-omap@vger.kernel.org Cc: Eero Nurkkala Subject: [PATCHv2] OMAP: McBSP: Always maintain McBSP fclk while active Date: Wed, 18 Mar 2009 13:31:02 +0200 Message-Id: <12373758621770-git-send-email-ext-eero.nurkkala@nokia.com> X-Mailer: git-send-email 1.5.2 X-OriginalArrivalTime: 18 Mar 2009 11:34:29.0885 (UTC) FILETIME=[803C1AD0:01C9A7BD] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Eero Nurkkala 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 Acked-by: Jarkko Nikula --- 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);