Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: mxc: use ARCH_NR_GPIOS to define gpio number

The patch removes MXC_GPIO_IRQS and instead uses ARCH_NR_GPIOS to
define gpio number. This change is need when we change mxc gpio
driver to be device tree aware. When migrating the driver to device
tree, pdev->id becomes unusable. It requires driver get gpio range
from gpio core, which will dynamically allocates number from
ARCH_NR_GPIOS to 0.

As a bonus point, it removes lines of '#if' and make the code a
little bit cleaner. The side effect is the waste of number. But
this is not a point when we go single image.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

authored by

Shawn Guo and committed by
Grant Likely
14305e68 e7fc6ae7

+3 -18
+3 -18
arch/arm/plat-mxc/include/mach/irqs.h
··· 11 11 #ifndef __ASM_ARCH_MXC_IRQS_H__ 12 12 #define __ASM_ARCH_MXC_IRQS_H__ 13 13 14 + #include <asm-generic/gpio.h> 15 + 14 16 /* 15 17 * SoCs with TZIC interrupt controller have 128 IRQs, those with AVIC have 64 16 18 */ ··· 24 22 25 23 #define MXC_GPIO_IRQ_START MXC_INTERNAL_IRQS 26 24 27 - /* these are ordered by size to support multi-SoC kernels */ 28 - #if defined CONFIG_SOC_IMX53 29 - #define MXC_GPIO_IRQS (32 * 7) 30 - #elif defined CONFIG_ARCH_MX2 31 - #define MXC_GPIO_IRQS (32 * 6) 32 - #elif defined CONFIG_SOC_IMX50 33 - #define MXC_GPIO_IRQS (32 * 6) 34 - #elif defined CONFIG_ARCH_MX1 35 - #define MXC_GPIO_IRQS (32 * 4) 36 - #elif defined CONFIG_ARCH_MX25 37 - #define MXC_GPIO_IRQS (32 * 4) 38 - #elif defined CONFIG_SOC_IMX51 39 - #define MXC_GPIO_IRQS (32 * 4) 40 - #elif defined CONFIG_ARCH_MX3 41 - #define MXC_GPIO_IRQS (32 * 3) 42 - #endif 43 - 44 25 /* 45 26 * The next 16 interrupts are for board specific purposes. Since 46 27 * the kernel can only run on one machine at a time, we can re-use 47 28 * these. If you need more, increase MXC_BOARD_IRQS, but keep it 48 29 * within sensible limits. 49 30 */ 50 - #define MXC_BOARD_IRQ_START (MXC_INTERNAL_IRQS + MXC_GPIO_IRQS) 31 + #define MXC_BOARD_IRQ_START (MXC_INTERNAL_IRQS + ARCH_NR_GPIOS) 51 32 52 33 #ifdef CONFIG_MACH_MX31ADS_WM1133_EV1 53 34 #define MXC_BOARD_IRQS 80