aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHema Kalliguddi <hemahk@ti.com>2010-09-29 12:26:39 -0400
committerFelipe Balbi <balbi@ti.com>2010-12-01 03:56:33 -0500
commitfcf173e4511193b1efeccb0f22a8c641b464353b (patch)
treea5cc4b3e560d857513a6684ed307b04a492b9670
parentea65df57c2eea803535a071752efb030c46a11f5 (diff)
usb: musb: add names for IRQs in structure resource
Soon resource data will get automatically populated from a set of autogenerated data from TI's hardware database for the OMAP platform. Such database, might not have resources at the expected order by the current drivers. While we could hack in some exceptions to that tool to generate resources in a specific order, it seems less fragile to use the resource name instead. That way, no matter what order the resources are generated, the driver still work. Modified the OMAP, Blackfin and Davinci architecture files to add the name of the IRQs in the resource structures and musb driver to use the platform_get_irq_byname() api to get the device and dma irq numbers instead of using the index. Cc: Tony Lindgren <tony@atomide.com> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Hema HK <hemahk@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--arch/arm/mach-davinci/usb.c2
-rw-r--r--arch/arm/mach-omap2/usb-musb.c2
-rw-r--r--arch/blackfin/mach-bf527/boards/cm_bf527.c2
-rw-r--r--arch/blackfin/mach-bf527/boards/ezbrd.c2
-rw-r--r--arch/blackfin/mach-bf527/boards/ezkit.c2
-rw-r--r--arch/blackfin/mach-bf548/boards/cm_bf548.c2
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c2
-rw-r--r--drivers/usb/musb/cppi_dma.c2
-rw-r--r--drivers/usb/musb/musb_core.c2
-rw-r--r--drivers/usb/musb/musbhsdma.c2
10 files changed, 17 insertions, 3 deletions
diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c
index 31f0cbea0caa..b0d6b07431c0 100644
--- a/arch/arm/mach-davinci/usb.c
+++ b/arch/arm/mach-davinci/usb.c
@@ -64,10 +64,12 @@ static struct resource usb_resources[] = {
64 { 64 {
65 .start = IRQ_USBINT, 65 .start = IRQ_USBINT,
66 .flags = IORESOURCE_IRQ, 66 .flags = IORESOURCE_IRQ,
67 .name = "mc"
67 }, 68 },
68 { 69 {
69 /* placeholder for the dedicated CPPI IRQ */ 70 /* placeholder for the dedicated CPPI IRQ */
70 .flags = IORESOURCE_IRQ, 71 .flags = IORESOURCE_IRQ,
72 .name = "dma"
71 }, 73 },
72}; 74};
73 75
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 72605584bfff..8dae0fa5905e 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -40,10 +40,12 @@ static struct resource musb_resources[] = {
40 [1] = { /* general IRQ */ 40 [1] = { /* general IRQ */
41 .start = INT_243X_HS_USB_MC, 41 .start = INT_243X_HS_USB_MC,
42 .flags = IORESOURCE_IRQ, 42 .flags = IORESOURCE_IRQ,
43 .name = "mc",
43 }, 44 },
44 [2] = { /* DMA IRQ */ 45 [2] = { /* DMA IRQ */
45 .start = INT_243X_HS_USB_DMA, 46 .start = INT_243X_HS_USB_DMA,
46 .flags = IORESOURCE_IRQ, 47 .flags = IORESOURCE_IRQ,
48 .name = "dma",
47 }, 49 },
48}; 50};
49 51
diff --git a/arch/blackfin/mach-bf527/boards/cm_bf527.c b/arch/blackfin/mach-bf527/boards/cm_bf527.c
index 2c31af7a320a..f714d7be35b9 100644
--- a/arch/blackfin/mach-bf527/boards/cm_bf527.c
+++ b/arch/blackfin/mach-bf527/boards/cm_bf527.c
@@ -82,11 +82,13 @@ static struct resource musb_resources[] = {
82 .start = IRQ_USB_INT0, 82 .start = IRQ_USB_INT0,
83 .end = IRQ_USB_INT0, 83 .end = IRQ_USB_INT0,
84 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 84 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
85 .name = "mc"
85 }, 86 },
86 [2] = { /* DMA IRQ */ 87 [2] = { /* DMA IRQ */
87 .start = IRQ_USB_DMA, 88 .start = IRQ_USB_DMA,
88 .end = IRQ_USB_DMA, 89 .end = IRQ_USB_DMA,
89 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 90 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
91 .name = "dma"
90 }, 92 },
91}; 93};
92 94
diff --git a/arch/blackfin/mach-bf527/boards/ezbrd.c b/arch/blackfin/mach-bf527/boards/ezbrd.c
index 9a736a850c5c..315eec930604 100644
--- a/arch/blackfin/mach-bf527/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf527/boards/ezbrd.c
@@ -46,11 +46,13 @@ static struct resource musb_resources[] = {
46 .start = IRQ_USB_INT0, 46 .start = IRQ_USB_INT0,
47 .end = IRQ_USB_INT0, 47 .end = IRQ_USB_INT0,
48 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 48 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
49 .name = "mc"
49 }, 50 },
50 [2] = { /* DMA IRQ */ 51 [2] = { /* DMA IRQ */
51 .start = IRQ_USB_DMA, 52 .start = IRQ_USB_DMA,
52 .end = IRQ_USB_DMA, 53 .end = IRQ_USB_DMA,
53 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 54 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
55 .name = "dma"
54 }, 56 },
55}; 57};
56 58
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c
index 9222bc00bbd3..273731279740 100644
--- a/arch/blackfin/mach-bf527/boards/ezkit.c
+++ b/arch/blackfin/mach-bf527/boards/ezkit.c
@@ -86,11 +86,13 @@ static struct resource musb_resources[] = {
86 .start = IRQ_USB_INT0, 86 .start = IRQ_USB_INT0,
87 .end = IRQ_USB_INT0, 87 .end = IRQ_USB_INT0,
88 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 88 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
89 .name = "mc"
89 }, 90 },
90 [2] = { /* DMA IRQ */ 91 [2] = { /* DMA IRQ */
91 .start = IRQ_USB_DMA, 92 .start = IRQ_USB_DMA,
92 .end = IRQ_USB_DMA, 93 .end = IRQ_USB_DMA,
93 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 94 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
95 .name = "dma"
94 }, 96 },
95}; 97};
96 98
diff --git a/arch/blackfin/mach-bf548/boards/cm_bf548.c b/arch/blackfin/mach-bf548/boards/cm_bf548.c
index f0c0eef95ba8..3e3dfb23f94e 100644
--- a/arch/blackfin/mach-bf548/boards/cm_bf548.c
+++ b/arch/blackfin/mach-bf548/boards/cm_bf548.c
@@ -482,11 +482,13 @@ static struct resource musb_resources[] = {
482 .start = IRQ_USB_INT0, 482 .start = IRQ_USB_INT0,
483 .end = IRQ_USB_INT0, 483 .end = IRQ_USB_INT0,
484 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 484 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
485 .name = "mc"
485 }, 486 },
486 [2] = { /* DMA IRQ */ 487 [2] = { /* DMA IRQ */
487 .start = IRQ_USB_DMA, 488 .start = IRQ_USB_DMA,
488 .end = IRQ_USB_DMA, 489 .end = IRQ_USB_DMA,
489 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 490 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
491 .name = "dma"
490 }, 492 },
491}; 493};
492 494
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index 216e26999af9..9ff166d6f00d 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -587,11 +587,13 @@ static struct resource musb_resources[] = {
587 .start = IRQ_USB_INT0, 587 .start = IRQ_USB_INT0,
588 .end = IRQ_USB_INT0, 588 .end = IRQ_USB_INT0,
589 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 589 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
590 .name = "mc"
590 }, 591 },
591 [2] = { /* DMA IRQ */ 592 [2] = { /* DMA IRQ */
592 .start = IRQ_USB_DMA, 593 .start = IRQ_USB_DMA,
593 .end = IRQ_USB_DMA, 594 .end = IRQ_USB_DMA,
594 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 595 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
596 .name = "dma"
595 }, 597 },
596}; 598};
597 599
diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c
index f5a65ff0ac2b..de55a3c3259a 100644
--- a/drivers/usb/musb/cppi_dma.c
+++ b/drivers/usb/musb/cppi_dma.c
@@ -1308,7 +1308,7 @@ dma_controller_create(struct musb *musb, void __iomem *mregs)
1308 struct cppi *controller; 1308 struct cppi *controller;
1309 struct device *dev = musb->controller; 1309 struct device *dev = musb->controller;
1310 struct platform_device *pdev = to_platform_device(dev); 1310 struct platform_device *pdev = to_platform_device(dev);
1311 int irq = platform_get_irq(pdev, 1); 1311 int irq = platform_get_irq_byname(pdev, "dma");
1312 1312
1313 controller = kzalloc(sizeof *controller, GFP_KERNEL); 1313 controller = kzalloc(sizeof *controller, GFP_KERNEL);
1314 if (!controller) 1314 if (!controller)
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 4b71a1bb4187..a5ceddfe57d6 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2206,7 +2206,7 @@ static u64 *orig_dma_mask;
2206static int __init musb_probe(struct platform_device *pdev) 2206static int __init musb_probe(struct platform_device *pdev)
2207{ 2207{
2208 struct device *dev = &pdev->dev; 2208 struct device *dev = &pdev->dev;
2209 int irq = platform_get_irq(pdev, 0); 2209 int irq = platform_get_irq_byname(pdev, "mc");
2210 int status; 2210 int status;
2211 struct resource *iomem; 2211 struct resource *iomem;
2212 void __iomem *base; 2212 void __iomem *base;
diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c
index 6f771af5cbdb..4e8183589624 100644
--- a/drivers/usb/musb/musbhsdma.c
+++ b/drivers/usb/musb/musbhsdma.c
@@ -363,7 +363,7 @@ dma_controller_create(struct musb *musb, void __iomem *base)
363 struct musb_dma_controller *controller; 363 struct musb_dma_controller *controller;
364 struct device *dev = musb->controller; 364 struct device *dev = musb->controller;
365 struct platform_device *pdev = to_platform_device(dev); 365 struct platform_device *pdev = to_platform_device(dev);
366 int irq = platform_get_irq(pdev, 1); 366 int irq = platform_get_irq_byname(pdev, "dma");
367 367
368 if (irq == 0) { 368 if (irq == 0) {
369 dev_err(dev, "No DMA interrupt line!\n"); 369 dev_err(dev, "No DMA interrupt line!\n");