All of lore.kernel.org
 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>,
	Ramneek Mehresh <ramneek.mehresh@freescale.com>
Subject: [PATCH 5/9] usb:fsl:otg: Combine host/gadget start/resume for ID change
Date: Thu, 26 Mar 2015 20:47:40 +0530	[thread overview]
Message-ID: <1427383064-10330-5-git-send-email-ramneek.mehresh@freescale.com> (raw)
In-Reply-To: <1427383064-10330-1-git-send-email-ramneek.mehresh@freescale.com>

Make call to fsl_otg_event for each id change even

Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
---
 drivers/usb/phy/phy-fsl-usb.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c
index 2eb54ef..ce40d5c 100644
--- a/drivers/usb/phy/phy-fsl-usb.c
+++ b/drivers/usb/phy/phy-fsl-usb.c
@@ -733,6 +733,7 @@ irqreturn_t fsl_otg_isr(int irq, void *dev_id)
 {
 	struct otg_fsm *fsm = &((struct fsl_otg *)dev_id)->fsm;
 	struct usb_otg *otg = ((struct fsl_otg *)dev_id)->phy.otg;
+	struct fsl_otg *otg_dev = dev_id;
 	u32 otg_int_src, otg_sc;
 
 	otg_sc = fsl_readl(&usb_dr_regs->otgsc);
@@ -762,18 +763,8 @@ irqreturn_t fsl_otg_isr(int irq, void *dev_id)
 				otg->gadget->is_a_peripheral = !fsm->id;
 			VDBG("ID int (ID is %d)\n", fsm->id);
 
-			if (fsm->id) {	/* switch to gadget */
-				schedule_delayed_work(
-					&((struct fsl_otg *)dev_id)->otg_event,
-					100);
-			} else {	/* switch to host */
-				cancel_delayed_work(&
-						    ((struct fsl_otg *)dev_id)->
-						    otg_event);
-				fsl_otg_start_gadget(fsm, 0);
-				otg_drv_vbus(fsm, 1);
-				fsl_otg_start_host(fsm, 1);
-			}
+			schedule_delayed_work(&otg_dev->otg_event, 100);
+
 			return IRQ_HANDLED;
 		}
 	}
-- 
1.8.3.1


  parent reply	other threads:[~2015-03-26 15:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26 15:17 [PATCH 1/9] usb:fsl:otg: Add controller version based ULPI and UTMI phy Ramneek Mehresh
2015-03-26 15:17 ` [PATCH 2/9][v2]usb:fsl:otg: Add support to add/remove usb host driver Ramneek Mehresh
2015-03-26 15:17 ` [PATCH 3/9] usb:fsl:otg: Signal host drv when host is otg Ramneek Mehresh
2015-03-26 15:17 ` [PATCH 4/9] usb:fsl:otg: Modify otg_event to start host drv Ramneek Mehresh
2015-03-26 15:17 ` Ramneek Mehresh [this message]
2015-03-26 15:17 ` [PATCH 6/9] usb:fsl:otg: Remove host drv upon otg bring-up Ramneek Mehresh
2015-03-26 15:17 ` [PATCH 7/9] usb:fsl:otg: Add host-gadget drv sync delay Ramneek Mehresh
2015-03-26 15:17 ` [PATCH 8/9] usb:fsl:otg: Resolve OTG crash issue with another host Ramneek Mehresh
2015-03-26 15:17 ` [PATCH 9/9] usb:fsl:otg: Make fsl otg driver as tristate Ramneek Mehresh
2015-03-26 17:10 ` [PATCH 1/9] usb:fsl:otg: Add controller version based ULPI and UTMI phy Felipe Balbi
2015-04-07 11:58 Ramneek Mehresh
2015-04-07 11:58 ` [PATCH 5/9] usb:fsl:otg: Combine host/gadget start/resume for ID change Ramneek Mehresh
2015-05-05 12:43 [PATCH 1/9] usb:fsl:otg: Add controller version based ULPI and UTMI phy Ramneek Mehresh
2015-05-05 12:43 ` [PATCH 5/9] usb:fsl:otg: Combine host/gadget start/resume for ID change Ramneek Mehresh
2015-05-05 17:58 [PATCH 1/9] usb:fsl:otg: Add controller version based ULPI and UTMI phy Ramneek Mehresh
2015-05-05 17:58 ` [PATCH 5/9] usb:fsl:otg: Combine host/gadget start/resume for ID change Ramneek Mehresh

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=1427383064-10330-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=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 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.