From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roger Quadros Date: Mon, 30 Jan 2017 17:15:09 +0200 Subject: [U-Boot] [u-boot PATCH v2 1/8] ARM: OMAP5+: GPIO: Add GPIO_TO_PIN() macro In-Reply-To: <1485789316-22216-1-git-send-email-rogerq@ti.com> References: <1485789316-22216-1-git-send-email-rogerq@ti.com> Message-ID: <1485789316-22216-2-git-send-email-rogerq@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 Reviewed-by: Tom Rini --- arch/arm/include/asm/arch-omap5/gpio.h | 4 ++++ 1 file changed, 4 insertions(+) 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 */ -- 2.7.4