From: jason77.wang@gmail.com (Jason Wang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V3 2/7] mxc/iomux: add GPIO bank offset for iomux v3 platforms
Date: Fri, 4 Jun 2010 22:32:52 +0800 [thread overview]
Message-ID: <1275661977-8077-3-git-send-email-jason77.wang@gmail.com> (raw)
In-Reply-To: <1275661977-8077-2-git-send-email-jason77.wang@gmail.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
next prev parent reply other threads:[~2010-06-04 14:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-04 14:32 [PATCH V3 0/7]Add i.MX51 3-stack board support Jason Wang
2010-06-04 14:32 ` [PATCH V3 1/7] mxc: add common debug board for 3-stack platforms Jason Wang
2010-06-04 14:32 ` Jason Wang [this message]
2010-06-04 14:32 ` [PATCH V3 3/7] mx51/iomux: fix some pad names and make some cleanups Jason Wang
2010-06-04 14:32 ` [PATCH V3 4/7] mx51/iomux: add pad definition for mx51_3ds Jason Wang
2010-06-04 14:32 ` [PATCH V3 5/7] mxc/mx51: Add support for the imx51 3-stack board Jason Wang
2010-06-04 14:32 ` [PATCH V3 6/7] mx51/keypad: add keypad support for i.MX51 platforms Jason Wang
2010-06-04 14:32 ` [PATCH V3 7/7] mx31_3ds: revert cpld debug board relate code Jason Wang
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=1275661977-8077-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).