linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Mack <zonque@gmail.com>
To: balbi@ti.com
Cc: bigeasy@linutronix.de, linux-usb@vger.kernel.org,
	linux-omap@vger.kernel.org, neumann@teufel.de,
	Daniel Mack <zonque@gmail.com>
Subject: [PATCH v2 1/4] usb: musb: unconditionally save and restore the context on suspend
Date: Mon, 25 Nov 2013 22:26:40 +0100	[thread overview]
Message-ID: <1385414803-13212-2-git-send-email-zonque@gmail.com> (raw)
In-Reply-To: <1385414803-13212-1-git-send-email-zonque@gmail.com>

It appears not all platforms featuring a musb core need to save the musb
core registers at suspend time and restore them on resume.

The dsps platform does, however, and because it shouldn't cause any
trouble on other platforms, do it unconditionally for all of them.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 drivers/usb/musb/musb_core.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 0a43329..797709d 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2215,16 +2215,28 @@ static int musb_suspend(struct device *dev)
 		 */
 	}
 
+	musb_save_context(musb);
+
 	spin_unlock_irqrestore(&musb->lock, flags);
 	return 0;
 }
 
 static int musb_resume_noirq(struct device *dev)
 {
-	/* for static cmos like DaVinci, register values were preserved
+	struct musb	*musb = dev_to_musb(dev);
+
+	/*
+	 * For static cmos like DaVinci, register values were preserved
 	 * unless for some reason the whole soc powered down or the USB
 	 * module got reset through the PSC (vs just being disabled).
+	 *
+	 * For the DSPS glue layer though, a full register restore has to
+	 * be done. As it shouldn't harm other platforms, we do it
+	 * unconditionally.
 	 */
+
+	musb_restore_context(musb);
+
 	return 0;
 }
 
-- 
1.8.4.2


  reply	other threads:[~2013-11-25 21:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-25 21:26 [PATCH v2 0/4] musb/dsps: suspend related patches for 3.14 (rebased) Daniel Mack
2013-11-25 21:26 ` Daniel Mack [this message]
2013-11-25 21:26 ` [PATCH v2 2/4] usb: musb: call musb_port_suspend from musb_bus_suspend Daniel Mack
     [not found] ` <1385414803-13212-1-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-11-25 21:26   ` [PATCH v2 3/4] usb: musb: dsps: add {tx,rx}_mode to wrapper Daniel Mack
2013-11-25 21:26   ` [PATCH v2 4/4] usb: musb: dsps: add support for suspend and resume Daniel Mack
2013-11-25 21:29     ` Felipe Balbi
2013-11-25 21:30       ` Daniel Mack
2013-11-25 21:32         ` Felipe Balbi
2013-11-26 12:30           ` Daniel Mack
     [not found]             ` <52949460.6090708-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-11-26 15:57               ` 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=1385414803-13212-2-git-send-email-zonque@gmail.com \
    --to=zonque@gmail.com \
    --cc=balbi@ti.com \
    --cc=bigeasy@linutronix.de \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=neumann@teufel.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).