Lines Matching +full:generic +full:- +full:ohci

1 // SPDX-License-Identifier: GPL-1.0+
3 * OHCI HCD (Host Controller Driver) for USB.
6 * (C) Copyright 2000-2005 David Brownell
7 * (C) Copyright 2002 Hewlett-Packard Company
10 * SM501 Bus Glue - based on ohci-omap.c
18 #include <linux/dma-mapping.h>
20 #include <linux/sm501-regs.h>
29 struct device *dev = hcd->self.controller; in ohci_sm501_start()
34 dev_err(dev, "can't start %s", hcd->self.bus_name); in ohci_sm501_start()
41 /*-------------------------------------------------------------------------*/
45 .product_desc = "SM501 OHCI",
49 * generic hardware linkage
86 /*-------------------------------------------------------------------------*/
91 struct device *dev = &pdev->dev; in ohci_hcd_sm501_drv_probe()
103 retval = -ENOENT; in ohci_hcd_sm501_drv_probe()
107 if (!request_mem_region(mem->start, resource_size(mem), pdev->name)) { in ohci_hcd_sm501_drv_probe()
109 retval = -EBUSY; in ohci_hcd_sm501_drv_probe()
117 retval = -ENOENT; in ohci_hcd_sm501_drv_probe()
121 hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev)); in ohci_hcd_sm501_drv_probe()
123 retval = -ENOMEM; in ohci_hcd_sm501_drv_probe()
127 hcd->rsrc_start = res->start; in ohci_hcd_sm501_drv_probe()
128 hcd->rsrc_len = resource_size(res); in ohci_hcd_sm501_drv_probe()
130 if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, pdev->name)) { in ohci_hcd_sm501_drv_probe()
132 retval = -EBUSY; in ohci_hcd_sm501_drv_probe()
136 hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); in ohci_hcd_sm501_drv_probe()
137 if (hcd->regs == NULL) { in ohci_hcd_sm501_drv_probe()
139 retval = -ENXIO; in ohci_hcd_sm501_drv_probe()
146 * by on-chip devices such as the video controller and the usb host. in ohci_hcd_sm501_drv_probe()
153 * fine. This is however not always the case - buffers may be allocated in ohci_hcd_sm501_drv_probe()
154 * using kmalloc() - so the usb core needs to be told that it must copy in ohci_hcd_sm501_drv_probe()
156 * regular memory. A non-null hcd->localmem_pool initialized by in ohci_hcd_sm501_drv_probe()
160 retval = usb_hcd_setup_local_mem(hcd, mem->start, in ohci_hcd_sm501_drv_probe()
161 mem->start - mem->parent->start, in ohci_hcd_sm501_drv_probe()
168 device_wakeup_enable(hcd->self.controller); in ohci_hcd_sm501_drv_probe()
172 sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 1); in ohci_hcd_sm501_drv_probe()
173 sm501_modify_reg(dev->parent, SM501_IRQ_MASK, 1 << 6, 0); in ohci_hcd_sm501_drv_probe()
177 iounmap(hcd->regs); in ohci_hcd_sm501_drv_probe()
179 release_mem_region(hcd->rsrc_start, hcd->rsrc_len); in ohci_hcd_sm501_drv_probe()
183 release_mem_region(mem->start, resource_size(mem)); in ohci_hcd_sm501_drv_probe()
194 iounmap(hcd->regs); in ohci_hcd_sm501_drv_remove()
195 release_mem_region(hcd->rsrc_start, hcd->rsrc_len); in ohci_hcd_sm501_drv_remove()
198 release_mem_region(mem->start, resource_size(mem)); in ohci_hcd_sm501_drv_remove()
202 sm501_modify_reg(pdev->dev.parent, SM501_IRQ_MASK, 0, 1 << 6); in ohci_hcd_sm501_drv_remove()
203 sm501_unit_power(pdev->dev.parent, SM501_GATE_USB_HOST, 0); in ohci_hcd_sm501_drv_remove()
206 /*-------------------------------------------------------------------------*/
211 struct device *dev = &pdev->dev; in ohci_sm501_suspend()
213 struct ohci_hcd *ohci = hcd_to_ohci(hcd); in ohci_sm501_suspend() local
217 if (time_before(jiffies, ohci->next_statechange)) in ohci_sm501_suspend()
219 ohci->next_statechange = jiffies; in ohci_sm501_suspend()
225 sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 0); in ohci_sm501_suspend()
231 struct device *dev = &pdev->dev; in ohci_sm501_resume()
233 struct ohci_hcd *ohci = hcd_to_ohci(hcd); in ohci_sm501_resume() local
235 if (time_before(jiffies, ohci->next_statechange)) in ohci_sm501_resume()
237 ohci->next_statechange = jiffies; in ohci_sm501_resume()
239 sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 1); in ohci_sm501_resume()
248 /*-------------------------------------------------------------------------*/
260 .name = "sm501-usb",
263 MODULE_ALIAS("platform:sm501-usb");