X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fusb%2Fhost%2Fisp1760-if.c;h=051ef7b6bdc640f99e0e17f2079b3929e73cab6f;hb=2a77c8144992e21367cc15956b0ff295f1112c85;hp=73fb2a38f1e40dd594549bd6d797ae6eba2a1216;hpb=a815752ac0ffdb910e92958d41d28f4fb28e5296;p=linux-2.6 diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c index 73fb2a38f1..051ef7b6bd 100644 --- a/drivers/usb/host/isp1760-if.c +++ b/drivers/usb/host/isp1760-if.c @@ -35,13 +35,15 @@ static int of_isp1760_probe(struct of_device *dev, int virq; u64 res_len; int ret; + const unsigned int *prop; + unsigned int devflags = 0; ret = of_address_to_resource(dp, 0, &memory); if (ret) return -ENXIO; res = request_mem_region(memory.start, memory.end - memory.start + 1, - dev->dev.bus_id); + dev_name(&dev->dev)); if (!res) return -EBUSY; @@ -55,8 +57,32 @@ static int of_isp1760_probe(struct of_device *dev, virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size); + if (of_device_is_compatible(dp, "nxp,usb-isp1761")) + devflags |= ISP1760_FLAG_ISP1761; + + if (of_get_property(dp, "port1-disable", NULL) != NULL) + devflags |= ISP1760_FLAG_PORT1_DIS; + + /* Some systems wire up only 16 of the 32 data lines */ + prop = of_get_property(dp, "bus-width", NULL); + if (prop && *prop == 16) + devflags |= ISP1760_FLAG_BUS_WIDTH_16; + + if (of_get_property(dp, "port1-otg", NULL) != NULL) + devflags |= ISP1760_FLAG_OTG_EN; + + if (of_get_property(dp, "analog-oc", NULL) != NULL) + devflags |= ISP1760_FLAG_ANALOG_OC; + + if (of_get_property(dp, "dack-polarity", NULL) != NULL) + devflags |= ISP1760_FLAG_DACK_POL_HIGH; + + if (of_get_property(dp, "dreq-polarity", NULL) != NULL) + devflags |= ISP1760_FLAG_DREQ_POL_HIGH; + hcd = isp1760_register(memory.start, res_len, virq, - IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev->dev.bus_id); + IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev_name(&dev->dev), + devflags); if (IS_ERR(hcd)) { ret = PTR_ERR(hcd); goto release_reg; @@ -87,6 +113,9 @@ static struct of_device_id of_isp1760_match[] = { { .compatible = "nxp,usb-isp1760", }, + { + .compatible = "nxp,usb-isp1761", + }, { }, }; MODULE_DEVICE_TABLE(of, of_isp1760_match); @@ -104,8 +133,8 @@ static u32 nxp_pci_io_base; static u32 iolength; static u32 pci_mem_phy0; static u32 length; -static u8 *chip_addr; -static u8 *iobase; +static u8 __iomem *chip_addr; +static u8 __iomem *iobase; static int __devinit isp1761_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) @@ -116,6 +145,7 @@ static int __devinit isp1761_pci_probe(struct pci_dev *dev, int length; int status = 1; struct usb_hcd *hcd; + unsigned int devflags = 0; if (usb_disabled()) return -ENODEV; @@ -200,7 +230,8 @@ static int __devinit isp1761_pci_probe(struct pci_dev *dev, dev->dev.dma_mask = NULL; hcd = isp1760_register(pci_mem_phy0, length, dev->irq, - IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev->dev.bus_id); + IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev_name(&dev->dev), + devflags); pci_set_drvdata(dev, hcd); if (!hcd) return 0; @@ -256,7 +287,7 @@ static struct pci_driver isp1761_pci_driver = { static int __init isp1760_init(void) { - int ret; + int ret = -ENODEV; init_kmem_once();