usb: renesas_usbhs: add IRQ resource decoding for IRQF_SHARED
authorShimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
Thu, 5 Jan 2012 06:37:18 +0000 (15:37 +0900)
committerFelipe Balbi <balbi@ti.com>
Tue, 24 Jan 2012 09:32:56 +0000 (11:32 +0200)
In case of the SH7757, the irq number of USB module and SUDMAC
are the same. So, we have to set the IRQF_SHARED in such a case.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/renesas_usbhs/common.c
drivers/usb/renesas_usbhs/common.h
drivers/usb/renesas_usbhs/mod.c

index e9a5b1d2615ec7c7955059b28001fef9662d632b..a165490bae48ae82140dd9a3abf68f66f4f0fb8c 100644 (file)
@@ -413,8 +413,7 @@ static int usbhs_probe(struct platform_device *pdev)
        struct renesas_usbhs_platform_info *info = pdev->dev.platform_data;
        struct renesas_usbhs_driver_callback *dfunc;
        struct usbhs_priv *priv;
-       struct resource *res;
-       unsigned int irq;
+       struct resource *res, *irq_res;
        int ret;
 
        /* check platform information */
@@ -426,8 +425,8 @@ static int usbhs_probe(struct platform_device *pdev)
 
        /* platform data */
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       irq = platform_get_irq(pdev, 0);
-       if (!res || (int)irq <= 0) {
+       irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+       if (!res || !irq_res) {
                dev_err(&pdev->dev, "Not enough Renesas USB platform resources.\n");
                return -ENODEV;
        }
@@ -476,7 +475,9 @@ static int usbhs_probe(struct platform_device *pdev)
        /*
         * priv settings
         */
-       priv->irq       = irq;
+       priv->irq       = irq_res->start;
+       if (irq_res->flags & IORESOURCE_IRQ_SHAREABLE)
+               priv->irqflags = IRQF_SHARED;
        priv->pdev      = pdev;
        INIT_DELAYED_WORK(&priv->notify_hotplug_work, usbhsc_notify_hotplug);
        spin_lock_init(usbhs_priv_to_lock(priv));
index d79b3e27db954c7ca6919152fee3d055031f4558..3f3ccd358753c37ca26d4db53f31fdc219093d0e 100644 (file)
@@ -242,6 +242,7 @@ struct usbhs_priv {
 
        void __iomem *base;
        unsigned int irq;
+       unsigned long irqflags;
 
        struct renesas_usbhs_platform_callback  pfunc;
        struct renesas_usbhs_driver_param       dparam;
index 1b97fb12694ba8d4634f0030cd695f2ed6ea7a94..0871e816df456956ce3ff8c62c1890997fc051dd 100644 (file)
@@ -152,7 +152,7 @@ int usbhs_mod_probe(struct usbhs_priv *priv)
 
        /* irq settings */
        ret = request_irq(priv->irq, usbhs_interrupt,
-                         0, dev_name(dev), priv);
+                         priv->irqflags, dev_name(dev), priv);
        if (ret) {
                dev_err(dev, "irq request err\n");
                goto mod_init_gadget_err;