All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vikram Pandita <vikram.pandita@ti.com>
To: balbi@ti.com
Cc: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
	Hema HK <hemahk@ti.com>, Kishon Vijay Abraham I <kishon@ti.com>,
	Vikram Pandita <vikram.pandita@ti.com>
Subject: [v2 2/2] usb: musb: omap2+: save and restore OTG_INTERFSEL
Date: Wed, 7 Sep 2011 09:19:24 -0700	[thread overview]
Message-ID: <1315412364-21384-3-git-send-email-vikram.pandita@ti.com> (raw)
In-Reply-To: <1315412364-21384-1-git-send-email-vikram.pandita@ti.com>

From: Hema HK <hemahk@ti.com>

we need to save and restore OTG_INTERFSEL register
else we will be unable to function on resume after
OFF mode.

Reported-by: Devaraj Rangasamy <dev@ti.com>
Signed-off-by: Hema HK <hemahk@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
---
 drivers/usb/musb/musb_core.h |    1 +
 drivers/usb/musb/omap2430.c  |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index b3c065a..3259a6b 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -311,6 +311,7 @@ struct musb_context_registers {
 	u8 index, testmode;
 
 	u8 devctl, busctl, misc;
+	u32 otg_interfsel;
 
 	struct musb_csr_regs index_regs[MUSB_C_NUM_EPS];
 };
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index ba85f27..78eb13a 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -491,6 +491,9 @@ static int omap2430_runtime_suspend(struct device *dev)
 	struct omap2430_glue		*glue = dev_get_drvdata(dev);
 	struct musb			*musb = glue_to_musb(glue);
 
+	musb->context.otg_interfsel = musb_readl(musb->mregs,
+						OTG_INTERFSEL);
+
 	omap2430_low_level_exit(musb);
 	otg_set_suspend(musb->xceiv, 1);
 
@@ -503,6 +506,9 @@ static int omap2430_runtime_resume(struct device *dev)
 	struct musb			*musb = glue_to_musb(glue);
 
 	omap2430_low_level_init(musb);
+	musb_writel(musb->mregs, OTG_INTERFSEL,
+					musb->context.otg_interfsel);
+
 	otg_set_suspend(musb->xceiv, 0);
 
 	return 0;
-- 
1.7.4.1


  parent reply	other threads:[~2011-09-07 16:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-07 16:19 [v2 0/2] usb: musb: off mode fixes Vikram Pandita
     [not found] ` <1315412364-21384-1-git-send-email-vikram.pandita-l0cyMroinI0@public.gmane.org>
2011-09-07 16:19   ` [v2 1/2] usb: musb: omap2+: fix context api's Vikram Pandita
     [not found]     ` <1315412364-21384-2-git-send-email-vikram.pandita-l0cyMroinI0@public.gmane.org>
2011-10-10  6:08       ` Felipe Balbi
     [not found]         ` <20111010060808.GD31707-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2011-10-31  6:48           ` Pandita, Vikram
2011-09-07 16:19 ` Vikram Pandita [this message]
2011-10-10  6:08   ` [v2 2/2] usb: musb: omap2+: save and restore OTG_INTERFSEL Felipe Balbi

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=1315412364-21384-3-git-send-email-vikram.pandita@ti.com \
    --to=vikram.pandita@ti.com \
    --cc=balbi@ti.com \
    --cc=hemahk@ti.com \
    --cc=kishon@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@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.