14 #include <linux/module.h>
21 #if defined(CONFIG_OF) && defined(CONFIG_OF_IRQ)
22 #include <linux/slab.h>
31 #include <linux/pci.h>
34 #if defined(CONFIG_OF) && defined(CONFIG_OF_IRQ)
50 unsigned int devflags = 0;
54 drvdata = kzalloc(
sizeof(*drvdata),
GFP_KERNEL);
64 res_len = resource_size(&
memory);
84 of_property_read_u32(dp,
"bus-width", &bus_width);
100 drvdata->rst_gpio = of_get_gpio_flags(dp, 0, &gpio_flags);
101 if (gpio_is_valid(drvdata->rst_gpio)) {
111 drvdata->rst_gpio =
ret;
117 &dev->
dev, dev_name(&dev->
dev),
119 if (IS_ERR(drvdata->hcd)) {
120 ret = PTR_ERR(drvdata->hcd);
128 if (gpio_is_valid(drvdata->rst_gpio))
148 if (gpio_is_valid(drvdata->rst_gpio))
160 .compatible =
"nxp,usb-isp1761",
168 .name =
"nxp-isp1760",
170 .of_match_table = of_isp1760_match,
172 .probe = of_isp1760_probe,
173 .remove = of_isp1760_remove,
185 unsigned int devflags = 0;
223 if (memlength < 0xffff) {
247 if (limit && limit < latency)
257 while ((reg_data != 0xFACE) && retry_count) {
272 if (reg_data != 0xFACE) {
273 dev_err(&dev->
dev,
"scratch register mismatch %x\n", reg_data);
281 #define PLX_INT_CSR_REG 0x68
282 reg_data =
readl(iobase + PLX_INT_CSR_REG);
284 writel(reg_data, iobase + PLX_INT_CSR_REG);
299 pci_set_drvdata(dev, hcd);
311 static void isp1761_pci_remove(
struct pci_dev *dev)
315 hcd = pci_get_drvdata(dev);
325 static void isp1761_pci_shutdown(
struct pci_dev *dev)
343 static struct pci_driver isp1761_pci_driver = {
345 .id_table = isp1760_plx,
346 .probe = isp1761_pci_probe,
347 .remove = isp1761_pci_remove,
348 .shutdown = isp1761_pci_shutdown,
360 unsigned int devflags = 0;
365 pr_warning(
"isp1760: Memory resource not available\n");
369 mem_size = resource_size(mem_res);
371 pr_warning(
"isp1760: Cannot reserve the memory resource\n");
378 pr_warning(
"isp1760: IRQ resource not available\n");
400 &pdev->
dev, dev_name(&pdev->
dev), devflags);
405 pr_warning(
"isp1760: Failed to register the HCD device\n");
410 pr_info(
"ISP1760 USB device initialised\n");
428 mem_size = resource_size(mem_res);
437 .probe = isp1760_plat_probe,
444 static int __init isp1760_init(
void)
453 #if defined(CONFIG_OF) && defined(CONFIG_OF_IRQ)
459 ret = pci_register_driver(&isp1761_pci_driver);
470 static void __exit isp1760_exit(
void)
473 #if defined(CONFIG_OF) && defined(CONFIG_OF_IRQ)