kmem_cache_destroy(urb_listitem_cachep);
}
- struct usb_hcd *isp1760_register(phys_addr_t res_start, resource_size_t res_len,
- int irq, unsigned long irqflags,
- int rst_gpio,
- struct device *dev, const char *busname,
- unsigned int devflags)
+ int isp1760_hcd_register(struct isp1760_hcd *priv, void __iomem *regs,
+ struct resource *mem, int irq, unsigned long irqflags,
+ struct device *dev)
{
struct usb_hcd *hcd;
- struct isp1760_hcd *priv;
int ret;
- if (usb_disabled())
- return ERR_PTR(-ENODEV);
-
- /* prevent usb-core allocating DMA pages */
- dev->dma_mask = NULL;
-
hcd = usb_create_hcd(&isp1760_hc_driver, dev, dev_name(dev));
if (!hcd)
- return ERR_PTR(-ENOMEM);
+ return -ENOMEM;
+
+ *(struct isp1760_hcd **)hcd->hcd_priv = priv;
+
+ priv->hcd = hcd;
- priv = hcd_to_priv(hcd);
- priv->devflags = devflags;
- priv->rst_gpio = rst_gpio;
init_memory(priv);
- hcd->regs = ioremap(res_start, res_len);
- if (!hcd->regs) {
- ret = -EIO;
- goto err_put;
- }
hcd->irq = irq;
- hcd->rsrc_start = res_start;
- hcd->rsrc_len = res_len;
+ hcd->regs = regs;
+ hcd->rsrc_start = mem->start;
+ hcd->rsrc_len = resource_size(mem);
+ /* This driver doesn't support wakeup requests */
+ hcd->cant_recv_wakeups = 1;
+
ret = usb_add_hcd(hcd, irq, irqflags);
if (ret)
- goto err_unmap;
+ goto error;
+
device_wakeup_enable(hcd->self.controller);
- return hcd;
+ return 0;
- err_unmap:
- iounmap(hcd->regs);
+ error:
+ usb_put_hcd(hcd);
+ return ret;
+ }
- err_put:
- usb_put_hcd(hcd);
+ void isp1760_hcd_unregister(struct isp1760_hcd *priv)
+ {
+ if (!priv->hcd)
+ return;
- return ERR_PTR(ret);
+ usb_remove_hcd(priv->hcd);
+ usb_put_hcd(priv->hcd);
}
-
- MODULE_DESCRIPTION("Driver for the ISP1760 USB-controller from NXP");
- MODULE_AUTHOR("Sebastian Siewior <bigeasy@linuxtronix.de>");
- MODULE_LICENSE("GPL v2");