aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/pxa27x_udc.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c
index 11510472ee00..e50419d08996 100644
--- a/drivers/usb/gadget/pxa27x_udc.c
+++ b/drivers/usb/gadget/pxa27x_udc.c
@@ -1623,12 +1623,34 @@ static int pxa_udc_vbus_session(struct usb_gadget *_gadget, int is_active)
1623 return 0; 1623 return 0;
1624} 1624}
1625 1625
1626/**
1627 * pxa_udc_vbus_draw - Called by gadget driver after SET_CONFIGURATION completed
1628 * @_gadget: usb gadget
1629 * @mA: current drawn
1630 *
1631 * Context: !in_interrupt()
1632 *
1633 * Called after a configuration was chosen by a USB host, to inform how much
1634 * current can be drawn by the device from VBus line.
1635 *
1636 * Returns 0 or -EOPNOTSUPP if no transceiver is handling the udc
1637 */
1638static int pxa_udc_vbus_draw(struct usb_gadget *_gadget, unsigned mA)
1639{
1640 struct pxa_udc *udc;
1641
1642 udc = to_gadget_udc(_gadget);
1643 if (udc->transceiver)
1644 return otg_set_power(udc->transceiver, mA);
1645 return -EOPNOTSUPP;
1646}
1647
1626static const struct usb_gadget_ops pxa_udc_ops = { 1648static const struct usb_gadget_ops pxa_udc_ops = {
1627 .get_frame = pxa_udc_get_frame, 1649 .get_frame = pxa_udc_get_frame,
1628 .wakeup = pxa_udc_wakeup, 1650 .wakeup = pxa_udc_wakeup,
1629 .pullup = pxa_udc_pullup, 1651 .pullup = pxa_udc_pullup,
1630 .vbus_session = pxa_udc_vbus_session, 1652 .vbus_session = pxa_udc_vbus_session,
1631 /* current versions must always be self-powered */ 1653 .vbus_draw = pxa_udc_vbus_draw,
1632}; 1654};
1633 1655
1634/** 1656/**