aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/isp1760-if.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-21 18:42:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-21 18:42:53 -0400
commit93ded9b8fd42abe2c3607097963d8de6ad9117eb (patch)
tree407a3adcf885ffd75a4d3299eaefd9b171b739be /drivers/usb/host/isp1760-if.c
parent6d52dcbe56ca8464bcad56d98a64bcd781596663 (diff)
parentf756cbd458ab71c996a069cb3928fb1e2d7cd9cc (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (100 commits) usb-storage: revert DMA-alignment change for Wireless USB USB: use reset_resume when normal resume fails usb_gadget: composite cdc gadget fault handling usb gadget: minor USBCV fix for composite framework USB: Fix bug with byte order in isp116x-hcd.c fio write/read USB: fix double kfree in ipaq in error case USB: fix build error in cdc-acm for CONFIG_PM=n USB: remove board-specific UP2OCR configuration from pxa27x-udc USB: EHCI: Reconciling USB register differences on MPC85xx vs MPC83xx USB: Fix pointer/int cast in USB devio code usb gadget: g_cdc dependso on NET USB: Au1xxx-usb: suspend/resume support. USB: Au1xxx-usb: clean up ohci/ehci bus glue sources. usbfs: don't store bad pointers in registration usbfs: fix race between open and unregister usbfs: simplify the lookup-by-minor routines usbfs: send disconnect signals when device is unregistered USB: Force unbinding of drivers lacking reset_resume or other methods USB: ohci-pnx4008: I2C cleanups and fixes USB: debug port converter does not accept more than 8 byte packets ...
Diffstat (limited to 'drivers/usb/host/isp1760-if.c')
-rw-r--r--drivers/usb/host/isp1760-if.c37
1 files changed, 34 insertions, 3 deletions
diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c
index c9db3fe98726..051ef7b6bdc6 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,
35 int virq; 35 int virq;
36 u64 res_len; 36 u64 res_len;
37 int ret; 37 int ret;
38 const unsigned int *prop;
39 unsigned int devflags = 0;
38 40
39 ret = of_address_to_resource(dp, 0, &memory); 41 ret = of_address_to_resource(dp, 0, &memory);
40 if (ret) 42 if (ret)
41 return -ENXIO; 43 return -ENXIO;
42 44
43 res = request_mem_region(memory.start, memory.end - memory.start + 1, 45 res = request_mem_region(memory.start, memory.end - memory.start + 1,
44 dev->dev.bus_id); 46 dev_name(&dev->dev));
45 if (!res) 47 if (!res)
46 return -EBUSY; 48 return -EBUSY;
47 49
@@ -55,8 +57,32 @@ static int of_isp1760_probe(struct of_device *dev,
55 virq = irq_create_of_mapping(oirq.controller, oirq.specifier, 57 virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
56 oirq.size); 58 oirq.size);
57 59
60 if (of_device_is_compatible(dp, "nxp,usb-isp1761"))
61 devflags |= ISP1760_FLAG_ISP1761;
62
63 if (of_get_property(dp, "port1-disable", NULL) != NULL)
64 devflags |= ISP1760_FLAG_PORT1_DIS;
65
66 /* Some systems wire up only 16 of the 32 data lines */
67 prop = of_get_property(dp, "bus-width", NULL);
68 if (prop && *prop == 16)
69 devflags |= ISP1760_FLAG_BUS_WIDTH_16;
70
71 if (of_get_property(dp, "port1-otg", NULL) != NULL)
72 devflags |= ISP1760_FLAG_OTG_EN;
73
74 if (of_get_property(dp, "analog-oc", NULL) != NULL)
75 devflags |= ISP1760_FLAG_ANALOG_OC;
76
77 if (of_get_property(dp, "dack-polarity", NULL) != NULL)
78 devflags |= ISP1760_FLAG_DACK_POL_HIGH;
79
80 if (of_get_property(dp, "dreq-polarity", NULL) != NULL)
81 devflags |= ISP1760_FLAG_DREQ_POL_HIGH;
82
58 hcd = isp1760_register(memory.start, res_len, virq, 83 hcd = isp1760_register(memory.start, res_len, virq,
59 IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev->dev.bus_id); 84 IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev_name(&dev->dev),
85 devflags);
60 if (IS_ERR(hcd)) { 86 if (IS_ERR(hcd)) {
61 ret = PTR_ERR(hcd); 87 ret = PTR_ERR(hcd);
62 goto release_reg; 88 goto release_reg;
@@ -87,6 +113,9 @@ static struct of_device_id of_isp1760_match[] = {
87 { 113 {
88 .compatible = "nxp,usb-isp1760", 114 .compatible = "nxp,usb-isp1760",
89 }, 115 },
116 {
117 .compatible = "nxp,usb-isp1761",
118 },
90 { }, 119 { },
91}; 120};
92MODULE_DEVICE_TABLE(of, of_isp1760_match); 121MODULE_DEVICE_TABLE(of, of_isp1760_match);
@@ -116,6 +145,7 @@ static int __devinit isp1761_pci_probe(struct pci_dev *dev,
116 int length; 145 int length;
117 int status = 1; 146 int status = 1;
118 struct usb_hcd *hcd; 147 struct usb_hcd *hcd;
148 unsigned int devflags = 0;
119 149
120 if (usb_disabled()) 150 if (usb_disabled())
121 return -ENODEV; 151 return -ENODEV;
@@ -200,7 +230,8 @@ static int __devinit isp1761_pci_probe(struct pci_dev *dev,
200 230
201 dev->dev.dma_mask = NULL; 231 dev->dev.dma_mask = NULL;
202 hcd = isp1760_register(pci_mem_phy0, length, dev->irq, 232 hcd = isp1760_register(pci_mem_phy0, length, dev->irq,
203 IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev->dev.bus_id); 233 IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev_name(&dev->dev),
234 devflags);
204 pci_set_drvdata(dev, hcd); 235 pci_set_drvdata(dev, hcd);
205 if (!hcd) 236 if (!hcd)
206 return 0; 237 return 0;