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.
27 #include <linux/dma-mapping.h>
29 /*-------------------------------------------------------------------------*/
43 #define CCR_LMW2L 0x5C /* w Local Memory Window 2 LMADRS Low */
44 #define CCR_LMW2H 0x5E /* w Local Memory Window 2 LMADRS High */
45 #define CCR_LMW2BL 0x60 /* w Local Memory Window 2 Base Address Low */
46 #define CCR_LMW2BH 0x62 /* w Local Memory Window 2 Base Address High */
57 /*-------------------------------------------------------------------------*/
66 /*-------------------------------------------------------------------------*/
75 spin_lock_irqsave(&tmio->lock, flags); in tmio_write_pm()
80 tmio_iowrite16(pm, tmio->ccr + CCR_PM); in tmio_write_pm()
81 spin_unlock_irqrestore(&tmio->lock, flags); in tmio_write_pm()
92 switch (ohci->num_ports) { in tmio_stop_hc()
94 dev_err(&dev->dev, "Unsupported amount of ports: %d\n", ohci->num_ports); in tmio_stop_hc()
99 case 2: in tmio_stop_hc()
105 tmio_iowrite8(0, tmio->ccr + CCR_INTC); in tmio_stop_hc()
106 tmio_iowrite8(0, tmio->ccr + CCR_ILME); in tmio_stop_hc()
107 tmio_iowrite16(0, tmio->ccr + CCR_BASE); in tmio_stop_hc()
108 tmio_iowrite16(0, tmio->ccr + CCR_BASE + 2); in tmio_stop_hc()
109 tmio_iowrite16(pm, tmio->ccr + CCR_PM); in tmio_stop_hc()
116 unsigned long base = hcd->rsrc_start; in tmio_start_hc()
119 tmio_iowrite16(base, tmio->ccr + CCR_BASE); in tmio_start_hc()
120 tmio_iowrite16(base >> 16, tmio->ccr + CCR_BASE + 2); in tmio_start_hc()
121 tmio_iowrite8(1, tmio->ccr + CCR_ILME); in tmio_start_hc()
122 tmio_iowrite8(2, tmio->ccr + CCR_INTC); in tmio_start_hc()
124 dev_info(&dev->dev, "revision %d @ 0x%08llx, irq %d\n", in tmio_start_hc()
125 tmio_ioread8(tmio->ccr + CCR_REVID), in tmio_start_hc()
126 (u64) hcd->rsrc_start, hcd->irq); in tmio_start_hc()
138 dev_err(hcd->self.controller, "can't start %s\n", in ohci_tmio_start()
139 hcd->self.bus_name); in ohci_tmio_start()
179 /*-------------------------------------------------------------------------*/
184 const struct mfd_cell *cell = mfd_get_cell(dev); in ohci_hcd_tmio_drv_probe() local
187 struct resource *sram = platform_get_resource(dev, IORESOURCE_MEM, 2); in ohci_hcd_tmio_drv_probe()
195 return -ENODEV; in ohci_hcd_tmio_drv_probe()
197 if (!cell || !regs || !config || !sram) in ohci_hcd_tmio_drv_probe()
198 return -EINVAL; in ohci_hcd_tmio_drv_probe()
203 hcd = usb_create_hcd(&ohci_tmio_hc_driver, &dev->dev, dev_name(&dev->dev)); in ohci_hcd_tmio_drv_probe()
205 ret = -ENOMEM; in ohci_hcd_tmio_drv_probe()
209 hcd->rsrc_start = regs->start; in ohci_hcd_tmio_drv_probe()
210 hcd->rsrc_len = resource_size(regs); in ohci_hcd_tmio_drv_probe()
214 spin_lock_init(&tmio->lock); in ohci_hcd_tmio_drv_probe()
216 tmio->ccr = ioremap(config->start, resource_size(config)); in ohci_hcd_tmio_drv_probe()
217 if (!tmio->ccr) { in ohci_hcd_tmio_drv_probe()
218 ret = -ENOMEM; in ohci_hcd_tmio_drv_probe()
222 hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); in ohci_hcd_tmio_drv_probe()
223 if (!hcd->regs) { in ohci_hcd_tmio_drv_probe()
224 ret = -ENOMEM; in ohci_hcd_tmio_drv_probe()
228 if (cell->enable) { in ohci_hcd_tmio_drv_probe()
229 ret = cell->enable(dev); in ohci_hcd_tmio_drv_probe()
238 ret = usb_hcd_setup_local_mem(hcd, sram->start, sram->start, in ohci_hcd_tmio_drv_probe()
247 device_wakeup_enable(hcd->self.controller); in ohci_hcd_tmio_drv_probe()
255 if (cell->disable) in ohci_hcd_tmio_drv_probe()
256 cell->disable(dev); in ohci_hcd_tmio_drv_probe()
258 iounmap(hcd->regs); in ohci_hcd_tmio_drv_probe()
260 iounmap(tmio->ccr); in ohci_hcd_tmio_drv_probe()
272 const struct mfd_cell *cell = mfd_get_cell(dev); in ohci_hcd_tmio_drv_remove() local
276 if (cell->disable) in ohci_hcd_tmio_drv_remove()
277 cell->disable(dev); in ohci_hcd_tmio_drv_remove()
278 iounmap(hcd->regs); in ohci_hcd_tmio_drv_remove()
279 iounmap(tmio->ccr); in ohci_hcd_tmio_drv_remove()
288 const struct mfd_cell *cell = mfd_get_cell(dev); in ohci_hcd_tmio_drv_suspend() local
296 if (time_before(jiffies, ohci->next_statechange)) in ohci_hcd_tmio_drv_suspend()
298 ohci->next_statechange = jiffies; in ohci_hcd_tmio_drv_suspend()
300 spin_lock_irqsave(&tmio->lock, flags); in ohci_hcd_tmio_drv_suspend()
302 misc = tmio_ioread8(tmio->ccr + CCR_MISC); in ohci_hcd_tmio_drv_suspend()
304 tmio_iowrite8(misc, tmio->ccr + CCR_MISC); in ohci_hcd_tmio_drv_suspend()
306 spin_unlock_irqrestore(&tmio->lock, flags); in ohci_hcd_tmio_drv_suspend()
308 if (cell->suspend) { in ohci_hcd_tmio_drv_suspend()
309 ret = cell->suspend(dev); in ohci_hcd_tmio_drv_suspend()
318 const struct mfd_cell *cell = mfd_get_cell(dev); in ohci_hcd_tmio_drv_resume() local
326 if (time_before(jiffies, ohci->next_statechange)) in ohci_hcd_tmio_drv_resume()
328 ohci->next_statechange = jiffies; in ohci_hcd_tmio_drv_resume()
330 if (cell->resume) { in ohci_hcd_tmio_drv_resume()
331 ret = cell->resume(dev); in ohci_hcd_tmio_drv_resume()
338 spin_lock_irqsave(&tmio->lock, flags); in ohci_hcd_tmio_drv_resume()
340 misc = tmio_ioread8(tmio->ccr + CCR_MISC); in ohci_hcd_tmio_drv_resume()
342 tmio_iowrite8(misc, tmio->ccr + CCR_MISC); in ohci_hcd_tmio_drv_resume()
344 spin_unlock_irqrestore(&tmio->lock, flags); in ohci_hcd_tmio_drv_resume()
362 .name = "tmio-ohci",