aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/sl811-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/sl811-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/sl811-hcd.c')
-rw-r--r--drivers/usb/host/sl811-hcd.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index 8a74bbb57d08..e106e9d48d4a 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -1620,22 +1620,26 @@ sl811h_probe(struct platform_device *dev)
1620{ 1620{
1621 struct usb_hcd *hcd; 1621 struct usb_hcd *hcd;
1622 struct sl811 *sl811; 1622 struct sl811 *sl811;
1623 struct resource *addr, *data; 1623 struct resource *addr, *data, *ires;
1624 int irq; 1624 int irq;
1625 void __iomem *addr_reg; 1625 void __iomem *addr_reg;
1626 void __iomem *data_reg; 1626 void __iomem *data_reg;
1627 int retval; 1627 int retval;
1628 u8 tmp, ioaddr = 0; 1628 u8 tmp, ioaddr = 0;
1629 unsigned long irqflags;
1629 1630
1630 /* basic sanity checks first. board-specific init logic should 1631 /* basic sanity checks first. board-specific init logic should
1631 * have initialized these three resources and probably board 1632 * have initialized these three resources and probably board
1632 * specific platform_data. we don't probe for IRQs, and do only 1633 * specific platform_data. we don't probe for IRQs, and do only
1633 * minimal sanity checking. 1634 * minimal sanity checking.
1634 */ 1635 */
1635 irq = platform_get_irq(dev, 0); 1636 ires = platform_get_resource(dev, IORESOURCE_IRQ, 0);
1636 if (dev->num_resources < 3 || irq < 0) 1637 if (dev->num_resources < 3 || !ires)
1637 return -ENODEV; 1638 return -ENODEV;
1638 1639
1640 irq = ires->start;
1641 irqflags = ires->flags & IRQF_TRIGGER_MASK;
1642
1639 /* refuse to confuse usbcore */ 1643 /* refuse to confuse usbcore */
1640 if (dev->dev.dma_mask) { 1644 if (dev->dev.dma_mask) {
1641 DBG("no we won't dma\n"); 1645 DBG("no we won't dma\n");
@@ -1717,8 +1721,11 @@ sl811h_probe(struct platform_device *dev)
1717 * triggers (e.g. most ARM CPUs). Initial driver stress testing 1721 * triggers (e.g. most ARM CPUs). Initial driver stress testing
1718 * was on a system with single edge triggering, so most sorts of 1722 * was on a system with single edge triggering, so most sorts of
1719 * triggering arrangement should work. 1723 * triggering arrangement should work.
1724 *
1725 * Use resource IRQ flags if set by platform device setup.
1720 */ 1726 */
1721 retval = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED); 1727 irqflags |= IRQF_SHARED;
1728 retval = usb_add_hcd(hcd, irq, IRQF_DISABLED | irqflags);
1722 if (retval != 0) 1729 if (retval != 0)
1723 goto err6; 1730 goto err6;
1724 1731