linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jason77.wang@gmail.com (Jason Wang)
To: linux-arm-kernel@lists.infradead.org
Subject: [V2 2/3] mxc/iomux: add GPIO bank offset for iomux v3 platforms
Date: Thu,  3 Jun 2010 20:05:45 +0800	[thread overview]
Message-ID: <1275566746-6510-3-git-send-email-jason77.wang@gmail.com> (raw)
In-Reply-To: <1275566746-6510-2-git-send-email-jason77.wang@gmail.com>

From: Wang Hui <Hui.Wang@windriver.com>

These GPIO bank offsets are useful when define a gpio number.
E.G. when GPIO PORTC pin 6 is used for irq request pin of external
expanding device, we can define it like:
  #define EXP_PARENT_IRQ_PIN (GPIO_PORTC + 6)

Signed-off-by: Jason Wang <jason77.wang@gmail.com>
---
 arch/arm/plat-mxc/include/mach/iomux-v3.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-mxc/include/mach/iomux-v3.h b/arch/arm/plat-mxc/include/mach/iomux-v3.h
index f2f73d3..0880a4a 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-v3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-v3.h
@@ -89,6 +89,21 @@ struct pad_desc {
 #define PAD_CTL_SRE_FAST		(1 << 0)
 #define PAD_CTL_SRE_SLOW		(0 << 0)
 
+
+#define MX51_NUM_GPIO_PORT	4
+
+#define GPIO_PIN_MASK 0x1f
+
+#define GPIO_PORT_SHIFT 5
+#define GPIO_PORT_MASK (0x7 << GPIO_PORT_SHIFT)
+
+#define GPIO_PORTA	(0 << GPIO_PORT_SHIFT)
+#define GPIO_PORTB	(1 << GPIO_PORT_SHIFT)
+#define GPIO_PORTC	(2 << GPIO_PORT_SHIFT)
+#define GPIO_PORTD	(3 << GPIO_PORT_SHIFT)
+#define GPIO_PORTE	(4 << GPIO_PORT_SHIFT)
+#define GPIO_PORTF	(5 << GPIO_PORT_SHIFT)
+
 /*
  * setups a single pad in the iomuxer
  */
-- 
1.5.6.5

  reply	other threads:[~2010-06-03 12:05 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-03 12:05 [V2 0/3]Add i.MX51 3-stack board support Jason Wang
2010-06-03 12:05 ` [V2 1/3] mxc: Add support for the imx51 3-stack board Jason Wang
2010-06-03 12:05   ` Jason Wang [this message]
2010-06-03 12:05     ` [V2 3/3] mx51/keypad: add keypad support for i.MX51 platforms Jason Wang
2010-06-05  9:35       ` Alberto Panizzo
2010-06-05 14:13         ` jason
2010-06-06 18:11           ` Alberto Panizzo
2010-06-07 23:22             ` jason
2010-06-03 12:39   ` [V2 1/3] mxc: Add support for the imx51 3-stack board Amit Kucheria
2010-06-03 13:57     ` Sascha Hauer
2010-06-03 14:35       ` Amit Kucheria
2010-06-03 14:36       ` jason
2010-06-03 14:39     ` jason
2010-06-04  8:53   ` Sascha Hauer
2010-06-04  9:48     ` Alberto Panizzo
2010-06-04 15:22       ` Sascha Hauer
2010-06-04 10:53     ` Amit Kucheria
2010-06-04 14:09       ` [PATCH] mxc: Fix pad names for imx51 Amit Kucheria
2010-06-07 20:41         ` Troy Kisky
2010-06-07 21:04           ` Amit Kucheria
2010-06-07 21:15             ` Troy Kisky
2010-06-08  6:30               ` Sascha Hauer
2010-06-09 13:09                 ` Amit Kucheria
2010-06-10 11:49                   ` Sascha Hauer
2010-06-10 13:04                     ` jason
2010-06-10 13:59                       ` Sascha Hauer
2010-06-10 19:24                     ` Amit Kucheria
2010-06-04 12:50     ` [V2 1/3] mxc: Add support for the imx51 3-stack board jason

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=1275566746-6510-3-git-send-email-jason77.wang@gmail.com \
    --to=jason77.wang@gmail.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).