diff mbox series

[1/7] ARM: OMAP5+: GPIO: Add GPIO_TO_PIN() macro

Message ID 1485436049-19754-2-git-send-email-rogerq@ti.com
State Superseded
Headers show
Series am57xx-idk LCD and am571x-idk 6 port ethernet pinmux | expand

Commit Message

Roger Quadros Jan. 26, 2017, 1:07 p.m. UTC
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>

---
 arch/arm/include/asm/arch-omap5/gpio.h | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.7.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Comments

Tom Rini Jan. 26, 2017, 5:41 p.m. UTC | #1
On Thu, Jan 26, 2017 at 03:07:23PM +0200, Roger Quadros wrote:

> 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>


-- 
Tom
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
diff mbox series

Patch

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 */