diff options
author | Robert Jarzmik <robert.jarzmik@free.fr> | 2016-07-08 16:09:07 -0400 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-08-25 05:13:07 -0400 |
commit | 77e012ac865037e5a227e69a294326b6ce93f9a4 (patch) | |
tree | 423487db5dba85430d02d2a5447342f6b4354f90 | |
parent | 9835a6ef1a96b203278629bbcf5099622070c32b (diff) |
usb: phy: generic: remove the vbus dependency
As the last known user, ie. pxa27x_udc relying on calls to
usb_gadget_xxx() was amended to use the phy notifier, remove a bit the
USB stack adherence.
Actually the driver still uses the gadget API for structures definition,
but the implementation of USB gadget specific function usb_gadget_*() is
not necessary anymore.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-rw-r--r-- | drivers/usb/phy/phy-generic.c | 7 |
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; |