fix all UDC drivers to use the new interfaces while also enabling compilation of udc.c on Kconfig. Signed-off-by: Felipe Balbi <balbi@xxxxxx> --- drivers/usb/gadget/Makefile | 1 + drivers/usb/gadget/dummy_hcd.c | 98 ++++++----------- drivers/usb/musb/musb_core.c | 4 +- drivers/usb/musb/musb_core.h | 4 +- drivers/usb/musb/musb_gadget.c | 214 ++++++++++------------------------- drivers/usb/musb/musb_gadget_ep0.c | 4 +- drivers/usb/musb/tusb6010.c | 2 +- 7 files changed, 103 insertions(+), 224 deletions(-) diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile index 27283df..d0d51fd 100644 --- a/drivers/usb/gadget/Makefile +++ b/drivers/usb/gadget/Makefile @@ -5,6 +5,7 @@ ifeq ($(CONFIG_USB_GADGET_DEBUG),y) EXTRA_CFLAGS += -DDEBUG endif +obj-$(CONFIG_USB_GADGET) += udc.o obj-$(CONFIG_USB_DUMMY_HCD) += dummy_hcd.o obj-$(CONFIG_USB_NET2280) += net2280.o obj-$(CONFIG_USB_AMD5536UDC) += amd5536udc.o diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index dc65462..4808593 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c @@ -46,6 +46,7 @@ #include <linux/interrupt.h> #include <linux/platform_device.h> #include <linux/usb.h> +#include <linux/usb/udc.h> #include <linux/usb/gadget.h> #include <linux/usb/hcd.h> @@ -160,6 +161,7 @@ struct dummy { */ struct dummy_ep ep [DUMMY_ENDPOINTS]; int address; + struct usb_udc udc; struct usb_gadget gadget; struct usb_gadget_driver *driver; struct dummy_request fifo_req; @@ -294,20 +296,20 @@ set_link_state (struct dummy *dum) (dum->port_status & USB_PORT_STAT_RESET) != 0) { if ((dum->old_status & USB_PORT_STAT_CONNECTION) != 0 && (dum->old_status & USB_PORT_STAT_RESET) == 0 && - dum->driver) { + dum->udc.driver) { stop_activity (dum); spin_unlock (&dum->lock); - dum->driver->disconnect (&dum->gadget); + dum->udc.driver->disconnect (&dum->gadget); spin_lock (&dum->lock); } } else if (dum->active != dum->old_active) { - if (dum->old_active && dum->driver->suspend) { + if (dum->old_active && dum->udc.driver->suspend) { spin_unlock (&dum->lock); - dum->driver->suspend (&dum->gadget); + dum->udc.driver->suspend (&dum->gadget); spin_lock (&dum->lock); - } else if (!dum->old_active && dum->driver->resume) { + } else if (!dum->old_active && dum->udc.driver->resume) { spin_unlock (&dum->lock); - dum->driver->resume (&dum->gadget); + dum->udc.driver->resume (&dum->gadget); spin_lock (&dum->lock); } } @@ -341,7 +343,7 @@ dummy_enable (struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) || desc->bDescriptorType != USB_DT_ENDPOINT) return -EINVAL; dum = ep_to_dummy (ep); - if (!dum->driver || !is_enabled (dum)) + if (!dum->udc.driver || !is_enabled (dum)) return -ESHUTDOWN; max = le16_to_cpu(desc->wMaxPacketSize) & 0x3ff; @@ -518,7 +520,7 @@ dummy_queue (struct usb_ep *_ep, struct usb_request *_req, return -EINVAL; dum = ep_to_dummy (ep); - if (!dum->driver || !is_enabled (dum)) + if (!dum->udc.driver || !is_enabled (dum)) return -ESHUTDOWN; #if 0 @@ -571,7 +573,7 @@ static int dummy_dequeue (struct usb_ep *_ep, struct usb_request *_req) ep = usb_ep_to_dummy_ep (_ep); dum = ep_to_dummy (ep); - if (!dum->driver) + if (!dum->udc.driver) return -ESHUTDOWN; local_irq_save (flags); @@ -606,7 +608,7 @@ dummy_set_halt_and_wedge(struct usb_ep *_ep, int value, int wedged) return -EINVAL; ep = usb_ep_to_dummy_ep (_ep); dum = ep_to_dummy (ep); - if (!dum->driver) + if (!dum->udc.driver) return -ESHUTDOWN; if (!value) ep->halted = ep->wedged = 0; @@ -710,11 +712,16 @@ static int dummy_pullup (struct usb_gadget *_gadget, int value) return 0; } +static int dummy_gadget_start(struct usb_gadget *driver); +static void dummy_gadget_stop(struct usb_gadget *driver); + static const struct usb_gadget_ops dummy_ops = { .get_frame = dummy_g_get_frame, .wakeup = dummy_wakeup, .set_selfpowered = dummy_set_selfpowered, .pullup = dummy_pullup, + .start = dummy_gadget_start, + .stop = dummy_gadget_stop, }; /*-------------------------------------------------------------------------*/ @@ -725,9 +732,9 @@ show_function (struct device *dev, struct device_attribute *attr, char *buf) { struct dummy *dum = gadget_dev_to_dummy (dev); - if (!dum->driver || !dum->driver->function) + if (!dum->udc.driver || !dum->udc.driver->function) return 0; - return scnprintf (buf, PAGE_SIZE, "%s\n", dum->driver->function); + return scnprintf (buf, PAGE_SIZE, "%s\n", dum->udc.driver->function); } static DEVICE_ATTR (function, S_IRUGO, show_function, NULL); @@ -747,19 +754,14 @@ static DEVICE_ATTR (function, S_IRUGO, show_function, NULL); * for each driver that registers: just add to a big root hub. */ -int -usb_gadget_register_driver (struct usb_gadget_driver *driver) +static int +dummy_gadget_start(struct usb_gadget *gadget) { struct dummy *dum = the_controller; - int retval, i; + int i; if (!dum) return -EINVAL; - if (dum->driver) - return -EBUSY; - if (!driver->bind || !driver->setup - || driver->speed == USB_SPEED_UNKNOWN) - return -EINVAL; /* * SLAVE side init ... the layer above hardware, which @@ -786,23 +788,11 @@ usb_gadget_register_driver (struct usb_gadget_driver *driver) INIT_LIST_HEAD (&ep->queue); } - dum->gadget.ep0 = &dum->ep [0].ep; + gadget->ep0 = &dum->ep [0].ep; dum->ep [0].ep.maxpacket = 64; list_del_init (&dum->ep [0].ep.ep_list); INIT_LIST_HEAD(&dum->fifo_req.queue); - driver->driver.bus = NULL; - dum->driver = driver; - dum->gadget.dev.driver = &driver->driver; - dev_dbg (udc_dev(dum), "binding gadget driver '%s'\n", - driver->driver.name); - retval = driver->bind(&dum->gadget); - if (retval) { - dum->driver = NULL; - dum->gadget.dev.driver = NULL; - return retval; - } - /* khubd will enumerate this in a while */ spin_lock_irq (&dum->lock); dum->pullup = 1; @@ -812,40 +802,28 @@ usb_gadget_register_driver (struct usb_gadget_driver *driver) usb_hcd_poll_rh_status (dummy_to_hcd (dum)); return 0; } -EXPORT_SYMBOL (usb_gadget_register_driver); -int -usb_gadget_unregister_driver (struct usb_gadget_driver *driver) +static void +dummy_gadget_stop(struct usb_gadget *gadget) { struct dummy *dum = the_controller; unsigned long flags; if (!dum) - return -ENODEV; - if (!driver || driver != dum->driver || !driver->unbind) - return -EINVAL; - - dev_dbg (udc_dev(dum), "unregister gadget driver '%s'\n", - driver->driver.name); + return; spin_lock_irqsave (&dum->lock, flags); dum->pullup = 0; set_link_state (dum); spin_unlock_irqrestore (&dum->lock, flags); - driver->unbind (&dum->gadget); - dum->gadget.dev.driver = NULL; - dum->driver = NULL; - spin_lock_irqsave (&dum->lock, flags); dum->pullup = 0; set_link_state (dum); spin_unlock_irqrestore (&dum->lock, flags); usb_hcd_poll_rh_status (dummy_to_hcd (dum)); - return 0; } -EXPORT_SYMBOL (usb_gadget_unregister_driver); #undef is_enabled @@ -859,32 +837,22 @@ int net2280_set_fifo_mode (struct usb_gadget *gadget, int mode) EXPORT_SYMBOL (net2280_set_fifo_mode); -/* The gadget structure is stored inside the hcd structure and will be - * released along with it. */ -static void -dummy_gadget_release (struct device *dev) -{ - struct dummy *dum = gadget_dev_to_dummy (dev); - - usb_put_hcd (dummy_to_hcd (dum)); -} - static int dummy_udc_probe (struct platform_device *pdev) { struct dummy *dum = the_controller; int rc; + dum->udc.name = gadget_name; dum->gadget.name = gadget_name; dum->gadget.ops = &dummy_ops; dum->gadget.is_dualspeed = 1; + dum->udc.gadget = &dum->gadget; /* maybe claim OTG support, though we won't complete HNP */ dum->gadget.is_otg = (dummy_to_hcd(dum)->self.otg_port != 0); dev_set_name(&dum->gadget.dev, "gadget"); - dum->gadget.dev.parent = &pdev->dev; - dum->gadget.dev.release = dummy_gadget_release; - rc = device_register (&dum->gadget.dev); + rc = usb_add_udc(&pdev->dev, &dum->udc); if (rc < 0) return rc; @@ -903,7 +871,7 @@ static int dummy_udc_remove (struct platform_device *pdev) platform_set_drvdata (pdev, NULL); device_remove_file (&dum->gadget.dev, &dev_attr_function); - device_unregister (&dum->gadget.dev); + usb_del_udc(&dum->udc); return 0; } @@ -1443,7 +1411,7 @@ restart: */ if (value > 0) { spin_unlock (&dum->lock); - value = dum->driver->setup (&dum->gadget, + value = dum->udc.driver->setup (&dum->gadget, &setup); spin_lock (&dum->lock); @@ -1640,7 +1608,7 @@ static int dummy_hub_control ( if (dum->pullup) { dum->port_status |= USB_PORT_STAT_ENABLE; /* give it the best speed we agree on */ - dum->gadget.speed = dum->driver->speed; + dum->gadget.speed = dum->udc.driver->speed; dum->gadget.ep0->maxpacket = 64; switch (dum->gadget.speed) { case USB_SPEED_HIGH: @@ -1841,7 +1809,7 @@ static void dummy_stop (struct usb_hcd *hcd) dum = hcd_to_dummy (hcd); device_remove_file (dummy_dev(dum), &dev_attr_urbs); - usb_gadget_unregister_driver (dum->driver); + usb_gadget_unregister_driver (dum->udc.driver); dev_info (dummy_dev(dum), "stopped\n"); } diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 540c766..9f26fc0 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -115,7 +115,7 @@ #define TA_WAIT_BCON(m) max_t(int, (m)->a_wait_bcon, OTG_TIME_A_WAIT_BCON) -unsigned musb_debug; +unsigned musb_debug = 5; module_param_named(debug, musb_debug, uint, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(debug, "Debug message level. Default = 0"); @@ -1584,7 +1584,7 @@ irqreturn_t musb_interrupt(struct musb *musb) #ifdef CONFIG_USB_GADGET_MUSB_HDRC if (is_otg_enabled(musb) || is_peripheral_enabled(musb)) - if (!musb->gadget_driver) { + if (!musb->udc.driver) { DBG(5, "No gadget driver loaded\n"); return IRQ_HANDLED; } diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index 91d6779..f35e457 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -42,6 +42,7 @@ #include <linux/timer.h> #include <linux/clk.h> #include <linux/device.h> +#include <linux/usb/udc.h> #include <linux/usb/ch9.h> #include <linux/usb/gadget.h> #include <linux/usb.h> @@ -446,8 +447,9 @@ struct musb { u8 test_mode_nr; u16 ackpend; /* ep0 */ enum musb_g_ep0_state ep0_state; + + struct usb_udc udc; struct usb_gadget g; /* the gadget */ - struct usb_gadget_driver *gadget_driver; /* its driver */ #endif struct musb_hdrc_config *config; diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 6fca870..6ad3f2b 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -47,6 +47,8 @@ #include "musb_core.h" +static int musb_gadget_start(struct usb_gadget *gadget); +static void musb_gadget_stop(struct usb_gadget *gadget); /* MUSB PERIPHERAL status 3-mar-2006: * @@ -1499,7 +1501,7 @@ static void musb_pullup(struct musb *musb, int is_on) /* FIXME if on, HdrcStart; if off, HdrcStop */ DBG(3, "gadget %s D+ pullup %s\n", - musb->gadget_driver->function, is_on ? "on" : "off"); + musb->udc.driver->function, is_on ? "on" : "off"); musb_writeb(musb->mregs, MUSB_POWER, power); } @@ -1552,6 +1554,8 @@ static const struct usb_gadget_ops musb_gadget_operations = { /* .vbus_session = musb_gadget_vbus_session, */ .vbus_draw = musb_gadget_vbus_draw, .pullup = musb_gadget_pullup, + .start = musb_gadget_start, + .stop = musb_gadget_stop, }; /* ----------------------------------------------------------------------- */ @@ -1564,13 +1568,6 @@ static const struct usb_gadget_ops musb_gadget_operations = { */ static struct musb *the_gadget; -static void musb_gadget_release(struct device *dev) -{ - /* kref_put(WHAT) */ - dev_dbg(dev, "%s\n", __func__); -} - - static void __init init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) { @@ -1656,13 +1653,9 @@ int __init musb_gadget_setup(struct musb *musb) musb->g.ops = &musb_gadget_operations; musb->g.is_dualspeed = 1; musb->g.speed = USB_SPEED_UNKNOWN; - - /* this "gadget" abstracts/virtualizes the controller */ - dev_set_name(&musb->g.dev, "gadget"); - musb->g.dev.parent = musb->controller; - musb->g.dev.dma_mask = musb->controller->dma_mask; - musb->g.dev.release = musb_gadget_release; musb->g.name = musb_driver_name; + musb->udc.name = musb_driver_name; + musb->udc.gadget = &musb->g; if (is_otg_enabled(musb)) musb->g.is_otg = 1; @@ -1672,9 +1665,10 @@ int __init musb_gadget_setup(struct musb *musb) musb->is_active = 0; musb_platform_try_idle(musb, 0); - status = device_register(&musb->g.dev); + status = usb_add_udc(musb->controller, &musb->udc); if (status != 0) the_gadget = NULL; + return status; } @@ -1683,7 +1677,7 @@ void musb_gadget_cleanup(struct musb *musb) if (musb != the_gadget) return; - device_unregister(&musb->g.dev); + usb_del_udc(&musb->udc); the_gadget = NULL; } @@ -1698,132 +1692,68 @@ void musb_gadget_cleanup(struct musb *musb) * @param driver the gadget driver * @return <0 if error, 0 if everything is fine */ -int usb_gadget_register_driver(struct usb_gadget_driver *driver) +static int musb_gadget_start(struct usb_gadget *gadget) { - int retval; + struct musb *musb = gadget_to_musb(gadget); unsigned long flags; - struct musb *musb = the_gadget; - - if (!driver - || driver->speed != USB_SPEED_HIGH - || !driver->bind - || !driver->setup) - return -EINVAL; - - /* driver must be initialized to support peripheral mode */ - if (!musb) { - DBG(1, "%s, no dev??\n", __func__); - return -ENODEV; - } + int retval = 0; - DBG(3, "registering driver %s\n", driver->function); spin_lock_irqsave(&musb->lock, flags); - if (musb->gadget_driver) { - DBG(1, "%s is already bound to %s\n", - musb_driver_name, - musb->gadget_driver->driver.name); - retval = -EBUSY; - } else { - musb->gadget_driver = driver; - musb->g.dev.driver = &driver->driver; - driver->driver.bus = NULL; - musb->softconnect = 1; - retval = 0; - } - - spin_unlock_irqrestore(&musb->lock, flags); + otg_set_peripheral(musb->xceiv, gadget); + musb->xceiv->state = OTG_STATE_B_IDLE; + musb->is_active = 1; - if (retval == 0) { - retval = driver->bind(&musb->g); - if (retval != 0) { - DBG(3, "bind to driver %s failed --> %d\n", - driver->driver.name, retval); - musb->gadget_driver = NULL; - musb->g.dev.driver = NULL; - } + /* FIXME this ignores the softconnect flag. Drivers are + * allowed hold the peripheral inactive until for example + * userspace hooks up printer hardware or DSP codecs, so + * hosts only see fully functional devices. + */ - spin_lock_irqsave(&musb->lock, flags); + if (!is_otg_enabled(musb)) + musb_start(musb); - otg_set_peripheral(musb->xceiv, &musb->g); - musb->xceiv->state = OTG_STATE_B_IDLE; - musb->is_active = 1; + if (is_otg_enabled(musb)) { + DBG(3, "OTG startup...\n"); - /* FIXME this ignores the softconnect flag. Drivers are - * allowed hold the peripheral inactive until for example - * userspace hooks up printer hardware or DSP codecs, so - * hosts only see fully functional devices. + /* REVISIT: funcall to other code, which also + * handles power budgeting ... this way also + * ensures HdrcStart is indirectly called. */ - - if (!is_otg_enabled(musb)) - musb_start(musb); - - otg_set_peripheral(musb->xceiv, &musb->g); - - spin_unlock_irqrestore(&musb->lock, flags); - - if (is_otg_enabled(musb)) { - DBG(3, "OTG startup...\n"); - - /* REVISIT: funcall to other code, which also - * handles power budgeting ... this way also - * ensures HdrcStart is indirectly called. - */ - retval = usb_add_hcd(musb_to_hcd(musb), -1, 0); - if (retval < 0) { - DBG(1, "add_hcd failed, %d\n", retval); - spin_lock_irqsave(&musb->lock, flags); - otg_set_peripheral(musb->xceiv, NULL); - musb->gadget_driver = NULL; - musb->g.dev.driver = NULL; - spin_unlock_irqrestore(&musb->lock, flags); - } + retval = usb_add_hcd(musb_to_hcd(musb), -1, 0); + if (retval < 0) { + DBG(1, "add_hcd failed, %d\n", retval); + otg_set_peripheral(musb->xceiv, NULL); } } + spin_unlock_irqrestore(&musb->lock, flags); + return retval; } -EXPORT_SYMBOL(usb_gadget_register_driver); -static void stop_activity(struct musb *musb, struct usb_gadget_driver *driver) +static void stop_activity(struct musb *musb) { int i; struct musb_hw_ep *hw_ep; - /* don't disconnect if it's not connected */ - if (musb->g.speed == USB_SPEED_UNKNOWN) - driver = NULL; - else - musb->g.speed = USB_SPEED_UNKNOWN; - - /* deactivate the hardware */ - if (musb->softconnect) { - musb->softconnect = 0; - musb_pullup(musb, 0); - } musb_stop(musb); /* killing any outstanding requests will quiesce the driver; * then report disconnect */ - if (driver) { - for (i = 0, hw_ep = musb->endpoints; - i < musb->nr_endpoints; - i++, hw_ep++) { - musb_ep_select(musb->mregs, i); - if (hw_ep->is_shared_fifo /* || !epnum */) { + for (i = 0, hw_ep = musb->endpoints; + i < musb->nr_endpoints; + i++, hw_ep++) { + musb_ep_select(musb->mregs, i); + if (hw_ep->is_shared_fifo /* || !epnum */) { + nuke(&hw_ep->ep_in, -ESHUTDOWN); + } else { + if (hw_ep->max_packet_sz_tx) nuke(&hw_ep->ep_in, -ESHUTDOWN); - } else { - if (hw_ep->max_packet_sz_tx) - nuke(&hw_ep->ep_in, -ESHUTDOWN); - if (hw_ep->max_packet_sz_rx) - nuke(&hw_ep->ep_out, -ESHUTDOWN); - } + if (hw_ep->max_packet_sz_rx) + nuke(&hw_ep->ep_out, -ESHUTDOWN); } - - spin_unlock(&musb->lock); - driver->disconnect(&musb->g); - spin_lock(&musb->lock); } } @@ -1833,14 +1763,10 @@ static void stop_activity(struct musb *musb, struct usb_gadget_driver *driver) * * @param driver the gadget driver to unregister */ -int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) +static void musb_gadget_stop(struct usb_gadget *gadget) { + struct musb *musb = gadget_to_musb(gadget); unsigned long flags; - int retval = 0; - struct musb *musb = the_gadget; - - if (!driver || !driver->unbind || !musb) - return -EINVAL; /* REVISIT always use otg_set_peripheral() here too; * this needs to shut down the OTG engine. @@ -1852,40 +1778,22 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) musb_hnp_stop(musb); #endif - if (musb->gadget_driver == driver) { - - (void) musb_gadget_vbus_draw(&musb->g, 0); - - musb->xceiv->state = OTG_STATE_UNDEFINED; - stop_activity(musb, driver); - otg_set_peripheral(musb->xceiv, NULL); - - DBG(3, "unregistering driver %s\n", driver->function); - spin_unlock_irqrestore(&musb->lock, flags); - driver->unbind(&musb->g); - spin_lock_irqsave(&musb->lock, flags); - - musb->gadget_driver = NULL; - musb->g.dev.driver = NULL; + musb->xceiv->state = OTG_STATE_UNDEFINED; + stop_activity(musb); + otg_set_peripheral(musb->xceiv, NULL); - musb->is_active = 0; - musb_platform_try_idle(musb, 0); - } else - retval = -EINVAL; + musb->is_active = 0; + musb_platform_try_idle(musb, 0); spin_unlock_irqrestore(&musb->lock, flags); - if (is_otg_enabled(musb) && retval == 0) { + if (is_otg_enabled(musb)) { usb_remove_hcd(musb_to_hcd(musb)); /* FIXME we need to be able to register another * gadget driver here and have everything work; * that currently misbehaves. */ } - - return retval; } -EXPORT_SYMBOL(usb_gadget_unregister_driver); - /* ----------------------------------------------------------------------- */ @@ -1900,9 +1808,9 @@ void musb_g_resume(struct musb *musb) case OTG_STATE_B_WAIT_ACON: case OTG_STATE_B_PERIPHERAL: musb->is_active = 1; - if (musb->gadget_driver && musb->gadget_driver->resume) { + if (musb->udc.driver && musb->udc.driver->resume) { spin_unlock(&musb->lock); - musb->gadget_driver->resume(&musb->g); + musb->udc.driver->resume(&musb->g); spin_lock(&musb->lock); } break; @@ -1927,9 +1835,9 @@ void musb_g_suspend(struct musb *musb) break; case OTG_STATE_B_PERIPHERAL: musb->is_suspended = 1; - if (musb->gadget_driver && musb->gadget_driver->suspend) { + if (musb->udc.driver && musb->udc.driver->suspend) { spin_unlock(&musb->lock); - musb->gadget_driver->suspend(&musb->g); + musb->udc.driver->suspend(&musb->g); spin_lock(&musb->lock); } break; @@ -1963,9 +1871,9 @@ void musb_g_disconnect(struct musb *musb) (void) musb_gadget_vbus_draw(&musb->g, 0); musb->g.speed = USB_SPEED_UNKNOWN; - if (musb->gadget_driver && musb->gadget_driver->disconnect) { + if (musb->udc.driver && musb->udc.driver->disconnect) { spin_unlock(&musb->lock); - musb->gadget_driver->disconnect(&musb->g); + musb->udc.driver->disconnect(&musb->g); spin_lock(&musb->lock); } @@ -2007,8 +1915,8 @@ __acquires(musb->lock) (devctl & MUSB_DEVCTL_BDEVICE) ? "B-Device" : "A-Device", musb_readb(mbase, MUSB_FADDR), - musb->gadget_driver - ? musb->gadget_driver->driver.name + musb->udc.driver + ? musb->udc.driver->driver.name : NULL ); diff --git a/drivers/usb/musb/musb_gadget_ep0.c b/drivers/usb/musb/musb_gadget_ep0.c index 59bef8f..d7d07f0 100644 --- a/drivers/usb/musb/musb_gadget_ep0.c +++ b/drivers/usb/musb/musb_gadget_ep0.c @@ -640,10 +640,10 @@ __releases(musb->lock) __acquires(musb->lock) { int retval; - if (!musb->gadget_driver) + if (!musb->udc.driver) return -EOPNOTSUPP; spin_unlock(&musb->lock); - retval = musb->gadget_driver->setup(&musb->g, ctrlrequest); + retval = musb->udc.driver->setup(&musb->g, ctrlrequest); spin_lock(&musb->lock); return retval; } diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 3c48e77..010fab5 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -444,7 +444,7 @@ static void musb_do_idle(unsigned long _musb) goto done; #ifdef CONFIG_USB_GADGET_MUSB_HDRC - if (is_peripheral_enabled(musb) && !musb->gadget_driver) + if (is_peripheral_enabled(musb) && !musb->udc.driver) wakeups = 0; else { wakeups = TUSB_PRCM_WHOSTDISCON -- 1.7.3.rc0.35.g8ac8c -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html