From: paul@pwsan.com (Paul Walmsley)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/10] OMAP hwmod: add names to module MPU IRQ lines
Date: Thu, 03 Dec 2009 06:49:48 -0700 [thread overview]
Message-ID: <20091203134943.17146.88603.stgit@localhost.localdomain> (raw)
In-Reply-To: <20091203134852.17146.81997.stgit@localhost.localdomain>
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>
---
arch/arm/mach-omap2/omap_hwmod.c | 5 +++--
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 709ec5d..234567b 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1389,8 +1389,9 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)
/* For each IRQ, DMA, memory area, fill in array.*/
for (i = 0; i < oh->mpu_irqs_cnt; i++) {
- (res + r)->start = *(oh->mpu_irqs + i);
- (res + r)->end = *(oh->mpu_irqs + i);
+ (res + r)->name = (oh->mpu_irqs + i)->name;
+ (res + r)->start = (oh->mpu_irqs + i)->irq;
+ (res + r)->end = (oh->mpu_irqs + i)->irq;
(res + r)->flags = IORESOURCE_IRQ;
r++;
}
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 643a972..007935a 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;
/**
- * struct omap_hwmod_dma_info - MPU address space handled by the hwmod
+ * struct omap_hwmod_irq_info - MPU IRQs used by the hwmod
+ * @name: name of the IRQ channel (module local name)
+ * @irq_ch: IRQ channel ID
+ *
+ * @name should be something short, e.g., "tx" or "rx". It is for use
+ * by platform_get_resource_byname(). It is defined locally to the
+ * hwmod.
+ */
+struct omap_hwmod_irq_info {
+ const char *name;
+ u16 irq;
+};
+
+/**
+ * struct omap_hwmod_dma_info - DMA channels used by the hwmod
* @name: name of the DMA channel (module local name)
* @dma_ch: DMA channel ID
*
@@ -379,7 +393,7 @@ struct omap_hwmod_omap4_prcm {
struct omap_hwmod {
const char *name;
struct omap_device *od;
- u8 *mpu_irqs;
+ struct omap_hwmod_irq_info *mpu_irqs;
struct omap_hwmod_dma_info *sdma_chs;
union {
struct omap_hwmod_omap2_prcm omap2;
next prev parent reply other threads:[~2009-12-03 13:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-03 13:49 [PATCH 00/10] OMAP: omap_hwmod/omap_device patches for 2.6.33 Paul Walmsley
2009-12-03 13:49 ` [PATCH 01/10] OMAP3 hwmod: reprogram OCP_SYSCONFIG register after setting SOFTRESET Paul Walmsley
2009-12-03 13:49 ` [PATCH 02/10] OMAP3 hwmod: Add automatic OCP_SYSCONFIG AUTOIDLE handling Paul Walmsley
2009-12-03 13:49 ` Paul Walmsley [this message]
2009-12-03 13:49 ` [PATCH 04/10] OMAP3 hwmod: drop most of the OCP_SYSCONFIG.CLOCKACTIVITY code Paul Walmsley
2009-12-03 13:49 ` [PATCH 05/10] OMAP: omap_device: add to_omap_device() macro Paul Walmsley
2009-12-03 13:49 ` [PATCH 06/10] OMAP: omap_device: use UINT_MAX for default wakeup latency limit Paul Walmsley
2009-12-03 13:49 ` [PATCH 07/10] OMAP: omap_device: use read_persistent_clock() instead of getnstimeofday() Paul Walmsley
2009-12-03 13:49 ` [PATCH 08/10] OMAP: hwmod: warn on missing clockdomain Paul Walmsley
2009-12-03 13:49 ` [PATCH 09/10] OMAP: omap_device: fix nsec/usec conversion in latency calculations Paul Walmsley
2009-12-03 13:49 ` [PATCH 10/10] OMAP: omap_device: track latency in nanoseconds Paul Walmsley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091203134943.17146.88603.stgit@localhost.localdomain \
--to=paul@pwsan.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).