aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/renesas_usbhs
diff options
context:
space:
mode:
authorShimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>2012-01-05 01:37:18 -0500
committerFelipe Balbi <balbi@ti.com>2012-01-24 04:32:56 -0500
commit53069af3fa8ba2849cd4785160690873995d4f39 (patch)
treed3b834678d59e2b6b6c1a0a4a39cfe4e2c2b0f85 /drivers/usb/renesas_usbhs
parent10800f2ca1a78e24cf92dc5e16a68a9b78f91bbe (diff)
usb: renesas_usbhs: add IRQ resource decoding for IRQF_SHARED
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>
Diffstat (limited to 'drivers/usb/renesas_usbhs')
-rw-r--r--drivers/usb/renesas_usbhs/common.c11
-rw-r--r--drivers/usb/renesas_usbhs/common.h1
-rw-r--r--drivers/usb/renesas_usbhs/mod.c2
3 files changed, 8 insertions, 6 deletions
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index e9a5b1d2615e..a165490bae48 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -413,8 +413,7 @@ static int usbhs_probe(struct platform_device *pdev)
413 struct renesas_usbhs_platform_info *info = pdev->dev.platform_data; 413 struct renesas_usbhs_platform_info *info = pdev->dev.platform_data;
414 struct renesas_usbhs_driver_callback *dfunc; 414 struct renesas_usbhs_driver_callback *dfunc;
415 struct usbhs_priv *priv; 415 struct usbhs_priv *priv;
416 struct resource *res; 416 struct resource *res, *irq_res;
417 unsigned int irq;
418 int ret; 417 int ret;
419 418
420 /* check platform information */ 419 /* check platform information */
@@ -426,8 +425,8 @@ static int usbhs_probe(struct platform_device *pdev)
426 425
427 /* platform data */ 426 /* platform data */
428 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 427 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
429 irq = platform_get_irq(pdev, 0); 428 irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
430 if (!res || (int)irq <= 0) { 429 if (!res || !irq_res) {
431 dev_err(&pdev->dev, "Not enough Renesas USB platform resources.\n"); 430 dev_err(&pdev->dev, "Not enough Renesas USB platform resources.\n");
432 return -ENODEV; 431 return -ENODEV;
433 } 432 }
@@ -476,7 +475,9 @@ static int usbhs_probe(struct platform_device *pdev)
476 /* 475 /*
477 * priv settings 476 * priv settings
478 */ 477 */
479 priv->irq = irq; 478 priv->irq = irq_res->start;
479 if (irq_res->flags & IORESOURCE_IRQ_SHAREABLE)
480 priv->irqflags = IRQF_SHARED;
480 priv->pdev = pdev; 481 priv->pdev = pdev;
481 INIT_DELAYED_WORK(&priv->notify_hotplug_work, usbhsc_notify_hotplug); 482 INIT_DELAYED_WORK(&priv->notify_hotplug_work, usbhsc_notify_hotplug);
482 spin_lock_init(usbhs_priv_to_lock(priv)); 483 spin_lock_init(usbhs_priv_to_lock(priv));
diff --git a/drivers/usb/renesas_usbhs/common.h b/drivers/usb/renesas_usbhs/common.h
index d79b3e27db95..3f3ccd358753 100644
--- a/drivers/usb/renesas_usbhs/common.h
+++ b/drivers/usb/renesas_usbhs/common.h
@@ -242,6 +242,7 @@ struct usbhs_priv {
242 242
243 void __iomem *base; 243 void __iomem *base;
244 unsigned int irq; 244 unsigned int irq;
245 unsigned long irqflags;
245 246
246 struct renesas_usbhs_platform_callback pfunc; 247 struct renesas_usbhs_platform_callback pfunc;
247 struct renesas_usbhs_driver_param dparam; 248 struct renesas_usbhs_driver_param dparam;
diff --git a/drivers/usb/renesas_usbhs/mod.c b/drivers/usb/renesas_usbhs/mod.c
index 1b97fb12694b..0871e816df45 100644
--- a/drivers/usb/renesas_usbhs/mod.c
+++ b/drivers/usb/renesas_usbhs/mod.c
@@ -152,7 +152,7 @@ int usbhs_mod_probe(struct usbhs_priv *priv)
152 152
153 /* irq settings */ 153 /* irq settings */
154 ret = request_irq(priv->irq, usbhs_interrupt, 154 ret = request_irq(priv->irq, usbhs_interrupt,
155 0, dev_name(dev), priv); 155 priv->irqflags, dev_name(dev), priv);
156 if (ret) { 156 if (ret) {
157 dev_err(dev, "irq request err\n"); 157 dev_err(dev, "irq request err\n");
158 goto mod_init_gadget_err; 158 goto mod_init_gadget_err;