Skip to content

Commit

Permalink
usb: renesas_usbhs: add IRQ resource decoding for IRQF_SHARED
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
  • Loading branch information
shimoday authored and Felipe Balbi committed Jan 24, 2012
1 parent 10800f2 commit 53069af
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions drivers/usb/renesas_usbhs/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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;
}
Expand Down Expand Up @@ -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));
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/renesas_usbhs/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/renesas_usbhs/mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 53069af

Please sign in to comment.