aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/phy/phy-generic.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
index 41b8aff9b925..c14e767a3fbf 100644
--- a/drivers/usb/phy/phy-generic.c
+++ b/drivers/usb/phy/phy-generic.c
@@ -118,8 +118,6 @@ static irqreturn_t nop_gpio_vbus_thread(int irq, void *data)
118 status = USB_EVENT_VBUS; 118 status = USB_EVENT_VBUS;
119 otg->state = OTG_STATE_B_PERIPHERAL; 119 otg->state = OTG_STATE_B_PERIPHERAL;
120 nop->phy.last_event = status; 120 nop->phy.last_event = status;
121 if (otg->gadget)
122 usb_gadget_vbus_connect(otg->gadget);
123 121
124 /* drawing a "unit load" is *always* OK, except for OTG */ 122 /* drawing a "unit load" is *always* OK, except for OTG */
125 nop_set_vbus_draw(nop, 100); 123 nop_set_vbus_draw(nop, 100);
@@ -129,8 +127,6 @@ static irqreturn_t nop_gpio_vbus_thread(int irq, void *data)
129 } else { 127 } else {
130 nop_set_vbus_draw(nop, 0); 128 nop_set_vbus_draw(nop, 0);
131 129
132 if (otg->gadget)
133 usb_gadget_vbus_disconnect(otg->gadget);
134 status = USB_EVENT_NONE; 130 status = USB_EVENT_NONE;
135 otg->state = OTG_STATE_B_IDLE; 131 otg->state = OTG_STATE_B_IDLE;
136 nop->phy.last_event = status; 132 nop->phy.last_event = status;
@@ -187,7 +183,8 @@ static int nop_set_peripheral(struct usb_otg *otg, struct usb_gadget *gadget)
187 183
188 otg->gadget = gadget; 184 otg->gadget = gadget;
189 if (otg->state == OTG_STATE_B_PERIPHERAL) 185 if (otg->state == OTG_STATE_B_PERIPHERAL)
190 usb_gadget_vbus_connect(gadget); 186 atomic_notifier_call_chain(&otg->usb_phy->notifier,
187 USB_EVENT_VBUS, otg->gadget);
191 else 188 else
192 otg->state = OTG_STATE_B_IDLE; 189 otg->state = OTG_STATE_B_IDLE;
193 return 0; 190 return 0;