Lines Matching +full:2 +full:- +full:cell
1 // SPDX-License-Identifier: GPL-2.0
6 *(C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net>
7 *(C) Copyright 2002 Hewlett-Packard Company
10 * (C) Copyright 2005 Chris Humbert <mahadri-usb@drigon.com>
21 * usb-ohci-tc6393.c(C) Copyright 2004 Lineo Solutions, Inc.
32 #include <linux/dma-mapping.h>
34 /*-------------------------------------------------------------------------*/
48 #define CCR_LMW2L 0x5C /* w Local Memory Window 2 LMADRS Low */
49 #define CCR_LMW2H 0x5E /* w Local Memory Window 2 LMADRS High */
50 #define CCR_LMW2BL 0x60 /* w Local Memory Window 2 Base Address Low */
51 #define CCR_LMW2BH 0x62 /* w Local Memory Window 2 Base Address High */
62 /*-------------------------------------------------------------------------*/
71 /*-------------------------------------------------------------------------*/
80 spin_lock_irqsave(&tmio->lock, flags); in tmio_write_pm()
85 tmio_iowrite16(pm, tmio->ccr + CCR_PM); in tmio_write_pm()
86 spin_unlock_irqrestore(&tmio->lock, flags); in tmio_write_pm()
97 switch (ohci->num_ports) { in tmio_stop_hc()
99 dev_err(&dev->dev, "Unsupported amount of ports: %d\n", ohci->num_ports); in tmio_stop_hc()
104 case 2: in tmio_stop_hc()
110 tmio_iowrite8(0, tmio->ccr + CCR_INTC); in tmio_stop_hc()
111 tmio_iowrite8(0, tmio->ccr + CCR_ILME); in tmio_stop_hc()
112 tmio_iowrite16(0, tmio->ccr + CCR_BASE); in tmio_stop_hc()
113 tmio_iowrite16(0, tmio->ccr + CCR_BASE + 2); in tmio_stop_hc()
114 tmio_iowrite16(pm, tmio->ccr + CCR_PM); in tmio_stop_hc()
121 unsigned long base = hcd->rsrc_start; in tmio_start_hc()
124 tmio_iowrite16(base, tmio->ccr + CCR_BASE); in tmio_start_hc()
125 tmio_iowrite16(base >> 16, tmio->ccr + CCR_BASE + 2); in tmio_start_hc()
126 tmio_iowrite8(1, tmio->ccr + CCR_ILME); in tmio_start_hc()
127 tmio_iowrite8(2, tmio->ccr + CCR_INTC); in tmio_start_hc()
129 dev_info(&dev->dev, "revision %d @ 0x%08llx, irq %d\n", in tmio_start_hc()
130 tmio_ioread8(tmio->ccr + CCR_REVID), in tmio_start_hc()
131 (u64) hcd->rsrc_start, hcd->irq); in tmio_start_hc()
143 dev_err(hcd->self.controller, "can't start %s\n", in ohci_tmio_start()
144 hcd->self.bus_name); in ohci_tmio_start()
184 /*-------------------------------------------------------------------------*/
189 const struct mfd_cell *cell = mfd_get_cell(dev); in ohci_hcd_tmio_drv_probe() local
192 struct resource *sram = platform_get_resource(dev, IORESOURCE_MEM, 2); in ohci_hcd_tmio_drv_probe()
200 return -ENODEV; in ohci_hcd_tmio_drv_probe()
202 if (!cell) in ohci_hcd_tmio_drv_probe()
203 return -EINVAL; in ohci_hcd_tmio_drv_probe()
208 hcd = usb_create_hcd(&ohci_tmio_hc_driver, &dev->dev, dev_name(&dev->dev)); in ohci_hcd_tmio_drv_probe()
210 ret = -ENOMEM; in ohci_hcd_tmio_drv_probe()
214 hcd->rsrc_start = regs->start; in ohci_hcd_tmio_drv_probe()
215 hcd->rsrc_len = resource_size(regs); in ohci_hcd_tmio_drv_probe()
219 spin_lock_init(&tmio->lock); in ohci_hcd_tmio_drv_probe()
221 tmio->ccr = ioremap(config->start, resource_size(config)); in ohci_hcd_tmio_drv_probe()
222 if (!tmio->ccr) { in ohci_hcd_tmio_drv_probe()
223 ret = -ENOMEM; in ohci_hcd_tmio_drv_probe()
227 hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); in ohci_hcd_tmio_drv_probe()
228 if (!hcd->regs) { in ohci_hcd_tmio_drv_probe()
229 ret = -ENOMEM; in ohci_hcd_tmio_drv_probe()
233 if (cell->enable) { in ohci_hcd_tmio_drv_probe()
234 ret = cell->enable(dev); in ohci_hcd_tmio_drv_probe()
243 ret = usb_hcd_setup_local_mem(hcd, sram->start, sram->start, in ohci_hcd_tmio_drv_probe()
252 device_wakeup_enable(hcd->self.controller); in ohci_hcd_tmio_drv_probe()
260 if (cell->disable) in ohci_hcd_tmio_drv_probe()
261 cell->disable(dev); in ohci_hcd_tmio_drv_probe()
263 iounmap(hcd->regs); in ohci_hcd_tmio_drv_probe()
265 iounmap(tmio->ccr); in ohci_hcd_tmio_drv_probe()
277 const struct mfd_cell *cell = mfd_get_cell(dev); in ohci_hcd_tmio_drv_remove() local
281 if (cell->disable) in ohci_hcd_tmio_drv_remove()
282 cell->disable(dev); in ohci_hcd_tmio_drv_remove()
283 iounmap(hcd->regs); in ohci_hcd_tmio_drv_remove()
284 iounmap(tmio->ccr); in ohci_hcd_tmio_drv_remove()
293 const struct mfd_cell *cell = mfd_get_cell(dev); in ohci_hcd_tmio_drv_suspend() local
301 if (time_before(jiffies, ohci->next_statechange)) in ohci_hcd_tmio_drv_suspend()
303 ohci->next_statechange = jiffies; in ohci_hcd_tmio_drv_suspend()
305 spin_lock_irqsave(&tmio->lock, flags); in ohci_hcd_tmio_drv_suspend()
307 misc = tmio_ioread8(tmio->ccr + CCR_MISC); in ohci_hcd_tmio_drv_suspend()
309 tmio_iowrite8(misc, tmio->ccr + CCR_MISC); in ohci_hcd_tmio_drv_suspend()
311 spin_unlock_irqrestore(&tmio->lock, flags); in ohci_hcd_tmio_drv_suspend()
313 if (cell->suspend) { in ohci_hcd_tmio_drv_suspend()
314 ret = cell->suspend(dev); in ohci_hcd_tmio_drv_suspend()
323 const struct mfd_cell *cell = mfd_get_cell(dev); in ohci_hcd_tmio_drv_resume() local
331 if (time_before(jiffies, ohci->next_statechange)) in ohci_hcd_tmio_drv_resume()
333 ohci->next_statechange = jiffies; in ohci_hcd_tmio_drv_resume()
335 if (cell->resume) { in ohci_hcd_tmio_drv_resume()
336 ret = cell->resume(dev); in ohci_hcd_tmio_drv_resume()
343 spin_lock_irqsave(&tmio->lock, flags); in ohci_hcd_tmio_drv_resume()
345 misc = tmio_ioread8(tmio->ccr + CCR_MISC); in ohci_hcd_tmio_drv_resume()
347 tmio_iowrite8(misc, tmio->ccr + CCR_MISC); in ohci_hcd_tmio_drv_resume()
349 spin_unlock_irqrestore(&tmio->lock, flags); in ohci_hcd_tmio_drv_resume()
367 .name = "tmio-ohci",