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>
This commit is contained in:
Roger Quadros 2017-03-13 15:04:24 +02:00 committed by Tom Rini
parent 30719e2b92
commit 080795b70c
1 changed files with 4 additions and 0 deletions

View File

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