static int ohci_hcd_at91_drv_resume(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); if (device_may_wakeup(&pdev->dev)) disable_irq_wake(hcd->irq); if (!clocked) at91_start_clock(); return 0; }
static int at91_ohci_probe(struct device_d *dev) { int ret; struct resource *io; struct ohci_at91_priv *ohci_at91 = xzalloc(sizeof(*ohci_at91)); dev->priv = ohci_at91; ohci_at91->dev = dev; if (dev->device_node) { ret = at91_ohci_probe_dt(dev); if (ret < 0) return ret; } io = dev_get_resource(dev, IORESOURCE_MEM, 0); if (IS_ERR(io)) { dev_err(dev, "Failed to get IORESOURCE_MEM\n"); return PTR_ERR(io); } ohci_at91->regs = IOMEM(io->start); ohci_at91->iclk = clk_get(dev, "ohci_clk"); if (IS_ERR(ohci_at91->iclk)) { dev_err(dev, "Failed to get 'ohci_clk'\n"); return PTR_ERR(ohci_at91->iclk); } ohci_at91->fclk = clk_get(dev, "uhpck"); if (IS_ERR(ohci_at91->fclk)) { dev_err(dev, "Failed to get 'uhpck'\n"); return PTR_ERR(ohci_at91->fclk); } /* * Start the USB clocks. */ ret = at91_start_clock(ohci_at91); if (ret < 0) return ret; /* * The USB host controller must remain in reset. */ writel(0, &ohci_at91->regs->control); add_generic_device("ohci", DEVICE_ID_DYNAMIC, NULL, io->start, resource_size(io), IORESOURCE_MEM, NULL); return 0; }
static void at91_start_hc(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct ohci_regs __iomem *regs = hcd->regs; dev_dbg(&pdev->dev, "start\n"); /* * Start the USB clocks. */ at91_start_clock(); /* * The USB host controller must remain in reset. */ writel(0, ®s->control); }
static int at91_ohci_probe(struct device_d *dev) { struct ohci_regs __iomem *regs = (struct ohci_regs __iomem *)dev->resource[0].start; iclk = clk_get(NULL, "ohci_clk"); fclk = clk_get(NULL, "uhpck"); /* * Start the USB clocks. */ at91_start_clock(); /* * The USB host controller must remain in reset. */ writel(0, ®s->control); add_generic_device("ohci", -1, NULL, dev->resource[0].start, dev->resource[0].size, IORESOURCE_MEM, NULL); return 0; }