aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/otg
diff options
context:
space:
mode:
authorMoiz Sonasath <m-sonasath@ti.com>2011-12-02 14:17:37 -0600
committerZiyann <jaraidaniel@gmail.com>2014-10-01 12:56:05 +0200
commitaee8f57a8178f191420529c4f4130f3e086f8cbb (patch)
treecaced86a51ba06a8d56a2e763e60c470a6898325 /drivers/usb/otg
parent2439a0ae6bf4faf7dca5864d15ef2c524876276f (diff)
downloadkernel_samsung_tuna-aee8f57a8178f191420529c4f4130f3e086f8cbb.zip
kernel_samsung_tuna-aee8f57a8178f191420529c4f4130f3e086f8cbb.tar.gz
kernel_samsung_tuna-aee8f57a8178f191420529c4f4130f3e086f8cbb.tar.bz2
usb: otg: twl6030-usb: Fix logic for DCP charger disconnect
It was observed that the disconnect of a DCP charger was not handled in the right way. This patch fixes this logic and also sets the otg states correctly when a DCP is connected. Change-Id: I06fcadc2d058e424af721eb934204b7091945d4c Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
Diffstat (limited to 'drivers/usb/otg')
-rw-r--r--drivers/usb/otg/twl6030-usb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/otg/twl6030-usb.c b/drivers/usb/otg/twl6030-usb.c
index 45dc0bd..e3bedec 100644
--- a/drivers/usb/otg/twl6030-usb.c
+++ b/drivers/usb/otg/twl6030-usb.c
@@ -303,6 +303,8 @@ static irqreturn_t twl6030_usb_irq(int irq, void *_twl)
regulator_disable(twl->usb3v3);
status = USB_EVENT_CHARGER;
twl->usb_cinlimit_mA = 1800;
+ twl->otg.state = OTG_STATE_B_IDLE;
+ twl->linkstat = status;
twl->otg.last_event = status;
} else {
regulator_disable(twl->usb3v3);
@@ -315,18 +317,17 @@ static irqreturn_t twl6030_usb_irq(int irq, void *_twl)
status = USB_EVENT_NONE;
twl->linkstat = status;
twl->otg.last_event = status;
+ atomic_notifier_call_chain(&twl->otg.notifier,
+ status, twl->otg.gadget);
if (twl->asleep) {
-
- atomic_notifier_call_chain(&twl->otg.notifier,
- status, twl->otg.gadget);
regulator_disable(twl->usb3v3);
twl->asleep = 0;
}
}
- sysfs_notify(&twl->dev->kobj, NULL, "vbus");
vbus_notify:
+ sysfs_notify(&twl->dev->kobj, NULL, "vbus");
twl->prev_vbus = vbus_state;
return IRQ_HANDLED;
}