From 814f17253c96fb4acfd7df7277bb2af7cb23dce1 Mon Sep 17 00:00:00 2001 From: Juergen Beisert Date: Mon, 13 Dec 2010 11:53:28 +0100 Subject: [PATCH] STM378x: Parameterize the max. possible GPIO number This is for easier integration of the i.MX28 architecture (to share the code later on). Signed-off-by: Juergen Beisert Signed-off-by: Sascha Hauer --- arch/arm/mach-stm/iomux-imx23.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-stm/iomux-imx23.c b/arch/arm/mach-stm/iomux-imx23.c index b0f4046e3..5d4465e07 100644 --- a/arch/arm/mach-stm/iomux-imx23.c +++ b/arch/arm/mach-stm/iomux-imx23.c @@ -31,6 +31,8 @@ #define HW_PINCTRL_DIN0 0x600 #define HW_PINCTRL_DOE0 0x700 +#define MAX_GPIO_NO 95 + static uint32_t calc_mux_reg(uint32_t no) { /* each register controls 16 pads */ @@ -77,7 +79,7 @@ void imx_gpio_mode(unsigned m) writel(reg, IMX_IOMUXC_BASE + reg_offset); /* some pins are disabled when configured for GPIO */ - if ((gpio_pin > 95) && (GET_FUNC(m) == IS_GPIO)) { + if ((gpio_pin > MAX_GPIO_NO) && (GET_FUNC(m) == IS_GPIO)) { printf("Cannot configure pad %d to GPIO\n", gpio_pin); return; }