mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ramneek Mehresh <ramneek.mehresh@freescale.com>
To: <linux-kernel@vger.kernel.org>
Cc: <balbi@ti.com>, <stern@rowland.harvard.edu>,
	<gregkh@linuxfoundation.org>, <linux-usb@vger.kernel.org>,
	Ramneek Mehresh <ramneek.mehresh@freescale.com>
Subject: [PATCH 4/7][v5]usb:fsl:otg: Signal host drv when host is otg
Date: Mon, 28 Dec 2015 16:42:31 +0530	[thread overview]
Message-ID: <1451301154-14422-5-git-send-email-ramneek.mehresh@freescale.com> (raw)
In-Reply-To: <1451301154-14422-1-git-send-email-ramneek.mehresh@freescale.com>

Set is_otg boolean flag to signal host driver when host
is running in context of otg host suspend/resume.

Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com>
---
 drivers/usb/phy/phy-fsl-usb.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c
index 4e58aee..815c22c 100644
--- a/drivers/usb/phy/phy-fsl-usb.c
+++ b/drivers/usb/phy/phy-fsl-usb.c
@@ -463,6 +463,7 @@ void otg_reset_controller(void)
 int fsl_otg_start_host(struct otg_fsm *fsm, int on)
 {
 	struct usb_otg *otg = fsm->otg;
+	struct usb_bus *host = otg->host;
 	struct device *dev;
 	struct fsl_otg *otg_dev =
 		container_of(otg->usb_phy, struct fsl_otg, phy);
@@ -485,6 +486,7 @@ int fsl_otg_start_host(struct otg_fsm *fsm, int on)
 		else {
 			otg_reset_controller();
 			VDBG("host on......\n");
+			host->is_otg = 1;
 			if (dev->driver->pm && dev->driver->pm->resume) {
 				retval = dev->driver->pm->resume(dev);
 				if (fsm->id) {
@@ -510,8 +512,11 @@ int fsl_otg_start_host(struct otg_fsm *fsm, int on)
 		else {
 			VDBG("host off......\n");
 			if (dev && dev->driver) {
-				if (dev->driver->pm && dev->driver->pm->suspend)
+				if (dev->driver->pm &&
+					dev->driver->pm->suspend) {
+					host->is_otg = 1;
 					retval = dev->driver->pm->suspend(dev);
+				}
 				if (fsm->id)
 					/* default-b */
 					fsl_otg_drv_vbus(fsm, 0);
-- 
1.8.3.1


  parent reply	other threads:[~2015-12-28 10:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-28 11:12 [PATCH 0/7][v5]Add OTG support for FSL socs Ramneek Mehresh
2015-12-28 11:12 ` [PATCH 1/7][v5]usb:fsl:otg: Make fsl otg driver as tristate Ramneek Mehresh
2015-12-28 11:12 ` [PATCH 2/7][v5]usb:fsl:otg: Add controller version based ULPI and UTMI phy Ramneek Mehresh
2015-12-28 11:12 ` [PATCH 3/7][v5]usb:fsl:otg: Add support to add/remove usb host driver Ramneek Mehresh
2015-12-28 11:12 ` Ramneek Mehresh [this message]
2015-12-28 11:12 ` [PATCH 5/7][v5]usb:fsl:otg: Modify otg_event to start host drv Ramneek Mehresh
2015-12-28 11:12 ` [PATCH 6/7][v5]usb:fsl:otg: Combine host/gadget start/resume for ID change Ramneek Mehresh
2015-12-28 11:12 ` [PATCH 7/7][v5]usb:fsl:otg: Add host-gadget drv sync delay Ramneek Mehresh
2016-01-14  7:02 ` [PATCH 0/7][v5]Add OTG support for FSL socs Ramneek Mehresh
2016-02-08  9:18 ` Ramneek Mehresh
2016-02-11 22:51   ` Li Yang
2016-02-17 14:17     ` 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=1451301154-14422-5-git-send-email-ramneek.mehresh@freescale.com \
    --to=ramneek.mehresh@freescale.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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

all inboxes | Powered by JetHome®