From patchwork Fri Dec 18 10:39:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 68658 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBIAdttf015836 for ; Fri, 18 Dec 2009 10:39:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752518AbZLRKjz (ORCPT ); Fri, 18 Dec 2009 05:39:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752594AbZLRKjz (ORCPT ); Fri, 18 Dec 2009 05:39:55 -0500 Received: from smtp.nokia.com ([192.100.105.134]:29908 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752382AbZLRKjx (ORCPT ); Fri, 18 Dec 2009 05:39:53 -0500 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nBIAdKBm031065; Fri, 18 Dec 2009 04:39:50 -0600 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 18 Dec 2009 12:39:33 +0200 Received: from mgw-sa01.ext.nokia.com ([147.243.1.47]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 18 Dec 2009 12:39:31 +0200 Received: from localhost.localdomain (esdhcp04366.research.nokia.com [172.21.43.66]) by mgw-sa01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nBIAdUrS006884; Fri, 18 Dec 2009 12:39:30 +0200 From: Eduardo Valentin To: Kevin Hilman Cc: Kristo Tero , Balbi Felipe , Gadiyar Anand , , Eduardo Valentin Subject: [PATCHv2 1/1] OMAP3: PM: Fix OTG autoidle workaround Date: Fri, 18 Dec 2009 12:39:23 +0200 Message-Id: <1261132763-16697-1-git-send-email-eduardo.valentin@nokia.com> X-Mailer: git-send-email 1.6.5.7.g9ecb2 In-Reply-To: <5A47E75E594F054BAF48C5E4FC4B92AB031DC20A71@dbde02.ent.ti.com> References: <5A47E75E594F054BAF48C5E4FC4B92AB031DC20A71@dbde02.ent.ti.com> X-OriginalArrivalTime: 18 Dec 2009 10:39:31.0932 (UTC) FILETIME=[6219A9C0:01CA7FCE] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index c301261..db75975 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -505,7 +505,8 @@ void omap_sram_idle(void) * Errata 1.164 fix : OTG autoidle can prevent * sleep */ - usb_musb_disable_autoidle(); + if (cpu_is_omap3430()) + usb_musb_disable_autoidle(); } omap_uart_resume_idle(0); omap_uart_resume_idle(1); diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c index bb3cee4..cbd4e45 100644 --- a/arch/arm/mach-omap2/usb-musb.c +++ b/arch/arm/mach-omap2/usb-musb.c @@ -81,7 +81,14 @@ static void __init usb_musb_pm_init(void) void usb_musb_disable_autoidle(void) { - __raw_writel(0, otg_base + OTG_SYSCONFIG); + if (otg_clk) { + unsigned long reg; + + clk_enable(otg_clk); + reg = __raw_readl(otg_base + OTG_SYSCONFIG); + __raw_writel(reg & ~1, otg_base + OTG_SYSCONFIG); + clk_disable(otg_clk); + } } #ifdef CONFIG_USB_MUSB_SOC