summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamneek Mehresh <ramneek.mehresh@freescale.com>2013-04-11 11:33:42 (GMT)
committerXie Xiaobo <xiaobo.xie@nxp.com>2017-09-25 07:25:26 (GMT)
commit7c2d7ecb736502933d99d74a5f29e1f3dce89714 (patch)
treeffd25f0830fc5647bb70c93b6137d77d37edc38e
parent3b197ebd0cee9a45dbb1f74b5b348d3c671c4bdf (diff)
downloadlinux-7c2d7ecb736502933d99d74a5f29e1f3dce89714.tar.xz
usb: phy: Combine host/gadget start/resume for ID change
Make call to fsl_otg_event for each id change event Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com>
-rw-r--r--drivers/usb/phy/phy-fsl-usb.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c
index 5207d68..7f70135 100644
--- a/drivers/usb/phy/phy-fsl-usb.c
+++ b/drivers/usb/phy/phy-fsl-usb.c
@@ -728,6 +728,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);
@@ -757,18 +758,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;
}
}