public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] imx: Add GPIO_TO_PORT macro
@ 2012-04-04 16:05 Vikram Narayanan
  2012-04-06  8:56 ` Stefano Babic
  0 siblings, 1 reply; 7+ messages in thread
From: Vikram Narayanan @ 2012-04-04 16:05 UTC (permalink / raw)
  To: u-boot

imx: Add GPIO_TO_PORT macro

Signed-off-by: Vikram Narayanan <vikram186@gmail.com>
---
 arch/arm/include/asm/arch-mx5/gpio.h |    2 ++
 arch/arm/include/asm/arch-mx6/gpio.h |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)
  50.0% arch/arm/include/asm/arch-mx5/
  50.0% arch/arm/include/asm/arch-mx6/

diff --git a/arch/arm/include/asm/arch-mx5/gpio.h b/arch/arm/include/asm/arch-mx5/gpio.h
index 1dc34e9..bcb5edb 100644
--- a/arch/arm/include/asm/arch-mx5/gpio.h
+++ b/arch/arm/include/asm/arch-mx5/gpio.h
@@ -25,6 +25,8 @@
 #ifndef __ASM_ARCH_MX5_GPIO_H
 #define __ASM_ARCH_MX5_GPIO_H
 
+#define GPIO_TO_PORT(number)		(number/32)
+
 /* GPIO registers */
 struct gpio_regs {
 	u32	gpio_dr;
diff --git a/arch/arm/include/asm/arch-mx6/gpio.h b/arch/arm/include/asm/arch-mx6/gpio.h
index 20c4e57..385d12d 100644
--- a/arch/arm/include/asm/arch-mx6/gpio.h
+++ b/arch/arm/include/asm/arch-mx6/gpio.h
@@ -25,6 +25,8 @@
 #ifndef __ASM_ARCH_MX6_GPIO_H
 #define __ASM_ARCH_MX6_GPIO_H
 
+#define GPIO_TO_PORT(number)		(number/32)
+
 /* GPIO registers */
 struct gpio_regs {
 	u32	gpio_dr;
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-04-10  2:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-04 16:05 [U-Boot] [PATCH 1/3] imx: Add GPIO_TO_PORT macro Vikram Narayanan
2012-04-06  8:56 ` Stefano Babic
2012-04-09  5:33   ` Dirk Behme
2012-04-09 14:30     ` Vikram Narayanan
2012-04-09 16:09   ` Vikram Narayanan
2012-04-09 22:31     ` stefano babic
2012-04-10  2:47       ` Vikram Narayanan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox