aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/isp116x-hcd.c
diff options
context:
space:
mode:
authorMarc Zyngier <maz@misterjones.org>2008-08-18 07:08:42 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-10-17 17:40:52 -0400
commit27140219373327f2291da5d74a78db0105b15060 (patch)
tree1cbb0eab32d9b847b0f030982429045ff0e8f041 /drivers/usb/host/isp116x-hcd.c
parent7dbcbe88b1495f778f56c742391e49f580dc101a (diff)
USB: Let some USB host controllers get IRQ flags from resource
[This version fixes a thinko in the r8a66597 driver] This patch let a few discrete USB host controllers drivers (isp116x-hcd, r8a66597-hcd and sl811-hcd) obtain IRQ flags from their IORESOURCE_IRQ resource if configured as such, much like it's been done for the smc91x driver. It spares people writing support for specific boards the burden to configure the interrupt controller independantly, and keeps all IRQ related information in a single resource. HCD that are integrally part of a SoC have been left aside, as there is probably no "wiring" options... Tested on an Xscale PXA-255 based platform with isp116x-hcd. Signed-off-by: Marc Zyngier <marc.zyngier@altran.com> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/isp116x-hcd.c')
-rw-r--r--drivers/usb/host/isp116x-hcd.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
index ce1ca0ba0515..4dda31b26892 100644
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -1562,11 +1562,12 @@ static int __devinit isp116x_probe(struct platform_device *pdev)
1562{ 1562{
1563 struct usb_hcd *hcd; 1563 struct usb_hcd *hcd;
1564 struct isp116x *isp116x; 1564 struct isp116x *isp116x;
1565 struct resource *addr, *data; 1565 struct resource *addr, *data, *ires;
1566 void __iomem *addr_reg; 1566 void __iomem *addr_reg;
1567 void __iomem *data_reg; 1567 void __iomem *data_reg;
1568 int irq; 1568 int irq;
1569 int ret = 0; 1569 int ret = 0;
1570 unsigned long irqflags;
1570 1571
1571 if (pdev->num_resources < 3) { 1572 if (pdev->num_resources < 3) {
1572 ret = -ENODEV; 1573 ret = -ENODEV;
@@ -1575,12 +1576,16 @@ static int __devinit isp116x_probe(struct platform_device *pdev)
1575 1576
1576 data = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1577 data = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1577 addr = platform_get_resource(pdev, IORESOURCE_MEM, 1); 1578 addr = platform_get_resource(pdev, IORESOURCE_MEM, 1);
1578 irq = platform_get_irq(pdev, 0); 1579 ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
1579 if (!addr || !data || irq < 0) { 1580
1581 if (!addr || !data || !ires) {
1580 ret = -ENODEV; 1582 ret = -ENODEV;
1581 goto err1; 1583 goto err1;
1582 } 1584 }
1583 1585
1586 irq = ires->start;
1587 irqflags = ires->flags & IRQF_TRIGGER_MASK;
1588
1584 if (pdev->dev.dma_mask) { 1589 if (pdev->dev.dma_mask) {
1585 DBG("DMA not supported\n"); 1590 DBG("DMA not supported\n");
1586 ret = -EINVAL; 1591 ret = -EINVAL;
@@ -1634,7 +1639,7 @@ static int __devinit isp116x_probe(struct platform_device *pdev)
1634 goto err6; 1639 goto err6;
1635 } 1640 }
1636 1641
1637 ret = usb_add_hcd(hcd, irq, IRQF_DISABLED); 1642 ret = usb_add_hcd(hcd, irq, irqflags | IRQF_DISABLED);
1638 if (ret) 1643 if (ret)
1639 goto err6; 1644 goto err6;
1640 1645