[PATCH 2/9] ARM STM/i.MX: Fix register offset calculation for GPIO input pins

Juergen Beisert jbe at pengutronix.de
Tue Dec 21 06:25:14 EST 2010


Fix the forgotten register calculation for GPIO input pins.

Signed-off-by: Juergen Beisert <jbe at pengutronix.de>
---
 arch/arm/mach-stm/iomux-imx.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-stm/iomux-imx.c b/arch/arm/mach-stm/iomux-imx.c
index 2c68ebf..2c34d01 100644
--- a/arch/arm/mach-stm/iomux-imx.c
+++ b/arch/arm/mach-stm/iomux-imx.c
@@ -129,6 +129,8 @@ void imx_gpio_mode(unsigned m)
 			writel(0x1 << (gpio_pin % 32),
 				IMX_IOMUXC_BASE + reg_offset + BIT_SET);
 		} else {
+			/* then the direction */
+			reg_offset = calc_output_enable_reg(gpio_pin);
 			writel(0x1 << (gpio_pin % 32),
 				IMX_IOMUXC_BASE + reg_offset + BIT_CLR);
 		}
-- 
1.7.2.3




More information about the barebox mailing list