summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Quadros <rogerq@ti.com>2017-03-13 13:04:24 (GMT)
committerTom Rini <trini@konsulko.com>2017-03-20 21:56:21 (GMT)
commit080795b70ccf97d934676371288650cff5055ca7 (patch)
tree78071852b3004feee875b6159636aad39a0f9e7d
parent30719e2b92c014926c59b25d6d8736959da84219 (diff)
downloadu-boot-fsl-qoriq-080795b70ccf97d934676371288650cff5055ca7.tar.xz
ARM: OMAP5+: GPIO: Add GPIO_TO_PIN() macro
GPIO_TO_PIN(bank, bank_gpio) returns the GPIO index from the GPIO bank number and bank's GPIO offset number. Signed-off-by: Roger Quadros <rogerq@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
-rw-r--r--arch/arm/include/asm/arch-omap5/gpio.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-omap5/gpio.h b/arch/arm/include/asm/arch-omap5/gpio.h
index 9dd03c9..48e8ca5 100644
--- a/arch/arm/include/asm/arch-omap5/gpio.h
+++ b/arch/arm/include/asm/arch-omap5/gpio.h
@@ -34,4 +34,8 @@
#define OMAP54XX_GPIO7_BASE 0x48051000
#define OMAP54XX_GPIO8_BASE 0x48053000
+
+/* Get the GPIO index from the given bank number and bank gpio */
+#define GPIO_TO_PIN(bank, bank_gpio) (32 * (bank - 1) + (bank_gpio))
+
#endif /* _GPIO_OMAP5_H */