diff options
author | Thirupathi Chippakurthy <thirupathi.chippakurthy@stericsson.com> | 2011-11-29 18:37:44 +0530 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:03:12 +0200 |
commit | 9107c03b38b67ae82f905fecf582a9501fb48036 (patch) | |
tree | fa95bdba12adb130e4b8576ab1ae9a845c9d3eb9 /drivers | |
parent | ed6b8a71d3ab63d73749278896ac515fc2ad0ca2 (diff) |
ux500: usb:handle connection of microA to A cable
Connect Micro-A to phone first,Then connect device
usb session should be valid to detect the connected
device,Until host cable (micro-A) removal.
MUSB session bit is cleared when usb host cable
(Micro-A) removal from the phone,Not in case of
only device disconnection from the usb host cable.
ST-Ericsson ID: 364426
ST-Ericsson FOSS-OUT ID: NA
ST-Ericsson Linux next: NA
Signed-off-by: Thirupathi <thirupathi.chippakurthy@stericsson.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/musb/ux500.c | 14 | ||||
-rw-r--r-- | drivers/usb/otg/ab8500-usb.c | 9 |
2 files changed, 18 insertions, 5 deletions
diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c index 51f14effa1f..8872393be94 100644 --- a/drivers/usb/musb/ux500.c +++ b/drivers/usb/musb/ux500.c @@ -192,11 +192,15 @@ static void musb_notify_idle(unsigned long _musb) switch (musb->xceiv->state) { case OTG_STATE_A_WAIT_BCON: - devctl &= ~MUSB_DEVCTL_SESSION; - musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); - musb->xceiv->state = OTG_STATE_B_IDLE; - MUSB_DEV_MODE(musb); + if (devctl & MUSB_DEVCTL_BDEVICE) { + musb->xceiv->state = OTG_STATE_B_IDLE; + MUSB_DEV_MODE(musb); + } else { + musb->xceiv->state = OTG_STATE_A_IDLE; + MUSB_HST_MODE(musb); + } break; + case OTG_STATE_A_SUSPEND: default: break; @@ -226,6 +230,8 @@ static int musb_otg_notifications(struct notifier_block *nb, case USB_EVENT_NONE: dev_dbg(musb->controller, "VBUS Disconnect\n"); + if (is_otg_enabled(musb)) + ux500_musb_set_vbus(musb, 0); break; default: diff --git a/drivers/usb/otg/ab8500-usb.c b/drivers/usb/otg/ab8500-usb.c index 189e764a68d..f51ac3fe836 100644 --- a/drivers/usb/otg/ab8500-usb.c +++ b/drivers/usb/otg/ab8500-usb.c @@ -413,10 +413,17 @@ static void ab8500_usb_delayed_work(struct work_struct *work) static irqreturn_t ab8500_usb_disconnect_irq(int irq, void *data) { struct ab8500_usb *ab = (struct ab8500_usb *) data; + enum usb_xceiv_events event; /* Link status will not be updated till phy is disabled. */ - if (ab->mode == USB_HOST) + if (ab->mode == USB_HOST) { + event = USB_EVENT_NONE; + ab->otg.default_a = false; + ab->vbus_draw = 0; + atomic_notifier_call_chain(&ab->otg.notifier, + event, &ab->vbus_draw); ab8500_usb_host_phy_dis(ab); + } else if (ab->mode == USB_PERIPHERAL) ab8500_usb_peri_phy_dis(ab); else if (ab->mode == USB_DEDICATED_CHG && ab->rev == 0x20) { |