diff options
| author | Paul Walmsley <paul@pwsan.com> | 2009-12-08 18:34:16 -0500 |
|---|---|---|
| committer | paul <paul@twilight.(none)> | 2009-12-11 19:00:43 -0500 |
| commit | 718bfd76932c566f79eb55083693ef0b68071bf8 (patch) | |
| tree | b12d20715e1b419c6a9ed4b0d163a40e69ad83d1 | |
| parent | 726072e5dd459e3831d1dd4308ba469ff3ded419 (diff) | |
OMAP hwmod: add names to module MPU IRQ lines
Replace the existing u8 array of module MPU IRQ lines with a struct
that includes a name - similar to the existing struct
omap_hwmod_dma_info. Device drivers can then use
platform_get_resource_byname() to retrieve specific IRQs without nasty
dependencies on array ordering.
Thanks to Benoît Cousson <b-cousson@ti.com> and Kevin Hilman
<khilman@deeprootsystems.com> for feedback on this approach.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Benoît Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
| -rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 5 | ||||
| -rw-r--r-- | arch/arm/plat-omap/include/plat/omap_hwmod.h | 18 |
2 files changed, 19 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index b01da1ed822d..61d220c5d488 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
| @@ -1386,8 +1386,9 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res) | |||
| 1386 | /* For each IRQ, DMA, memory area, fill in array.*/ | 1386 | /* For each IRQ, DMA, memory area, fill in array.*/ |
| 1387 | 1387 | ||
| 1388 | for (i = 0; i < oh->mpu_irqs_cnt; i++) { | 1388 | for (i = 0; i < oh->mpu_irqs_cnt; i++) { |
| 1389 | (res + r)->start = *(oh->mpu_irqs + i); | 1389 | (res + r)->name = (oh->mpu_irqs + i)->name; |
| 1390 | (res + r)->end = *(oh->mpu_irqs + i); | 1390 | (res + r)->start = (oh->mpu_irqs + i)->irq; |
| 1391 | (res + r)->end = (oh->mpu_irqs + i)->irq; | ||
| 1391 | (res + r)->flags = IORESOURCE_IRQ; | 1392 | (res + r)->flags = IORESOURCE_IRQ; |
| 1392 | r++; | 1393 | r++; |
| 1393 | } | 1394 | } |
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h index 643a9727de35..007935a921ea 100644 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h | |||
| @@ -64,7 +64,21 @@ struct omap_device; | |||
| 64 | 64 | ||
| 65 | 65 | ||
| 66 | /** | 66 | /** |
| 67 | * struct omap_hwmod_dma_info - MPU address space handled by the hwmod | 67 | * struct omap_hwmod_irq_info - MPU IRQs used by the hwmod |
| 68 | * @name: name of the IRQ channel (module local name) | ||
| 69 | * @irq_ch: IRQ channel ID | ||
| 70 | * | ||
| 71 | * @name should be something short, e.g., "tx" or "rx". It is for use | ||
| 72 | * by platform_get_resource_byname(). It is defined locally to the | ||
| 73 | * hwmod. | ||
| 74 | */ | ||
| 75 | struct omap_hwmod_irq_info { | ||
| 76 | const char *name; | ||
| 77 | u16 irq; | ||
| 78 | }; | ||
| 79 | |||
| 80 | /** | ||
| 81 | * struct omap_hwmod_dma_info - DMA channels used by the hwmod | ||
| 68 | * @name: name of the DMA channel (module local name) | 82 | * @name: name of the DMA channel (module local name) |
| 69 | * @dma_ch: DMA channel ID | 83 | * @dma_ch: DMA channel ID |
| 70 | * | 84 | * |
| @@ -379,7 +393,7 @@ struct omap_hwmod_omap4_prcm { | |||
| 379 | struct omap_hwmod { | 393 | struct omap_hwmod { |
| 380 | const char *name; | 394 | const char *name; |
| 381 | struct omap_device *od; | 395 | struct omap_device *od; |
| 382 | u8 *mpu_irqs; | 396 | struct omap_hwmod_irq_info *mpu_irqs; |
| 383 | struct omap_hwmod_dma_info *sdma_chs; | 397 | struct omap_hwmod_dma_info *sdma_chs; |
| 384 | union { | 398 | union { |
| 385 | struct omap_hwmod_omap2_prcm omap2; | 399 | struct omap_hwmod_omap2_prcm omap2; |
