diff options
author | Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org> | 2010-11-26 09:20:52 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-12-03 05:05:16 -0500 |
commit | 96886c4361f1ae3f6c775d7c9295e2d557101d0f (patch) | |
tree | f3101c9303ed759ab5660985291366619a8e8fd9 /arch/arm/mach-mx5/board-cpuimx51.c | |
parent | b99545cb59dc0a55507100a1335f4fd0ed521032 (diff) |
iMX51: introduce IMX_GPIO_NR
Currently, to define a GPIO number, we're using something like :
#define EFIKAMX_PCBID0 (2*32 + 16)
to define GPIO 3 16.
This is not really readable and it's error prone imho (note the 3 vs 2).
So, I'm introducing a new macro to define this in a better way. Now, the
code sample become :
#define EFIKAMX_PCBID0 IMX_GPIO_NR(3, 16)
v2:
- move to gpio.h
- add parens & spaces
- switch to IMX_GPIO_NR instead of MX51_GPIO_NR
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: Amit Kucheria <amit.kucheria@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Eric BĂ©nard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx5/board-cpuimx51.c')
-rw-r--r-- | arch/arm/mach-mx5/board-cpuimx51.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/arm/mach-mx5/board-cpuimx51.c b/arch/arm/mach-mx5/board-cpuimx51.c index 5ff5522ff6fd..6ab002d08a56 100644 --- a/arch/arm/mach-mx5/board-cpuimx51.c +++ b/arch/arm/mach-mx5/board-cpuimx51.c | |||
@@ -40,11 +40,11 @@ | |||
40 | #include "devices-imx51.h" | 40 | #include "devices-imx51.h" |
41 | #include "devices.h" | 41 | #include "devices.h" |
42 | 42 | ||
43 | #define CPUIMX51_USBH1_STP (0*32 + 27) | 43 | #define CPUIMX51_USBH1_STP IMX_GPIO_NR(1, 27) |
44 | #define CPUIMX51_QUARTA_GPIO (2*32 + 28) | 44 | #define CPUIMX51_QUARTA_GPIO IMX_GPIO_NR(3, 28) |
45 | #define CPUIMX51_QUARTB_GPIO (2*32 + 25) | 45 | #define CPUIMX51_QUARTB_GPIO IMX_GPIO_NR(3, 25) |
46 | #define CPUIMX51_QUARTC_GPIO (2*32 + 26) | 46 | #define CPUIMX51_QUARTC_GPIO IMX_GPIO_NR(3, 26) |
47 | #define CPUIMX51_QUARTD_GPIO (2*32 + 27) | 47 | #define CPUIMX51_QUARTD_GPIO IMX_GPIO_NR(3, 27) |
48 | #define CPUIMX51_QUARTA_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTA_GPIO) | 48 | #define CPUIMX51_QUARTA_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTA_GPIO) |
49 | #define CPUIMX51_QUARTB_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTB_GPIO) | 49 | #define CPUIMX51_QUARTB_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTB_GPIO) |
50 | #define CPUIMX51_QUARTC_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTC_GPIO) | 50 | #define CPUIMX51_QUARTC_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTC_GPIO) |