All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Valentin <eduardo.valentin@nokia.com>
To: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Kristo Tero <Tero.Kristo@nokia.com>,
	Balbi Felipe <felipe.balbi@nokia.com>,
	Gadiyar Anand <gadiyar@ti.com>,
	linux-omap@vger.kernel.org,
	Eduardo Valentin <eduardo.valentin@nokia.com>
Subject: [PATCHv2 1/1] OMAP3: PM: Fix OTG autoidle workaround
Date: Fri, 18 Dec 2009 12:39:23 +0200	[thread overview]
Message-ID: <1261132763-16697-1-git-send-email-eduardo.valentin@nokia.com> (raw)
In-Reply-To: <5A47E75E594F054BAF48C5E4FC4B92AB031DC20A71@dbde02.ent.ti.com>

From: Eduardo Valentin <eduardo.valentin@nokia.com>

This patch fix the OTG autoidle workaround so now
usb gadget modules can be properly loaded.

Besides it also adds a cpu check, because this hardware
but is present only in OMAP34xx chips.

Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
---
 arch/arm/mach-omap2/pm34xx.c   |    3 ++-
 arch/arm/mach-omap2/usb-musb.c |    9 ++++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

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
-- 
1.6.5.7.g9ecb2


  reply	other threads:[~2009-12-18 10:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-12 10:07 [PATCHv3 0/5] Misc fixes [for PM branch] Tero Kristo
2009-11-12 10:07 ` [PATCH 1/5] OMAP3: Fixed ARM aux ctrl register save/restore Tero Kristo
2009-11-12 10:07   ` [PATCH 2/5] OMAP3: PM: Disabled I2C4 repeated start operation mode Tero Kristo
2009-11-12 10:07     ` [PATCH 3/5] OMAP3: PM: Added support for L2 aux ctrl register save and restore Tero Kristo
2009-11-12 10:07       ` [PATCH 4/5] OMAP3: PM: Write voltage and clock setup times dynamically in idle loop Tero Kristo
2009-11-12 10:07         ` [PATCH 5/5] OMAP3: PM: Disable OTG autoidle when waking up from off-mode Tero Kristo
2009-11-12 15:37           ` Kevin Hilman
2009-11-12 15:40             ` Gadiyar, Anand
2009-12-18  8:08               ` Eduardo Valentin
2009-12-18  8:58                 ` [PATCH 1/1] OMAP3: PM: Fix OTG autoidle workaround Eduardo Valentin
2009-12-18  9:40                   ` Gadiyar, Anand
2009-12-18 10:39                     ` Eduardo Valentin [this message]
2009-12-18 11:12                       ` [PATCHv2 " Felipe Balbi
2010-01-05 23:47                         ` Tony Lindgren
2010-01-12 19:49                       ` Kevin Hilman
2009-11-12 15:31         ` [PATCH 4/5] OMAP3: PM: Write voltage and clock setup times dynamically in idle loop Kevin Hilman
2009-11-12 15:32     ` [PATCH 2/5] OMAP3: PM: Disabled I2C4 repeated start operation mode Kevin Hilman
2009-11-26 11:18   ` [PATCH 1/5] OMAP3: Fixed ARM aux ctrl register save/restore Gopinath, Thara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1261132763-16697-1-git-send-email-eduardo.valentin@nokia.com \
    --to=eduardo.valentin@nokia.com \
    --cc=Tero.Kristo@nokia.com \
    --cc=felipe.balbi@nokia.com \
    --cc=gadiyar@ti.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.