summaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/arch-at91/gpio.h
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2013-12-10 17:15:18 -0500
committerTom Rini <trini@ti.com>2013-12-10 17:15:18 -0500
commit4b210ad34282bfd9fc982a8e3c9a9126f4094cdb (patch)
treef91ebdc46ede952728602d5ecc18e64ad0e52682 /arch/arm/include/asm/arch-at91/gpio.h
parent65b7fe28a12bbaccc7a0c076f5f9f213150030e7 (diff)
parentf15ea6e1d67782a1626d4a4922b6c20e380085e5 (diff)
downloadtalos-obmc-uboot-4b210ad34282bfd9fc982a8e3c9a9126f4094cdb.tar.gz
talos-obmc-uboot-4b210ad34282bfd9fc982a8e3c9a9126f4094cdb.zip
Merge branch 'master' of git://git.denx.de/u-boot-arm
Conflicts: board/samsung/trats2/trats2.c include/configs/exynos5250-dt.h Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'arch/arm/include/asm/arch-at91/gpio.h')
-rw-r--r--arch/arm/include/asm/arch-at91/gpio.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/arch/arm/include/asm/arch-at91/gpio.h b/arch/arm/include/asm/arch-at91/gpio.h
index 0700427fa4..ff6142b8aa 100644
--- a/arch/arm/include/asm/arch-at91/gpio.h
+++ b/arch/arm/include/asm/arch-at91/gpio.h
@@ -16,7 +16,7 @@
#ifdef CONFIG_ATMEL_LEGACY
-#define PIN_BASE 32
+#define PIN_BASE 0
#define MAX_GPIO_BANKS 5
@@ -231,4 +231,26 @@ static inline unsigned pin_to_mask(unsigned pin)
#define at91_set_gpio_value(x, y) at91_set_pio_value(x, y)
#define at91_get_gpio_value(x) at91_get_pio_value(x)
#endif
-#endif
+
+#define GPIO_PIOA_BASE (0)
+#define GPIO_PIOB_BASE (GPIO_PIOA_BASE + 32)
+#define GPIO_PIOC_BASE (GPIO_PIOB_BASE + 32)
+#define GPIO_PIOD_BASE (GPIO_PIOC_BASE + 32)
+#define GPIO_PIOE_BASE (GPIO_PIOD_BASE + 32)
+#define GPIO_PIN_PA(x) (GPIO_PIOA_BASE + (x))
+#define GPIO_PIN_PB(x) (GPIO_PIOB_BASE + (x))
+#define GPIO_PIN_PC(x) (GPIO_PIOC_BASE + (x))
+#define GPIO_PIN_PD(x) (GPIO_PIOD_BASE + (x))
+#define GPIO_PIN_PE(x) (GPIO_PIOE_BASE + (x))
+
+static inline unsigned at91_gpio_to_port(unsigned gpio)
+{
+ return gpio / 32;
+}
+
+static inline unsigned at91_gpio_to_pin(unsigned gpio)
+{
+ return gpio % 32;
+}
+
+#endif /* __ASM_ARCH_AT91_GPIO_H */
OpenPOWER on IntegriCloud